Workflows

Create a workflow

Changed on

Creates a new workflow in the Novu Cloud environment

post/v2/workflows

Request

  • Base URL
    https://api.novu.co
  • Auth
    API key in header Authorization

Headers

idempotency-keystring

A header for idempotency purposes

Request body

namestring required

Name of the workflow

descriptionstring

Description of the workflow

tagsstring[]

Tags associated with the workflow

activeboolean

Whether the workflow is active

validatePayloadboolean

Enable or disable payload schema validation

payloadSchemaobject nullable

The payload JSON Schema for the workflow

isTranslationEnabledboolean

Enable or disable translations for this workflow

workflowIdstring required

Unique identifier for the workflow

__source'template_store' | 'editor' | 'notification_directory' | 'onboarding_digest_demo' | 'onboarding_in_app' | 'empty_state' | 'dropdown' | 'onboarding_get_started' | 'bridge' | 'dashboard' | 'ai'

Source of workflow creation

severity'high' | 'medium' | 'low' | 'none'

Override the severity of the workflow

Example request

{
  "steps": [
    {
      "controlValues": {
        "skip": {
          "and": [
            {
              "==": [
                {
                  "var": "payload.tier"
                },
                "pro"
              ]
            },
            {
              "==": [
                {
                  "var": "subscriber.data.role"
                },
                "admin"
              ]
            },
            {
              ">": [
                {
                  "var": "payload.amount"
                },
                "4"
              ]
            }
          ]
        }
      }
    }
  ],
  "preferences": {
    "user": {
      "channels": {
        "email": {
          "enabled": true
        },
        "sms": {
          "enabled": false
        }
      }
    },
    "workflow": {
      "channels": {
        "email": {
          "enabled": true
        },
        "sms": {
          "enabled": false
        }
      }
    }
  }
}

Response

Created

namestring required

Name of the workflow

descriptionstring

Description of the workflow

tagsstring[]

Tags associated with the workflow

activeboolean

Whether the workflow is active

validatePayloadboolean

Enable or disable payload schema validation

payloadSchemaobject nullable

The payload JSON Schema for the workflow

isTranslationEnabledboolean

Enable or disable translations for this workflow

_idstring required

Database identifier of the workflow

workflowIdstring required

Workflow identifier

slugstring required

Slug of the workflow

updatedAtstring required

Last updated timestamp

createdAtstring required

Creation timestamp

lastPublishedAtstring nullable

Timestamp of the last workflow publication

origin'novu-cloud' | 'novu-cloud-v1' | 'external' required

Origin of the workflow

status'ACTIVE' | 'INACTIVE' | 'ERROR' required

Status of the workflow

issuesobject

Runtime issues for workflow creation and update

lastTriggeredAtstring nullable

Timestamp of the last workflow trigger

payloadExampleobject nullable

Generated payload example based on the payload schema

severity'high' | 'medium' | 'low' | 'none' required

Override the severity of the workflow

Example response

{
  "steps": [
    {
      "controls": {
        "values": {
          "skip": {
            "and": [
              {
                "==": [
                  {
                    "var": "payload.tier"
                  },
                  "pro"
                ]
              },
              {
                "==": [
                  {
                    "var": "subscriber.data.role"
                  },
                  "admin"
                ]
              },
              {
                ">": [
                  {
                    "var": "payload.amount"
                  },
                  "4"
                ]
              }
            ]
          }
        }
      },
      "controlValues": {
        "skip": {
          "and": [
            {
              "==": [
                {
                  "var": "payload.tier"
                },
                "pro"
              ]
            },
            {
              "==": [
                {
                  "var": "subscriber.data.role"
                },
                "admin"
              ]
            },
            {
              ">": [
                {
                  "var": "payload.amount"
                },
                "4"
              ]
            }
          ]
        }
      },
      "providerOverrides": {
        "slack": {
          "text": "{{payload.title}}",
          "blocks": [
            {
              "type": "divider"
            }
          ]
        },
        "whatsapp-business": {
          "type": "text",
          "text": {
            "body": "{{payload.title}}"
          }
        },
        "pagerduty": {
          "severity": "warning",
          "source": "novu",
          "summary": "{{payload.title}}"
        }
      },
      "integrationOverrides": {
        "tool-webhook": {
          "prod-alerts": {
            "alert_type": "incident"
          },
          "staging-alerts": {
            "alert_type": "test"
          }
        }
      }
    }
  ],
  "preferences": {
    "user": {
      "channels": {
        "email": {
          "enabled": true
        },
        "sms": {
          "enabled": false
        }
      }
    },
    "default": {
      "channels": {
        "email": {
          "enabled": true
        },
        "sms": {
          "enabled": false
        }
      }
    }
  }
}

Changes

    • breaking

      the request property type changed from no type to object

    • breaking

      the ///// request property type changed from no type to object

    • breaking

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

    • breaking

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

    • breaking

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

    • breaking

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

    • info

      the request property default value chat was added

    • info

      the request property default value custom was added

    • info

      the request property default value delay was added

    • info

      the request property default value digest was added

    • info

      the request property default value email was added

    • info

      the request property default value http_request was added

    • info

      the request property default value in_app was added

    • info

      the request property default value push was added

    • info

      the request property default value sms was added

    • info

      the request property default value throttle was added

    • info

      the request property default value tool was added

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property //////

    • info

      removed the pattern SLUG_IDENTIFIER_REGEX from the request property

    • info

      added the new optional request property //////

    • info

      added the new optional request property //////

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status