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

# Add workflow branch

> Gives a Condition, Buttons, Card, Carousel, Code or Crew step one more way out. When you send `to`, the call also links the new branch to a block.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/workflow/{workflowID}/step/{stepID}/branch
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/workflow/{workflowID}/step/{stepID}/branch:
    post:
      tags:
        - Workflow
      summary: Add workflow branch
      description: Gives a Condition, Buttons, Card, Carousel, Code or Crew step one
        more way out. When you send `to`, the call also links the new branch to
        a block.
      operationId: StableWorkflowController_addBranch
      parameters:
        - name: workflowID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the workflow to operate on.
          description: The ID of the workflow to operate on.
        - name: stepID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the step to operate on.
          description: The ID of the step to operate on.
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableWorkflowBranchAddRequest"
      responses:
        "201":
          description: Returns the new branch's ID, which is also its port key, and the
            step with the branch added.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableWorkflowBranchWriteResponse"
          x-vf-doc:
            description: Returns the new branch's ID, which is also its port key, and the
              step with the branch added.
      security:
        - token: []
components:
  schemas:
    StableWorkflowBranchAddRequest:
      oneOf:
        - $ref: "#/components/schemas/StableWorkflowConditionBranchAdd"
        - $ref: "#/components/schemas/StableWorkflowButtonsBranchAdd"
        - $ref: "#/components/schemas/StableWorkflowCardBranchAdd"
        - $ref: "#/components/schemas/StableWorkflowCarouselBranchAdd"
        - $ref: "#/components/schemas/StableWorkflowCodeBranchAdd"
        - $ref: "#/components/schemas/StableWorkflowCrewBranchAdd"
    StableWorkflowConditionBranchAdd:
      type: object
      properties:
        label:
          nullable: true
          type: string
        matchAll:
          type: boolean
        assertions:
          minItems: 1
          type: array
          items:
            type: object
            properties:
              id:
                description: The assertion's ID. Send the id a read returned to keep it; leave
                  it out for a new assertion.
                type: string
                minLength: 1
                maxLength: 255
              lhs:
                type: object
                properties:
                  variableID:
                    nullable: true
                    type: string
                  path:
                    description: "A property path inside the variable, as stored: .status compares
                      {order.status}, [0] the first item. A path without a
                      leading dot or bracket gets a dot."
                    nullable: true
                    type: string
                required:
                  - variableID
                additionalProperties: false
              operation:
                allOf:
                  - $ref: "#/components/schemas/ConditionOperation"
              rhs:
                $ref: "#/components/schemas/VariableReferenceString"
            required:
              - lhs
              - rhs
            additionalProperties: false
        to:
          type: string
          description: The block this branch leads to. In create, a block key from this
            request; in add_blocks, a block key from this request or an existing
            block ID; everywhere else, an existing block ID.
        kind:
          type: string
          enum:
            - condition
          x-enumNames:
            - CONDITION
      required:
        - assertions
        - kind
      additionalProperties: false
    ConditionOperation:
      type: string
      enum:
        - is
        - is_not
        - greater_than
        - greater_or_equal
        - less_than
        - less_or_equal
        - contains
        - not_contains
        - starts_with
        - ends_with
        - is_empty
        - is_not_empty
      x-enumNames:
        - IS
        - IS_NOT
        - GREATER_THAN
        - GREATER_OR_EQUAL
        - LESS_THAN
        - LESS_OR_EQUAL
        - CONTAINS
        - NOT_CONTAINS
        - STARTS_WITH
        - ENDS_WITH
        - IS_EMPTY
        - IS_NOT_EMPTY
    VariableReferenceString:
      type: string
      description: Plain text; markdown is not interpreted. {variable_name} inserts a
        variable or entity, {variable_name.path} a field of a variable. Escape a
        literal { or \ with a backslash. A name matching neither is stored as
        literal text and reported in unresolvedReferences; secrets are not
        available here.
    StableWorkflowButtonsBranchAdd:
      type: object
      properties:
        label:
          $ref: "#/components/schemas/VariableReferenceString"
        url:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        to:
          type: string
          description: The block this branch leads to. In create, a block key from this
            request; in add_blocks, a block key from this request or an existing
            block ID; everywhere else, an existing block ID.
        kind:
          type: string
          enum:
            - buttons
          x-enumNames:
            - BUTTONS
      required:
        - label
        - kind
      additionalProperties: false
    StableWorkflowCardBranchAdd:
      type: object
      properties:
        label:
          $ref: "#/components/schemas/VariableReferenceString"
        url:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        to:
          type: string
          description: The block this branch leads to. In create, a block key from this
            request; in add_blocks, a block key from this request or an existing
            block ID; everywhere else, an existing block ID.
        kind:
          type: string
          enum:
            - card
          x-enumNames:
            - CARD
      required:
        - label
        - kind
      additionalProperties: false
    StableWorkflowCarouselBranchAdd:
      type: object
      properties:
        label:
          $ref: "#/components/schemas/VariableReferenceString"
        url:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        to:
          type: string
          description: The block this branch leads to. In create, a block key from this
            request; in add_blocks, a block key from this request or an existing
            block ID; everywhere else, an existing block ID.
        kind:
          type: string
          enum:
            - carousel
          x-enumNames:
            - CAROUSEL
        cardID:
          type: string
          description: The card the new button goes on.
      required:
        - label
        - kind
        - cardID
      additionalProperties: false
    StableWorkflowCodeBranchAdd:
      type: object
      properties:
        label:
          type: string
        to:
          type: string
          description: The block this branch leads to. In create, a block key from this
            request; in add_blocks, a block key from this request or an existing
            block ID; everywhere else, an existing block ID.
        kind:
          type: string
          enum:
            - code
          x-enumNames:
            - CODE
      required:
        - label
        - kind
      additionalProperties: false
    StableWorkflowCrewBranchAdd:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        description:
          nullable: true
          type: string
        requiredVariables:
          type: array
          items:
            type: object
            properties:
              description:
                nullable: true
                type: string
              variableOrEntityID:
                nullable: true
                type: string
            required:
              - variableOrEntityID
            additionalProperties: false
        messages:
          type: object
          properties:
            execution:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/StableToolMessageRequest"
            failure:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/StableToolMessageRequest"
            delay:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/StableToolMessageRequest"
            completion:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/StableToolMessageRequest"
          additionalProperties: false
          description: One message per slot. null clears the slot; a slot you leave out
            keeps its message.
        delayMessageSeconds:
          nullable: true
          type: integer
          minimum: 0
          maximum: 9007199254740991
        to:
          type: string
          description: The block this branch leads to. In create, a block key from this
            request; in add_blocks, a block key from this request or an existing
            block ID; everywhere else, an existing block ID.
        kind:
          type: string
          enum:
            - crew
          x-enumNames:
            - CREW
      required:
        - name
        - kind
      additionalProperties: false
    StableToolMessageRequest:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - generative
              description: "Discriminator: the model writes this message itself, guided by the
                examples below."
              x-enumNames:
                - GENERATIVE
            examples:
              minItems: 1
              type: array
              items:
                $ref: "#/components/schemas/MarkdownLikeString"
              description: Example phrasings the model writes from. Replaces every example the
                slot holds today.
          required:
            - type
            - examples
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - scripted
              description: "Discriminator: this message is a fixed response, said verbatim."
              x-enumNames:
                - SCRIPTED
            messageID:
              type: string
              description: The ID of an existing response in this environment — the same ID
                this slot reports as <slot>MessageID on a read.
          required:
            - type
            - messageID
          additionalProperties: false
      description: A tool message in one of its two forms. Writing one form switches
        the slot to it and leaves the other form stored but inactive, exactly as
        the editor does — so switching back does not have to be retyped.
    MarkdownLikeString:
      type: string
      description: "Message text shown to the end user. Limited markdown: **bold**,
        _italic_, <u>underline</u>, ~~strikethrough~~, [label](url).
        {variable_name} inserts a variable or entity, {variable_name.path} a
        field of a variable. Escape a literal { or \\ with a backslash. A name
        matching neither is stored as literal text and reported in
        unresolvedReferences; secrets are not available here."
    StableWorkflowBranchWriteResponse:
      type: object
      properties:
        message:
          type: string
          description: What was written.
        branchID:
          type: string
          description: The branch ID. It is also the port key that link and unlink take.
        step:
          $ref: "#/components/schemas/StableWorkflowStep"
        unresolvedReferences:
          description: References this write kept as literal text instead of binding, each
            with the reason. The write still succeeded.
          type: array
          items:
            $ref: "#/components/schemas/StableUnresolvedReference"
      required:
        - message
        - branchID
        - step
    StableWorkflowStep:
      type: object
      properties:
        id:
          type: string
        kind:
          $ref: "#/components/schemas/StableWorkflowStepKind"
        exitClass:
          $ref: "#/components/schemas/StableWorkflowExitClass"
        content:
          $ref: "#/components/schemas/StableWorkflowStepContent"
        fallsThroughTo:
          nullable: true
          description: "When the step is not the last of its block: the step it continues
            to. Otherwise null."
          type: string
        suppressedPorts:
          type: array
          items:
            type: string
          description: Ports that run into the next step instead of their link, because
            the step is not last.
        links:
          type: array
          items:
            $ref: "#/components/schemas/StableWorkflowLink"
        reconciledPorts:
          allOf:
            - $ref: "#/components/schemas/StableWorkflowReconciledPorts"
        warnings:
          type: array
          items:
            $ref: "#/components/schemas/StableWorkflowDiagnostic"
      required:
        - id
        - kind
        - exitClass
        - content
        - fallsThroughTo
        - suppressedPorts
        - links
    StableWorkflowStepKind:
      type: string
      enum:
        - message
        - end
        - set
        - workflow
        - listen
        - condition
        - buttons
        - card
        - carousel
        - code
        - api
        - function
        - integration
        - mcp
        - playbook
        - operator
        - crew
        - handoff
        - legacy
        - goToBlock
        - callForward
      description: What the step does. api, function, integration and mcp are Tool
        steps. playbook and operator are Agent steps. goToBlock jumps to a block
        or a workflow start and ends the path. callForward transfers a phone
        call and ends the path. legacy is a step these operations show but
        cannot change.
      x-enumNames:
        - MESSAGE
        - END
        - SET
        - WORKFLOW
        - LISTEN
        - CONDITION
        - BUTTONS
        - CARD
        - CAROUSEL
        - CODE
        - API
        - FUNCTION
        - INTEGRATION
        - MCP
        - PLAYBOOK
        - OPERATOR
        - CREW
        - HANDOFF
        - LEGACY
        - GO_TO_BLOCK
        - CALL_FORWARD
    StableWorkflowExitClass:
      type: string
      enum:
        - sequential
        - branch
        - async-branch
        - terminal
      description: "How the step leaves. sequential: it continues to the step below
        it, or through next when it is last. branch: it leaves through one of
        its links, so it must be last. async-branch: a Card or Carousel, whose
        linked buttons run from any position. terminal: it ends the path."
      x-enumNames:
        - SEQUENTIAL
        - BRANCH
        - ASYNC_BRANCH
        - TERMINAL
    StableWorkflowStepContent:
      anyOf:
        - $ref: "#/components/schemas/StableWorkflowStepMessageContent"
        - $ref: "#/components/schemas/StableWorkflowStepEndContent"
        - $ref: "#/components/schemas/StableWorkflowStepSetContent"
        - $ref: "#/components/schemas/StableWorkflowStepWorkflowContent"
        - $ref: "#/components/schemas/StableWorkflowStepListenContent"
        - $ref: "#/components/schemas/StableWorkflowStepConditionContent"
        - $ref: "#/components/schemas/StableWorkflowStepButtonsContent"
        - $ref: "#/components/schemas/StableWorkflowStepCardContent"
        - $ref: "#/components/schemas/StableWorkflowStepCarouselContent"
        - $ref: "#/components/schemas/StableWorkflowStepCodeContent"
        - $ref: "#/components/schemas/StableWorkflowStepApiContent"
        - $ref: "#/components/schemas/StableWorkflowStepFunctionContent"
        - $ref: "#/components/schemas/StableWorkflowStepIntegrationContent"
        - $ref: "#/components/schemas/StableWorkflowStepMcpContent"
        - $ref: "#/components/schemas/StableWorkflowStepOperatorContent"
        - $ref: "#/components/schemas/StableWorkflowStepPlaybookContent"
        - $ref: "#/components/schemas/StableWorkflowStepCrewContent"
        - $ref: "#/components/schemas/StableWorkflowStepHandoffContent"
        - $ref: "#/components/schemas/StableWorkflowStepGoToBlockContent"
        - $ref: "#/components/schemas/StableWorkflowStepCallForwardContent"
        - $ref: "#/components/schemas/StableWorkflowStepReadOnlyContent"
      description: The step's settings, shaped by its kind. A step these operations
        cannot show reads as readOnly.
    StableWorkflowStepMessageContent:
      oneOf:
        - type: object
          properties:
            responseType:
              type: string
              enum:
                - message
              x-enumNames:
                - MESSAGE
            messageID:
              nullable: true
              description: The ID of the message this step says, or null. Read its words with
                the message operations.
              type: string
            waitForUserResponse:
              type: boolean
              description: Whether the step waits for the user to reply before it continues.
          required:
            - responseType
            - messageID
            - waitForUserResponse
        - type: object
          properties:
            responseType:
              type: string
              enum:
                - prompt
              x-enumNames:
                - PROMPT
            promptID:
              nullable: true
              description: The ID of the prompt this step runs, or null. Read it with the
                prompt operations.
              type: string
            waitForUserResponse:
              type: boolean
              description: Whether the step waits for the user to reply before it continues.
          required:
            - responseType
            - promptID
            - waitForUserResponse
    StableWorkflowStepEndContent:
      oneOf:
        - type: object
          properties:
            responseType:
              type: string
              enum:
                - message
              x-enumNames:
                - MESSAGE
            messageID:
              nullable: true
              description: The ID of the message this step says, or null. Read its words with
                the message operations.
              type: string
            responseEnabled:
              type: boolean
              description: Whether the step says something before it ends the conversation.
          required:
            - responseType
            - messageID
            - responseEnabled
        - type: object
          properties:
            responseType:
              type: string
              enum:
                - prompt
              x-enumNames:
                - PROMPT
            promptID:
              nullable: true
              description: The ID of the prompt this step runs, or null. Read it with the
                prompt operations.
              type: string
            responseEnabled:
              type: boolean
              description: Whether the step says something before it ends the conversation.
          required:
            - responseType
            - promptID
            - responseEnabled
    StableWorkflowStepSetContent:
      type: object
      properties:
        assignments:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                    enum:
                      - value
                    x-enumNames:
                      - VALUE
                  variableID:
                    nullable: true
                    type: string
                  label:
                    nullable: true
                    type: string
                  value:
                    nullable: true
                    allOf:
                      - $ref: "#/components/schemas/VariableReferenceString"
                required:
                  - id
                  - type
                  - variableID
                  - label
                  - value
              - type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                    enum:
                      - prompt
                    x-enumNames:
                      - PROMPT
                  variableID:
                    nullable: true
                    type: string
                  label:
                    nullable: true
                    type: string
                  promptID:
                    nullable: true
                    description: The prompt whose answer is stored in the variable.
                    type: string
                required:
                  - id
                  - type
                  - variableID
                  - label
                  - promptID
        parallelExecution:
          type: boolean
          description: Whether the assignments run at the same time instead of in order.
        transcriptProperties:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              operationType:
                type: string
                enum:
                  - append
                  - replace
                x-enumNames:
                  - APPEND
                  - REPLACE
              propertyID:
                nullable: true
                type: string
              label:
                nullable: true
                type: string
              value:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/VariableReferenceString"
            required:
              - id
              - operationType
              - propertyID
              - label
              - value
      required:
        - assignments
        - parallelExecution
        - transcriptProperties
    StableWorkflowStepWorkflowContent:
      type: object
      properties:
        targetWorkflowID:
          nullable: true
          description: The workflow this step runs, by the ID the workflow list returns,
            or null.
          type: string
        targetWorkflowName:
          nullable: true
          description: Read-only. The name of that workflow.
          type: string
        variableMap:
          nullable: true
          type: object
          properties:
            inputs:
              type: array
              items:
                minItems: 2
                maxItems: 2
                type: array
                items:
                  nullable: true
                  type: string
            outputs:
              type: array
              items:
                minItems: 2
                maxItems: 2
                type: array
                items:
                  nullable: true
                  type: string
          required:
            - inputs
            - outputs
      required:
        - targetWorkflowID
        - targetWorkflowName
        - variableMap
    StableWorkflowStepListenContent:
      type: object
      properties:
        variableID:
          nullable: true
          description: The variable that receives the user's reply.
          type: string
        noReply:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoReply"
        listenForOtherTriggers:
          type: boolean
      required:
        - variableID
        - noReply
        - listenForOtherTriggers
    StableWorkflowNoReply:
      type: object
      properties:
        enabled:
          type: boolean
          description: "Whether the no-reply path is on: the step then leaves through its
            no-reply port."
        repromptID:
          nullable: true
          description: The message said when the user does not reply, or null.
          type: string
        inactivityTime:
          nullable: true
          description: Seconds to wait for a reply, or null for the default.
          type: number
      required:
        - enabled
        - repromptID
        - inactivityTime
    StableWorkflowStepConditionContent:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The branch ID, which is also its port key.
              label:
                nullable: true
                type: string
              matchAll:
                type: boolean
              assertions:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: The assertion's ID. Send it back with the assertion in a write to
                        keep it.
                    lhs:
                      type: object
                      properties:
                        variableID:
                          nullable: true
                          type: string
                        path:
                          nullable: true
                          type: string
                      required:
                        - variableID
                        - path
                    operation:
                      $ref: "#/components/schemas/ConditionOperation"
                    rhs:
                      $ref: "#/components/schemas/VariableReferenceString"
                  required:
                    - id
                    - lhs
                    - operation
                    - rhs
            required:
              - id
              - label
              - matchAll
              - assertions
        elsePath:
          type: boolean
          description: "Whether the else port is on: a reply that matches no branch leaves
            through it."
        elseReprompt:
          nullable: true
          type: object
          properties:
            repromptID:
              nullable: true
              type: string
          required:
            - repromptID
      required:
        - items
        - elsePath
        - elseReprompt
    StableWorkflowStepButtonsContent:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                $ref: "#/components/schemas/VariableReferenceString"
              url:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/VariableReferenceString"
              openInNewTab:
                description: "Read-only. Present when the button has a URL: true opens the URL
                  in a new tab."
                type: boolean
            required:
              - id
              - label
              - url
        noMatch:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoMatch"
        noReply:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoReply"
        listenForOtherTriggers:
          type: boolean
      required:
        - items
        - noMatch
        - noReply
        - listenForOtherTriggers
    StableWorkflowNoMatch:
      type: object
      properties:
        enabled:
          type: boolean
          description: "Whether the no-match path is on: the step then leaves through its
            else port."
        repromptID:
          nullable: true
          description: The message said when the reply matches nothing, or null.
          type: string
      required:
        - enabled
        - repromptID
    StableWorkflowStepCardContent:
      type: object
      properties:
        title:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        description:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/MarkdownLikeString"
        imageUrl:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        buttons:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                $ref: "#/components/schemas/VariableReferenceString"
              url:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/VariableReferenceString"
              openInNewTab:
                description: "Read-only. Present when the button has a URL: true opens the URL
                  in a new tab."
                type: boolean
            required:
              - id
              - label
              - url
        noMatch:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoMatch"
        noReply:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoReply"
      required:
        - title
        - description
        - imageUrl
        - buttons
        - noMatch
        - noReply
    StableWorkflowStepCarouselContent:
      type: object
      properties:
        layout:
          type: string
          enum:
            - List
            - Carousel
          x-enumNames:
            - LIST
            - CAROUSEL
        cards:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              title:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/VariableReferenceString"
              description:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/MarkdownLikeString"
              imageUrl:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/VariableReferenceString"
              buttons:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    label:
                      $ref: "#/components/schemas/VariableReferenceString"
                    url:
                      nullable: true
                      allOf:
                        - $ref: "#/components/schemas/VariableReferenceString"
                    openInNewTab:
                      description: "Read-only. Present when the button has a URL: true opens the URL
                        in a new tab."
                      type: boolean
                  required:
                    - id
                    - label
                    - url
            required:
              - id
              - title
              - description
              - imageUrl
              - buttons
        noMatch:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoMatch"
        noReply:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowNoReply"
      required:
        - layout
        - cards
        - noMatch
        - noReply
    StableWorkflowStepCodeContent:
      type: object
      properties:
        code:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        paths:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
            required:
              - id
              - label
        fallback:
          type: boolean
          description: "Whether the fail port is on: an error in the code leaves through
            it."
      required:
        - code
        - paths
        - fallback
    StableWorkflowStepApiContent:
      type: object
      properties:
        apiToolID:
          type: string
        apiToolName:
          nullable: true
          description: Read-only.
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              description:
                default: null
                nullable: true
                type: string
              defaultValue:
                default: null
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/DefaultValueString"
              apiToolInputVariableID:
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              required:
                type: boolean
                description: "Whether the agent must supply a value for this input. Omit it and
                  the API infers: false when defaultValue holds a secret
                  reference (the secret is injected and the model is never asked
                  for it), true otherwise. Sending true together with a secret
                  defaultValue is rejected."
            required:
              - id
              - apiToolInputVariableID
              - required
        captureResponse:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              path:
                type: string
              variableOrEntityID:
                nullable: true
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
            required:
              - id
              - path
              - variableOrEntityID
        failPath:
          type: boolean
          description: "Whether the fail port is on: a failed call leaves through it."
        asyncExecution:
          type: boolean
          description: Read-only. When true, the path continues without waiting for the
            call to finish.
      required:
        - apiToolID
        - apiToolName
        - description
        - inputs
        - captureResponse
        - failPath
        - asyncExecution
    DefaultValueString:
      type: string
      description: Plain text resolved at runtime and never shown to a model.
        {variable_name} inserts a variable or entity, {secret_name} a project
        secret, {variable_name.path} a field of a variable. Escape a literal {
        or \ with a backslash. When a name is both a variable and a secret, the
        secret wins. A name matching none is stored as literal text and reported
        in unresolvedReferences. Where the field is sent to an upstream system,
        an unresolved placeholder may be sent as literal text; on an MCP server
        it is re-resolved by name at connect time, so a literal that matches a
        real secret binds.
    ToolNodeCaptureType:
      type: string
      enum:
        - variable
        - property
      x-enumNames:
        - VARIABLE
        - PROPERTY
    StableWorkflowStepFunctionContent:
      type: object
      properties:
        functionID:
          type: string
        functionName:
          nullable: true
          description: Read-only.
          type: string
        paths:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
            required:
              - id
              - label
          description: Read-only. The function's paths; each is also a port key of this
            step.
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              description:
                default: null
                nullable: true
                type: string
              defaultValue:
                default: null
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/DefaultValueString"
              functionInputVariableID:
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              required:
                type: boolean
                description: "Whether the agent must supply a value for this input. Omit it and
                  the API infers: false when defaultValue holds a secret
                  reference (the secret is injected and the model is never asked
                  for it), true otherwise. Sending true together with a secret
                  defaultValue is rejected."
            required:
              - id
              - functionInputVariableID
              - required
        captureResponse:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              variableOrEntityID:
                nullable: true
                type: string
              functionOutputVariableID:
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
            required:
              - id
              - variableOrEntityID
              - functionOutputVariableID
        failPath:
          type: boolean
          description: "Whether the fail port is on: a failed call leaves through it."
        asyncExecution:
          type: boolean
          description: Read-only. When true, the path continues without waiting for the
            call to finish.
      required:
        - functionID
        - functionName
        - paths
        - description
        - inputs
        - captureResponse
        - failPath
        - asyncExecution
    StableWorkflowStepIntegrationContent:
      type: object
      properties:
        integrationToolID:
          type: string
        integrationToolName:
          nullable: true
          description: Read-only.
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              description:
                default: null
                nullable: true
                type: string
              defaultValue:
                default: null
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/DefaultValueString"
              integrationToolVariableName:
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              required:
                type: boolean
                description: "Whether the agent must supply a value for this input. Omit it and
                  the API infers: false when defaultValue holds a secret
                  reference (the secret is injected and the model is never asked
                  for it), true otherwise. Sending true together with a secret
                  defaultValue is rejected."
            required:
              - id
              - integrationToolVariableName
              - required
        captureResponse:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              path:
                type: string
              variableOrEntityID:
                nullable: true
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
            required:
              - id
              - path
              - variableOrEntityID
      required:
        - integrationToolID
        - integrationToolName
        - description
        - inputs
        - captureResponse
    StableWorkflowStepMcpContent:
      type: object
      properties:
        mcpToolID:
          type: string
        mcpToolName:
          nullable: true
          description: Read-only.
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              description:
                default: null
                nullable: true
                type: string
              defaultValue:
                default: null
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/DefaultValueString"
              mcpIntegrationVariableName:
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              required:
                type: boolean
                description: "Whether the agent must supply a value for this input. Omit it and
                  the API infers: false when defaultValue holds a secret
                  reference (the secret is injected and the model is never asked
                  for it), true otherwise. Sending true together with a secret
                  defaultValue is rejected."
            required:
              - id
              - mcpIntegrationVariableName
              - required
        captureResponse:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              path:
                type: string
              variableOrEntityID:
                nullable: true
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
            required:
              - id
              - path
              - variableOrEntityID
      required:
        - mcpToolID
        - mcpToolName
        - description
        - inputs
        - captureResponse
    StableWorkflowStepOperatorContent:
      type: object
      properties:
        agentID:
          nullable: true
          type: string
        agentName:
          nullable: true
          description: Read-only.
          type: string
        paths:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
            required:
              - id
              - label
          description: Read-only. The agent's paths; each is also a port key of this step.
        exitEveryConversationalTurn:
          type: boolean
        listenForOtherTriggers:
          type: boolean
        useAsRoutingAgent:
          type: boolean
      required:
        - agentID
        - agentName
        - paths
        - exitEveryConversationalTurn
        - listenForOtherTriggers
        - useAsRoutingAgent
    StableWorkflowStepPlaybookContent:
      type: object
      properties:
        agentID:
          nullable: true
          type: string
        agentName:
          nullable: true
          description: Read-only.
          type: string
        paths:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
            required:
              - id
              - label
          description: Read-only. The agent's paths; each is also a port key of this step.
        exitEveryConversationalTurn:
          type: boolean
        listenForOtherTriggers:
          type: boolean
        waitForUserResponse:
          type: boolean
          description: "Read-only. True: the step waits for the user to speak first.
            False: the Playbook talks first, the canvas default."
      required:
        - agentID
        - agentName
        - paths
        - exitEveryConversationalTurn
        - listenForOtherTriggers
        - waitForUserResponse
    StableWorkflowStepCrewContent:
      type: object
      properties:
        rootAgent:
          nullable: true
          type: object
          properties:
            agentID:
              type: string
            description:
              nullable: true
              type: string
            condition:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/StableExpressionCondition"
            requiredVariables:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  description:
                    nullable: true
                    type: string
                  variableOrEntityID:
                    nullable: true
                    type: string
                required:
                  - id
                  - description
                  - variableOrEntityID
          required:
            - agentID
            - description
            - condition
            - requiredVariables
        subAgents:
          type: array
          items:
            type: object
            properties:
              agentID:
                type: string
              description:
                nullable: true
                type: string
              condition:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/StableExpressionCondition"
              requiredVariables:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    description:
                      nullable: true
                      type: string
                    variableOrEntityID:
                      nullable: true
                      type: string
                  required:
                    - id
                    - description
                    - variableOrEntityID
            required:
              - agentID
              - description
              - condition
              - requiredVariables
        subFlows:
          type: array
          items:
            type: object
            properties:
              flowID:
                type: string
              description:
                nullable: true
                type: string
              condition:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/StableExpressionCondition"
              requiredVariables:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    description:
                      nullable: true
                      type: string
                    variableOrEntityID:
                      nullable: true
                      type: string
                  required:
                    - id
                    - description
                    - variableOrEntityID
            required:
              - flowID
              - description
              - condition
              - requiredVariables
        exitPaths:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The exit path ID, which is also its port key.
              name:
                type: string
              description:
                nullable: true
                type: string
              requiredVariables:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    description:
                      nullable: true
                      type: string
                    variableOrEntityID:
                      nullable: true
                      type: string
                  required:
                    - id
                    - description
                    - variableOrEntityID
              messages:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/StableWorkflowCrewExitMessages"
              delayMessageSeconds:
                nullable: true
                type: number
            required:
              - id
              - name
              - description
              - requiredVariables
              - messages
              - delayMessageSeconds
        listenForOtherTriggers:
          type: boolean
        waitForUserResponse:
          type: boolean
      required:
        - rootAgent
        - subAgents
        - subFlows
        - exitPaths
        - listenForOtherTriggers
        - waitForUserResponse
    StableExpressionCondition:
      type: object
      properties:
        type:
          type: string
          enum:
            - value-variable
          x-enumNames:
            - VALUE_VARIABLE
        matchAll:
          type: boolean
        assertions:
          type: array
          items:
            $ref: "#/components/schemas/StableConditionAssertion"
      required:
        - type
        - matchAll
        - assertions
    StableConditionAssertion:
      type: object
      properties:
        key:
          type: string
        lhs:
          $ref: "#/components/schemas/ConditionAssertionLhs"
        rhs:
          $ref: "#/components/schemas/VariableReferenceString"
        operation:
          default: is
          allOf:
            - $ref: "#/components/schemas/ConditionOperation"
      required:
        - key
        - lhs
        - rhs
    ConditionAssertionLhs:
      type: object
      properties:
        variableID:
          nullable: true
          type: string
        path:
          type: string
      required:
        - variableID
    StableWorkflowCrewExitMessages:
      type: object
      properties:
        generative:
          type: object
          properties:
            execution:
              allOf:
                - $ref: "#/components/schemas/StableToolMessageGenerative"
            failure:
              allOf:
                - $ref: "#/components/schemas/StableToolMessageGenerative"
            delay:
              allOf:
                - $ref: "#/components/schemas/StableToolMessageGenerative"
            completion:
              allOf:
                - $ref: "#/components/schemas/StableToolMessageGenerative"
        delayMessageID:
          nullable: true
          type: string
        failureMessageID:
          nullable: true
          type: string
        executionMessageID:
          nullable: true
          type: string
        completionMessageID:
          nullable: true
          type: string
      required:
        - delayMessageID
        - failureMessageID
        - executionMessageID
        - completionMessageID
    StableToolMessageGenerative:
      type: object
      properties:
        enabled:
          type: boolean
        examples:
          type: array
          items:
            $ref: "#/components/schemas/MarkdownLikeString"
      required:
        - enabled
    StableWorkflowStepHandoffContent:
      type: object
      properties:
        config:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowHandoffConfig"
        handoffContext:
          type: object
          properties:
            type:
              type: string
              enum:
                - full
                - none
                - custom
              x-enumNames:
                - FULL
                - NONE
                - CUSTOM
            variableID:
              nullable: true
              type: string
          required:
            - type
            - variableID
        returnPath:
          type: boolean
          description: Whether the step continues through its next port when the agent
            hands the conversation back.
        failPath:
          type: boolean
          description: Whether the step continues through its fail port when the handoff
            cannot start.
      required:
        - config
        - handoffContext
        - returnPath
        - failPath
    StableWorkflowHandoffConfig:
      oneOf:
        - type: object
          properties:
            provider:
              type: string
              enum:
                - ujet
              x-enumNames:
                - UJET
            menuID:
              $ref: "#/components/schemas/VariableReferenceString"
            userID:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            userLanguage:
              $ref: "#/components/schemas/VariableReferenceString"
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - menuID
            - userID
            - userEmail
            - userLanguage
            - metadata
        - type: object
          properties:
            provider:
              type: string
              enum:
                - genesys
              x-enumNames:
                - GENESYS
            integrationId:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            customerName:
              $ref: "#/components/schemas/VariableReferenceString"
            customerAccountId:
              $ref: "#/components/schemas/VariableReferenceString"
            queueName:
              $ref: "#/components/schemas/VariableReferenceString"
            queueId:
              $ref: "#/components/schemas/VariableReferenceString"
            inactivityTimeout:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - integrationId
            - userEmail
            - customerName
            - customerAccountId
            - queueName
            - queueId
            - inactivityTimeout
            - metadata
        - type: object
          properties:
            provider:
              type: string
              enum:
                - kustomer
              x-enumNames:
                - KUSTOMER
            endUserId:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            customerName:
              $ref: "#/components/schemas/VariableReferenceString"
            userLanguage:
              $ref: "#/components/schemas/VariableReferenceString"
            assignedTeamId:
              $ref: "#/components/schemas/VariableReferenceString"
            brand:
              $ref: "#/components/schemas/VariableReferenceString"
            title:
              $ref: "#/components/schemas/VariableReferenceString"
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - endUserId
            - userEmail
            - customerName
            - userLanguage
            - assignedTeamId
            - brand
            - title
            - metadata
        - type: object
          properties:
            provider:
              type: string
              enum:
                - dixa
              x-enumNames:
                - DIXA
            endUserId:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            customerName:
              $ref: "#/components/schemas/VariableReferenceString"
            userLanguage:
              $ref: "#/components/schemas/VariableReferenceString"
            queueId:
              $ref: "#/components/schemas/VariableReferenceString"
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - endUserId
            - userEmail
            - customerName
            - userLanguage
            - queueId
            - metadata
        - type: object
          properties:
            provider:
              type: string
              enum:
                - sunshine
              x-enumNames:
                - SUNSHINE
            endUserId:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            customerName:
              $ref: "#/components/schemas/VariableReferenceString"
            userLanguage:
              $ref: "#/components/schemas/VariableReferenceString"
            groupId:
              $ref: "#/components/schemas/VariableReferenceString"
            brandId:
              $ref: "#/components/schemas/VariableReferenceString"
            priority:
              $ref: "#/components/schemas/VariableReferenceString"
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - endUserId
            - userEmail
            - customerName
            - userLanguage
            - groupId
            - brandId
            - priority
            - metadata
        - type: object
          properties:
            provider:
              type: string
              enum:
                - custom
              x-enumNames:
                - CUSTOM
            endUserId:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            userPhone:
              $ref: "#/components/schemas/VariableReferenceString"
            customerName:
              $ref: "#/components/schemas/VariableReferenceString"
            userLanguage:
              $ref: "#/components/schemas/VariableReferenceString"
            queueId:
              $ref: "#/components/schemas/VariableReferenceString"
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - endUserId
            - userEmail
            - userPhone
            - customerName
            - userLanguage
            - queueId
            - metadata
    StableWorkflowStepGoToBlockContent:
      type: object
      properties:
        targetWorkflowID:
          nullable: true
          description: The workflow the path jumps to, by its workflow ID. It is this
            workflow when the target is in it. Null when that workflow no longer
            exists; the step then carries a GO_TO_TARGET_MISSING warning.
          type: string
        targetWorkflowName:
          nullable: true
          description: Read-only. The name of that workflow.
          type: string
        targetBlockID:
          nullable: true
          description: The block the path jumps to, or the target workflow's start step ID.
          type: string
      required:
        - targetWorkflowID
        - targetWorkflowName
        - targetBlockID
    StableWorkflowStepCallForwardContent:
      type: object
      properties:
        addressType:
          type: string
          enum:
            - phone
            - sip
          description: Whether address is a phone number or a SIP address.
          x-enumNames:
            - PHONE
            - SIP
        address:
          $ref: "#/components/schemas/VariableReferenceString"
        extension:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        callerIDPassthrough:
          type: boolean
          description: Whether the forwarded call shows the caller's own number.
      required:
        - addressType
        - address
        - extension
        - callerIDPassthrough
      description: Forwards the call to a phone number or SIP address, then ends the
        path. address is the number or SIP address; extension is the digits
        dialled after the call connects, or null.
    StableWorkflowStepReadOnlyContent:
      type: object
      properties:
        readOnly:
          type: boolean
          enum:
            - true
          x-enumNames:
            - "TRUE"
        storedType:
          type: string
          description: The stored step type.
        reason:
          type: string
          description: Why these operations do not show or change this step's content.
      required:
        - readOnly
        - storedType
        - reason
    StableWorkflowLink:
      type: object
      properties:
        port:
          type: string
          description: "The port key: next, else, fail, no-reply, conversation-turn, or
            the ID of a branch or path."
        label:
          type: string
        to:
          nullable: true
          description: The block this port reaches. With actions, the block after the last
            action. Null when it points nowhere, or when its actions end the
            path.
          type: string
        actions:
          description: The port actions this exit runs, in order, before it reaches to.
          type: array
          items:
            $ref: "#/components/schemas/StableWorkflowPortAction"
        overridden:
          description: Present when this link does not run, because the step is not the
            last of its block.
          type: boolean
          enum:
            - true
          x-enumNames:
            - "TRUE"
        effectiveTo:
          description: "With overridden: the step that runs instead."
          type: string
      required:
        - port
        - label
        - to
    StableWorkflowPortAction:
      type: object
      properties:
        id:
          type: string
          description: The action ID. Use it with the step operations to read, change or
            delete this action.
        kind:
          $ref: "#/components/schemas/StableWorkflowStepKind"
        content:
          $ref: "#/components/schemas/StableWorkflowStepContent"
        warnings:
          type: array
          items:
            $ref: "#/components/schemas/StableWorkflowDiagnostic"
      required:
        - id
        - kind
        - content
      description: One action on an exit. Actions run in array order.
    StableWorkflowDiagnostic:
      type: object
      properties:
        code:
          $ref: "#/components/schemas/StableWorkflowDiagnosticCode"
        detail:
          type: string
          description: What is wrong, in one or two sentences, naming the step, block and
            port.
      required:
        - code
        - detail
    StableWorkflowDiagnosticCode:
      type: string
      enum:
        - BRANCH_NOT_LAST
        - TERMINAL_NOT_LAST
        - HIDDEN_LINK
        - UNREACHABLE_BLOCK
        - DANGLING_LINK
        - ORPHAN_STEP
        - GO_TO_TARGET_MISSING
      x-enumNames:
        - BRANCH_NOT_LAST
        - TERMINAL_NOT_LAST
        - HIDDEN_LINK
        - UNREACHABLE_BLOCK
        - DANGLING_LINK
        - ORPHAN_STEP
        - GO_TO_TARGET_MISSING
    StableWorkflowReconciledPorts:
      type: object
      properties:
        added:
          type: array
          items:
            type: string
          description: Paths that exist on the agent or function but had no port on this
            step.
        removed:
          type: array
          items:
            type: string
          description: Ports whose path no longer exists. They are not shown.
      required:
        - added
        - removed
    StableUnresolvedReference:
      type: object
      properties:
        path:
          type: string
          description: Dotted path of the field that carried it, e.g.
            `knowledgeBaseTool.filters[0].defaultValue`.
        token:
          type: string
          description: The reference as written, without braces.
        reason:
          type: string
          enum:
            - unknown
            - secret-not-allowed
            - path-on-non-variable
            - resource-id
            - invalid-name
            - dangling
          description: "`unknown`: no variable or entity of that name.
            `secret-not-allowed`: the name is a project secret and this field
            does not accept one. `path-on-non-variable`: only a variable has
            fields. `resource-id`: a bare resource id, not a name.
            `invalid-name`: outside the `^\\w{1,64}$` name grammar. `dangling`:
            the reference rendered as a bare id, because its row is gone or its
            name is outside the name grammar."
          x-enumNames:
            - UNKNOWN
            - SECRET_NOT_ALLOWED
            - PATH_ON_NON_VARIABLE
            - RESOURCE_ID
            - INVALID_NAME
            - DANGLING
      required:
        - path
        - token
        - reason
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
