Skip to content

Enforcing ServiceNow-Based Approvals with Rafay

Enterprises often require explicit approvals before critical actions can proceed especially when provisioning infrastructure or making configuration changes. With Rafay’s out-of-the-box (OOB) workflow handlers, customers can easily integrate with popular ITSM systems such as ServiceNow (SNOW).

Catalog

This post explains how to configure and use Rafay’s ServiceNow Workflow Handler to enforce approval gates.


Workflow Handlers in Rafay

Rafay enables platform teams to attach Workflow Handlers to key actions as pre-hooks or post-hooks:

  • Pre-hook Handlers: Triggered before an action (e.g., pause provisioning until approval is received)
  • Post-hook Handlers: Triggered after an action (e.g., notify stakeholders after infrastructure (environment) creation)

Typical Scenarios

Here are a few use cases where ServiceNow-based approvals come into play:

  • Developers request a vCluster to test their app before raising a PR
  • Platform admins initiate a Kubernetes upgrade for a fleet of clusters that requires approval

Approval Workflow Overview

Here’s how the integrated approval process works:

sequenceDiagram
    participant User
    participant Rafay
    participant ServiceNow
    participant Admin

    User->>Rafay: Request environment (e.g., vCluster, namespace)
    Rafay->>ServiceNow: Create ticket with request details
    Rafay->>Rafay: Wait for approval (with timeout)
    Admin->>ServiceNow: Approve the ticket
    ServiceNow-->>Rafay: Approval status updated
    Rafay->>Rafay: Proceed with provisioning
    Rafay->>ServiceNow: Update ticket with provisioning status
    Rafay-->>User: (Optional) Send notification

1. User Initiates an Action

A user requests environment creation (e.g., namespace, vCluster).

2. Rafay Creates a ServiceNow Ticket

A ticket is automatically generated with details like: - Environment name - Requestor - Purpose and compliance info

3. Approval Pending

Rafay waits for the ticket to be approved in ServiceNow. A timeout is configured to auto-cancel if no response is received in time.

4. Approval Granted

An admin approves the ticket in ServiceNow. Rafay detects this and proceeds with the action.

5. Post-Provisioning Update

Once completed, Rafay updates the ticket with the outcome. Optional: send an email notification using a post-hook handler.


Implementation Guide

flowchart TD
    S1["Step 1: Clone the Handler"]
    S1a["→ Navigate to Catalog in Rafay"]
    S1b["→ Locate ServiceNow Approval Handler"]
    S1c["→ Clone into target project"]

    S2["Step 2: Configure Input Variables"]
    S2a["→ Update fields to match ServiceNow"]
    S2b["→ Extend default fields if needed"]

    S3["Step 3: Attach as a Pre-Hook"]
    S3a["→ Go to Environment Templates"]
    S3b["→ Attach handler to template"]
    S3c["→ Set to trigger once or on every run"]

    S4["Step 4: Monitor Approval Status"]
    S4a["→ Display ticket and status in UI"]
    S4b["→ If Approved: Proceed"]
    S4c["→ If Denied/Timeout: Cancel"]

    S5["Step 5: Project-Based Overrides"]
    S5a["→ Share reusable templates"]
    S5b["→ Define approvers per project"]

    S1 --> S1a --> S1b --> S1c --> S2
    S2 --> S2a --> S2b --> S3
    S3 --> S3a --> S3b --> S3c --> S4
    S4 --> S4a --> S4b --> S5
    S4a --> S4c --> S5
    S5 --> S5a --> S5b

Step 1: Clone the Handler

  • Navigate to the Catalog in Rafay
  • Locate the ServiceNow Approval Workflow Handler
  • Clone it into the appropriate project (e.g., platform-team)

Step 2: Configure Input Variables

  • Modify the input fields to align with your ServiceNow instance
  • Extend default fields as needed, make sure they match names in the ServiceNow API

Step 3: Attach as a Pre-Hook

  • Go to Environment Templates in Rafay
  • Choose the relevant template and attach the handler as a pre-hook
  • You can configure it to trigger on every run or just once

Step 4: Monitor Approval Status

  • Rafay displays the ticket ID and approval status in the UI
  • If approved, execution continues
  • If denied/timed out: the request is canceled

Step 5: Use Project-Based Overrides

  • Share environment templates across teams
  • Each project can specify different approvers without duplicating templates

Conclusion

Rafay’s integration with ServiceNow ensures that infrastructure automation remains compliant and controlled, without slowing down developers. Whether you’re scaling clusters or creating environments, approvals are just a hook away. For teams operating in regulated environments or with strong ITSM processes, this is a game-changer.