Skip to main content
PATCH
/
v2
/
workflows
/
{workflowId}
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();

$patchWorkflowDto = new Components\PatchWorkflowDto();

$response = $sdk->workflows->patch(
    workflowId: '<id>',
    patchWorkflowDto: $patchWorkflowDto

);

if ($response->workflowResponseDto !== null) {
    // handle response
}
{
  "name": "<string>",
  "_id": "<string>",
  "workflowId": "<string>",
  "slug": "<string>",
  "updatedAt": "<string>",
  "createdAt": "<string>",
  "steps": [
    {
      "controls": {
        "values": {
          "skip": {
            "and": [
              {
                "==": [
                  {
                    "var": "payload.tier"
                  },
                  "pro"
                ]
              },
              {
                "==": [
                  {
                    "var": "subscriber.data.role"
                  },
                  "admin"
                ]
              },
              {
                ">": [
                  {
                    "var": "payload.amount"
                  },
                  "4"
                ]
              }
            ]
          },
          "body": "<string>",
          "subject": "<string>",
          "avatar": "<string>",
          "primaryAction": {
            "label": "<string>",
            "redirect": {
              "url": "<string>"
            }
          },
          "secondaryAction": {
            "label": "<string>",
            "redirect": {
              "url": "<string>"
            }
          },
          "redirect": {
            "url": "<string>"
          },
          "disableOutputSanitization": false,
          "data": {}
        },
        "dataSchema": {},
        "uiSchema": {
          "properties": {}
        }
      },
      "variables": {},
      "stepId": "<string>",
      "_id": "<string>",
      "name": "<string>",
      "slug": "<string>",
      "workflowId": "<string>",
      "workflowDatabaseId": "<string>",
      "controlValues": {
        "skip": {
          "and": [
            {
              "==": [
                {
                  "var": "payload.tier"
                },
                "pro"
              ]
            },
            {
              "==": [
                {
                  "var": "subscriber.data.role"
                },
                "admin"
              ]
            },
            {
              ">": [
                {
                  "var": "payload.amount"
                },
                "4"
              ]
            }
          ]
        },
        "body": "<string>",
        "subject": "<string>",
        "avatar": "<string>",
        "primaryAction": {
          "label": "<string>",
          "redirect": {
            "url": "<string>"
          }
        },
        "secondaryAction": {
          "label": "<string>",
          "redirect": {
            "url": "<string>"
          }
        },
        "redirect": {
          "url": "<string>"
        },
        "disableOutputSanitization": false,
        "data": {}
      },
      "issues": {
        "controls": {},
        "integration": {}
      },
      "stepResolverHash": "<string>"
    }
  ],
  "preferences": {
    "default": {
      "all": {
        "enabled": true,
        "readOnly": false
      },
      "channels": {
        "email": {
          "enabled": true
        },
        "sms": {
          "enabled": false
        }
      }
    },
    "user": {
      "all": {
        "enabled": true,
        "readOnly": false
      },
      "channels": {
        "email": {
          "enabled": true
        },
        "sms": {
          "enabled": false
        }
      }
    }
  },
  "description": "<string>",
  "tags": [
    "<string>"
  ],
  "active": false,
  "validatePayload": true,
  "payloadSchema": {},
  "isTranslationEnabled": false,
  "updatedBy": {
    "_id": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "externalId": "<string>"
  },
  "lastPublishedAt": "<string>",
  "lastPublishedBy": {
    "_id": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "externalId": "<string>"
  },
  "issues": {},
  "lastTriggeredAt": "<string>",
  "payloadExample": {}
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

workflowId
string
required

Body

application/json

Workflow patch details

active
boolean

Activate or deactivate the workflow

name
string

New name for the workflow

description
string

Updated description of the workflow

tags
string[]

Tags associated with the workflow

payloadSchema
object

The payload JSON Schema for the workflow

validatePayload
boolean

Enable or disable payload schema validation

isTranslationEnabled
boolean

Enable or disable translations for this workflow

Response

OK

name
string
required

Name of the workflow

_id
string
required

Database identifier of the workflow

workflowId
string
required

Workflow identifier

slug
string
required

Slug of the workflow

updatedAt
string
required

Last updated timestamp

createdAt
string
required

Creation timestamp

steps
object[]
required

Steps of the workflow

origin
enum<string>
required

Origin of the layout

Available options:
novu-cloud,
novu-cloud-v1,
external
preferences
object
required

Preferences for the workflow

status
enum<string>
required

Status of the workflow

Available options:
ACTIVE,
INACTIVE,
ERROR
severity
enum<string>
required

Severity of the workflow

Available options:
high,
medium,
low,
none
description
string

Description of the workflow

tags
string[]

Tags associated with the workflow

active
boolean
default:false

Whether the workflow is active

validatePayload
boolean

Enable or disable payload schema validation

payloadSchema
object

The payload JSON Schema for the workflow

isTranslationEnabled
boolean
default:false

Enable or disable translations for this workflow

updatedBy
object

User who last updated the workflow

lastPublishedAt
string | null

Timestamp of the last workflow publication

lastPublishedBy
object

User who last published the workflow

issues
object

Runtime issues for workflow creation and update

lastTriggeredAt
string | null

Timestamp of the last workflow trigger

payloadExample
object

Generated payload example based on the payload schema