{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/notifly-io/json-schema/notifly-io-workflow-response-dto-schema.json",
  "title": "WorkflowResponseDto",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/notifly-io-openapi.yml#/components/schemas/WorkflowResponseDto",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the workflow"
    },
    "description": {
      "type": "string",
      "description": "Description of the workflow"
    },
    "tags": {
      "description": "Tags associated with the workflow",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "active": {
      "type": "boolean",
      "description": "Whether the workflow is active",
      "default": false
    },
    "validatePayload": {
      "type": "boolean",
      "description": "Enable or disable payload schema validation"
    },
    "payloadSchema": {
      "type": [
        "object",
        "null"
      ],
      "description": "The payload JSON Schema for the workflow",
      "additionalProperties": true
    },
    "isTranslationEnabled": {
      "type": "boolean",
      "description": "Enable or disable translations for this workflow",
      "default": false
    },
    "agent": {
      "description": "Optional agent assignment used to route this workflow through an agent's connected channels. Null when unassigned.",
      "type": [
        "object",
        "null"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/WorkflowAgentConfigDto"
        }
      ]
    },
    "_id": {
      "type": "string",
      "description": "Database identifier of the workflow"
    },
    "workflowId": {
      "type": "string",
      "description": "Workflow identifier"
    },
    "slug": {
      "type": "string",
      "description": "Slug of the workflow"
    },
    "updatedAt": {
      "type": "string",
      "description": "Last updated timestamp"
    },
    "createdAt": {
      "type": "string",
      "description": "Creation timestamp"
    },
    "updatedBy": {
      "description": "User who last updated the workflow",
      "type": [
        "object",
        "null"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/UserResponseDto"
        }
      ]
    },
    "lastPublishedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Timestamp of the last workflow publication"
    },
    "lastPublishedBy": {
      "description": "User who last published the workflow",
      "type": [
        "object",
        "null"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/UserResponseDto"
        }
      ]
    },
    "steps": {
      "type": "array",
      "description": "Steps of the workflow",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/InAppStepResponseDto"
          },
          {
            "$ref": "#/$defs/EmailStepResponseDto"
          },
          {
            "$ref": "#/$defs/SmsStepResponseDto"
          },
          {
            "$ref": "#/$defs/PushStepResponseDto"
          },
          {
            "$ref": "#/$defs/ChatStepResponseDto"
          },
          {
            "$ref": "#/$defs/DelayStepResponseDto"
          },
          {
            "$ref": "#/$defs/DigestStepResponseDto"
          },
          {
            "$ref": "#/$defs/CustomStepResponseDto"
          },
          {
            "$ref": "#/$defs/ThrottleStepResponseDto"
          },
          {
            "$ref": "#/$defs/HttpRequestStepResponseDto"
          },
          {
            "$ref": "#/$defs/ToolStepResponseDto"
          }
        ]
      }
    },
    "origin": {
      "description": "Origin of the workflow",
      "allOf": [
        {
          "$ref": "#/$defs/ResourceOriginEnum"
        }
      ]
    },
    "preferences": {
      "description": "Preferences for the workflow",
      "allOf": [
        {
          "$ref": "#/$defs/WorkflowPreferencesResponseDto"
        }
      ]
    },
    "status": {
      "description": "Status of the workflow",
      "allOf": [
        {
          "$ref": "#/$defs/WorkflowStatusEnum"
        }
      ]
    },
    "issues": {
      "type": "object",
      "description": "Runtime issues for workflow creation and update",
      "additionalProperties": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/RuntimeIssueDto"
        }
      }
    },
    "lastTriggeredAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Timestamp of the last workflow trigger"
    },
    "payloadExample": {
      "type": [
        "object",
        "null"
      ],
      "description": "Generated payload example based on the payload schema",
      "additionalProperties": true
    },
    "severity": {
      "description": "Severity of the workflow",
      "allOf": [
        {
          "$ref": "#/$defs/SeverityLevelEnum"
        }
      ]
    }
  },
  "required": [
    "name",
    "_id",
    "workflowId",
    "slug",
    "updatedAt",
    "createdAt",
    "steps",
    "origin",
    "preferences",
    "status",
    "severity"
  ],
  "$defs": {
    "ActionDto": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "description": "Label for the action button."
        },
        "redirect": {
          "description": "Redirect configuration for the action.",
          "allOf": [
            {
              "$ref": "#/$defs/RedirectDto"
            }
          ]
        }
      }
    },
    "ChannelPreferenceDto": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "A flag specifying if notification delivery is enabled for the channel. If true, notification delivery is enabled.",
          "default": true
        }
      },
      "required": [
        "enabled"
      ]
    },
    "ChatControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "body": {
          "type": "string",
          "description": "Content of the chat message."
        },
        "editorType": {
          "type": "string",
          "description": "Type of editor to use for the body. When omitted, inferred from the body: Maily JSON is \"block\", otherwise \"text\".",
          "enum": [
            "block",
            "text"
          ]
        }
      }
    },
    "ChatControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Chat",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/ChatControlDto"
            }
          ]
        }
      }
    },
    "ChatStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the chat step",
          "allOf": [
            {
              "$ref": "#/$defs/ChatControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the chat step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/ChatControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "ContentIssueEnum": {
      "type": "string",
      "enum": [
        "ILLEGAL_VARIABLE_IN_CONTROL_VALUE",
        "INVALID_FILTER_ARG_IN_VARIABLE",
        "INVALID_URL",
        "MISSING_VALUE",
        "TIER_LIMIT_EXCEEDED",
        "UNSUPPORTED_PROPERTY",
        "CHAT_CARD_LIMIT_EXCEEDED",
        "CHAT_CARD_INVALID_BUTTON"
      ],
      "description": "Type of step content issue"
    },
    "CustomControlDto": {
      "type": "object",
      "properties": {
        "custom": {
          "type": "object",
          "description": "Custom control values for the step.",
          "additionalProperties": true
        }
      }
    },
    "CustomControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Custom step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/CustomControlDto"
            }
          ]
        }
      }
    },
    "CustomStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the custom step",
          "allOf": [
            {
              "$ref": "#/$defs/CustomControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the custom step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/CustomControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "DelayControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "type": {
          "type": "string",
          "description": "Type of the delay. Currently only 'regular' is supported by the schema.",
          "enum": [
            "regular",
            "timed"
          ],
          "default": "regular"
        },
        "amount": {
          "type": "number",
          "description": "Amount of time to delay.",
          "minimum": 1
        },
        "unit": {
          "type": "string",
          "description": "Unit of time for the delay amount.",
          "enum": [
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months"
          ]
        },
        "cron": {
          "type": "string",
          "description": "Cron expression for the delay. Min length 1."
        }
      },
      "required": [
        "type"
      ]
    },
    "DelayControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Delay",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/DelayControlDto"
            }
          ]
        }
      }
    },
    "DelayStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the delay step",
          "allOf": [
            {
              "$ref": "#/$defs/DelayControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the delay step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/DelayControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "DigestControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "type": {
          "type": "string",
          "description": "The type of digest strategy. Determines which fields are applicable.",
          "enum": [
            "regular",
            "timed"
          ]
        },
        "amount": {
          "type": "number",
          "description": "The amount of time for the digest interval (for REGULAR type). Min 1.",
          "minimum": 1
        },
        "unit": {
          "type": "string",
          "description": "The unit of time for the digest interval (for REGULAR type).",
          "enum": [
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months"
          ]
        },
        "lookBackWindow": {
          "description": "Configuration for look-back window (for REGULAR type).",
          "allOf": [
            {
              "$ref": "#/$defs/LookBackWindowDto"
            }
          ]
        },
        "cron": {
          "type": "string",
          "description": "Cron expression for TIMED digest. Min length 1."
        },
        "digestKey": {
          "type": "string",
          "description": "Specify a custom key for digesting events instead of the default event key."
        }
      }
    },
    "DigestControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Digest",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/DigestControlDto"
            }
          ]
        }
      }
    },
    "DigestStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the digest step",
          "allOf": [
            {
              "$ref": "#/$defs/DigestControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the digest step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/DigestControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "EmailControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "subject": {
          "type": "string",
          "description": "Subject of the email.",
          "minLength": 1
        },
        "body": {
          "type": "string",
          "description": "Body content of the email, either a valid Maily JSON object, or html string.",
          "default": ""
        },
        "editorType": {
          "type": "string",
          "description": "Type of editor to use for the body.",
          "enum": [
            "block",
            "html"
          ],
          "default": "block"
        },
        "disableOutputSanitization": {
          "type": "boolean",
          "description": "Disable sanitization of the output.",
          "default": false
        },
        "layoutId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Layout ID to use for the email. Null means no layout, undefined means default layout."
        },
        "from": {
          "description": "Sender name and email overrides for this step.",
          "allOf": [
            {
              "$ref": "#/$defs/EmailFromControlDto"
            }
          ]
        },
        "useProviderDefaults": {
          "type": "boolean",
          "description": "When true, sender name/email use the primary email integration defaults and skip workflow agent defaults."
        },
        "replyTo": {
          "type": "string",
          "description": "Step-level Reply-To override. When unset, inherits the workflow agent reply-to."
        },
        "preheader": {
          "type": "string",
          "description": "One-line inbox preview text shown next to the subject."
        }
      },
      "required": [
        "subject",
        "body"
      ]
    },
    "EmailControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Email",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/EmailControlDto"
            }
          ]
        }
      }
    },
    "EmailFromControlDto": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "description": "Sender email address override for this step."
        },
        "name": {
          "type": "string",
          "description": "Sender display name override for this step."
        }
      }
    },
    "EmailStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the email step",
          "allOf": [
            {
              "$ref": "#/$defs/EmailControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the email step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/EmailControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "HttpMethodEnum": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "DELETE",
        "PATCH"
      ],
      "description": "HTTP method"
    },
    "HttpRequestControlDto": {
      "type": "object",
      "properties": {
        "method": {
          "description": "HTTP method",
          "allOf": [
            {
              "$ref": "#/$defs/HttpMethodEnum"
            }
          ]
        },
        "url": {
          "type": "string",
          "description": "Target URL for the HTTP request"
        },
        "headers": {
          "description": "Request headers as key-value pairs",
          "type": "array",
          "items": {
            "$ref": "#/$defs/HttpRequestKeyValuePairDto"
          }
        },
        "body": {
          "description": "Request body as a raw JSON string. Key-value arrays are supported for legacy workflows.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/HttpRequestKeyValuePairDto"
              }
            }
          ]
        },
        "responseBodySchema": {
          "type": "object",
          "description": "JSON schema to validate response body against",
          "additionalProperties": true
        },
        "enforceSchemaValidation": {
          "type": "boolean",
          "description": "Whether to enforce response body schema validation"
        },
        "continueOnFailure": {
          "type": "boolean",
          "description": "Whether to continue workflow execution on failure"
        }
      },
      "required": [
        "method",
        "url"
      ]
    },
    "HttpRequestControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to HTTP Request step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/HttpRequestControlDto"
            }
          ]
        }
      }
    },
    "HttpRequestKeyValuePairDto": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Key of the key-value pair"
        },
        "value": {
          "type": "string",
          "description": "Value of the key-value pair"
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "HttpRequestStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the HTTP request step",
          "allOf": [
            {
              "$ref": "#/$defs/HttpRequestControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the HTTP request step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/HttpRequestControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "InAppControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "body": {
          "type": "string",
          "description": "Content/body of the in-app message. Required if subject is empty.",
          "minLength": 1
        },
        "subject": {
          "type": "string",
          "description": "Subject/title of the in-app message. Required if body is empty.",
          "minLength": 1
        },
        "avatar": {
          "type": "string",
          "description": "URL for an avatar image. Must be a valid URL or start with / or {{ variable }}."
        },
        "primaryAction": {
          "description": "Primary action button details.",
          "allOf": [
            {
              "$ref": "#/$defs/ActionDto"
            }
          ]
        },
        "secondaryAction": {
          "description": "Secondary action button details.",
          "allOf": [
            {
              "$ref": "#/$defs/ActionDto"
            }
          ]
        },
        "redirect": {
          "description": "Redirection URL configuration for the main content click (if no actions defined/clicked)..",
          "allOf": [
            {
              "$ref": "#/$defs/RedirectDto"
            }
          ]
        },
        "disableOutputSanitization": {
          "type": "boolean",
          "description": "Disable sanitization of the output.",
          "default": false
        },
        "data": {
          "type": "object",
          "description": "Additional data payload for the step.",
          "additionalProperties": true
        }
      }
    },
    "InAppControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to In-App",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/InAppControlDto"
            }
          ]
        }
      }
    },
    "InAppStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the in-app step",
          "allOf": [
            {
              "$ref": "#/$defs/InAppControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the in-app step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/InAppControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "IntegrationIssueEnum": {
      "type": "string",
      "enum": [
        "MISSING_INTEGRATION",
        "INBOX_NOT_CONNECTED"
      ],
      "description": "Type of integration issue"
    },
    "LookBackWindowDto": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number",
          "description": "Amount of time for the look-back window.",
          "minimum": 1
        },
        "unit": {
          "type": "string",
          "description": "Unit of time for the look-back window.",
          "enum": [
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months"
          ]
        }
      },
      "required": [
        "amount",
        "unit"
      ]
    },
    "PushControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "subject": {
          "type": "string",
          "description": "Subject/title of the push notification."
        },
        "body": {
          "type": "string",
          "description": "Body content of the push notification."
        }
      }
    },
    "PushControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Push",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/PushControlDto"
            }
          ]
        }
      }
    },
    "PushStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the push step",
          "allOf": [
            {
              "$ref": "#/$defs/PushControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the push step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/PushControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "RedirectDto": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "URL to redirect to"
        },
        "target": {
          "enum": [
            "_self",
            "_blank",
            "_parent",
            "_top",
            "_unfencedTop"
          ],
          "type": "string",
          "description": "Target attribute for the redirect link"
        }
      },
      "required": [
        "url"
      ]
    },
    "ResourceOriginEnum": {
      "type": "string",
      "enum": [
        "novu-cloud",
        "novu-cloud-v1",
        "external"
      ],
      "description": "Origin of the workflow"
    },
    "RuntimeIssueDto": {
      "type": "object",
      "properties": {
        "issueType": {
          "allOf": [
            {
              "$ref": "#/$defs/WorkflowIssueTypeEnum"
            }
          ]
        },
        "variableName": {
          "type": "string",
          "description": "Variable associated with the issue"
        },
        "message": {
          "type": "string",
          "description": "Human-readable issue message"
        }
      },
      "required": [
        "issueType",
        "message"
      ]
    },
    "SeverityLevelEnum": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low",
        "none"
      ],
      "description": "Override the severity of the workflow"
    },
    "SmsControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "body": {
          "type": "string",
          "description": "Content of the SMS message."
        }
      }
    },
    "SmsControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to SMS",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/SmsControlDto"
            }
          ]
        }
      }
    },
    "SmsStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the SMS step",
          "allOf": [
            {
              "$ref": "#/$defs/SmsControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the SMS step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/SmsControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "StepContentIssueDto": {
      "type": "object",
      "properties": {
        "issueType": {
          "description": "Type of step content issue",
          "allOf": [
            {
              "$ref": "#/$defs/ContentIssueEnum"
            }
          ]
        },
        "variableName": {
          "type": "string",
          "description": "Name of the variable related to the issue"
        },
        "message": {
          "type": "string",
          "description": "Detailed message describing the issue"
        },
        "severity": {
          "description": "Blocking severity of the issue. `error` (default when omitted) blocks save; `warning` is a non-blocking notice.",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssueSeverityEnum"
            }
          ]
        }
      },
      "required": [
        "issueType",
        "message"
      ]
    },
    "StepIntegrationIssue": {
      "type": "object",
      "properties": {
        "issueType": {
          "description": "Type of integration issue",
          "allOf": [
            {
              "$ref": "#/$defs/IntegrationIssueEnum"
            }
          ]
        },
        "variableName": {
          "type": "string",
          "description": "Name of the variable related to the issue"
        },
        "message": {
          "type": "string",
          "description": "Detailed message describing the issue"
        },
        "severity": {
          "description": "Blocking severity of the issue. `error` (default when omitted) blocks save; `warning` is a non-blocking notice.",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssueSeverityEnum"
            }
          ]
        }
      },
      "required": [
        "issueType",
        "message"
      ]
    },
    "StepIssueSeverityEnum": {
      "type": "string",
      "enum": [
        "error",
        "warning"
      ],
      "description": "Blocking severity of the issue. `error` (default when omitted) blocks save; `warning` is a non-blocking notice."
    },
    "StepIssuesDto": {
      "type": "object",
      "properties": {
        "controls": {
          "type": "object",
          "description": "Controls-related issues",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/StepContentIssueDto"
            }
          }
        },
        "integration": {
          "type": "object",
          "description": "Integration-related issues",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/StepIntegrationIssue"
            }
          }
        }
      }
    },
    "StepTypeEnum": {
      "type": "string",
      "enum": [
        "in_app",
        "email",
        "sms",
        "chat",
        "push",
        "tool",
        "digest",
        "trigger",
        "delay",
        "throttle",
        "custom",
        "http_request"
      ],
      "description": "Channels of the notification"
    },
    "ThrottleControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "type": {
          "type": "string",
          "description": "The type of throttle window.",
          "enum": [
            "fixed",
            "dynamic"
          ],
          "default": "fixed"
        },
        "amount": {
          "type": "number",
          "description": "The amount of time for the throttle window (required for fixed type).",
          "minimum": 1
        },
        "unit": {
          "type": "string",
          "description": "The unit of time for the throttle window (required for fixed type).",
          "enum": [
            "minutes",
            "hours",
            "days"
          ]
        },
        "dynamicKey": {
          "type": "string",
          "description": "Key path to retrieve dynamic window value (required for dynamic type)."
        },
        "threshold": {
          "type": "number",
          "description": "The maximum number of executions allowed within the window. Defaults to 1.",
          "minimum": 1,
          "default": 1
        },
        "throttleKey": {
          "type": "string",
          "description": "Optional key for grouping throttle rules. If not provided, defaults to workflow and subscriber combination."
        }
      },
      "required": [
        "type"
      ]
    },
    "ThrottleControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Throttle",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/ThrottleControlDto"
            }
          ]
        }
      }
    },
    "ThrottleStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the throttle step",
          "allOf": [
            {
              "$ref": "#/$defs/ThrottleControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the throttle step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/ThrottleControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "ToolControlDto": {
      "type": "object",
      "properties": {
        "skip": {
          "type": "object",
          "description": "JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.",
          "additionalProperties": true
        },
        "body": {
          "type": "string",
          "description": "Content of the tool payload."
        }
      }
    },
    "ToolControlsMetadataResponseDto": {
      "type": "object",
      "properties": {
        "dataSchema": {
          "type": "object",
          "description": "JSON Schema for data",
          "additionalProperties": true
        },
        "uiSchema": {
          "description": "UI Schema for rendering",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchema"
            }
          ]
        },
        "values": {
          "description": "Control values specific to Tool",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/ToolControlDto"
            }
          ]
        }
      }
    },
    "ToolStepResponseDto": {
      "type": "object",
      "properties": {
        "controls": {
          "description": "Controls metadata for the tool step",
          "allOf": [
            {
              "$ref": "#/$defs/ToolControlsMetadataResponseDto"
            }
          ]
        },
        "controlValues": {
          "description": "Control values for the tool step",
          "additionalProperties": true,
          "allOf": [
            {
              "$ref": "#/$defs/ToolControlDto"
            }
          ]
        },
        "providerOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-provider content overrides keyed by providerId. Stored separately from controlValues and merged over the default body at send time. Keys are ChatProviderIdEnum / ToolProviderIdEnum values (e.g. `slack`, `whatsapp-business`, `pagerduty`).",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "integrationOverrides": {
          "type": [
            "object",
            "null"
          ],
          "description": "Per-integration content overrides keyed by providerId, then by integration identifier. Each entry is merged over the matching providerOverrides entry, only for sends through that integration. Trigger-time overrides still take precedence. Entries whose integration does not exist in the environment are kept but not applied.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "JSON Schema for variables, follows the JSON Schema standard",
          "additionalProperties": true
        },
        "stepId": {
          "type": "string",
          "description": "Unique identifier of the step"
        },
        "_id": {
          "type": "string",
          "description": "Database identifier of the step"
        },
        "name": {
          "type": "string",
          "description": "Name of the step"
        },
        "slug": {
          "type": "string",
          "description": "Slug of the step"
        },
        "type": {
          "description": "Type of the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepTypeEnum"
            }
          ]
        },
        "origin": {
          "description": "Origin of the step",
          "allOf": [
            {
              "$ref": "#/$defs/ResourceOriginEnum"
            }
          ]
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow identifier"
        },
        "workflowDatabaseId": {
          "type": "string",
          "description": "Workflow database identifier"
        },
        "issues": {
          "description": "Issues associated with the step",
          "allOf": [
            {
              "$ref": "#/$defs/StepIssuesDto"
            }
          ]
        },
        "stepResolverHash": {
          "type": "string",
          "description": "Hash identifying the deployed Cloudflare Worker for this step"
        }
      },
      "required": [
        "controls",
        "variables",
        "stepId",
        "_id",
        "name",
        "slug",
        "type",
        "origin",
        "workflowId",
        "workflowDatabaseId"
      ]
    },
    "UiComponentEnum": {
      "type": "string",
      "enum": [
        "EMAIL_EDITOR_SELECT",
        "CHAT_EDITOR_SELECT",
        "LAYOUT_SELECT",
        "BLOCK_EDITOR",
        "EMAIL_BODY",
        "TEXT_FULL_LINE",
        "TEXT_INLINE_LABEL",
        "IN_APP_BODY",
        "IN_APP_AVATAR",
        "IN_APP_PRIMARY_SUBJECT",
        "IN_APP_BUTTON_DROPDOWN",
        "IN_APP_DISABLE_SANITIZATION_SWITCH",
        "DISABLE_SANITIZATION_SWITCH",
        "URL_TEXT_BOX",
        "DIGEST_AMOUNT",
        "DIGEST_UNIT",
        "DIGEST_TYPE",
        "DIGEST_KEY",
        "DIGEST_CRON",
        "DELAY_AMOUNT",
        "DELAY_UNIT",
        "DELAY_TYPE",
        "DELAY_CRON",
        "DELAY_DYNAMIC_KEY",
        "THROTTLE_TYPE",
        "THROTTLE_WINDOW",
        "THROTTLE_UNIT",
        "THROTTLE_DYNAMIC_KEY",
        "THROTTLE_THRESHOLD",
        "THROTTLE_KEY",
        "EXTEND_TO_SCHEDULE",
        "SMS_BODY",
        "CHAT_BODY",
        "PUSH_BODY",
        "TOOL_BODY",
        "PUSH_SUBJECT",
        "QUERY_EDITOR",
        "DATA",
        "LAYOUT_EMAIL",
        "DESTINATION_METHOD",
        "DESTINATION_URL",
        "DESTINATION_HEADERS",
        "DESTINATION_BODY",
        "DESTINATION_RESPONSE_BODY_SCHEMA",
        "DESTINATION_ENFORCE_SCHEMA_VALIDATION",
        "DESTINATION_CONTINUE_ON_FAILURE",
        "DESTINATION_TIMEOUT"
      ],
      "description": "Component type for the UI Schema Property"
    },
    "UiSchema": {
      "type": "object",
      "properties": {
        "group": {
          "description": "Group of the UI Schema",
          "allOf": [
            {
              "$ref": "#/$defs/UiSchemaGroupEnum"
            }
          ]
        },
        "properties": {
          "type": "object",
          "description": "Properties of the UI Schema",
          "additionalProperties": {
            "$ref": "#/$defs/UiSchemaProperty"
          }
        }
      }
    },
    "UiSchemaGroupEnum": {
      "type": "string",
      "enum": [
        "IN_APP",
        "EMAIL",
        "DIGEST",
        "DELAY",
        "THROTTLE",
        "SMS",
        "CHAT",
        "PUSH",
        "TOOL",
        "SKIP",
        "LAYOUT",
        "HTTP_REQUEST"
      ],
      "description": "Group of the UI Schema"
    },
    "UiSchemaProperty": {
      "type": "object",
      "properties": {
        "placeholder": {
          "description": "Placeholder for the UI Schema Property",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "additionalProperties": true
                  }
                ]
              }
            }
          ],
          "nullable": true
        },
        "component": {
          "description": "Component type for the UI Schema Property",
          "allOf": [
            {
              "$ref": "#/$defs/UiComponentEnum"
            }
          ]
        },
        "properties": {
          "type": "object",
          "description": "Properties of the UI Schema",
          "additionalProperties": {
            "$ref": "#/$defs/UiSchemaProperty"
          }
        }
      },
      "required": [
        "component"
      ]
    },
    "UserResponseDto": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "User ID"
        },
        "firstName": {
          "type": [
            "string",
            "null"
          ],
          "description": "User first name"
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ],
          "description": "User last name"
        },
        "externalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "User external ID"
        }
      },
      "required": [
        "_id"
      ]
    },
    "WorkflowAgentConfigDto": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Public agent identifier used to route this workflow through an agent's connected channels."
        },
        "providers": {
          "type": "object",
          "description": "Optional per-provider overrides keyed by providerId (e.g. novu-email-agent). Today only Novu Email replyTo is supported.",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "replyTo": {
                "type": "string"
              }
            }
          }
        }
      },
      "required": [
        "identifier"
      ]
    },
    "WorkflowIssueTypeEnum": {
      "type": "string",
      "enum": [
        "MISSING_VALUE",
        "MAX_LENGTH_ACCESSED",
        "WORKFLOW_ID_ALREADY_EXISTS",
        "DUPLICATED_VALUE",
        "LIMIT_REACHED"
      ]
    },
    "WorkflowPreferenceDto": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "A flag specifying if notification delivery is enabled for the workflow. If true, notification delivery is enabled by default for all channels. This setting can be overridden by the channel preferences.",
          "default": true
        },
        "readOnly": {
          "type": "boolean",
          "description": "A flag specifying if the preference is read-only. If true, the preference cannot be changed by the Subscriber.",
          "default": false
        },
        "condition": {
          "type": "object",
          "additionalProperties": true,
          "description": "JsonLogic condition controlling whether this preference applies"
        }
      },
      "required": [
        "enabled",
        "readOnly"
      ]
    },
    "WorkflowPreferencesDto": {
      "type": "object",
      "properties": {
        "all": {
          "description": "A preference for the workflow. The values specified here will be used if no preference is specified for a channel.",
          "oneOf": [
            {
              "$ref": "#/$defs/WorkflowPreferenceDto"
            }
          ],
          "allOf": [
            {
              "$ref": "#/$defs/WorkflowPreferenceDto"
            }
          ]
        },
        "channels": {
          "type": "object",
          "description": "Preferences for different communication channels",
          "additionalProperties": {
            "$ref": "#/$defs/ChannelPreferenceDto"
          }
        }
      },
      "required": [
        "all",
        "channels"
      ]
    },
    "WorkflowPreferencesResponseDto": {
      "type": "object",
      "properties": {
        "user": {
          "description": "User-specific workflow preferences",
          "type": [
            "object",
            "null"
          ],
          "allOf": [
            {
              "$ref": "#/$defs/WorkflowPreferencesDto"
            }
          ]
        },
        "default": {
          "description": "Default workflow preferences",
          "allOf": [
            {
              "$ref": "#/$defs/WorkflowPreferencesDto"
            }
          ]
        }
      },
      "required": [
        "default"
      ]
    },
    "WorkflowStatusEnum": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "INACTIVE",
        "ERROR"
      ],
      "description": "Status of the workflow"
    }
  }
}