> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Compile and validate flow spec without publishing

> Compiles a flow-spec DSL object (see `GET /v1/schemas/flow-spec`) and validates the result exactly like `flows.publish` would, without persisting anything. On success, returns the compiled node/edge graph. On failure, returns a 422 with structured errors (`path`/`code`/`message`/`hint`/`candidates`) — fix and retry before calling `flows.publish`.



## OpenAPI

````yaml /api-reference/platform-api.json post /v1/flows/validate
openapi: 3.1.1
info:
  title: ChatbotX
  version: 0.0.1
servers:
  - url: https://app.chatbotx.io/api
security:
  - bearerAuth: []
  - developerAccessToken: []
  - tokenInSearchParams: []
paths:
  /v1/flows/validate:
    post:
      tags:
        - Flows
      summary: Compile and validate flow spec without publishing
      description: >-
        Compiles a flow-spec DSL object (see `GET /v1/schemas/flow-spec`) and
        validates the result exactly like `flows.publish` would, without
        persisting anything. On success, returns the compiled node/edge graph.
        On failure, returns a 422 with structured errors
        (`path`/`code`/`message`/`hint`/`candidates`) — fix and retry before
        calling `flows.publish`.
      operationId: flows.validate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                spec:
                  type: object
                  properties:
                    formatVersion:
                      const: 1
                      description: DSL format version. Always 1.
                    name:
                      type: string
                      minLength: 1
                      maxLength: 255
                      description: Flow name (max 255 characters).
                    channel:
                      enum:
                        - omnichannel
                        - webchat
                        - messenger
                        - whatsapp
                        - zalo
                        - smtp
                        - telegram
                        - instagram
                        - threads
                        - tiktok
                        - api
                      type: string
                      description: >-
                        Channel this flow targets. Omit for any/omnichannel.
                        sendTemplate steps always send over WhatsApp regardless
                        of this value.
                    steps:
                      type: array
                      minItems: 1
                      items:
                        anyOf:
                          - type: object
                            properties:
                              type:
                                const: send
                                description: 'Step type: "send".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              text:
                                type: string
                                minLength: 1
                                maxLength: 1000
                                description: >-
                                  Text message body (max 1000 characters).
                                  Exactly one of text/imageUrl/fileUrl is
                                  required.
                              imageUrl:
                                type: string
                                format: uri
                                description: >-
                                  Image URL to send. Exactly one of
                                  text/imageUrl/fileUrl is required.
                              fileUrl:
                                type: string
                                format: uri
                                description: >-
                                  File URL to send. Exactly one of
                                  text/imageUrl/fileUrl is required.
                              buttons:
                                type: array
                                maxItems: 3
                                items:
                                  type: object
                                  properties:
                                    text:
                                      type: string
                                      minLength: 1
                                      maxLength: 20
                                      description: >-
                                        Button label shown to the contact (max
                                        20 characters).
                                    then:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: object
                                            properties:
                                              type:
                                                const: send
                                                description: 'Step type: "send".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              text:
                                                type: string
                                                minLength: 1
                                                maxLength: 1000
                                                description: >-
                                                  Text message body (max 1000 characters).
                                                  Exactly one of text/imageUrl/fileUrl is
                                                  required.
                                              imageUrl:
                                                type: string
                                                format: uri
                                                description: >-
                                                  Image URL to send. Exactly one of
                                                  text/imageUrl/fileUrl is required.
                                              fileUrl:
                                                type: string
                                                format: uri
                                                description: >-
                                                  File URL to send. Exactly one of
                                                  text/imageUrl/fileUrl is required.
                                              buttons:
                                                type: array
                                                maxItems: 3
                                                items: {}
                                                description: >-
                                                  Up to 3 quick-reply buttons attached to
                                                  this message.
                                            required:
                                              - type
                                            description: >-
                                              Sends one message (text, image, or
                                              file), optionally with quick-reply
                                              buttons.
                                          - type: object
                                            properties:
                                              type:
                                                const: sendTemplate
                                                description: 'Step type: "sendTemplate".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              templateName:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Name of an existing WhatsApp message
                                                  template whose status is `APPROVED` (see
                                                  `capabilities.get`'s `templates` list).
                                                  Sent as-is, without dynamic variables.
                                            required:
                                              - type
                                              - templateName
                                            description: >-
                                              Sends an existing WhatsApp message
                                              template.
                                          - type: object
                                            properties:
                                              type:
                                                const: wait
                                                description: 'Step type: "wait".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              duration:
                                                type: integer
                                                minimum: -9007199254740991
                                                maximum: 9007199254740991
                                                exclusiveMinimum: 0
                                                description: How long to wait, in `unit`s.
                                              unit:
                                                enum:
                                                  - seconds
                                                  - minutes
                                                  - hours
                                                  - days
                                                type: string
                                                description: Unit for `duration`.
                                            required:
                                              - type
                                              - duration
                                              - unit
                                            description: >-
                                              Pauses the flow for a fixed duration
                                              before continuing.
                                          - type: object
                                            properties:
                                              type:
                                                const: branch
                                                description: 'Step type: "branch".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              cases:
                                                type: array
                                                minItems: 1
                                                items: {}
                                                description: >-
                                                  Ordered cases evaluated until one
                                                  matches.
                                              otherwise:
                                                type: array
                                                items: {}
                                                description: Steps to run when no case matches.
                                            required:
                                              - type
                                              - cases
                                            description: >-
                                              Splits the flow by contact-filter-style
                                              conditions. Terminal within its step
                                              list — nothing may follow a `branch` at
                                              the same level; continue inside
                                              `cases[].then` / `otherwise` instead.
                                          - type: object
                                            properties:
                                              type:
                                                const: action
                                                description: 'Step type: "action".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              action:
                                                enum:
                                                  - addTags
                                                  - removeTags
                                                  - setCustomField
                                                  - assignConversation
                                                  - archiveConversation
                                                type: string
                                                description: Which workspace action to perform.
                                              tagNames:
                                                type: array
                                                items: {}
                                                description: >-
                                                  Tag names. Required for
                                                  `addTags`/`removeTags`.
                                              customFieldName:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Custom field name. Required for
                                                  `setCustomField`.
                                              value:
                                                type: string
                                                description: >-
                                                  Value to set. Required for
                                                  `setCustomField`.
                                              assigneeId:
                                                type: string
                                                description: >-
                                                  Workspace member id to assign the
                                                  conversation to. Optional for
                                                  `assignConversation`; omit to unassign.
                                            required:
                                              - type
                                              - action
                                            description: >-
                                              Performs a workspace side-effect: tag,
                                              custom field, or conversation action.
                                          - type: object
                                            properties:
                                              type:
                                                const: startFlow
                                                description: 'Step type: "startFlow".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              flowName:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Name of another existing flow in this
                                                  workspace (see `flows.list`).
                                            required:
                                              - type
                                              - flowName
                                            description: >-
                                              Starts another flow for the contact;
                                              this flow keeps running afterward (an
                                              ordinary step may follow).
                                          - type: object
                                            properties:
                                              type:
                                                const: addNote
                                                description: 'Step type: "addNote".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              note:
                                                type: string
                                                minLength: 1
                                                maxLength: 1000
                                                description: >-
                                                  Internal note text (max 1000 characters)
                                                  — never shown to the contact.
                                            required:
                                              - type
                                              - note
                                            description: >-
                                              Adds an internal note to the
                                              conversation.
                                          - type: object
                                            properties:
                                              type:
                                                const: goto
                                                description: 'Step type: "goto".'
                                              targetId:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  The `id` of an earlier step in this flow
                                                  spec to jump to, instead of continuing
                                                  linearly.
                                            required:
                                              - type
                                              - targetId
                                            description: >-
                                              Terminal — routes to an already-defined
                                              step instead of continuing. Must be the
                                              last step in its list.
                                      description: >-
                                        Steps to run when the contact taps this
                                        button. Omitted or empty means the
                                        button has no follow-up.
                                  required:
                                    - text
                                  description: >-
                                    A quick-reply button attached to a send
                                    step.
                                description: >-
                                  Up to 3 quick-reply buttons attached to this
                                  message.
                            required:
                              - type
                            description: >-
                              Sends one message (text, image, or file),
                              optionally with quick-reply buttons.
                          - type: object
                            properties:
                              type:
                                const: sendTemplate
                                description: 'Step type: "sendTemplate".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              templateName:
                                type: string
                                minLength: 1
                                description: >-
                                  Name of an existing WhatsApp message template
                                  whose status is `APPROVED` (see
                                  `capabilities.get`'s `templates` list). Sent
                                  as-is, without dynamic variables.
                            required:
                              - type
                              - templateName
                            description: Sends an existing WhatsApp message template.
                          - type: object
                            properties:
                              type:
                                const: wait
                                description: 'Step type: "wait".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              duration:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                                exclusiveMinimum: 0
                                description: How long to wait, in `unit`s.
                              unit:
                                enum:
                                  - seconds
                                  - minutes
                                  - hours
                                  - days
                                type: string
                                description: Unit for `duration`.
                            required:
                              - type
                              - duration
                              - unit
                            description: >-
                              Pauses the flow for a fixed duration before
                              continuing.
                          - type: object
                            properties:
                              type:
                                const: branch
                                description: 'Step type: "branch".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              cases:
                                type: array
                                minItems: 1
                                items:
                                  type: object
                                  properties:
                                    match:
                                      enum:
                                        - and
                                        - or
                                      type: string
                                      default: and
                                      description: >-
                                        Whether every ('and') or any ('or')
                                        condition in `when` must match.
                                    when:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          field:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              A static field name from `GET
                                              /v1/contacts/filter-fields`, or
                                              `customField:<name>` to reference a
                                              workspace custom field by name (resolved
                                              automatically — use the exact name from
                                              `contacts.listFilterFields`).
                                              `botField:` prefixed names are rejected
                                              by the compiler with error code
                                              `invalidSpec`; bot fields are
                                              reference-only data.
                                          operator:
                                            type: string
                                            minLength: 1
                                            description: >-
                                              One of the operators `GET
                                              /v1/contacts/filter-fields` lists for
                                              this field.
                                          value:
                                            anyOf:
                                              - type: string
                                              - type: array
                                                items: {}
                                              - type: array
                                                prefixItems:
                                                  - {}
                                                  - {}
                                            description: >-
                                              Comparison value. Omit for valueless
                                              operators (e.g. isEmpty/isNotEmpty). A
                                              two-element tuple is a between-range.
                                        required:
                                          - field
                                          - operator
                                        description: >-
                                          One contact-filter-style condition for a
                                          branch case.
                                      description: >-
                                        Conditions evaluated to determine
                                        whether this case matches.
                                    then:
                                      type: array
                                      minItems: 1
                                      items:
                                        anyOf:
                                          - type: object
                                            properties:
                                              type:
                                                const: send
                                                description: 'Step type: "send".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              text:
                                                type: string
                                                minLength: 1
                                                maxLength: 1000
                                                description: >-
                                                  Text message body (max 1000 characters).
                                                  Exactly one of text/imageUrl/fileUrl is
                                                  required.
                                              imageUrl:
                                                type: string
                                                format: uri
                                                description: >-
                                                  Image URL to send. Exactly one of
                                                  text/imageUrl/fileUrl is required.
                                              fileUrl:
                                                type: string
                                                format: uri
                                                description: >-
                                                  File URL to send. Exactly one of
                                                  text/imageUrl/fileUrl is required.
                                              buttons:
                                                type: array
                                                maxItems: 3
                                                items: {}
                                                description: >-
                                                  Up to 3 quick-reply buttons attached to
                                                  this message.
                                            required:
                                              - type
                                            description: >-
                                              Sends one message (text, image, or
                                              file), optionally with quick-reply
                                              buttons.
                                          - type: object
                                            properties:
                                              type:
                                                const: sendTemplate
                                                description: 'Step type: "sendTemplate".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              templateName:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Name of an existing WhatsApp message
                                                  template whose status is `APPROVED` (see
                                                  `capabilities.get`'s `templates` list).
                                                  Sent as-is, without dynamic variables.
                                            required:
                                              - type
                                              - templateName
                                            description: >-
                                              Sends an existing WhatsApp message
                                              template.
                                          - type: object
                                            properties:
                                              type:
                                                const: wait
                                                description: 'Step type: "wait".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              duration:
                                                type: integer
                                                minimum: -9007199254740991
                                                maximum: 9007199254740991
                                                exclusiveMinimum: 0
                                                description: How long to wait, in `unit`s.
                                              unit:
                                                enum:
                                                  - seconds
                                                  - minutes
                                                  - hours
                                                  - days
                                                type: string
                                                description: Unit for `duration`.
                                            required:
                                              - type
                                              - duration
                                              - unit
                                            description: >-
                                              Pauses the flow for a fixed duration
                                              before continuing.
                                          - type: object
                                            properties:
                                              type:
                                                const: branch
                                                description: 'Step type: "branch".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              cases:
                                                type: array
                                                minItems: 1
                                                items: {}
                                                description: >-
                                                  Ordered cases evaluated until one
                                                  matches.
                                              otherwise:
                                                type: array
                                                items: {}
                                                description: Steps to run when no case matches.
                                            required:
                                              - type
                                              - cases
                                            description: >-
                                              Splits the flow by contact-filter-style
                                              conditions. Terminal within its step
                                              list — nothing may follow a `branch` at
                                              the same level; continue inside
                                              `cases[].then` / `otherwise` instead.
                                          - type: object
                                            properties:
                                              type:
                                                const: action
                                                description: 'Step type: "action".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              action:
                                                enum:
                                                  - addTags
                                                  - removeTags
                                                  - setCustomField
                                                  - assignConversation
                                                  - archiveConversation
                                                type: string
                                                description: Which workspace action to perform.
                                              tagNames:
                                                type: array
                                                items: {}
                                                description: >-
                                                  Tag names. Required for
                                                  `addTags`/`removeTags`.
                                              customFieldName:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Custom field name. Required for
                                                  `setCustomField`.
                                              value:
                                                type: string
                                                description: >-
                                                  Value to set. Required for
                                                  `setCustomField`.
                                              assigneeId:
                                                type: string
                                                description: >-
                                                  Workspace member id to assign the
                                                  conversation to. Optional for
                                                  `assignConversation`; omit to unassign.
                                            required:
                                              - type
                                              - action
                                            description: >-
                                              Performs a workspace side-effect: tag,
                                              custom field, or conversation action.
                                          - type: object
                                            properties:
                                              type:
                                                const: startFlow
                                                description: 'Step type: "startFlow".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              flowName:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Name of another existing flow in this
                                                  workspace (see `flows.list`).
                                            required:
                                              - type
                                              - flowName
                                            description: >-
                                              Starts another flow for the contact;
                                              this flow keeps running afterward (an
                                              ordinary step may follow).
                                          - type: object
                                            properties:
                                              type:
                                                const: addNote
                                                description: 'Step type: "addNote".'
                                              id:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  Stable id for this step. Omit to
                                                  auto-generate one. Set it explicitly
                                                  when a `goto` elsewhere needs to jump to
                                                  this exact step.
                                              note:
                                                type: string
                                                minLength: 1
                                                maxLength: 1000
                                                description: >-
                                                  Internal note text (max 1000 characters)
                                                  — never shown to the contact.
                                            required:
                                              - type
                                              - note
                                            description: >-
                                              Adds an internal note to the
                                              conversation.
                                          - type: object
                                            properties:
                                              type:
                                                const: goto
                                                description: 'Step type: "goto".'
                                              targetId:
                                                type: string
                                                minLength: 1
                                                description: >-
                                                  The `id` of an earlier step in this flow
                                                  spec to jump to, instead of continuing
                                                  linearly.
                                            required:
                                              - type
                                              - targetId
                                            description: >-
                                              Terminal — routes to an already-defined
                                              step instead of continuing. Must be the
                                              last step in its list.
                                      description: Steps to run when this case matches.
                                  required:
                                    - when
                                    - then
                                  description: One ordered case in a branch step.
                                description: Ordered cases evaluated until one matches.
                              otherwise:
                                type: array
                                items:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          const: send
                                          description: 'Step type: "send".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        text:
                                          type: string
                                          minLength: 1
                                          maxLength: 1000
                                          description: >-
                                            Text message body (max 1000 characters).
                                            Exactly one of text/imageUrl/fileUrl is
                                            required.
                                        imageUrl:
                                          type: string
                                          format: uri
                                          description: >-
                                            Image URL to send. Exactly one of
                                            text/imageUrl/fileUrl is required.
                                        fileUrl:
                                          type: string
                                          format: uri
                                          description: >-
                                            File URL to send. Exactly one of
                                            text/imageUrl/fileUrl is required.
                                        buttons:
                                          type: array
                                          maxItems: 3
                                          items:
                                            type: object
                                            properties:
                                              text:
                                                type: string
                                                minLength: 1
                                                maxLength: 20
                                                description: >-
                                                  Button label shown to the contact (max
                                                  20 characters).
                                              then:
                                                type: array
                                                items: {}
                                                description: >-
                                                  Steps to run when the contact taps this
                                                  button. Omitted or empty means the
                                                  button has no follow-up.
                                            required:
                                              - text
                                            description: >-
                                              A quick-reply button attached to a send
                                              step.
                                          description: >-
                                            Up to 3 quick-reply buttons attached to
                                            this message.
                                      required:
                                        - type
                                      description: >-
                                        Sends one message (text, image, or
                                        file), optionally with quick-reply
                                        buttons.
                                    - type: object
                                      properties:
                                        type:
                                          const: sendTemplate
                                          description: 'Step type: "sendTemplate".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        templateName:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Name of an existing WhatsApp message
                                            template whose status is `APPROVED` (see
                                            `capabilities.get`'s `templates` list).
                                            Sent as-is, without dynamic variables.
                                      required:
                                        - type
                                        - templateName
                                      description: >-
                                        Sends an existing WhatsApp message
                                        template.
                                    - type: object
                                      properties:
                                        type:
                                          const: wait
                                          description: 'Step type: "wait".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        duration:
                                          type: integer
                                          minimum: -9007199254740991
                                          maximum: 9007199254740991
                                          exclusiveMinimum: 0
                                          description: How long to wait, in `unit`s.
                                        unit:
                                          enum:
                                            - seconds
                                            - minutes
                                            - hours
                                            - days
                                          type: string
                                          description: Unit for `duration`.
                                      required:
                                        - type
                                        - duration
                                        - unit
                                      description: >-
                                        Pauses the flow for a fixed duration
                                        before continuing.
                                    - type: object
                                      properties:
                                        type:
                                          const: branch
                                          description: 'Step type: "branch".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        cases:
                                          type: array
                                          minItems: 1
                                          items:
                                            type: object
                                            properties:
                                              match:
                                                enum:
                                                  - and
                                                  - or
                                                type: string
                                                default: and
                                                description: >-
                                                  Whether every ('and') or any ('or')
                                                  condition in `when` must match.
                                              when:
                                                type: array
                                                minItems: 1
                                                items: {}
                                                description: >-
                                                  Conditions evaluated to determine
                                                  whether this case matches.
                                              then:
                                                type: array
                                                minItems: 1
                                                items: {}
                                                description: Steps to run when this case matches.
                                            required:
                                              - when
                                              - then
                                            description: One ordered case in a branch step.
                                          description: >-
                                            Ordered cases evaluated until one
                                            matches.
                                        otherwise:
                                          type: array
                                          items:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  text: {}
                                                  imageUrl: {}
                                                  fileUrl: {}
                                                  buttons: {}
                                                description: >-
                                                  Sends one message (text, image, or
                                                  file), optionally with quick-reply
                                                  buttons.
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  templateName: {}
                                                description: >-
                                                  Sends an existing WhatsApp message
                                                  template.
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  duration: {}
                                                  unit: {}
                                                description: >-
                                                  Pauses the flow for a fixed duration
                                                  before continuing.
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  cases: {}
                                                  otherwise: {}
                                                description: >-
                                                  Splits the flow by contact-filter-style
                                                  conditions. Terminal within its step
                                                  list — nothing may follow a `branch` at
                                                  the same level; continue inside
                                                  `cases[].then` / `otherwise` instead.
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  action: {}
                                                  tagNames: {}
                                                  customFieldName: {}
                                                  value: {}
                                                  assigneeId: {}
                                                description: >-
                                                  Performs a workspace side-effect: tag,
                                                  custom field, or conversation action.
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  flowName: {}
                                                description: >-
                                                  Starts another flow for the contact;
                                                  this flow keeps running afterward (an
                                                  ordinary step may follow).
                                              - type: object
                                                properties:
                                                  type: {}
                                                  id: {}
                                                  note: {}
                                                description: >-
                                                  Adds an internal note to the
                                                  conversation.
                                              - type: object
                                                properties:
                                                  type: {}
                                                  targetId: {}
                                                description: >-
                                                  Terminal — routes to an already-defined
                                                  step instead of continuing. Must be the
                                                  last step in its list.
                                          description: Steps to run when no case matches.
                                      required:
                                        - type
                                        - cases
                                      description: >-
                                        Splits the flow by contact-filter-style
                                        conditions. Terminal within its step
                                        list — nothing may follow a `branch` at
                                        the same level; continue inside
                                        `cases[].then` / `otherwise` instead.
                                    - type: object
                                      properties:
                                        type:
                                          const: action
                                          description: 'Step type: "action".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        action:
                                          enum:
                                            - addTags
                                            - removeTags
                                            - setCustomField
                                            - assignConversation
                                            - archiveConversation
                                          type: string
                                          description: Which workspace action to perform.
                                        tagNames:
                                          type: array
                                          items:
                                            type: string
                                            minLength: 1
                                          description: >-
                                            Tag names. Required for
                                            `addTags`/`removeTags`.
                                        customFieldName:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Custom field name. Required for
                                            `setCustomField`.
                                        value:
                                          type: string
                                          description: >-
                                            Value to set. Required for
                                            `setCustomField`.
                                        assigneeId:
                                          type: string
                                          description: >-
                                            Workspace member id to assign the
                                            conversation to. Optional for
                                            `assignConversation`; omit to unassign.
                                      required:
                                        - type
                                        - action
                                      description: >-
                                        Performs a workspace side-effect: tag,
                                        custom field, or conversation action.
                                    - type: object
                                      properties:
                                        type:
                                          const: startFlow
                                          description: 'Step type: "startFlow".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        flowName:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Name of another existing flow in this
                                            workspace (see `flows.list`).
                                      required:
                                        - type
                                        - flowName
                                      description: >-
                                        Starts another flow for the contact;
                                        this flow keeps running afterward (an
                                        ordinary step may follow).
                                    - type: object
                                      properties:
                                        type:
                                          const: addNote
                                          description: 'Step type: "addNote".'
                                        id:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Stable id for this step. Omit to
                                            auto-generate one. Set it explicitly
                                            when a `goto` elsewhere needs to jump to
                                            this exact step.
                                        note:
                                          type: string
                                          minLength: 1
                                          maxLength: 1000
                                          description: >-
                                            Internal note text (max 1000 characters)
                                            — never shown to the contact.
                                      required:
                                        - type
                                        - note
                                      description: >-
                                        Adds an internal note to the
                                        conversation.
                                    - type: object
                                      properties:
                                        type:
                                          const: goto
                                          description: 'Step type: "goto".'
                                        targetId:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            The `id` of an earlier step in this flow
                                            spec to jump to, instead of continuing
                                            linearly.
                                      required:
                                        - type
                                        - targetId
                                      description: >-
                                        Terminal — routes to an already-defined
                                        step instead of continuing. Must be the
                                        last step in its list.
                                description: Steps to run when no case matches.
                            required:
                              - type
                              - cases
                            description: >-
                              Splits the flow by contact-filter-style
                              conditions. Terminal within its step list —
                              nothing may follow a `branch` at the same level;
                              continue inside `cases[].then` / `otherwise`
                              instead.
                          - type: object
                            properties:
                              type:
                                const: action
                                description: 'Step type: "action".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              action:
                                enum:
                                  - addTags
                                  - removeTags
                                  - setCustomField
                                  - assignConversation
                                  - archiveConversation
                                type: string
                                description: Which workspace action to perform.
                              tagNames:
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                description: >-
                                  Tag names. Required for
                                  `addTags`/`removeTags`.
                              customFieldName:
                                type: string
                                minLength: 1
                                description: >-
                                  Custom field name. Required for
                                  `setCustomField`.
                              value:
                                type: string
                                description: Value to set. Required for `setCustomField`.
                              assigneeId:
                                type: string
                                description: >-
                                  Workspace member id to assign the conversation
                                  to. Optional for `assignConversation`; omit to
                                  unassign.
                            required:
                              - type
                              - action
                            description: >-
                              Performs a workspace side-effect: tag, custom
                              field, or conversation action.
                          - type: object
                            properties:
                              type:
                                const: startFlow
                                description: 'Step type: "startFlow".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              flowName:
                                type: string
                                minLength: 1
                                description: >-
                                  Name of another existing flow in this
                                  workspace (see `flows.list`).
                            required:
                              - type
                              - flowName
                            description: >-
                              Starts another flow for the contact; this flow
                              keeps running afterward (an ordinary step may
                              follow).
                          - type: object
                            properties:
                              type:
                                const: addNote
                                description: 'Step type: "addNote".'
                              id:
                                type: string
                                minLength: 1
                                description: >-
                                  Stable id for this step. Omit to auto-generate
                                  one. Set it explicitly when a `goto` elsewhere
                                  needs to jump to this exact step.
                              note:
                                type: string
                                minLength: 1
                                maxLength: 1000
                                description: >-
                                  Internal note text (max 1000 characters) —
                                  never shown to the contact.
                            required:
                              - type
                              - note
                            description: Adds an internal note to the conversation.
                          - type: object
                            properties:
                              type:
                                const: goto
                                description: 'Step type: "goto".'
                              targetId:
                                type: string
                                minLength: 1
                                description: >-
                                  The `id` of an earlier step in this flow spec
                                  to jump to, instead of continuing linearly.
                            required:
                              - type
                              - targetId
                            description: >-
                              Terminal — routes to an already-defined step
                              instead of continuing. Must be the last step in
                              its list.
                      description: Ordered steps executed from the flow's start node.
                  required:
                    - formatVersion
                    - name
                    - steps
                  description: A complete agent-authored flow DSL document.
              required:
                - spec
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  nodes:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: sendMessage
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    beforeStep:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          pattern: ^\d+$
                                        stepType:
                                          const: chooseChannel
                                        channel:
                                          type: string
                                          minLength: 1
                                      required:
                                        - id
                                        - stepType
                                        - channel
                                    steps:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendAudio
                                              mode:
                                                enum:
                                                  - url
                                                  - file
                                                type: string
                                              url:
                                                type: string
                                              buttons:
                                                type: array
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                            required:
                                              - id
                                              - stepType
                                              - mode
                                              - url
                                              - buttons
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendFile
                                              mode:
                                                enum:
                                                  - url
                                                  - file
                                                type: string
                                              url:
                                                type: string
                                              buttons:
                                                type: array
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                            required:
                                              - id
                                              - stepType
                                              - mode
                                              - url
                                              - buttons
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendImage
                                              mode:
                                                enum:
                                                  - url
                                                  - file
                                                type: string
                                              url:
                                                type: string
                                              buttons:
                                                type: array
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                            required:
                                              - id
                                              - stepType
                                              - mode
                                              - url
                                              - buttons
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendMultipleImages
                                              images:
                                                type: array
                                                minItems: 2
                                                maxItems: 10
                                                items:
                                                  type: object
                                                  properties:
                                                    id: {}
                                                    mode: {}
                                                    url: {}
                                            required:
                                              - id
                                              - stepType
                                              - images
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendText
                                              text:
                                                type: string
                                                minLength: 1
                                                maxLength: 1000
                                              buttons:
                                                type: array
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                            required:
                                              - id
                                              - stepType
                                              - text
                                              - buttons
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendVideo
                                              mode:
                                                enum:
                                                  - url
                                                  - file
                                                type: string
                                              url:
                                                type: string
                                              buttons:
                                                type: array
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                            required:
                                              - id
                                              - stepType
                                              - mode
                                              - url
                                              - buttons
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendCarousel
                                              layout:
                                                enum:
                                                  - horizontal
                                                  - vertical
                                                type: string
                                              cards:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    id: {}
                                                    nodeId: {}
                                                    stepType: {}
                                                    title: {}
                                                    subtitle: {}
                                                    image: {}
                                                    buttons: {}
                                            required:
                                              - id
                                              - stepType
                                              - layout
                                              - cards
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: getUserData
                                              message:
                                                type: string
                                                minLength: 1
                                                maxLength: 255
                                              replyFormat:
                                                enum:
                                                  - RF01
                                                  - RF02
                                                  - RF03
                                                  - RF04
                                                  - RF05
                                                  - RF06
                                                  - RF07
                                                  - RF08
                                                  - RF09
                                                  - RF10
                                                  - RF11
                                                type: string
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              retryMessage:
                                                type: string
                                                maxLength: 255
                                              skipButtonLabel:
                                                type: string
                                                maxLength: 255
                                              autoSkip:
                                                type: boolean
                                              autoSkipTimeUnit:
                                                enum:
                                                  - seconds
                                                  - minutes
                                                  - hours
                                                  - days
                                                type: string
                                              autoSkipTimeValue:
                                                type: integer
                                                minimum: 1
                                                maximum: 100
                                              autoSkipFailAttempts:
                                                type: integer
                                                minimum: 1
                                                maximum: 100
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - message
                                              - replyFormat
                                              - outputFieldId
                                              - retryMessage
                                              - skipButtonLabel
                                              - autoSkip
                                              - autoSkipTimeUnit
                                              - autoSkipTimeValue
                                              - autoSkipFailAttempts
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendGif
                                              url:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                              - url
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: typing
                                              seconds:
                                                type: number
                                                minimum: 1
                                                maximum: 60
                                            required:
                                              - id
                                              - stepType
                                              - seconds
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendWaTemplateMessage
                                              template:
                                                type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    minLength: 1
                                                  name:
                                                    type: string
                                                  language:
                                                    type: string
                                                  inboxId:
                                                    anyOf:
                                                      - type: string
                                                        pattern: ^\d+$
                                                      - type: 'null'
                                                  params:
                                                    type: object
                                                    properties:
                                                      header: {}
                                                      body: {}
                                                      button: {}
                                                      carousel: {}
                                                      limited_time_offer: {}
                                                required:
                                                  - id
                                                  - name
                                                  - language
                                                  - params
                                              buttons: {}
                                            required:
                                              - id
                                              - stepType
                                              - template
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: sendMessengerTemplateMessage
                                              template:
                                                type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    minLength: 1
                                                  name:
                                                    type: string
                                                  language:
                                                    type: string
                                                  parameterFormat:
                                                    enum:
                                                      - POSITIONAL
                                                      - NAMED
                                                    type: string
                                                    default: POSITIONAL
                                                  params:
                                                    type: object
                                                    properties:
                                                      header: {}
                                                      body: {}
                                                      button: {}
                                                  inboxId:
                                                    type: string
                                                  integrationMessengerId:
                                                    type: string
                                                required:
                                                  - id
                                                  - name
                                                  - language
                                                  - params
                                              buttons:
                                                type: array
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                                default: []
                                            required:
                                              - id
                                              - stepType
                                              - template
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: whatsappOptionList
                                              text:
                                                type: string
                                                minLength: 1
                                                maxLength: 1024
                                              buttonId:
                                                type: string
                                                pattern: ^\d+$
                                              buttonLabel:
                                                type: string
                                                minLength: 1
                                                maxLength: 20
                                              options:
                                                type: array
                                                maxItems: 10
                                                items:
                                                  type: object
                                                  properties:
                                                    id: {}
                                                    title: {}
                                                    description: {}
                                            required:
                                              - id
                                              - stepType
                                              - text
                                              - buttonId
                                              - buttonLabel
                                              - options
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                              stepType:
                                                const: whatsappFlow
                                              text:
                                                type: string
                                                minLength: 1
                                                maxLength: 1024
                                              buttons:
                                                type: array
                                                minItems: 1
                                                maxItems: 1
                                                items:
                                                  anyOf:
                                                    - allOf:
                                                        - {}
                                                        - {}
                                                    - type: 'null'
                                              inboxId:
                                                anyOf:
                                                  - type: string
                                                    pattern: ^\d+$
                                                  - type: 'null'
                                              flow:
                                                type: object
                                                properties:
                                                  id:
                                                    anyOf:
                                                      - type: string
                                                        pattern: ^\d+$
                                                      - type: 'null'
                                                  sourceId:
                                                    type: string
                                                  startScreenId:
                                                    anyOf:
                                                      - type: string
                                                      - type: 'null'
                                                  fieldMappings:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - id
                                                  - sourceId
                                                  - startScreenId
                                                  - fieldMappings
                                            required:
                                              - id
                                              - stepType
                                              - text
                                              - buttons
                                              - inboxId
                                              - flow
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: enableBot
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: disableBot
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: assignConversation
                                              assignedId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                              - assignedId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: autoAssignConversation
                                              assignedIds:
                                                type: array
                                                items:
                                                  type: string
                                              rule:
                                                enum:
                                                  - ALL_TIME
                                                  - LAST_HOUR
                                                  - LAST_8HOURS
                                                  - LAST_24HOURS
                                                type: string
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - assignedIds
                                              - rule
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unassignConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: followConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unfollowConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: archiveConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unarchiveConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: addContactNotes
                                              content:
                                                type: string
                                                maxLength: 1000
                                            required:
                                              - id
                                              - stepType
                                              - content
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: blockContact
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: addContactTag
                                              tags:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: string
                                                  minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - tags
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: removeContactTag
                                              tags:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: string
                                                  minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - tags
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setCustomField
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              operation:
                                                enum:
                                                  - O01
                                                  - O02
                                                  - O03
                                                  - O04
                                                  - O05
                                                type: string
                                              value:
                                                type: string
                                              timezone:
                                                type: string
                                                maxLength: 64
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - operation
                                              - value
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: clearCustomField
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: deleteContact
                                            required:
                                              - id
                                              - stepType
                                          - anyOf:
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: bookFromCustomField
                                                  dateTimeFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                                  - dateTimeFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: checkAvailabilityFromCustomField
                                                  startDateFieldId:
                                                    type: string
                                                    minLength: 1
                                                  endDateFieldId:
                                                    type: string
                                                    minLength: 1
                                                  resultUsedByAI:
                                                    type: boolean
                                                    default: false
                                                  outputCustomFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                                  - startDateFieldId
                                                  - endDateFieldId
                                                  - outputCustomFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: book
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: cancel
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: checkAvailability
                                                  resultUsedByAI:
                                                    type: boolean
                                                    default: false
                                                  outputCustomFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                                  - outputCustomFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: questionnaires
                                              mode:
                                                enum:
                                                  - start
                                                  - end
                                                  - deleteApplicant
                                                type: string
                                                default: start
                                              questionnaireId:
                                                type: string
                                                pattern: ^\d+$
                                              states:
                                                not: {}
                                            required:
                                              - id
                                              - stepType
                                              - questionnaireId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setUpCoupon
                                              topicId:
                                                type: string
                                                pattern: ^\d+$
                                              states:
                                                not: {}
                                            required:
                                              - id
                                              - stepType
                                              - topicId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: markCouponUsed
                                              topicId:
                                                type: string
                                                pattern: ^\d+$
                                              states:
                                                not: {}
                                            required:
                                              - id
                                              - stepType
                                              - topicId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: subscribeBroadcast
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unsubscribeBroadcast
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: subscribeSequence
                                              sequenceId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unsubscribeSequence
                                              sequenceId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: getDataFromJson
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              mapping:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    jsonPath: {}
                                                    outputFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - mapping
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: formatDate
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              format:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              timezone:
                                                enum:
                                                  - contact
                                                  - workspace
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - format
                                              - outputFieldId
                                              - timezone
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: generateCode
                                              type:
                                                enum:
                                                  - NUMERIC_LENGTH
                                                  - NUMERIC_VALUE
                                                  - ALPHANUMERIC_LENGTH
                                                type: string
                                              min:
                                                type: integer
                                                minimum: 0
                                                maximum: 9007199254740990
                                              max:
                                                type: integer
                                                minimum: 0
                                                maximum: 9007199254740991
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - type
                                              - min
                                              - max
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: countCharacters
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: callApi
                                              method:
                                                enum:
                                                  - GET
                                                  - POST
                                                  - PUT
                                                  - PATCH
                                                  - DELETE
                                                type: string
                                                default: GET
                                              url:
                                                type: string
                                                minLength: 1
                                              headers:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    key: {}
                                                    value: {}
                                              body:
                                                anyOf:
                                                  - type: object
                                                    properties:
                                                      bodyType: {}
                                                  - type: object
                                                    properties:
                                                      bodyType: {}
                                                      jsonBody: {}
                                                  - type: object
                                                    properties:
                                                      bodyType: {}
                                                      formFields: {}
                                              mapping:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    jsonPath: {}
                                                    outputFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - url
                                              - headers
                                              - mapping
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: executeJavascript
                                              code:
                                                type: string
                                                minLength: 1
                                                maxLength: 10000
                                              customFieldId:
                                                type: string
                                              mapping:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    jsonPath: {}
                                                    outputFieldId: {}
                                                default: []
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - code
                                              - customFieldId
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: markEmailVerified
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: optInEmail
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: optOutEmail
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: activeCampaignSyncContact
                                              operation:
                                                enum:
                                                  - createOrUpdateContact
                                                  - addContactToAutomation
                                                type: string
                                                default: createOrUpdateContact
                                              emailField:
                                                type: string
                                                minLength: 1
                                              phoneField:
                                                type: string
                                                minLength: 1
                                              automationId:
                                                type: string
                                                minLength: 1
                                              listIds:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              tagIds:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              fieldValues:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    activeCampaignFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - listIds
                                              - tagIds
                                              - fieldValues
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: getResponseAddContact
                                              campaignId:
                                                type: string
                                                minLength: 1
                                              emailField:
                                                type: string
                                                minLength: 1
                                              tags:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              dayOfCycle: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - campaignId
                                              - emailField
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: mailchimpAddMember
                                              listId:
                                                type: string
                                                minLength: 1
                                              email:
                                                type: string
                                                minLength: 1
                                              doubleOptIn:
                                                type: boolean
                                              tags:
                                                type: array
                                                items:
                                                  type: string
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    tag: {}
                                                    name: {}
                                                    type: {}
                                                    customFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - listId
                                              - email
                                              - doubleOptIn
                                              - tags
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: mailerLiteAddSubscriber
                                              groupId: {}
                                              emailField:
                                                type: string
                                                minLength: 1
                                              status:
                                                enum:
                                                  - active
                                                  - unconfirmed
                                                type: string
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    mailerLiteField: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - status
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: moosendCreateContact
                                              listId:
                                                type: string
                                                minLength: 1
                                              emailField:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - listId
                                              - emailField
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: dripSubscribeSubscriber
                                              accountId:
                                                type: string
                                                minLength: 1
                                              emailField:
                                                type: string
                                                minLength: 1
                                              phoneField:
                                                type: string
                                                minLength: 1
                                              tags:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    dripField: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - accountId
                                              - emailField
                                              - tags
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: sendGridAddContact
                                              listId: {}
                                              emailField:
                                                type: string
                                                minLength: 1
                                              phoneField: {}
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    sendGridField: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: klaviyoSyncProfile
                                              listId: {}
                                              emailField:
                                                type: string
                                                minLength: 1
                                              titleField: {}
                                              orgField: {}
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    klaviyoProperty: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: startAnotherNode
                                              nodeId:
                                                type: string
                                                pattern: ^\d+$
                                              viewOnly:
                                                type: boolean
                                            required:
                                              - id
                                              - stepType
                                              - nodeId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: startExternalFlow
                                              flowId:
                                                type: string
                                                pattern: ^\d+$
                                            required:
                                              - id
                                              - stepType
                                              - flowId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: startExternalNode
                                              flowId:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                                pattern: ^\d+$
                                            required:
                                              - id
                                              - stepType
                                              - flowId
                                              - nodeId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiGenerateText
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - deepseek
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              integrationId:
                                                type: string
                                              model:
                                                type: string
                                              system:
                                                type: string
                                              text:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              tools:
                                                type: array
                                                items:
                                                  type: string
                                              remember:
                                                type: boolean
                                              temperature:
                                                type: number
                                                minimum: 0
                                                maximum: 2
                                              maxOutputTokens:
                                                type: integer
                                                minimum: 250
                                                maximum: 4096
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - text
                                              - outputFieldId
                                              - remember
                                              - temperature
                                              - maxOutputTokens
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiGenerateImage
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                type: string
                                              model:
                                                type: string
                                                minLength: 1
                                              prompt:
                                                type: string
                                                minLength: 1
                                              quality:
                                                enum:
                                                  - auto
                                                  - hd
                                                  - md
                                                  - ld
                                                type: string
                                              size:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - prompt
                                              - quality
                                              - size
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiDeleteMessageHistory
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - deepseek
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiEditImage
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                type: string
                                              model:
                                                type: string
                                                minLength: 1
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              prompt:
                                                type: string
                                                minLength: 1
                                              size:
                                                type: string
                                                minLength: 1
                                              quality:
                                                enum:
                                                  - auto
                                                  - low
                                                  - medium
                                                  - high
                                                  - ld
                                                  - md
                                                  - hd
                                                type: string
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - inputFieldId
                                              - prompt
                                              - size
                                              - quality
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiAnalyzeImage
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              integrationId:
                                                type: string
                                              model:
                                                type: string
                                              prompt:
                                                type: string
                                                minLength: 1
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              temperature:
                                                type: number
                                                minimum: 0
                                                maximum: 2
                                              maxOutputTokens:
                                                type: integer
                                                minimum: 250
                                                maximum: 4096
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - prompt
                                              - inputFieldId
                                              - outputFieldId
                                              - temperature
                                              - maxOutputTokens
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiGenerateTextAgent
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - deepseek
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              integrationId:
                                                type: string
                                              model:
                                                type: string
                                              aiAgentId:
                                                type: string
                                                pattern: ^\d+$
                                              message:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              rememberConversation:
                                                type: boolean
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - aiAgentId
                                              - message
                                              - outputFieldId
                                              - rememberConversation
                                          - anyOf:
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: aiExtractData
                                                  extractFields:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  provider:
                                                    enum:
                                                      - openai
                                                      - gemini
                                                      - claude
                                                      - openrouter
                                                      - openaiCompatible
                                                    type: string
                                                  integrationId:
                                                    type: string
                                                  model:
                                                    type: string
                                                  inputType:
                                                    const: text
                                                  inputFieldId:
                                                    type: string
                                                    minLength: 1
                                                  file:
                                                    type: object
                                                    properties:
                                                      attribute: {}
                                                      value: {}
                                                required:
                                                  - id
                                                  - stepType
                                                  - extractFields
                                                  - provider
                                                  - model
                                                  - inputType
                                                  - inputFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: aiExtractData
                                                  extractFields:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  provider:
                                                    enum:
                                                      - openai
                                                      - gemini
                                                      - claude
                                                      - openrouter
                                                      - openaiCompatible
                                                    type: string
                                                  integrationId:
                                                    type: string
                                                  model:
                                                    type: string
                                                  inputType:
                                                    const: image
                                                  inputFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - extractFields
                                                  - provider
                                                  - model
                                                  - inputType
                                                  - inputFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: aiExtractData
                                                  extractFields:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  provider:
                                                    enum:
                                                      - openai
                                                      - gemini
                                                      - claude
                                                      - openrouter
                                                      - openaiCompatible
                                                    type: string
                                                  integrationId:
                                                    type: string
                                                  model:
                                                    type: string
                                                  inputType:
                                                    const: file
                                                  inputFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - extractFields
                                                  - provider
                                                  - model
                                                  - inputType
                                                  - inputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiSpeechToText
                                              provider:
                                                const: openai
                                              model:
                                                type: string
                                                minLength: 1
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - inputFieldId
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiTextToSpeech
                                              provider:
                                                const: openai
                                              model:
                                                enum:
                                                  - gpt-4o-mini-tts
                                                  - tts-1
                                                  - tts-1-hd
                                                type: string
                                              message:
                                                type: string
                                                minLength: 1
                                              voiceType:
                                                enum:
                                                  - alloy
                                                  - ash
                                                  - ballad
                                                  - coral
                                                  - echo
                                                  - fable
                                                  - onyx
                                                  - nova
                                                  - sage
                                                  - shimmer
                                                  - verse
                                                  - marin
                                                  - cedar
                                                type: string
                                              voiceTone:
                                                type: string
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - message
                                              - voiceType
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetGetRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    customFieldId: {}
                                                    header: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetClearRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetGetRandomRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    customFieldId: {}
                                                    header: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetSendData
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              version:
                                                enum:
                                                  - v1
                                                  - v2
                                                type: string
                                                default: v1
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    header: {}
                                                    customFieldId: {}
                                                    value: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetUpdateRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              version:
                                                enum:
                                                  - v1
                                                  - v2
                                                type: string
                                                default: v1
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    header: {}
                                                    customFieldId: {}
                                                    value: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: facebookCustomAudience
                                              operation:
                                                enum:
                                                  - add
                                                  - remove
                                                type: string
                                                default: add
                                              adAccountId:
                                                type: string
                                                minLength: 1
                                              customAudienceId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - adAccountId
                                              - customAudienceId
                                          - type: object
                                            properties:
                                              eventName:
                                                type: string
                                                minLength: 1
                                                maxLength: 50
                                                default: LeadSubmitted
                                              actionSource:
                                                enum:
                                                  - business_messaging
                                                  - email
                                                  - phone_call
                                                  - chat
                                                  - physical_store
                                                  - system_generated
                                                  - other
                                                type: string
                                                default: business_messaging
                                              contentType:
                                                enum:
                                                  - product
                                                  - product_group
                                                type: string
                                              contentIds: {}
                                              value: {}
                                              currency: {}
                                              contentCategory:
                                                type: string
                                                minLength: 1
                                                maxLength: 200
                                              contentName:
                                                type: string
                                                minLength: 1
                                                maxLength: 200
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: sendMetaCapiEvent
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setMessengerUserPersistentMenu
                                              userPersistentMenuId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: enableMessengerComposer
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: disableMessengerComposer
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setMessengerPersona
                                              personaId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: updateMessengerContactData
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: make
                                              events:
                                                type: array
                                                minItems: 1
                                                maxItems: 20
                                                items:
                                                  type: string
                                                  minLength: 1
                                                  maxLength: 100
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - events
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: triggerN8n
                                              events:
                                                type: array
                                                minItems: 1
                                                maxItems: 20
                                                items:
                                                  type: string
                                                  minLength: 1
                                                  maxLength: 100
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - events
                                              - states
                                    quickReplies:
                                      type: array
                                      maxItems: 10
                                      items:
                                        allOf:
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              label:
                                                type: string
                                                minLength: 1
                                                maxLength: 20
                                            required:
                                              - id
                                              - label
                                          - anyOf:
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: sendMessage
                                                  beforeStep:
                                                    type: object
                                                    properties:
                                                      id: {}
                                                      stepType: {}
                                                      nodeId: {}
                                                      viewOnly: {}
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: openWebsite
                                                  beforeStep:
                                                    type: object
                                                    properties:
                                                      id: {}
                                                      stepType: {}
                                                      url: {}
                                                      browserSize: {}
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: performAction
                                                  beforeStep:
                                                    type: object
                                                    properties:
                                                      id: {}
                                                      stepType: {}
                                                      nodeId: {}
                                                      viewOnly: {}
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: startExternalFlow
                                                  beforeStep:
                                                    type: object
                                                    properties:
                                                      id: {}
                                                      stepType: {}
                                                      flowId: {}
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: startExternalNode
                                                  beforeStep:
                                                    type: object
                                                    properties:
                                                      id: {}
                                                      stepType: {}
                                                      flowId: {}
                                                      nodeId: {}
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: whatsappOptionList
                                                  beforeStep:
                                                    type: 'null'
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: startAnotherNode
                                                  beforeStep:
                                                    type: object
                                                    properties:
                                                      id: {}
                                                      stepType: {}
                                                      nodeId: {}
                                                      viewOnly: {}
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                              - type: object
                                                properties:
                                                  buttonType:
                                                    const: null
                                                  beforeStep:
                                                    type: 'null'
                                                  steps:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - buttonType
                                                  - beforeStep
                                                  - steps
                                  required:
                                    - beforeStep
                                    - steps
                                    - quickReplies
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: startFlow
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    beforeStep:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          pattern: ^\d+$
                                        stepType:
                                          const: startExternalFlow
                                        flowId:
                                          type: string
                                          pattern: ^\d+$
                                      required:
                                        - id
                                        - stepType
                                        - flowId
                                  required:
                                    - beforeStep
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: performAction
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    steps:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: enableBot
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: disableBot
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: assignConversation
                                              assignedId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                              - assignedId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: autoAssignConversation
                                              assignedIds:
                                                type: array
                                                items:
                                                  type: string
                                              rule:
                                                enum:
                                                  - ALL_TIME
                                                  - LAST_HOUR
                                                  - LAST_8HOURS
                                                  - LAST_24HOURS
                                                type: string
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - assignedIds
                                              - rule
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unassignConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: followConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unfollowConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: archiveConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unarchiveConversation
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: addContactNotes
                                              content:
                                                type: string
                                                maxLength: 1000
                                            required:
                                              - id
                                              - stepType
                                              - content
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: blockContact
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: addContactTag
                                              tags:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: string
                                                  minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - tags
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: removeContactTag
                                              tags:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: string
                                                  minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - tags
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setCustomField
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              operation:
                                                enum:
                                                  - O01
                                                  - O02
                                                  - O03
                                                  - O04
                                                  - O05
                                                type: string
                                              value:
                                                type: string
                                              timezone:
                                                type: string
                                                maxLength: 64
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - operation
                                              - value
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: clearCustomField
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: deleteContact
                                            required:
                                              - id
                                              - stepType
                                          - anyOf:
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: bookFromCustomField
                                                  dateTimeFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                                  - dateTimeFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: checkAvailabilityFromCustomField
                                                  startDateFieldId:
                                                    type: string
                                                    minLength: 1
                                                  endDateFieldId:
                                                    type: string
                                                    minLength: 1
                                                  resultUsedByAI:
                                                    type: boolean
                                                    default: false
                                                  outputCustomFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                                  - startDateFieldId
                                                  - endDateFieldId
                                                  - outputCustomFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: book
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: cancel
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: appointmentScheduling
                                                  calendarId:
                                                    type: string
                                                    pattern: ^\d+$
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  mode:
                                                    const: checkAvailability
                                                  resultUsedByAI:
                                                    type: boolean
                                                    default: false
                                                  outputCustomFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - calendarId
                                                  - states
                                                  - mode
                                                  - outputCustomFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: questionnaires
                                              mode:
                                                enum:
                                                  - start
                                                  - end
                                                  - deleteApplicant
                                                type: string
                                                default: start
                                              questionnaireId:
                                                type: string
                                                pattern: ^\d+$
                                              states:
                                                not: {}
                                            required:
                                              - id
                                              - stepType
                                              - questionnaireId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setUpCoupon
                                              topicId:
                                                type: string
                                                pattern: ^\d+$
                                              states:
                                                not: {}
                                            required:
                                              - id
                                              - stepType
                                              - topicId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: markCouponUsed
                                              topicId:
                                                type: string
                                                pattern: ^\d+$
                                              states:
                                                not: {}
                                            required:
                                              - id
                                              - stepType
                                              - topicId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: subscribeBroadcast
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unsubscribeBroadcast
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: subscribeSequence
                                              sequenceId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: unsubscribeSequence
                                              sequenceId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: getDataFromJson
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              mapping:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    jsonPath: {}
                                                    outputFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - mapping
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: formatDate
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              format:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              timezone:
                                                enum:
                                                  - contact
                                                  - workspace
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - format
                                              - outputFieldId
                                              - timezone
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: generateCode
                                              type:
                                                enum:
                                                  - NUMERIC_LENGTH
                                                  - NUMERIC_VALUE
                                                  - ALPHANUMERIC_LENGTH
                                                type: string
                                              min:
                                                type: integer
                                                minimum: 0
                                                maximum: 9007199254740990
                                              max:
                                                type: integer
                                                minimum: 0
                                                maximum: 9007199254740991
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - type
                                              - min
                                              - max
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: countCharacters
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - inputFieldId
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: callApi
                                              method:
                                                enum:
                                                  - GET
                                                  - POST
                                                  - PUT
                                                  - PATCH
                                                  - DELETE
                                                type: string
                                                default: GET
                                              url:
                                                type: string
                                                minLength: 1
                                              headers:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    key: {}
                                                    value: {}
                                              body:
                                                anyOf:
                                                  - type: object
                                                    properties:
                                                      bodyType: {}
                                                  - type: object
                                                    properties:
                                                      bodyType: {}
                                                      jsonBody: {}
                                                  - type: object
                                                    properties:
                                                      bodyType: {}
                                                      formFields: {}
                                              mapping:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    jsonPath: {}
                                                    outputFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - url
                                              - headers
                                              - mapping
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: executeJavascript
                                              code:
                                                type: string
                                                minLength: 1
                                                maxLength: 10000
                                              customFieldId:
                                                type: string
                                              mapping:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    jsonPath: {}
                                                    outputFieldId: {}
                                                default: []
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - code
                                              - customFieldId
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: markEmailVerified
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: optInEmail
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: optOutEmail
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: activeCampaignSyncContact
                                              operation:
                                                enum:
                                                  - createOrUpdateContact
                                                  - addContactToAutomation
                                                type: string
                                                default: createOrUpdateContact
                                              emailField:
                                                type: string
                                                minLength: 1
                                              phoneField:
                                                type: string
                                                minLength: 1
                                              automationId:
                                                type: string
                                                minLength: 1
                                              listIds:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              tagIds:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              fieldValues:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    activeCampaignFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - listIds
                                              - tagIds
                                              - fieldValues
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: getResponseAddContact
                                              campaignId:
                                                type: string
                                                minLength: 1
                                              emailField:
                                                type: string
                                                minLength: 1
                                              tags:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              dayOfCycle: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - campaignId
                                              - emailField
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: mailchimpAddMember
                                              listId:
                                                type: string
                                                minLength: 1
                                              email:
                                                type: string
                                                minLength: 1
                                              doubleOptIn:
                                                type: boolean
                                              tags:
                                                type: array
                                                items:
                                                  type: string
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    tag: {}
                                                    name: {}
                                                    type: {}
                                                    customFieldId: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - listId
                                              - email
                                              - doubleOptIn
                                              - tags
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: mailerLiteAddSubscriber
                                              groupId: {}
                                              emailField:
                                                type: string
                                                minLength: 1
                                              status:
                                                enum:
                                                  - active
                                                  - unconfirmed
                                                type: string
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    mailerLiteField: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - status
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: moosendCreateContact
                                              listId:
                                                type: string
                                                minLength: 1
                                              emailField:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - listId
                                              - emailField
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: dripSubscribeSubscriber
                                              accountId:
                                                type: string
                                                minLength: 1
                                              emailField:
                                                type: string
                                                minLength: 1
                                              phoneField:
                                                type: string
                                                minLength: 1
                                              tags:
                                                type: array
                                                items:
                                                  type: string
                                                  minLength: 1
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    dripField: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - accountId
                                              - emailField
                                              - tags
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: sendGridAddContact
                                              listId: {}
                                              emailField:
                                                type: string
                                                minLength: 1
                                              phoneField: {}
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    sendGridField: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: klaviyoSyncProfile
                                              listId: {}
                                              emailField:
                                                type: string
                                                minLength: 1
                                              titleField: {}
                                              orgField: {}
                                              mergeFields:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    contactFieldId: {}
                                                    klaviyoProperty: {}
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - emailField
                                              - mergeFields
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: startAnotherNode
                                              nodeId:
                                                type: string
                                                pattern: ^\d+$
                                              viewOnly:
                                                type: boolean
                                            required:
                                              - id
                                              - stepType
                                              - nodeId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: startExternalFlow
                                              flowId:
                                                type: string
                                                pattern: ^\d+$
                                            required:
                                              - id
                                              - stepType
                                              - flowId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: startExternalNode
                                              flowId:
                                                type: string
                                                pattern: ^\d+$
                                              nodeId:
                                                type: string
                                                pattern: ^\d+$
                                            required:
                                              - id
                                              - stepType
                                              - flowId
                                              - nodeId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiGenerateText
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - deepseek
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              integrationId:
                                                type: string
                                              model:
                                                type: string
                                              system:
                                                type: string
                                              text:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              tools:
                                                type: array
                                                items:
                                                  type: string
                                              remember:
                                                type: boolean
                                              temperature:
                                                type: number
                                                minimum: 0
                                                maximum: 2
                                              maxOutputTokens:
                                                type: integer
                                                minimum: 250
                                                maximum: 4096
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - text
                                              - outputFieldId
                                              - remember
                                              - temperature
                                              - maxOutputTokens
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiGenerateImage
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                type: string
                                              model:
                                                type: string
                                                minLength: 1
                                              prompt:
                                                type: string
                                                minLength: 1
                                              quality:
                                                enum:
                                                  - auto
                                                  - hd
                                                  - md
                                                  - ld
                                                type: string
                                              size:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - prompt
                                              - quality
                                              - size
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiDeleteMessageHistory
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - deepseek
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiEditImage
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                type: string
                                              model:
                                                type: string
                                                minLength: 1
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              prompt:
                                                type: string
                                                minLength: 1
                                              size:
                                                type: string
                                                minLength: 1
                                              quality:
                                                enum:
                                                  - auto
                                                  - low
                                                  - medium
                                                  - high
                                                  - ld
                                                  - md
                                                  - hd
                                                type: string
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - inputFieldId
                                              - prompt
                                              - size
                                              - quality
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiAnalyzeImage
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              integrationId:
                                                type: string
                                              model:
                                                type: string
                                              prompt:
                                                type: string
                                                minLength: 1
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              temperature:
                                                type: number
                                                minimum: 0
                                                maximum: 2
                                              maxOutputTokens:
                                                type: integer
                                                minimum: 250
                                                maximum: 4096
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - prompt
                                              - inputFieldId
                                              - outputFieldId
                                              - temperature
                                              - maxOutputTokens
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiGenerateTextAgent
                                              provider:
                                                enum:
                                                  - openai
                                                  - gemini
                                                  - claude
                                                  - deepseek
                                                  - openrouter
                                                  - openaiCompatible
                                                type: string
                                              integrationId:
                                                type: string
                                              model:
                                                type: string
                                              aiAgentId:
                                                type: string
                                                pattern: ^\d+$
                                              message:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              rememberConversation:
                                                type: boolean
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - aiAgentId
                                              - message
                                              - outputFieldId
                                              - rememberConversation
                                          - anyOf:
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: aiExtractData
                                                  extractFields:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  provider:
                                                    enum:
                                                      - openai
                                                      - gemini
                                                      - claude
                                                      - openrouter
                                                      - openaiCompatible
                                                    type: string
                                                  integrationId:
                                                    type: string
                                                  model:
                                                    type: string
                                                  inputType:
                                                    const: text
                                                  inputFieldId:
                                                    type: string
                                                    minLength: 1
                                                  file:
                                                    type: object
                                                    properties:
                                                      attribute: {}
                                                      value: {}
                                                required:
                                                  - id
                                                  - stepType
                                                  - extractFields
                                                  - provider
                                                  - model
                                                  - inputType
                                                  - inputFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: aiExtractData
                                                  extractFields:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  provider:
                                                    enum:
                                                      - openai
                                                      - gemini
                                                      - claude
                                                      - openrouter
                                                      - openaiCompatible
                                                    type: string
                                                  integrationId:
                                                    type: string
                                                  model:
                                                    type: string
                                                  inputType:
                                                    const: image
                                                  inputFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - extractFields
                                                  - provider
                                                  - model
                                                  - inputType
                                                  - inputFieldId
                                              - type: object
                                                properties:
                                                  id:
                                                    type: string
                                                    pattern: ^\d+$
                                                  stepType:
                                                    const: aiExtractData
                                                  extractFields:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                  states:
                                                    type: array
                                                    prefixItems:
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                      - anyOf:
                                                          - {}
                                                          - type: 'null'
                                                  provider:
                                                    enum:
                                                      - openai
                                                      - gemini
                                                      - claude
                                                      - openrouter
                                                      - openaiCompatible
                                                    type: string
                                                  integrationId:
                                                    type: string
                                                  model:
                                                    type: string
                                                  inputType:
                                                    const: file
                                                  inputFieldId:
                                                    type: string
                                                    minLength: 1
                                                required:
                                                  - id
                                                  - stepType
                                                  - extractFields
                                                  - provider
                                                  - model
                                                  - inputType
                                                  - inputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiSpeechToText
                                              provider:
                                                const: openai
                                              model:
                                                type: string
                                                minLength: 1
                                              inputFieldId:
                                                type: string
                                                minLength: 1
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - inputFieldId
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: aiTextToSpeech
                                              provider:
                                                const: openai
                                              model:
                                                enum:
                                                  - gpt-4o-mini-tts
                                                  - tts-1
                                                  - tts-1-hd
                                                type: string
                                              message:
                                                type: string
                                                minLength: 1
                                              voiceType:
                                                enum:
                                                  - alloy
                                                  - ash
                                                  - ballad
                                                  - coral
                                                  - echo
                                                  - fable
                                                  - onyx
                                                  - nova
                                                  - sage
                                                  - shimmer
                                                  - verse
                                                  - marin
                                                  - cedar
                                                type: string
                                              voiceTone:
                                                type: string
                                              outputFieldId:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - provider
                                              - model
                                              - message
                                              - voiceType
                                              - outputFieldId
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetGetRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    customFieldId: {}
                                                    header: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetClearRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetGetRandomRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    customFieldId: {}
                                                    header: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetSendData
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              version:
                                                enum:
                                                  - v1
                                                  - v2
                                                type: string
                                                default: v1
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    header: {}
                                                    customFieldId: {}
                                                    value: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: spreadsheetUpdateRow
                                              spreadsheetId:
                                                type: string
                                                pattern: ^\d+$
                                              sheetName:
                                                type: string
                                                minLength: 1
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                              version:
                                                enum:
                                                  - v1
                                                  - v2
                                                type: string
                                                default: v1
                                              lookup:
                                                type: object
                                                properties:
                                                  mode:
                                                    enum:
                                                      - AND
                                                      - OR
                                                    type: string
                                                  conditions:
                                                    type: array
                                                    items:
                                                      anyOf:
                                                        - {}
                                                        - type: 'null'
                                                required:
                                                  - mode
                                                  - conditions
                                              map:
                                                type: array
                                                minItems: 1
                                                items:
                                                  type: object
                                                  properties:
                                                    header: {}
                                                    customFieldId: {}
                                                    value: {}
                                            required:
                                              - id
                                              - stepType
                                              - spreadsheetId
                                              - sheetName
                                              - states
                                              - lookup
                                              - map
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: facebookCustomAudience
                                              operation:
                                                enum:
                                                  - add
                                                  - remove
                                                type: string
                                                default: add
                                              adAccountId:
                                                type: string
                                                minLength: 1
                                              customAudienceId:
                                                type: string
                                                minLength: 1
                                            required:
                                              - id
                                              - stepType
                                              - adAccountId
                                              - customAudienceId
                                          - type: object
                                            properties:
                                              eventName:
                                                type: string
                                                minLength: 1
                                                maxLength: 50
                                                default: LeadSubmitted
                                              actionSource:
                                                enum:
                                                  - business_messaging
                                                  - email
                                                  - phone_call
                                                  - chat
                                                  - physical_store
                                                  - system_generated
                                                  - other
                                                type: string
                                                default: business_messaging
                                              contentType:
                                                enum:
                                                  - product
                                                  - product_group
                                                type: string
                                              contentIds: {}
                                              value: {}
                                              currency: {}
                                              contentCategory:
                                                type: string
                                                minLength: 1
                                                maxLength: 200
                                              contentName:
                                                type: string
                                                minLength: 1
                                                maxLength: 200
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: sendMetaCapiEvent
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setMessengerUserPersistentMenu
                                              userPersistentMenuId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: enableMessengerComposer
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: disableMessengerComposer
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: setMessengerPersona
                                              personaId:
                                                type: string
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: updateMessengerContactData
                                            required:
                                              - id
                                              - stepType
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: make
                                              events:
                                                type: array
                                                minItems: 1
                                                maxItems: 20
                                                items:
                                                  type: string
                                                  minLength: 1
                                                  maxLength: 100
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - events
                                              - states
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: triggerN8n
                                              events:
                                                type: array
                                                minItems: 1
                                                maxItems: 20
                                                items:
                                                  type: string
                                                  minLength: 1
                                                  maxLength: 100
                                              states:
                                                type: array
                                                prefixItems:
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                                  - type: object
                                                    properties:
                                                      id: {}
                                                      stateType: {}
                                            required:
                                              - id
                                              - stepType
                                              - events
                                              - states
                                  required:
                                    - steps
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: condition
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    steps:
                                      type: array
                                      minItems: 1
                                      maxItems: 1
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            pattern: ^\d+$
                                          stepType:
                                            const: condition
                                          cases:
                                            type: array
                                            minItems: 1
                                            items:
                                              type: object
                                              properties:
                                                id:
                                                  type: string
                                                  pattern: ^\d+$
                                                operator:
                                                  enum:
                                                    - and
                                                    - or
                                                  type: string
                                                conditions:
                                                  type: array
                                                  minItems: 1
                                                  items:
                                                    anyOf:
                                                      - {}
                                                      - type: 'null'
                                                timezone:
                                                  type: string
                                                  maxLength: 64
                                              required:
                                                - id
                                                - operator
                                                - conditions
                                          otherwiseId:
                                            type: string
                                            pattern: ^\d+$
                                        required:
                                          - id
                                          - stepType
                                          - cases
                                          - otherwiseId
                                  required:
                                    - steps
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: splitTraffic
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    steps:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            pattern: ^\d+$
                                          stepType:
                                            const: splitTraffic
                                          cases:
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                value:
                                                  type: integer
                                                  minimum: 0
                                                  maximum: 100
                                                nodeId:
                                                  anyOf:
                                                    - type: string
                                                      pattern: ^\d+$
                                                    - type: 'null'
                                              required:
                                                - value
                                        required:
                                          - id
                                          - stepType
                                          - cases
                                  required:
                                    - steps
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: wait
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    steps:
                                      type: array
                                      minItems: 1
                                      maxItems: 1
                                      items:
                                        allOf:
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                pattern: ^\d+$
                                              stepType:
                                                const: wait
                                            required:
                                              - id
                                              - stepType
                                          - anyOf:
                                              - type: object
                                                properties:
                                                  delayType:
                                                    const: duration
                                                  duration:
                                                    type: integer
                                                    minimum: 1
                                                    maximum: 999999
                                                  unit:
                                                    enum:
                                                      - seconds
                                                      - minutes
                                                      - hours
                                                      - days
                                                    type: string
                                                  interval:
                                                    type: boolean
                                                  startTime:
                                                    anyOf:
                                                      - type: string
                                                        format: time
                                                      - type: 'null'
                                                  endTime:
                                                    anyOf:
                                                      - type: string
                                                        format: time
                                                      - type: 'null'
                                                required:
                                                  - delayType
                                                  - duration
                                                  - unit
                                                  - interval
                                                  - startTime
                                                  - endTime
                                              - type: object
                                                properties:
                                                  delayType:
                                                    const: date
                                                  dateType:
                                                    enum:
                                                      - specific
                                                      - dynamic
                                                    type: string
                                                  datetime:
                                                    type: string
                                                    format: date-time
                                                  outputFieldId:
                                                    type: string
                                                    minLength: 1
                                                  offset:
                                                    type: boolean
                                                    default: false
                                                  offsetOperator:
                                                    enum:
                                                      - add
                                                      - subtract
                                                    type: string
                                                  offsetValue:
                                                    type: integer
                                                    minimum: 1
                                                    maximum: 999999
                                                  offsetUnit:
                                                    enum:
                                                      - seconds
                                                      - minutes
                                                      - hours
                                                      - days
                                                    type: string
                                                required:
                                                  - delayType
                                                  - dateType
                                              - type: object
                                                properties:
                                                  delayType:
                                                    const: random
                                                  min:
                                                    type: integer
                                                    minimum: 1
                                                    maximum: 999999
                                                  max:
                                                    type: integer
                                                    minimum: 1
                                                    maximum: 999999
                                                  unit:
                                                    enum:
                                                      - seconds
                                                      - minutes
                                                      - hours
                                                      - days
                                                    type: string
                                                required:
                                                  - delayType
                                                  - min
                                                  - max
                                                  - unit
                                  required:
                                    - steps
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: followUp
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    steps:
                                      type: array
                                      minItems: 1
                                      maxItems: 1
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            pattern: ^\d+$
                                          stepType:
                                            const: followUp
                                          duration:
                                            type: integer
                                            minimum: 1
                                            maximum: 9007199254740991
                                          unit:
                                            enum:
                                              - seconds
                                              - minutes
                                              - hours
                                              - days
                                            type: string
                                        required:
                                          - id
                                          - stepType
                                          - duration
                                          - unit
                                  required:
                                    - steps
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: addNotes
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    beforeStep:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          pattern: ^\d+$
                                        stepType:
                                          const: addNotes
                                        text:
                                          type: string
                                          maxLength: 1000
                                      required:
                                        - id
                                        - stepType
                                        - text
                                  required:
                                    - beforeStep
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: landingPage
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                        - type: object
                          properties:
                            id:
                              type: string
                              pattern: ^\d+$
                            position:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            measured:
                              type: object
                              properties:
                                width:
                                  type: number
                                height:
                                  type: number
                              required:
                                - width
                                - height
                            type:
                              const: sendMail
                            data:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                isStartNode:
                                  type: boolean
                                details:
                                  type: object
                                  properties:
                                    steps:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            pattern: ^\d+$
                                          stepType:
                                            const: email
                                          integrationSmtpId:
                                            type: string
                                          topicId:
                                            type: string
                                          from:
                                            type: string
                                          to:
                                            type: string
                                          subject:
                                            type: string
                                          preheader:
                                            type: string
                                          elements:
                                            type: array
                                            items:
                                              anyOf:
                                                - anyOf:
                                                    - type: object
                                                      properties:
                                                        id: {}
                                                        type: {}
                                                        text: {}
                                                    - type: object
                                                      properties:
                                                        id: {}
                                                        type: {}
                                                        url: {}
                                                        mode: {}
                                                    - type: object
                                                      properties:
                                                        id: {}
                                                        type: {}
                                                    - anyOf:
                                                        - {}
                                                        - {}
                                                        - {}
                                                        - {}
                                                        - {}
                                                        - {}
                                                        - {}
                                                - type: 'null'
                                        required:
                                          - id
                                          - stepType
                                          - integrationSmtpId
                                          - from
                                          - to
                                          - subject
                                          - preheader
                                          - elements
                                  required:
                                    - steps
                              required:
                                - name
                                - isStartNode
                                - details
                          required:
                            - id
                            - position
                            - measured
                            - type
                            - data
                    description: Raw flow node graph, as sent by the builder UI.
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        source:
                          type: string
                        sourceHandle:
                          type: string
                        target:
                          type: string
                        targetHandle:
                          type: string
                      required:
                        - id
                        - source
                        - sourceHandle
                        - target
                        - targetHandle
                    description: Raw flow edge graph, as sent by the builder UI.
                required:
                  - nodes
                  - edges
        '400':
          description: '400'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: businessError
                      status:
                        const: 400
                      message:
                        type: string
                        default: An error occurred while processing your request
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: UNAUTHORIZED
                      status:
                        const: 401
                      message:
                        type: string
                        default: Authentication required
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: INVALID_CHATBOT_TOKEN
                      status:
                        const: 401
                      message:
                        type: string
                        default: Invalid or missing workspace API token
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FORBIDDEN
                      status:
                        const: 403
                      message:
                        type: string
                        default: You do not have permission to perform this action
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: trialExpired
                      status:
                        const: 403
                      message:
                        type: string
                        default: Trial expired
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: macLimitReached
                      status:
                        const: 403
                      message:
                        type: string
                        default: Monthly active contact limit reached
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
        '404':
          description: '404'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: notFound
                      status:
                        const: 404
                      message:
                        type: string
                        default: Resource not found
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
        '422':
          description: '422'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: invalidRequestData
                      status:
                        const: 422
                      message:
                        type: string
                        default: Input validation failed
                      data:
                        type: object
                        properties:
                          issues:
                            type: array
                            items:
                              type: object
                              properties:
                                message:
                                  type: string
                                path:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                      - type: object
                                        properties:
                                          key:
                                            anyOf:
                                              - type: string
                                              - type: number
                                        required:
                                          - key
                                        additionalProperties: {}
                              required:
                                - message
                              additionalProperties: {}
                        required:
                          - issues
                        additionalProperties: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: validation
                      status:
                        const: 422
                      message:
                        type: string
                        default: Validation error
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
        '429':
          description: '429'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: tooManyRequests
                      status:
                        const: 429
                      message:
                        type: string
                        default: Too many requests
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
        '500':
          description: '500'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: INTERNAL_SERVER_ERROR
                      status:
                        const: 500
                      message:
                        type: string
                        default: An unexpected error occurred
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - $ref: '#/components/schemas/UndefinedError'
components:
  schemas:
    UndefinedError:
      type: object
      properties:
        defined:
          const: false
        code:
          type: string
        status:
          type: number
        message:
          type: string
        data: {}
      required:
        - defined
        - code
        - status
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    developerAccessToken:
      type: http
      scheme: bearer
    tokenInSearchParams:
      type: apiKey
      in: query
      name: token

````