> ## 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 port actions

> Adds port actions to one exit of a step. They run in order when the conversation leaves through that exit, before the path reaches the next block. Add 1 to 10 at a time, and send the exit's current action IDs as `expectedActions`.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/workflow/{workflowID}/step/{stepID}/link/{portKey}/actions
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}/link/{portKey}/actions:
    post:
      tags:
        - Workflow
      summary: Add port actions
      description: Adds port actions to one exit of a step. They run in order when the
        conversation leaves through that exit, before the path reaches the next
        block. Add 1 to 10 at a time, and send the exit's current action IDs as
        `expectedActions`.
      operationId: StableWorkflowController_addActions
      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: portKey
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: "The port to operate on: next, fail, else, no-reply, or the ID of a
              branch."
          description: "The port to operate on: next, fail, else, no-reply, or the ID of a
            branch."
        - 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/StableWorkflowPortActionsAddRequest"
      responses:
        "201":
          description: Returns what was written, the exit's step and port, and its link.
            If the last action ends the path, `clearedTo` names the block the
            exit led to before.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableWorkflowPortActionsWriteResponse"
          x-vf-doc:
            description: Returns what was written, the exit's step and port, and its link.
              If the last action ends the path, `clearedTo` names the block the
              exit led to before.
      security:
        - token: []
components:
  schemas:
    StableWorkflowPortActionsAddRequest:
      type: object
      properties:
        actions:
          minItems: 1
          maxItems: 10
          type: array
          items:
            $ref: "#/components/schemas/StableWorkflowPortActionInput"
          description: 1 to 10 actions to add, in run order.
        afterActionID:
          description: Add them after this action. Leave out afterActionID and atStart to
            add them at the end, before an action that ends the path.
          type: string
        atStart:
          description: Add them before every other action on this exit.
          type: boolean
          enum:
            - true
          x-enumNames:
            - "TRUE"
        expectedActions:
          maxItems: 20
          type: array
          items:
            type: string
          description: The IDs in this exit's actions from your last read, in order. Send
            [] when it has none.
        to:
          description: The block the path goes to after the actions. Leave it out to keep
            the current one. Send null to clear it.
          nullable: true
          type: string
          minLength: 1
      required:
        - actions
        - expectedActions
      additionalProperties: false
    StableWorkflowPortActionInput:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - goToBlock
              x-enumNames:
                - GO_TO_BLOCK
            content:
              $ref: "#/components/schemas/StableWorkflowStepGoToBlockContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - set
              x-enumNames:
                - SET
            content:
              $ref: "#/components/schemas/StableWorkflowStepSetContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - api
              x-enumNames:
                - API
            content:
              $ref: "#/components/schemas/StableWorkflowStepApiContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - function
              x-enumNames:
                - FUNCTION
            content:
              $ref: "#/components/schemas/StableWorkflowStepFunctionContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - integration
              x-enumNames:
                - INTEGRATION
            content:
              $ref: "#/components/schemas/StableWorkflowStepIntegrationContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - mcp
              x-enumNames:
                - MCP
            content:
              $ref: "#/components/schemas/StableWorkflowStepMcpContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - code
              x-enumNames:
                - CODE
            content:
              $ref: "#/components/schemas/StableWorkflowStepCodeContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - workflow
              x-enumNames:
                - WORKFLOW
            content:
              $ref: "#/components/schemas/StableWorkflowStepWorkflowContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - callForward
              x-enumNames:
                - CALL_FORWARD
            content:
              $ref: "#/components/schemas/StableWorkflowStepCallForwardContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - handoff
              x-enumNames:
                - HANDOFF
            content:
              $ref: "#/components/schemas/StableWorkflowStepHandoffContentInput"
          required:
            - kind
            - content
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - end
              x-enumNames:
                - END
            content:
              allOf:
                - $ref: "#/components/schemas/StableWorkflowStepEndContentInput"
          required:
            - kind
          additionalProperties: false
    StableWorkflowStepGoToBlockContentInput:
      type: object
      properties:
        targetBlockID:
          type: string
          description: A block ID, or the Start step ID of the target workflow. Never a
            step inside a block.
        targetWorkflowID:
          description: The workflow that holds the block, from voiceflow_workflow.list.
            Leave it out for this workflow.
          type: string
      required:
        - targetBlockID
      additionalProperties: false
    StableWorkflowStepSetContentInput:
      type: object
      properties:
        assignments:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  id:
                    description: The id a read returned for this entry, to keep it; omit it for a
                      new entry.
                    type: string
                  type:
                    type: string
                    enum:
                      - value
                    x-enumNames:
                      - VALUE
                  variableID:
                    nullable: true
                    type: string
                  label:
                    nullable: true
                    type: string
                  value:
                    nullable: true
                    description: 'Stored as text with each {variable} filled in, and never
                      calculated: "{attempts} + 1" stores "0 + 1". A value that
                      is only a number is stored as a number. For math, use a
                      Code step.'
                    allOf:
                      - $ref: "#/components/schemas/VariableReferenceString"
                required:
                  - type
                  - variableID
                  - value
                additionalProperties: false
              - type: object
                properties:
                  id:
                    description: The id a read returned for this entry, to keep it; omit it for a
                      new entry.
                    type: string
                  type:
                    type: string
                    enum:
                      - prompt
                    x-enumNames:
                      - PROMPT
                  variableID:
                    nullable: true
                    type: string
                  label:
                    nullable: true
                    type: string
                  promptID:
                    nullable: true
                    type: string
                required:
                  - type
                  - variableID
                  - promptID
                additionalProperties: false
        parallelExecution:
          type: boolean
        transcriptProperties:
          type: array
          items:
            type: object
            properties:
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
              operationType:
                $ref: "#/components/schemas/SetV3NodePropertyItemOperationType"
              propertyID:
                nullable: true
                type: string
              label:
                nullable: true
                type: string
              value:
                nullable: true
                allOf:
                  - $ref: "#/components/schemas/VariableReferenceString"
            required:
              - operationType
              - propertyID
              - value
            additionalProperties: false
      required:
        - assignments
      additionalProperties: false
    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.
    SetV3NodePropertyItemOperationType:
      type: string
      enum:
        - append
        - replace
      x-enumNames:
        - APPEND
        - REPLACE
    StableWorkflowStepApiContentInput:
      type: object
      properties:
        apiToolID:
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              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."
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - apiToolInputVariableID
        captureResponse:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: 'A dot path from the top of the JSON response body, because the
                  step already reads inside the body: "order.status" reads
                  "shipped" from { "order": { "status": "shipped" } }. Add no
                  wrapper the body does not have, such as data., body. or
                  output.'
              variableOrEntityID:
                nullable: true
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - path
              - variableOrEntityID
        failPath:
          description: Adds the fail port, taken when the tool fails.
          type: boolean
      required:
        - apiToolID
      additionalProperties: false
    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
    StableWorkflowStepFunctionContentInput:
      type: object
      properties:
        functionID:
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              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."
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - functionInputVariableID
        captureResponse:
          type: array
          items:
            type: object
            properties:
              variableOrEntityID:
                nullable: true
                type: string
              functionOutputVariableID:
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - variableOrEntityID
              - functionOutputVariableID
        failPath:
          description: Adds the fail port, taken when the tool fails.
          type: boolean
      required:
        - functionID
      additionalProperties: false
    StableWorkflowStepIntegrationContentInput:
      type: object
      properties:
        integrationToolID:
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              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."
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - integrationToolVariableName
        captureResponse:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: 'A dot path from the top of what the tool returns, because the step
                  already reads inside it: "order.status" reads "shipped" from {
                  "order": { "status": "shipped" } }. Add no wrapper it does not
                  have, such as data., body. or output.'
              variableOrEntityID:
                nullable: true
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - path
              - variableOrEntityID
      required:
        - integrationToolID
      additionalProperties: false
    StableWorkflowStepMcpContentInput:
      type: object
      properties:
        mcpToolID:
          type: string
        description:
          nullable: true
          type: string
        inputs:
          type: array
          items:
            type: object
            properties:
              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."
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - mcpIntegrationVariableName
        captureResponse:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              variableOrEntityID:
                nullable: true
                type: string
              captureType:
                allOf:
                  - $ref: "#/components/schemas/ToolNodeCaptureType"
              id:
                description: The id a read returned for this entry, to keep it; omit it for a
                  new entry.
                type: string
            required:
              - path
              - variableOrEntityID
      required:
        - mcpToolID
      additionalProperties: false
    StableWorkflowStepCodeContentInput:
      type: object
      properties:
        code:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        paths:
          maxItems: 20
          type: array
          items:
            $ref: "#/components/schemas/StableWorkflowCodePathInput"
        fallback:
          description: Adds the fail port, taken when the code throws.
          type: boolean
      required:
        - code
      additionalProperties: false
    StableWorkflowCodePathInput:
      type: object
      properties:
        key:
          allOf:
            - $ref: "#/components/schemas/StableWorkflowSeedKey"
        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.
      required:
        - label
      additionalProperties: false
    StableWorkflowSeedKey:
      type: string
      pattern: ^\w{1,64}$
      description: A name you choose for something this call creates, so the response
        can map it to the ID the server creates. Letters, digits and
        underscores, at most 64 characters, unique in the request.
    StableWorkflowStepWorkflowContentInput:
      type: object
      properties:
        targetWorkflowID:
          nullable: true
          description: A workflow ID from voiceflow_workflow.list, not a diagram ID.
          type: string
        variableMap:
          nullable: true
          type: object
          properties:
            inputs:
              type: array
              items:
                type: array
                items:
                  anyOf:
                    - nullable: true
                      type: string
                    - nullable: true
                      type: string
                minItems: 2
                maxItems: 2
            outputs:
              type: array
              items:
                type: array
                items:
                  anyOf:
                    - nullable: true
                      type: string
                    - nullable: true
                      type: string
                minItems: 2
                maxItems: 2
          required:
            - inputs
            - outputs
          additionalProperties: false
      required:
        - targetWorkflowID
      additionalProperties: false
    StableWorkflowStepCallForwardContentInput:
      type: object
      properties:
        addressType:
          description: phone (the default) or sip.
          type: string
          enum:
            - phone
            - sip
          x-enumNames:
            - PHONE
            - SIP
        address:
          $ref: "#/components/schemas/VariableReferenceString"
        extension:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/VariableReferenceString"
        callerIDPassthrough:
          type: boolean
      required:
        - address
      additionalProperties: false
      description: "Call forward works only in a phone project. In a chat project, do
        not add it as a step or an action: tell the user it needs a phone
        project."
    StableWorkflowStepHandoffContentInput:
      type: object
      properties:
        config:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/StableWorkflowHandoffConfigInput"
        handoffContext:
          type: object
          properties:
            type:
              $ref: "#/components/schemas/LiveAgentHandoffContextType"
            variableID:
              nullable: true
              type: string
          required:
            - type
          additionalProperties: false
        returnPath:
          description: Adds the next port, taken when the conversation returns from the
            agent.
          type: boolean
        failPath:
          description: Adds a fail port, taken when the handoff cannot start. Set it only
            when the user says what happens then, and link the port in the same
            call, because an unlinked port leads nowhere.
          type: boolean
      additionalProperties: false
    StableWorkflowHandoffConfigInput:
      oneOf:
        - type: object
          properties:
            provider:
              type: string
              enum:
                - ujet
              x-enumNames:
                - UJET
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            menuID:
              $ref: "#/components/schemas/VariableReferenceString"
            userID:
              $ref: "#/components/schemas/VariableReferenceString"
            userEmail:
              $ref: "#/components/schemas/VariableReferenceString"
            userLanguage:
              $ref: "#/components/schemas/VariableReferenceString"
          required:
            - provider
            - menuID
            - userID
            - userEmail
            - userLanguage
          additionalProperties: false
        - type: object
          properties:
            provider:
              type: string
              enum:
                - genesys
              x-enumNames:
                - GENESYS
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            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"
          required:
            - provider
            - integrationId
            - userEmail
            - customerName
            - customerAccountId
            - queueName
            - queueId
          additionalProperties: false
        - type: object
          properties:
            provider:
              type: string
              enum:
                - kustomer
              x-enumNames:
                - KUSTOMER
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            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"
          required:
            - provider
            - endUserId
            - userEmail
            - customerName
            - userLanguage
            - assignedTeamId
            - brand
            - title
          additionalProperties: false
        - type: object
          properties:
            provider:
              type: string
              enum:
                - dixa
              x-enumNames:
                - DIXA
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            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"
          required:
            - provider
            - endUserId
            - userEmail
            - customerName
            - userLanguage
            - queueId
          additionalProperties: false
        - type: object
          properties:
            provider:
              type: string
              enum:
                - sunshine
              x-enumNames:
                - SUNSHINE
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            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"
          required:
            - provider
            - endUserId
            - userEmail
            - customerName
            - userLanguage
            - groupId
            - brandId
            - priority
          additionalProperties: false
        - type: object
          properties:
            provider:
              type: string
              enum:
                - custom
              x-enumNames:
                - CUSTOM
            metadata:
              nullable: true
              allOf:
                - $ref: "#/components/schemas/VariableReferenceString"
            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"
          required:
            - provider
            - endUserId
            - userEmail
            - userPhone
            - customerName
            - userLanguage
            - queueId
          additionalProperties: false
    LiveAgentHandoffContextType:
      type: string
      enum:
        - full
        - none
        - custom
      x-enumNames:
        - FULL
        - NONE
        - CUSTOM
    StableWorkflowStepEndContentInput:
      type: object
      properties:
        responseType:
          description: message or prompt. Defaults to the kind of ID you send.
          type: string
          enum:
            - message
            - prompt
          x-enumNames:
            - MESSAGE
            - PROMPT
        messageID:
          description: A message ID from voiceflow_message.create_many, said before the
            conversation ends.
          nullable: true
          type: string
        promptID:
          description: A prompt ID from voiceflow_prompt.create, run before the
            conversation ends.
          nullable: true
          type: string
        responseEnabled:
          description: Whether the End says its message or prompt. Defaults to true when
            you send an ID.
          type: boolean
      additionalProperties: false
      description: 'Leave out content for an End that says nothing: { "kind": "end" }.
        In a block, say something first with a Message step before the End. An
        End action on an exit can speak itself: send one messageID or promptID.'
    StableWorkflowPortActionsWriteResponse:
      type: object
      properties:
        message:
          type: string
          description: What was written.
        stepID:
          type: string
          description: The step that owns the exit, or the start node.
        port:
          type: string
        link:
          $ref: "#/components/schemas/StableWorkflowLink"
        clearedTo:
          description: The block the exit continued to before this write. Dropped because
            the actions now end the path.
          type: string
        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
        - stepID
        - port
        - link
    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.
    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
    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
    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
    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
    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."
    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
    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
    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
    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
````
