Enable/Disable Workflow

Changed on

Enable or disable a workflow. Disabled workflows will not be executed when triggered. By default, workflows are enabled unless you explicitly disable them.

patch/v1/{workspace}/workflow/{slug}/enable/

Request

Path parameters

workspacestring required

Workspace to which the workflow belongs (staging, production, etc.)

slugstring required

Unique identifier of the workflow. You can get it from workflow settings.

Request body

is_enabledboolean required

Set to true to enable the workflow, false to disable it.

Example request

{
  "is_enabled": true
}

Response

Workflow status updated successfully

$schemastring uri

Schema URL for workflow validation

slugstring

Unique identifier for the workflow

is_enabledboolean

Whether the workflow is enabled

created_atstring date-time

When the workflow was created

last_executed_atstring date-time nullable

When the workflow was last executed

namestring

Human-readable name of the workflow

descriptionstring nullable

Description explaining the usecase of the workflow

updated_atstring date-time

When the workflow was last updated

commit_messagestring nullable

Last commit message

hashstring nullable

Git-like hash for version tracking

status'active' | 'inactive' | 'draft'

Current status of the workflow

categorystring

Notification category of the workflow. Used to apply category-specific settings and preferences.

tagsstring[]

Tags for organizing and filtering workflows in API.

ratelimitobject nullable

Workflow throttle settings. This is used to limit the number of times a workflow can be executed per user in a given time period.

conditionsobject[]

Trigger Conditions for workflow execution. Workflow will only be executed if trigger conditions evaluate to true.

trigger_type'event' | 'dynamic' | 'api'

How the workflow is triggered. You can refer to all trigger types here.

trigger_eventsstring[]

Events that trigger this workflow. This will be set for trigger_type = event.

cancellation_keystring nullable

Expression used to compute the cancellation key for workflow runs. null when not set.

override_recipients_type'user' | 'single_object_fields' nullable

Type of recipient override. Define whether to override and run this workflow for user, list of users or a single object.

override_recipients_user_exprstring nullable

Expression for overriding recipients when override_recipients_type = user.

override_recipients_single_object_fields_exprobject nullable

Expressions (object id, object_type, optional subscription depth) for overriding recipients when override_recipients_type = single_object_fields.

override_actor_user_exprstring nullable

Expression for overriding actor

override_tenant_exprstring nullable

Expression for overriding tenant

active_atstring date-time

When the workflow's live version became active. Will be null for draft version.

treeobject

Node tree structure of the workflow. Shows the list of all nodes used in the workflow along with their configuration.

Example response

{
  "$schema": "https://schema.suprsend.com/workflow/v1/schema.json",
  "slug": "welcome-sequence",
  "is_enabled": true,
  "name": "Welcome Sequence",
  "category": "transactional"
}

Changes

    • breaking

      response property detail list-of-types was widened by adding types array and object to media type application/json of response 401

    • breaking

      response property detail list-of-types was widened by adding types array and object to media type application/json of response 404

    • breaking

      the response property's maxLength was increased from 255 to 500 for the response status

    • breaking

      the response's property type changed from string to object for status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      the response's property pattern was changed from ^[a-z0-9-_]+$ to ^[a-zA-Z0-9_-]+$ for the status