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

# Get workflow version

> Resolve a wf_vr_ sid (a record's workflow_version_sid or a workflow's published_version_sid) to its frozen step graph; pair with the record's current_step_id to locate a person inside steps.

Contract:
- MCP tool `get_workflow_version`, registry package `mcp.playtables/workflow_versions`, mount `playtables.workflows`.
- Operation `get`, response envelope `get`.
- Flags: read only.



## OpenAPI

````yaml /api-reference/playtables/openapi.yaml get /api/workflow-versions/{sid}
openapi: 3.0.3
info:
  title: 'GetSales public contract: gs.service.playtables'
  description: >-
    The data platform and the outreach engine: tables of people and companies,
    their enrichment columns, cells and runs, the data sources that feed them,
    sender profiles, the stoplist, the activity feed, the credit ledger, and the
    multichannel workflows with their per-person journeys and tasks.


    GENERATED. This document is projected from the Zod MCP tool registry in
    `product/mcp/gs.mcp` (one tool per public endpoint, 1:1). Do not edit it by
    hand; edit the tool definition and regenerate with `pnpm openapi:public`.


    Surface: the public `/api` contract of `gs.service.playtables`, 142
    operations. This is the only OpenAPI document the platform publishes.
    Internal (`/internal`) and health endpoints are deliberately absent: they
    are not part of any contract, they can change without notice, and the
    service source is their only description.


    Conventions:

    - Auth is a bearer JWT, optionally narrowed by the `Team-SID` header.

    - Every success body is an MCP envelope: `success: true` plus one typed
    `operation` shape (`search`, `get`, `create`, `update`, `delete`, `metrics`,
    `group_by`, `action`), and a `meta` block with `trace_id` for support.

    - Every failure is the same `McpError` envelope with a code from a fixed
    16-code taxonomy, so a client maps errors once.

    - Lists page with `page_size` (0 to 500, default 50) plus an opaque forward
    `cursor`; `page_size: 0` returns counts only.

    - On `GET` and `DELETE`, object-valued query parameters (`filter`, `sort`)
    travel as JSON text and array-valued ones repeat as `name[]=value`.

    - The MCP-only `_meta` field (usage analytics) never reaches the backend and
    is not part of this contract.
  version: '1.0'
  contact:
    name: GetSales
    url: https://getsales.io
    email: support@getsales.io
  license:
    name: Proprietary
    url: https://getsales.io/terms
servers:
  - url: https://beta.getsales.io/playtables/v1
    description: >-
      Production (the gateway path on the beta ring; the origin is provisioned
      per DEPLOY_MAP.md)
security:
  - BearerJwt: []
    TeamSid: []
tags:
  - name: activities
    description: >-
      Registry package `mcp.playtables/activities`, served on MCP mount
      `playtables.journeys`.
  - name: activity_objects
    description: >-
      Registry package `mcp.playtables/activity_objects`, served on MCP mount
      `playtables.people`.
  - name: companies
    description: >-
      Registry package `mcp.playtables/companies`, served on MCP mount
      `playtables.people`.
  - name: credit_ledger_entries
    description: >-
      Registry package `mcp.playtables/credit_ledger_entries`, served on MCP
      mount `id.billing`.
  - name: data_source_items
    description: >-
      Registry package `mcp.playtables/data_source_items`, served on MCP mount
      `playtables.sources`.
  - name: data_sources
    description: >-
      Registry package `mcp.playtables/data_sources`, served on MCP mount
      `playtables.sources`.
  - name: notes
    description: >-
      Registry package `mcp.playtables/notes`, served on MCP mount
      `playtables.pipeline`.
  - name: people
    description: >-
      Registry package `mcp.playtables/people`, served on MCP mount
      `playtables.people`.
  - name: pipeline_stages
    description: >-
      Registry package `mcp.playtables/pipeline_stages`, served on MCP mount
      `playtables.pipeline`.
  - name: plays
    description: >-
      Registry package `mcp.playtables/plays`, served on MCP mount
      `playtables.pipeline`.
  - name: playtable_field_values
    description: >-
      Registry package `mcp.playtables/playtable_field_values`, served on MCP
      mount `playtables.columns`.
  - name: playtable_fields
    description: >-
      Registry package `mcp.playtables/playtable_fields`, served on MCP mount
      `playtables.columns`.
  - name: playtable_runs
    description: >-
      Registry package `mcp.playtables/playtable_runs`, served on MCP mount
      `playtables.columns`.
  - name: playtable_views
    description: >-
      Registry package `mcp.playtables/playtable_views`, served on MCP mount
      `playtables.tables`.
  - name: playtables
    description: >-
      Registry package `mcp.playtables/playtables`, served on MCP mount
      `playtables.tables`.
  - name: result_pages
    description: >-
      Registry package `mcp.playtables/result_pages`, served on MCP mount
      `playtables.tables`.
  - name: sender_profiles
    description: >-
      Registry package `mcp.playtables/sender_profiles`, served on MCP mount
      `playtables.sources`.
  - name: stoplist_entries
    description: >-
      Registry package `mcp.playtables/stoplist_entries`, served on MCP mount
      `playtables.stoplist`.
  - name: tags
    description: >-
      Registry package `mcp.playtables/tags`, served on MCP mount
      `playtables.pipeline`.
  - name: workflow_attachments
    description: >-
      Registry package `mcp.playtables/workflow_attachments`, served on MCP
      mount `playtables.workflows`.
  - name: workflow_records
    description: >-
      Registry package `mcp.playtables/workflow_records`, served on MCP mount
      `playtables.journeys`.
  - name: workflow_sources
    description: >-
      Registry package `mcp.playtables/workflow_sources`, served on MCP mount
      `playtables.workflows`.
  - name: workflow_tasks
    description: >-
      Registry package `mcp.playtables/workflow_tasks`, served on MCP mount
      `playtables.journeys`.
  - name: workflow_versions
    description: >-
      Registry package `mcp.playtables/workflow_versions`, served on MCP mount
      `playtables.workflows`.
  - name: workflows
    description: >-
      Registry package `mcp.playtables/workflows`, served on MCP mount
      `playtables.workflows`.
paths:
  /api/workflow-versions/{sid}:
    get:
      tags:
        - workflow_versions
      summary: Get workflow version
      description: >-
        Resolve a wf_vr_ sid (a record's workflow_version_sid or a workflow's
        published_version_sid) to its frozen step graph; pair with the record's
        current_step_id to locate a person inside steps.


        Contract:

        - MCP tool `get_workflow_version`, registry package
        `mcp.playtables/workflow_versions`, mount `playtables.workflows`.

        - Operation `get`, response envelope `get`.

        - Flags: read only.
      operationId: get_workflow_version
      parameters:
        - name: sid
          in: path
          required: true
          description: The wf_vr_* sid of the row to read.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^wf_vr_
            description: The wf_vr_* sid of the row to read.
        - name: include[]
          in: query
          required: false
          description: Relations to attach to the row; omit for the bare row.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - workflow
                - workflow_records_counts
            description: Relations to attach to the row; omit for the bare row.
      responses:
        '200':
          description: '`get` success envelope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWorkflowVersionResponse'
        4XX:
          $ref: '#/components/responses/McpClientError'
        5XX:
          $ref: '#/components/responses/McpServerError'
components:
  schemas:
    GetWorkflowVersionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Version sid (wf_vr_…).
            team_sid:
              type: string
              description: Owning team (ts_tm_…, external - gs.service.id).
            workflow_sid:
              type: string
              description: >-
                Parent workflow (wf_wf_…) - written once at publish, never
                repointed; see ./workflows.md.
            version:
              type: integer
              minimum: 1
              description: >-
                Per-workflow sequence, max+1 at publish (serialized by the
                publish FOR UPDATE on the workflow row).
            steps:
              type: array
              items:
                oneOf:
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_send_connection_request
                      message:
                        type: string
                        nullable: true
                        description: >-
                          Invite note template; rendered note <=300 chars -
                          enforced at publish after variable resolution
                          (research: max 300 RENDERED). null/omitted = blank
                          invite.
                      required_fields:
                        type: object
                        nullable: true
                        properties:
                          refs:
                            type: array
                            items:
                              type: string
                              maxLength: 160
                              pattern: >-
                                ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                            maxItems: 20
                            description: >-
                              0..20 bare template refs required on top of the
                              text's own variables (people.first_name,
                              company.name, record.<slug>,
                              company.record.<slug>, ai.<key>); every variable
                              the text carries without a |fallback is required
                              by itself. Slug existence resolved at RUNTIME per
                              record's playtable, not at publish.
                          on_missing:
                            type: string
                            enum:
                              - fail
                              - skip
                            description: >-
                              Policy when a value the step text needs is empty
                              at task time: fail = the task fails at once
                              (required_fields_missing), the record with it,
                              visible as Failed and run again through the task
                              retry once the value is there; skip = skip this
                              step and advance. A variable with a |fallback is
                              never missing; no policy (null) = the text goes as
                              it renders. The wait policy went on 2026-10-11.
                        required:
                          - refs
                          - on_missing
                        additionalProperties: false
                        description: >-
                          When a value the note needs is empty: refs required on
                          top of the text + on_missing policy.
                    required:
                      - id
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_send_message
                      message:
                        type: string
                        minLength: 1
                        maxLength: 8000
                        description: >-
                          Message template ({{people.*}} / {{company.*}} /
                          {{record.<slug>}} / {{ai.<key>}}); rendered at task
                          time.
                      required_fields:
                        type: object
                        nullable: true
                        properties:
                          refs:
                            type: array
                            items:
                              type: string
                              maxLength: 160
                              pattern: >-
                                ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                            maxItems: 20
                            description: >-
                              0..20 bare template refs required on top of the
                              text's own variables (people.first_name,
                              company.name, record.<slug>,
                              company.record.<slug>, ai.<key>); every variable
                              the text carries without a |fallback is required
                              by itself. Slug existence resolved at RUNTIME per
                              record's playtable, not at publish.
                          on_missing:
                            type: string
                            enum:
                              - fail
                              - skip
                            description: >-
                              Policy when a value the step text needs is empty
                              at task time: fail = the task fails at once
                              (required_fields_missing), the record with it,
                              visible as Failed and run again through the task
                              retry once the value is there; skip = skip this
                              step and advance. A variable with a |fallback is
                              never missing; no policy (null) = the text goes as
                              it renders. The wait policy went on 2026-10-11.
                        required:
                          - refs
                          - on_missing
                        additionalProperties: false
                        description: >-
                          When a value the text needs is empty: refs required on
                          top of the text + on_missing policy.
                    required:
                      - id
                      - type
                      - message
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_send_inmail
                      subject:
                        type: string
                        nullable: true
                        maxLength: 200
                        description: InMail subject template, max 200.
                      message:
                        type: string
                        minLength: 1
                        maxLength: 8000
                        description: InMail body template, 1..8000.
                      required_fields:
                        type: object
                        nullable: true
                        properties:
                          refs:
                            type: array
                            items:
                              type: string
                              maxLength: 160
                              pattern: >-
                                ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                            maxItems: 20
                            description: >-
                              0..20 bare template refs required on top of the
                              text's own variables (people.first_name,
                              company.name, record.<slug>,
                              company.record.<slug>, ai.<key>); every variable
                              the text carries without a |fallback is required
                              by itself. Slug existence resolved at RUNTIME per
                              record's playtable, not at publish.
                          on_missing:
                            type: string
                            enum:
                              - fail
                              - skip
                            description: >-
                              Policy when a value the step text needs is empty
                              at task time: fail = the task fails at once
                              (required_fields_missing), the record with it,
                              visible as Failed and run again through the task
                              retry once the value is there; skip = skip this
                              step and advance. A variable with a |fallback is
                              never missing; no policy (null) = the text goes as
                              it renders. The wait policy went on 2026-10-11.
                        required:
                          - refs
                          - on_missing
                        additionalProperties: false
                        description: >-
                          When a value the text needs is empty: refs required on
                          top of the text + on_missing policy.
                    required:
                      - id
                      - type
                      - message
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_visit_profile
                    required:
                      - id
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_endorse_skills
                      skills_count:
                        type: integer
                        minimum: 1
                        maximum: 10
                        description: >-
                          Endorse the person's top N listed skills, 1..10
                          (named-skill targeting deferred - count-only in v1).
                    required:
                      - id
                      - type
                      - skills_count
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_withdraw_connection_request
                    required:
                      - id
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_like_latest_post
                    required:
                      - id
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - linkedin_comment_latest_post
                      comment:
                        type: string
                        minLength: 1
                        maxLength: 1250
                        description: >-
                          Comment template posted on the person's latest post,
                          1..1250 rendered; same variable namespaces as message
                          templates.
                      required_fields:
                        type: object
                        nullable: true
                        properties:
                          refs:
                            type: array
                            items:
                              type: string
                              maxLength: 160
                              pattern: >-
                                ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                            maxItems: 20
                            description: >-
                              0..20 bare template refs required on top of the
                              text's own variables (people.first_name,
                              company.name, record.<slug>,
                              company.record.<slug>, ai.<key>); every variable
                              the text carries without a |fallback is required
                              by itself. Slug existence resolved at RUNTIME per
                              record's playtable, not at publish.
                          on_missing:
                            type: string
                            enum:
                              - fail
                              - skip
                            description: >-
                              Policy when a value the step text needs is empty
                              at task time: fail = the task fails at once
                              (required_fields_missing), the record with it,
                              visible as Failed and run again through the task
                              retry once the value is there; skip = skip this
                              step and advance. A variable with a |fallback is
                              never missing; no policy (null) = the text goes as
                              it renders. The wait policy went on 2026-10-11.
                        required:
                          - refs
                          - on_missing
                        additionalProperties: false
                        description: >-
                          When a value the comment needs is empty: refs required
                          on top of the text + on_missing policy.
                    required:
                      - id
                      - type
                      - comment
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - email_send
                      subject:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: Email subject template, 1..255.
                      body:
                        type: string
                        minLength: 1
                        maxLength: 100000
                        description: Email body template, HTML, 1..100000.
                      required_fields:
                        type: object
                        nullable: true
                        properties:
                          refs:
                            type: array
                            items:
                              type: string
                              maxLength: 160
                              pattern: >-
                                ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                            maxItems: 20
                            description: >-
                              0..20 bare template refs required on top of the
                              text's own variables (people.first_name,
                              company.name, record.<slug>,
                              company.record.<slug>, ai.<key>); every variable
                              the text carries without a |fallback is required
                              by itself. Slug existence resolved at RUNTIME per
                              record's playtable, not at publish.
                          on_missing:
                            type: string
                            enum:
                              - fail
                              - skip
                            description: >-
                              Policy when a value the step text needs is empty
                              at task time: fail = the task fails at once
                              (required_fields_missing), the record with it,
                              visible as Failed and run again through the task
                              retry once the value is there; skip = skip this
                              step and advance. A variable with a |fallback is
                              never missing; no policy (null) = the text goes as
                              it renders. The wait policy went on 2026-10-11.
                        required:
                          - refs
                          - on_missing
                        additionalProperties: false
                        description: >-
                          When a value the text needs is empty: refs required on
                          top of the text + on_missing policy.
                      email_field:
                        type: string
                        nullable: true
                        description: >-
                          Which address the send uses: any | work_email |
                          personal_email; omitted or any = the best one.
                      cc:
                        type: array
                        nullable: true
                        items:
                          type: string
                          maxLength: 320
                          format: email
                        maxItems: 5
                        description: >-
                          Up to 5 literal copy addresses (no templates: a copy
                          goes to a colleague).
                      bcc:
                        type: array
                        nullable: true
                        items:
                          type: string
                          maxLength: 320
                          format: email
                        maxItems: 5
                        description: Up to 5 literal blind-copy addresses.
                      attachments:
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            sid:
                              type: string
                              minLength: 18
                              maxLength: 18
                              pattern: ^wf_at_
                              description: >-
                                A workflow attachment the team uploaded
                                (create_workflow_attachment_upload_url).
                            name:
                              type: string
                              minLength: 1
                              maxLength: 255
                              description: The filename the receiver sees.
                          required:
                            - sid
                            - name
                          additionalProperties: false
                        maxItems: 5
                        description: >-
                          Up to 5 library files sent with the email; the
                          executor reads the bytes at send time.
                      reply_in_thread:
                        type: boolean
                        nullable: true
                        description: True threads the send onto the prior email exchange.
                      track_opens:
                        type: boolean
                        nullable: true
                      track_clicks:
                        type: boolean
                        nullable: true
                      unsubscribe_link:
                        type: boolean
                        nullable: true
                    required:
                      - id
                      - type
                      - subject
                      - body
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      type:
                        type: string
                        enum:
                          - wait
                      for:
                        type: string
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long to pause the record before the next step -
                          "45m" / "12h" / "14d" (replaces v3
                          timer.duration_seconds).
                    required:
                      - id
                      - type
                      - for
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      type:
                        type: string
                        enum:
                          - wait_for_event
                      event:
                        type: string
                        enum:
                          - linkedin_connection_request_accepted
                          - email_opened
                          - email_link_clicked
                        description: >-
                          Event a wait_for_event step blocks on (observed via
                          activities ingest).
                      timeout:
                        type: object
                        properties:
                          after:
                            type: string
                            pattern: ^[1-9][0-9]*(m|h|d)$
                            description: >-
                              Timeout duration - bundled: a timeout path cannot
                              exist without one.
                          steps:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_send_connection_request
                                    message:
                                      type: string
                                      nullable: true
                                      description: >-
                                        Invite note template; rendered note
                                        <=300 chars - enforced at publish after
                                        variable resolution (research: max 300
                                        RENDERED). null/omitted = blank invite.
                                    required_fields:
                                      type: object
                                      nullable: true
                                      properties:
                                        refs:
                                          type: array
                                          items:
                                            type: string
                                            maxLength: 160
                                            pattern: >-
                                              ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                          maxItems: 20
                                          description: >-
                                            0..20 bare template refs required on top
                                            of the text's own variables
                                            (people.first_name, company.name,
                                            record.<slug>, company.record.<slug>,
                                            ai.<key>); every variable the text
                                            carries without a |fallback is required
                                            by itself. Slug existence resolved at
                                            RUNTIME per record's playtable, not at
                                            publish.
                                        on_missing:
                                          type: string
                                          enum:
                                            - fail
                                            - skip
                                          description: >-
                                            Policy when a value the step text needs
                                            is empty at task time: fail = the task
                                            fails at once (required_fields_missing),
                                            the record with it, visible as Failed
                                            and run again through the task retry
                                            once the value is there; skip = skip
                                            this step and advance. A variable with a
                                            |fallback is never missing; no policy
                                            (null) = the text goes as it renders.
                                            The wait policy went on 2026-10-11.
                                      required:
                                        - refs
                                        - on_missing
                                      additionalProperties: false
                                      description: >-
                                        When a value the note needs is empty:
                                        refs required on top of the text +
                                        on_missing policy.
                                  required:
                                    - id
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_send_message
                                    message:
                                      type: string
                                      minLength: 1
                                      maxLength: 8000
                                      description: >-
                                        Message template ({{people.*}} /
                                        {{company.*}} / {{record.<slug>}} /
                                        {{ai.<key>}}); rendered at task time.
                                    required_fields:
                                      type: object
                                      nullable: true
                                      properties:
                                        refs:
                                          type: array
                                          items:
                                            type: string
                                            maxLength: 160
                                            pattern: >-
                                              ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                          maxItems: 20
                                          description: >-
                                            0..20 bare template refs required on top
                                            of the text's own variables
                                            (people.first_name, company.name,
                                            record.<slug>, company.record.<slug>,
                                            ai.<key>); every variable the text
                                            carries without a |fallback is required
                                            by itself. Slug existence resolved at
                                            RUNTIME per record's playtable, not at
                                            publish.
                                        on_missing:
                                          type: string
                                          enum:
                                            - fail
                                            - skip
                                          description: >-
                                            Policy when a value the step text needs
                                            is empty at task time: fail = the task
                                            fails at once (required_fields_missing),
                                            the record with it, visible as Failed
                                            and run again through the task retry
                                            once the value is there; skip = skip
                                            this step and advance. A variable with a
                                            |fallback is never missing; no policy
                                            (null) = the text goes as it renders.
                                            The wait policy went on 2026-10-11.
                                      required:
                                        - refs
                                        - on_missing
                                      additionalProperties: false
                                      description: >-
                                        When a value the text needs is empty:
                                        refs required on top of the text +
                                        on_missing policy.
                                  required:
                                    - id
                                    - type
                                    - message
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_send_inmail
                                    subject:
                                      type: string
                                      nullable: true
                                      maxLength: 200
                                      description: InMail subject template, max 200.
                                    message:
                                      type: string
                                      minLength: 1
                                      maxLength: 8000
                                      description: InMail body template, 1..8000.
                                    required_fields:
                                      type: object
                                      nullable: true
                                      properties:
                                        refs:
                                          type: array
                                          items:
                                            type: string
                                            maxLength: 160
                                            pattern: >-
                                              ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                          maxItems: 20
                                          description: >-
                                            0..20 bare template refs required on top
                                            of the text's own variables
                                            (people.first_name, company.name,
                                            record.<slug>, company.record.<slug>,
                                            ai.<key>); every variable the text
                                            carries without a |fallback is required
                                            by itself. Slug existence resolved at
                                            RUNTIME per record's playtable, not at
                                            publish.
                                        on_missing:
                                          type: string
                                          enum:
                                            - fail
                                            - skip
                                          description: >-
                                            Policy when a value the step text needs
                                            is empty at task time: fail = the task
                                            fails at once (required_fields_missing),
                                            the record with it, visible as Failed
                                            and run again through the task retry
                                            once the value is there; skip = skip
                                            this step and advance. A variable with a
                                            |fallback is never missing; no policy
                                            (null) = the text goes as it renders.
                                            The wait policy went on 2026-10-11.
                                      required:
                                        - refs
                                        - on_missing
                                      additionalProperties: false
                                      description: >-
                                        When a value the text needs is empty:
                                        refs required on top of the text +
                                        on_missing policy.
                                  required:
                                    - id
                                    - type
                                    - message
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_visit_profile
                                  required:
                                    - id
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_endorse_skills
                                    skills_count:
                                      type: integer
                                      minimum: 1
                                      maximum: 10
                                      description: >-
                                        Endorse the person's top N listed
                                        skills, 1..10 (named-skill targeting
                                        deferred - count-only in v1).
                                  required:
                                    - id
                                    - type
                                    - skills_count
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_withdraw_connection_request
                                  required:
                                    - id
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_like_latest_post
                                  required:
                                    - id
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - linkedin_comment_latest_post
                                    comment:
                                      type: string
                                      minLength: 1
                                      maxLength: 1250
                                      description: >-
                                        Comment template posted on the person's
                                        latest post, 1..1250 rendered; same
                                        variable namespaces as message
                                        templates.
                                    required_fields:
                                      type: object
                                      nullable: true
                                      properties:
                                        refs:
                                          type: array
                                          items:
                                            type: string
                                            maxLength: 160
                                            pattern: >-
                                              ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                          maxItems: 20
                                          description: >-
                                            0..20 bare template refs required on top
                                            of the text's own variables
                                            (people.first_name, company.name,
                                            record.<slug>, company.record.<slug>,
                                            ai.<key>); every variable the text
                                            carries without a |fallback is required
                                            by itself. Slug existence resolved at
                                            RUNTIME per record's playtable, not at
                                            publish.
                                        on_missing:
                                          type: string
                                          enum:
                                            - fail
                                            - skip
                                          description: >-
                                            Policy when a value the step text needs
                                            is empty at task time: fail = the task
                                            fails at once (required_fields_missing),
                                            the record with it, visible as Failed
                                            and run again through the task retry
                                            once the value is there; skip = skip
                                            this step and advance. A variable with a
                                            |fallback is never missing; no policy
                                            (null) = the text goes as it renders.
                                            The wait policy went on 2026-10-11.
                                      required:
                                        - refs
                                        - on_missing
                                      additionalProperties: false
                                      description: >-
                                        When a value the comment needs is empty:
                                        refs required on top of the text +
                                        on_missing policy.
                                  required:
                                    - id
                                    - type
                                    - comment
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - email_send
                                    subject:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                      description: Email subject template, 1..255.
                                    body:
                                      type: string
                                      minLength: 1
                                      maxLength: 100000
                                      description: Email body template, HTML, 1..100000.
                                    required_fields:
                                      type: object
                                      nullable: true
                                      properties:
                                        refs:
                                          type: array
                                          items:
                                            type: string
                                            maxLength: 160
                                            pattern: >-
                                              ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                          maxItems: 20
                                          description: >-
                                            0..20 bare template refs required on top
                                            of the text's own variables
                                            (people.first_name, company.name,
                                            record.<slug>, company.record.<slug>,
                                            ai.<key>); every variable the text
                                            carries without a |fallback is required
                                            by itself. Slug existence resolved at
                                            RUNTIME per record's playtable, not at
                                            publish.
                                        on_missing:
                                          type: string
                                          enum:
                                            - fail
                                            - skip
                                          description: >-
                                            Policy when a value the step text needs
                                            is empty at task time: fail = the task
                                            fails at once (required_fields_missing),
                                            the record with it, visible as Failed
                                            and run again through the task retry
                                            once the value is there; skip = skip
                                            this step and advance. A variable with a
                                            |fallback is never missing; no policy
                                            (null) = the text goes as it renders.
                                            The wait policy went on 2026-10-11.
                                      required:
                                        - refs
                                        - on_missing
                                      additionalProperties: false
                                      description: >-
                                        When a value the text needs is empty:
                                        refs required on top of the text +
                                        on_missing policy.
                                    email_field:
                                      type: string
                                      nullable: true
                                      description: >-
                                        Which address the send uses: any |
                                        work_email | personal_email; omitted or
                                        any = the best one.
                                    cc:
                                      type: array
                                      nullable: true
                                      items:
                                        type: string
                                        maxLength: 320
                                        format: email
                                      maxItems: 5
                                      description: >-
                                        Up to 5 literal copy addresses (no
                                        templates: a copy goes to a colleague).
                                    bcc:
                                      type: array
                                      nullable: true
                                      items:
                                        type: string
                                        maxLength: 320
                                        format: email
                                      maxItems: 5
                                      description: Up to 5 literal blind-copy addresses.
                                    attachments:
                                      type: array
                                      nullable: true
                                      items:
                                        type: object
                                        properties:
                                          sid:
                                            type: string
                                            minLength: 18
                                            maxLength: 18
                                            pattern: ^wf_at_
                                            description: >-
                                              A workflow attachment the team uploaded
                                              (create_workflow_attachment_upload_url).
                                          name:
                                            type: string
                                            minLength: 1
                                            maxLength: 255
                                            description: The filename the receiver sees.
                                        required:
                                          - sid
                                          - name
                                        additionalProperties: false
                                      maxItems: 5
                                      description: >-
                                        Up to 5 library files sent with the
                                        email; the executor reads the bytes at
                                        send time.
                                    reply_in_thread:
                                      type: boolean
                                      nullable: true
                                      description: >-
                                        True threads the send onto the prior
                                        email exchange.
                                    track_opens:
                                      type: boolean
                                      nullable: true
                                    track_clicks:
                                      type: boolean
                                      nullable: true
                                    unsubscribe_link:
                                      type: boolean
                                      nullable: true
                                  required:
                                    - id
                                    - type
                                    - subject
                                    - body
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    type:
                                      type: string
                                      enum:
                                        - wait
                                    for:
                                      type: string
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long to pause the record before the
                                        next step - "45m" / "12h" / "14d"
                                        (replaces v3 timer.duration_seconds).
                                  required:
                                    - id
                                    - type
                                    - for
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    type:
                                      type: string
                                      enum:
                                        - wait_for_event
                                    event:
                                      type: string
                                      enum:
                                        - linkedin_connection_request_accepted
                                        - email_opened
                                        - email_link_clicked
                                      description: >-
                                        Event a wait_for_event step blocks on
                                        (observed via activities ingest).
                                    timeout:
                                      type: object
                                      properties:
                                        after:
                                          type: string
                                          pattern: ^[1-9][0-9]*(m|h|d)$
                                          description: >-
                                            Timeout duration - bundled: a timeout
                                            path cannot exist without one.
                                        steps:
                                          type: array
                                          items:
                                            type: object
                                            additionalProperties: {}
                                            description: >-
                                              Recursive node: the same object shape
                                              repeats here. A static OpenAPI document
                                              cannot express the cycle, so this level
                                              is documented as an open object.
                                          description: >-
                                            Fallback sub-flow; [] = on timeout,
                                            continue as if the event fired; falls
                                            through to the parent chain unless it
                                            ends with `end`.
                                      required:
                                        - after
                                        - steps
                                      additionalProperties: false
                                      description: >-
                                        Required since 2026-10-11: a wait always
                                        has a time limit (a wait with no end is
                                        a stuck journey); steps: [] = on
                                        timeout, continue as if the event fired.
                                        The reply-pause machinery still applies
                                        (KNOWLEDGE §4.9).
                                  required:
                                    - id
                                    - type
                                    - event
                                    - timeout
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - condition
                                    branches:
                                      type: array
                                      items:
                                        type: object
                                        additionalProperties: {}
                                        description: >-
                                          Recursive node: the same object shape
                                          repeats here. A static OpenAPI document
                                          cannot express the cycle, so this level
                                          is documented as an open object.
                                      minItems: 1
                                      maxItems: 9
                                      description: >-
                                        1..9, evaluated in order, first match
                                        wins; the fired branch id lands on the
                                        condition task result
                                        (workflow_tasks.md).
                                    else:
                                      type: array
                                      items:
                                        type: object
                                        additionalProperties: {}
                                        description: >-
                                          Recursive node: the same object shape
                                          repeats here. A static OpenAPI document
                                          cannot express the cycle, so this level
                                          is documented as an open object.
                                      description: >-
                                        REQUIRED no-match path (may be []);
                                        falls through unless it ends with `end`.
                                  required:
                                    - id
                                    - type
                                    - branches
                                    - else
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - ab_test
                                    branches:
                                      type: array
                                      items:
                                        type: object
                                        additionalProperties: {}
                                        description: >-
                                          Recursive node: the same object shape
                                          repeats here. A static OpenAPI document
                                          cannot express the cycle, so this level
                                          is documented as an open object.
                                      minItems: 2
                                      maxItems: 9
                                      description: >-
                                        2..9 weighted arms; the record is
                                        assigned to one deterministically by
                                        hashing its sid into the weight
                                        distribution (workflow_versions.md). No
                                        `else` - weights cover the whole
                                        distribution.
                                  required:
                                    - id
                                    - type
                                    - branches
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    type:
                                      type: string
                                      enum:
                                        - end
                                  required:
                                    - id
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - api_call
                                    method:
                                      type: string
                                      enum:
                                        - GET
                                        - POST
                                        - PUT
                                        - PATCH
                                        - DELETE
                                      description: >-
                                        The request method. POST / PUT / PATCH
                                        carry the JSON body; GET / DELETE must
                                        publish with body null.
                                    url:
                                      type: string
                                      minLength: 1
                                      maxLength: 2048
                                      description: >-
                                        https-only (publish check), max 2048. A
                                        template: {{people.*}} / {{company.*}} /
                                        {{record.<slug>}} / {{ai.<key>}} may
                                        stand in the path and the query and are
                                        URL-encoded where they stand.
                                    headers:
                                      type: object
                                      nullable: true
                                      additionalProperties:
                                        type: string
                                        maxLength: 1024
                                      description: >-
                                        Up to 20 custom request headers; values
                                        are templates. Auth comes from
                                        provider_connection_sid, never from a
                                        literal here.
                                    query:
                                      type: object
                                      nullable: true
                                      additionalProperties:
                                        type: string
                                        maxLength: 2048
                                      description: >-
                                        Up to 20 query parameters appended to
                                        the URL; values are templates.
                                    body:
                                      type: string
                                      nullable: true
                                      maxLength: 16000
                                      description: >-
                                        A JSON body template with the variables
                                        INSIDE quotes ("{{people.full_name}}"),
                                        stood in JSON-safely at call time. null
                                        = the fixed payload {event,
                                        workflow_sid, workflow_record_sid,
                                        workflow_task_sid, step_id, people_sid,
                                        context}.
                                    provider_connection_sid:
                                      type: string
                                      nullable: true
                                      minLength: 18
                                      maxLength: 18
                                      pattern: ^in_cn_
                                      description: >-
                                        A `custom` provider connection of the
                                        team (provider-connections.search filter
                                        provider=custom): the integration
                                        platform injects its auth (bearer /
                                        basic / header / query) when the call
                                        fires. null = no auth (a public API).
                                    timeout_secs:
                                      type: integer
                                      nullable: true
                                      minimum: 1
                                      maximum: 120
                                      description: The call budget in seconds; null = 15.
                                    retry_on_error:
                                      type: boolean
                                      nullable: true
                                      description: >-
                                        null/true: a 5xx, a 429, a timeout or an
                                        unreachable target earns a fresh attempt
                                        (3 in all, with backoff); false: the
                                        record fails on the first error. A 4xx /
                                        auth refusal never retries.
                                    remove_empty_values:
                                      type: boolean
                                      nullable: true
                                      description: >-
                                        true: empty rendered values leave the
                                        query and the body, so they never
                                        overwrite the receiver's data;
                                        null/false: sent as empty strings.
                                    output_key:
                                      type: string
                                      nullable: true
                                      pattern: ^[a-z][a-z0-9_]{0,63}$
                                      description: >-
                                        The answer's name for the steps after
                                        this one (2026-10-11): a slug, unique
                                        within the version together with the
                                        ask_ai keys (publish check). Later steps
                                        read {{api.<output_key>.<path>}} (a
                                        dotted path into the decoded JSON
                                        answer) and condition leaves filter on
                                        api.<output_key>.<path>; the answer is
                                        kept on the done task row, capped at 64
                                        KB. null = the answer is not kept.
                                  required:
                                    - id
                                    - type
                                    - method
                                    - url
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - ask_ai
                                    prompt:
                                      type: string
                                      minLength: 1
                                      maxLength: 8000
                                      description: >-
                                        Prompt template, 1..8000 - same variable
                                        namespaces as message templates.
                                    output_key:
                                      type: string
                                      pattern: ^[a-z][a-z0-9_]{0,63}$
                                      description: >-
                                        Slug 1..64, unique within the version
                                        (publish check); later steps read
                                        {{ai.<output_key>}} and condition leaves
                                        filter on ai.<output_key>. Outputs live
                                        on the completed task row, never on
                                        records.
                                    preset_sid:
                                      type: string
                                      nullable: true
                                      description: >-
                                        gtm-api preset for the AI call (external
                                        sid, opaque); null/omitted = team
                                        default (service KNOWLEDGE §1).
                                  required:
                                    - id
                                    - type
                                    - prompt
                                    - output_key
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    type:
                                      type: string
                                      enum:
                                        - manual_task
                                    title:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                      description: Todo title template, 1..255.
                                    instructions:
                                      type: string
                                      nullable: true
                                      maxLength: 4000
                                      description: >-
                                        Rendered into the human todo, max 4000;
                                        the journey waits until the task is
                                        completed (workflow_tasks.md manual
                                        queue).
                                  required:
                                    - id
                                    - type
                                    - title
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - move_to_workflow
                                    target_workflow_sid:
                                      type: string
                                      minLength: 18
                                      maxLength: 18
                                      pattern: ^wf_wf_
                                      description: >-
                                        Enroll the person into this campaign
                                        (wf_wf_…); reuses the existing record
                                        per the re-entry policy
                                        (workflow_records.md). THIS record then
                                        completes - terminal-for-this-record.
                                    mode:
                                      type: string
                                      nullable: true
                                      enum:
                                        - from_start
                                        - from_current
                                      description: >-
                                        Re-entry mode when the person is ALREADY
                                        in the target (workflow_records.md,
                                        Re-entry): from_start (default; reset to
                                        the entry step) | from_current (resume
                                        the pinned step, else the entry step). A
                                        re-entry is loop-guarded at
                                        re_entered_count 10.
                                  required:
                                    - id
                                    - type
                                    - target_workflow_sid
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - add_tag
                                    tag_sids:
                                      type: array
                                      items:
                                        type: string
                                        minLength: 18
                                        maxLength: 18
                                        pattern: ^cr_tg_
                                        description: CRM tag sid (cr_tg_…).
                                      minItems: 1
                                      maxItems: 20
                                      description: >-
                                        1..20 CRM tags (cr_tg_…) attached to the
                                        person mid-flow, then falls through
                                        (tags.md).
                                  required:
                                    - id
                                    - type
                                    - tag_sids
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - remove_tag
                                    tag_sids:
                                      type: array
                                      items:
                                        type: string
                                        minLength: 18
                                        maxLength: 18
                                        pattern: ^cr_tg_
                                        description: CRM tag sid (cr_tg_…).
                                      minItems: 1
                                      maxItems: 20
                                      description: >-
                                        1..20 CRM tags (cr_tg_…) detached from
                                        the person mid-flow, then falls through.
                                  required:
                                    - id
                                    - type
                                    - tag_sids
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - set_field
                                    field_slug:
                                      type: string
                                      pattern: ^[a-z][a-z0-9_]{0,63}$
                                      description: >-
                                        Playtable field slug to write
                                        (pipeline_stage is a scalar_select field
                                        - service KNOWLEDGE §3).
                                    value:
                                      anyOf:
                                        - type: string
                                        - type: number
                                        - type: boolean
                                        - {}
                                        - {}
                                      description: >-
                                        Scalar cell value written for the person
                                        (one cell; no arrays/objects); null
                                        clears the field
                                        (playtable_field_values.md).
                                  required:
                                    - id
                                    - type
                                    - field_slug
                                    - value
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    id:
                                      type: integer
                                      minimum: 1
                                      description: >-
                                        Server-assigned small int, unique across
                                        the whole document (steps + branch ids);
                                        immutable, never reused; user-facing in
                                        the editor tree.
                                    name:
                                      type: string
                                      nullable: true
                                      maxLength: 255
                                      description: Editor label.
                                    delay:
                                      type: string
                                      nullable: true
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        How long the record waits at this step
                                        before it runs: "45m" / "12h" / "2d";
                                        null/omitted = runs as soon as it
                                        arrives. Not allowed on wait (use
                                        `for`), wait_for_event, manual_task,
                                        end.
                                    type:
                                      type: string
                                      enum:
                                        - change_sender
                                    sender_profile_sid:
                                      type: string
                                      nullable: true
                                      minLength: 18
                                      maxLength: 18
                                      pattern: ^ub_sp_
                                      description: >-
                                        Explicit forward-only re-pin of
                                        workflow_records.sender_profile_sid
                                        (ub_sp_…). Exactly one of the three
                                        shapes (publish check).
                                    rotation:
                                      type: string
                                      nullable: true
                                      enum:
                                        - fair
                                        - random
                                        - new_sender
                                        - prior_engagement
                                      description: >-
                                        Re-pick the sender from the workflow
                                        pool by this strategy instead of a fixed
                                        sid, forward only. Exactly one of the
                                        three shapes (publish check).
                                    rotations:
                                      type: array
                                      nullable: true
                                      items:
                                        type: object
                                        properties:
                                          sender_profile_sid:
                                            type: string
                                            nullable: true
                                            minLength: 18
                                            maxLength: 18
                                            pattern: ^ub_sp_
                                            description: >-
                                              The sender profile for this pass; null =
                                              the workflow's rotation strategy picks,
                                              never the sender profile the record
                                              already has. Must be in the workflow's
                                              pool (publish check).
                                          entry_step_id:
                                            type: integer
                                            nullable: true
                                            minimum: 0
                                            exclusiveMinimum: true
                                            description: >-
                                              A step id of THIS document to restart
                                              the journey from (publish check); null =
                                              the workflow's entry step.
                                        required:
                                          - sender_profile_sid
                                          - entry_step_id
                                        additionalProperties: false
                                      minItems: 1
                                      maxItems: 10
                                      description: >-
                                        The legacy gs_rotate_sender_profile list
                                        (D45): each pass through the node
                                        consumes the next entry and RESTARTS the
                                        journey from its entry step with its
                                        sender profile (touches start over;
                                        workflow_records.rotations_done is the
                                        cursor); past the end the journey
                                        continues. Exactly one of the three
                                        shapes (publish check).
                                  required:
                                    - id
                                    - type
                                  additionalProperties: false
                            description: >-
                              Fallback sub-flow; [] = on timeout, continue as if
                              the event fired; falls through to the parent chain
                              unless it ends with `end`.
                        required:
                          - after
                          - steps
                        additionalProperties: false
                        description: >-
                          Required since 2026-10-11: a wait always has a time
                          limit (a wait with no end is a stuck journey); steps:
                          [] = on timeout, continue as if the event fired. The
                          reply-pause machinery still applies (KNOWLEDGE §4.9).
                    required:
                      - id
                      - type
                      - event
                      - timeout
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - condition
                      branches:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              minimum: 1
                              description: >-
                                Server-assigned small int, unique across the
                                whole document (steps + branch ids); immutable,
                                never reused; user-facing in the editor tree.
                            label:
                              type: string
                              nullable: true
                              maxLength: 255
                              description: Editor caption.
                            when:
                              type: object
                              additionalProperties: {}
                              description: >-
                                Recursive node: the same object shape repeats
                                here. A static OpenAPI document cannot express
                                the cycle, so this level is documented as an
                                open object.
                            steps:
                              type: array
                              items:
                                type: object
                                additionalProperties: {}
                                description: >-
                                  Recursive node: the same object shape repeats
                                  here. A static OpenAPI document cannot express
                                  the cycle, so this level is documented as an
                                  open object.
                              description: >-
                                Branch sub-flow; falls through to the
                                condition's successor unless it ends with `end`.
                          required:
                            - id
                            - when
                            - steps
                          additionalProperties: false
                        minItems: 1
                        maxItems: 9
                        description: >-
                          1..9, evaluated in order, first match wins; the fired
                          branch id lands on the condition task result
                          (workflow_tasks.md).
                      else:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_send_connection_request
                                message:
                                  type: string
                                  nullable: true
                                  description: >-
                                    Invite note template; rendered note <=300
                                    chars - enforced at publish after variable
                                    resolution (research: max 300 RENDERED).
                                    null/omitted = blank invite.
                                required_fields:
                                  type: object
                                  nullable: true
                                  properties:
                                    refs:
                                      type: array
                                      items:
                                        type: string
                                        maxLength: 160
                                        pattern: >-
                                          ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                      maxItems: 20
                                      description: >-
                                        0..20 bare template refs required on top
                                        of the text's own variables
                                        (people.first_name, company.name,
                                        record.<slug>, company.record.<slug>,
                                        ai.<key>); every variable the text
                                        carries without a |fallback is required
                                        by itself. Slug existence resolved at
                                        RUNTIME per record's playtable, not at
                                        publish.
                                    on_missing:
                                      type: string
                                      enum:
                                        - fail
                                        - skip
                                      description: >-
                                        Policy when a value the step text needs
                                        is empty at task time: fail = the task
                                        fails at once (required_fields_missing),
                                        the record with it, visible as Failed
                                        and run again through the task retry
                                        once the value is there; skip = skip
                                        this step and advance. A variable with a
                                        |fallback is never missing; no policy
                                        (null) = the text goes as it renders.
                                        The wait policy went on 2026-10-11.
                                  required:
                                    - refs
                                    - on_missing
                                  additionalProperties: false
                                  description: >-
                                    When a value the note needs is empty: refs
                                    required on top of the text + on_missing
                                    policy.
                              required:
                                - id
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_send_message
                                message:
                                  type: string
                                  minLength: 1
                                  maxLength: 8000
                                  description: >-
                                    Message template ({{people.*}} /
                                    {{company.*}} / {{record.<slug>}} /
                                    {{ai.<key>}}); rendered at task time.
                                required_fields:
                                  type: object
                                  nullable: true
                                  properties:
                                    refs:
                                      type: array
                                      items:
                                        type: string
                                        maxLength: 160
                                        pattern: >-
                                          ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                      maxItems: 20
                                      description: >-
                                        0..20 bare template refs required on top
                                        of the text's own variables
                                        (people.first_name, company.name,
                                        record.<slug>, company.record.<slug>,
                                        ai.<key>); every variable the text
                                        carries without a |fallback is required
                                        by itself. Slug existence resolved at
                                        RUNTIME per record's playtable, not at
                                        publish.
                                    on_missing:
                                      type: string
                                      enum:
                                        - fail
                                        - skip
                                      description: >-
                                        Policy when a value the step text needs
                                        is empty at task time: fail = the task
                                        fails at once (required_fields_missing),
                                        the record with it, visible as Failed
                                        and run again through the task retry
                                        once the value is there; skip = skip
                                        this step and advance. A variable with a
                                        |fallback is never missing; no policy
                                        (null) = the text goes as it renders.
                                        The wait policy went on 2026-10-11.
                                  required:
                                    - refs
                                    - on_missing
                                  additionalProperties: false
                                  description: >-
                                    When a value the text needs is empty: refs
                                    required on top of the text + on_missing
                                    policy.
                              required:
                                - id
                                - type
                                - message
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_send_inmail
                                subject:
                                  type: string
                                  nullable: true
                                  maxLength: 200
                                  description: InMail subject template, max 200.
                                message:
                                  type: string
                                  minLength: 1
                                  maxLength: 8000
                                  description: InMail body template, 1..8000.
                                required_fields:
                                  type: object
                                  nullable: true
                                  properties:
                                    refs:
                                      type: array
                                      items:
                                        type: string
                                        maxLength: 160
                                        pattern: >-
                                          ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                      maxItems: 20
                                      description: >-
                                        0..20 bare template refs required on top
                                        of the text's own variables
                                        (people.first_name, company.name,
                                        record.<slug>, company.record.<slug>,
                                        ai.<key>); every variable the text
                                        carries without a |fallback is required
                                        by itself. Slug existence resolved at
                                        RUNTIME per record's playtable, not at
                                        publish.
                                    on_missing:
                                      type: string
                                      enum:
                                        - fail
                                        - skip
                                      description: >-
                                        Policy when a value the step text needs
                                        is empty at task time: fail = the task
                                        fails at once (required_fields_missing),
                                        the record with it, visible as Failed
                                        and run again through the task retry
                                        once the value is there; skip = skip
                                        this step and advance. A variable with a
                                        |fallback is never missing; no policy
                                        (null) = the text goes as it renders.
                                        The wait policy went on 2026-10-11.
                                  required:
                                    - refs
                                    - on_missing
                                  additionalProperties: false
                                  description: >-
                                    When a value the text needs is empty: refs
                                    required on top of the text + on_missing
                                    policy.
                              required:
                                - id
                                - type
                                - message
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_visit_profile
                              required:
                                - id
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_endorse_skills
                                skills_count:
                                  type: integer
                                  minimum: 1
                                  maximum: 10
                                  description: >-
                                    Endorse the person's top N listed skills,
                                    1..10 (named-skill targeting deferred -
                                    count-only in v1).
                              required:
                                - id
                                - type
                                - skills_count
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_withdraw_connection_request
                              required:
                                - id
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_like_latest_post
                              required:
                                - id
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - linkedin_comment_latest_post
                                comment:
                                  type: string
                                  minLength: 1
                                  maxLength: 1250
                                  description: >-
                                    Comment template posted on the person's
                                    latest post, 1..1250 rendered; same variable
                                    namespaces as message templates.
                                required_fields:
                                  type: object
                                  nullable: true
                                  properties:
                                    refs:
                                      type: array
                                      items:
                                        type: string
                                        maxLength: 160
                                        pattern: >-
                                          ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                      maxItems: 20
                                      description: >-
                                        0..20 bare template refs required on top
                                        of the text's own variables
                                        (people.first_name, company.name,
                                        record.<slug>, company.record.<slug>,
                                        ai.<key>); every variable the text
                                        carries without a |fallback is required
                                        by itself. Slug existence resolved at
                                        RUNTIME per record's playtable, not at
                                        publish.
                                    on_missing:
                                      type: string
                                      enum:
                                        - fail
                                        - skip
                                      description: >-
                                        Policy when a value the step text needs
                                        is empty at task time: fail = the task
                                        fails at once (required_fields_missing),
                                        the record with it, visible as Failed
                                        and run again through the task retry
                                        once the value is there; skip = skip
                                        this step and advance. A variable with a
                                        |fallback is never missing; no policy
                                        (null) = the text goes as it renders.
                                        The wait policy went on 2026-10-11.
                                  required:
                                    - refs
                                    - on_missing
                                  additionalProperties: false
                                  description: >-
                                    When a value the comment needs is empty:
                                    refs required on top of the text +
                                    on_missing policy.
                              required:
                                - id
                                - type
                                - comment
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - email_send
                                subject:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                  description: Email subject template, 1..255.
                                body:
                                  type: string
                                  minLength: 1
                                  maxLength: 100000
                                  description: Email body template, HTML, 1..100000.
                                required_fields:
                                  type: object
                                  nullable: true
                                  properties:
                                    refs:
                                      type: array
                                      items:
                                        type: string
                                        maxLength: 160
                                        pattern: >-
                                          ^(people|company|record|ai|api)\.[a-z][a-z0-9_]*(\.[a-z0-9_]+)*$
                                      maxItems: 20
                                      description: >-
                                        0..20 bare template refs required on top
                                        of the text's own variables
                                        (people.first_name, company.name,
                                        record.<slug>, company.record.<slug>,
                                        ai.<key>); every variable the text
                                        carries without a |fallback is required
                                        by itself. Slug existence resolved at
                                        RUNTIME per record's playtable, not at
                                        publish.
                                    on_missing:
                                      type: string
                                      enum:
                                        - fail
                                        - skip
                                      description: >-
                                        Policy when a value the step text needs
                                        is empty at task time: fail = the task
                                        fails at once (required_fields_missing),
                                        the record with it, visible as Failed
                                        and run again through the task retry
                                        once the value is there; skip = skip
                                        this step and advance. A variable with a
                                        |fallback is never missing; no policy
                                        (null) = the text goes as it renders.
                                        The wait policy went on 2026-10-11.
                                  required:
                                    - refs
                                    - on_missing
                                  additionalProperties: false
                                  description: >-
                                    When a value the text needs is empty: refs
                                    required on top of the text + on_missing
                                    policy.
                                email_field:
                                  type: string
                                  nullable: true
                                  description: >-
                                    Which address the send uses: any |
                                    work_email | personal_email; omitted or any
                                    = the best one.
                                cc:
                                  type: array
                                  nullable: true
                                  items:
                                    type: string
                                    maxLength: 320
                                    format: email
                                  maxItems: 5
                                  description: >-
                                    Up to 5 literal copy addresses (no
                                    templates: a copy goes to a colleague).
                                bcc:
                                  type: array
                                  nullable: true
                                  items:
                                    type: string
                                    maxLength: 320
                                    format: email
                                  maxItems: 5
                                  description: Up to 5 literal blind-copy addresses.
                                attachments:
                                  type: array
                                  nullable: true
                                  items:
                                    type: object
                                    properties:
                                      sid:
                                        type: string
                                        minLength: 18
                                        maxLength: 18
                                        pattern: ^wf_at_
                                        description: >-
                                          A workflow attachment the team uploaded
                                          (create_workflow_attachment_upload_url).
                                      name:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                        description: The filename the receiver sees.
                                    required:
                                      - sid
                                      - name
                                    additionalProperties: false
                                  maxItems: 5
                                  description: >-
                                    Up to 5 library files sent with the email;
                                    the executor reads the bytes at send time.
                                reply_in_thread:
                                  type: boolean
                                  nullable: true
                                  description: >-
                                    True threads the send onto the prior email
                                    exchange.
                                track_opens:
                                  type: boolean
                                  nullable: true
                                track_clicks:
                                  type: boolean
                                  nullable: true
                                unsubscribe_link:
                                  type: boolean
                                  nullable: true
                              required:
                                - id
                                - type
                                - subject
                                - body
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                type:
                                  type: string
                                  enum:
                                    - wait
                                for:
                                  type: string
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long to pause the record before the next
                                    step - "45m" / "12h" / "14d" (replaces v3
                                    timer.duration_seconds).
                              required:
                                - id
                                - type
                                - for
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                type:
                                  type: string
                                  enum:
                                    - wait_for_event
                                event:
                                  type: string
                                  enum:
                                    - linkedin_connection_request_accepted
                                    - email_opened
                                    - email_link_clicked
                                  description: >-
                                    Event a wait_for_event step blocks on
                                    (observed via activities ingest).
                                timeout:
                                  type: object
                                  properties:
                                    after:
                                      type: string
                                      pattern: ^[1-9][0-9]*(m|h|d)$
                                      description: >-
                                        Timeout duration - bundled: a timeout
                                        path cannot exist without one.
                                    steps:
                                      type: array
                                      items:
                                        type: object
                                        additionalProperties: {}
                                        description: >-
                                          Recursive node: the same object shape
                                          repeats here. A static OpenAPI document
                                          cannot express the cycle, so this level
                                          is documented as an open object.
                                      description: >-
                                        Fallback sub-flow; [] = on timeout,
                                        continue as if the event fired; falls
                                        through to the parent chain unless it
                                        ends with `end`.
                                  required:
                                    - after
                                    - steps
                                  additionalProperties: false
                                  description: >-
                                    Required since 2026-10-11: a wait always has
                                    a time limit (a wait with no end is a stuck
                                    journey); steps: [] = on timeout, continue
                                    as if the event fired. The reply-pause
                                    machinery still applies (KNOWLEDGE §4.9).
                              required:
                                - id
                                - type
                                - event
                                - timeout
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - condition
                                branches:
                                  type: array
                                  items:
                                    type: object
                                    additionalProperties: {}
                                    description: >-
                                      Recursive node: the same object shape
                                      repeats here. A static OpenAPI document
                                      cannot express the cycle, so this level is
                                      documented as an open object.
                                  minItems: 1
                                  maxItems: 9
                                  description: >-
                                    1..9, evaluated in order, first match wins;
                                    the fired branch id lands on the condition
                                    task result (workflow_tasks.md).
                                else:
                                  type: array
                                  items:
                                    type: object
                                    additionalProperties: {}
                                    description: >-
                                      Recursive node: the same object shape
                                      repeats here. A static OpenAPI document
                                      cannot express the cycle, so this level is
                                      documented as an open object.
                                  description: >-
                                    REQUIRED no-match path (may be []); falls
                                    through unless it ends with `end`.
                              required:
                                - id
                                - type
                                - branches
                                - else
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - ab_test
                                branches:
                                  type: array
                                  items:
                                    type: object
                                    additionalProperties: {}
                                    description: >-
                                      Recursive node: the same object shape
                                      repeats here. A static OpenAPI document
                                      cannot express the cycle, so this level is
                                      documented as an open object.
                                  minItems: 2
                                  maxItems: 9
                                  description: >-
                                    2..9 weighted arms; the record is assigned
                                    to one deterministically by hashing its sid
                                    into the weight distribution
                                    (workflow_versions.md). No `else` - weights
                                    cover the whole distribution.
                              required:
                                - id
                                - type
                                - branches
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                type:
                                  type: string
                                  enum:
                                    - end
                              required:
                                - id
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - api_call
                                method:
                                  type: string
                                  enum:
                                    - GET
                                    - POST
                                    - PUT
                                    - PATCH
                                    - DELETE
                                  description: >-
                                    The request method. POST / PUT / PATCH carry
                                    the JSON body; GET / DELETE must publish
                                    with body null.
                                url:
                                  type: string
                                  minLength: 1
                                  maxLength: 2048
                                  description: >-
                                    https-only (publish check), max 2048. A
                                    template: {{people.*}} / {{company.*}} /
                                    {{record.<slug>}} / {{ai.<key>}} may stand
                                    in the path and the query and are
                                    URL-encoded where they stand.
                                headers:
                                  type: object
                                  nullable: true
                                  additionalProperties:
                                    type: string
                                    maxLength: 1024
                                  description: >-
                                    Up to 20 custom request headers; values are
                                    templates. Auth comes from
                                    provider_connection_sid, never from a
                                    literal here.
                                query:
                                  type: object
                                  nullable: true
                                  additionalProperties:
                                    type: string
                                    maxLength: 2048
                                  description: >-
                                    Up to 20 query parameters appended to the
                                    URL; values are templates.
                                body:
                                  type: string
                                  nullable: true
                                  maxLength: 16000
                                  description: >-
                                    A JSON body template with the variables
                                    INSIDE quotes ("{{people.full_name}}"),
                                    stood in JSON-safely at call time. null =
                                    the fixed payload {event, workflow_sid,
                                    workflow_record_sid, workflow_task_sid,
                                    step_id, people_sid, context}.
                                provider_connection_sid:
                                  type: string
                                  nullable: true
                                  minLength: 18
                                  maxLength: 18
                                  pattern: ^in_cn_
                                  description: >-
                                    A `custom` provider connection of the team
                                    (provider-connections.search filter
                                    provider=custom): the integration platform
                                    injects its auth (bearer / basic / header /
                                    query) when the call fires. null = no auth
                                    (a public API).
                                timeout_secs:
                                  type: integer
                                  nullable: true
                                  minimum: 1
                                  maximum: 120
                                  description: The call budget in seconds; null = 15.
                                retry_on_error:
                                  type: boolean
                                  nullable: true
                                  description: >-
                                    null/true: a 5xx, a 429, a timeout or an
                                    unreachable target earns a fresh attempt (3
                                    in all, with backoff); false: the record
                                    fails on the first error. A 4xx / auth
                                    refusal never retries.
                                remove_empty_values:
                                  type: boolean
                                  nullable: true
                                  description: >-
                                    true: empty rendered values leave the query
                                    and the body, so they never overwrite the
                                    receiver's data; null/false: sent as empty
                                    strings.
                                output_key:
                                  type: string
                                  nullable: true
                                  pattern: ^[a-z][a-z0-9_]{0,63}$
                                  description: >-
                                    The answer's name for the steps after this
                                    one (2026-10-11): a slug, unique within the
                                    version together with the ask_ai keys
                                    (publish check). Later steps read
                                    {{api.<output_key>.<path>}} (a dotted path
                                    into the decoded JSON answer) and condition
                                    leaves filter on api.<output_key>.<path>;
                                    the answer is kept on the done task row,
                                    capped at 64 KB. null = the answer is not
                                    kept.
                              required:
                                - id
                                - type
                                - method
                                - url
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - ask_ai
                                prompt:
                                  type: string
                                  minLength: 1
                                  maxLength: 8000
                                  description: >-
                                    Prompt template, 1..8000 - same variable
                                    namespaces as message templates.
                                output_key:
                                  type: string
                                  pattern: ^[a-z][a-z0-9_]{0,63}$
                                  description: >-
                                    Slug 1..64, unique within the version
                                    (publish check); later steps read
                                    {{ai.<output_key>}} and condition leaves
                                    filter on ai.<output_key>. Outputs live on
                                    the completed task row, never on records.
                                preset_sid:
                                  type: string
                                  nullable: true
                                  description: >-
                                    gtm-api preset for the AI call (external
                                    sid, opaque); null/omitted = team default
                                    (service KNOWLEDGE §1).
                              required:
                                - id
                                - type
                                - prompt
                                - output_key
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                type:
                                  type: string
                                  enum:
                                    - manual_task
                                title:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                  description: Todo title template, 1..255.
                                instructions:
                                  type: string
                                  nullable: true
                                  maxLength: 4000
                                  description: >-
                                    Rendered into the human todo, max 4000; the
                                    journey waits until the task is completed
                                    (workflow_tasks.md manual queue).
                              required:
                                - id
                                - type
                                - title
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - move_to_workflow
                                target_workflow_sid:
                                  type: string
                                  minLength: 18
                                  maxLength: 18
                                  pattern: ^wf_wf_
                                  description: >-
                                    Enroll the person into this campaign
                                    (wf_wf_…); reuses the existing record per
                                    the re-entry policy (workflow_records.md).
                                    THIS record then completes -
                                    terminal-for-this-record.
                                mode:
                                  type: string
                                  nullable: true
                                  enum:
                                    - from_start
                                    - from_current
                                  description: >-
                                    Re-entry mode when the person is ALREADY in
                                    the target (workflow_records.md, Re-entry):
                                    from_start (default; reset to the entry
                                    step) | from_current (resume the pinned
                                    step, else the entry step). A re-entry is
                                    loop-guarded at re_entered_count 10.
                              required:
                                - id
                                - type
                                - target_workflow_sid
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - add_tag
                                tag_sids:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 18
                                    maxLength: 18
                                    pattern: ^cr_tg_
                                    description: CRM tag sid (cr_tg_…).
                                  minItems: 1
                                  maxItems: 20
                                  description: >-
                                    1..20 CRM tags (cr_tg_…) attached to the
                                    person mid-flow, then falls through
                                    (tags.md).
                              required:
                                - id
                                - type
                                - tag_sids
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - remove_tag
                                tag_sids:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 18
                                    maxLength: 18
                                    pattern: ^cr_tg_
                                    description: CRM tag sid (cr_tg_…).
                                  minItems: 1
                                  maxItems: 20
                                  description: >-
                                    1..20 CRM tags (cr_tg_…) detached from the
                                    person mid-flow, then falls through.
                              required:
                                - id
                                - type
                                - tag_sids
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - set_field
                                field_slug:
                                  type: string
                                  pattern: ^[a-z][a-z0-9_]{0,63}$
                                  description: >-
                                    Playtable field slug to write
                                    (pipeline_stage is a scalar_select field -
                                    service KNOWLEDGE §3).
                                value:
                                  anyOf:
                                    - type: string
                                    - type: number
                                    - type: boolean
                                    - {}
                                    - {}
                                  description: >-
                                    Scalar cell value written for the person
                                    (one cell; no arrays/objects); null clears
                                    the field (playtable_field_values.md).
                              required:
                                - id
                                - type
                                - field_slug
                                - value
                              additionalProperties: false
                            - type: object
                              properties:
                                id:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    Server-assigned small int, unique across the
                                    whole document (steps + branch ids);
                                    immutable, never reused; user-facing in the
                                    editor tree.
                                name:
                                  type: string
                                  nullable: true
                                  maxLength: 255
                                  description: Editor label.
                                delay:
                                  type: string
                                  nullable: true
                                  pattern: ^[1-9][0-9]*(m|h|d)$
                                  description: >-
                                    How long the record waits at this step
                                    before it runs: "45m" / "12h" / "2d";
                                    null/omitted = runs as soon as it arrives.
                                    Not allowed on wait (use `for`),
                                    wait_for_event, manual_task, end.
                                type:
                                  type: string
                                  enum:
                                    - change_sender
                                sender_profile_sid:
                                  type: string
                                  nullable: true
                                  minLength: 18
                                  maxLength: 18
                                  pattern: ^ub_sp_
                                  description: >-
                                    Explicit forward-only re-pin of
                                    workflow_records.sender_profile_sid
                                    (ub_sp_…). Exactly one of the three shapes
                                    (publish check).
                                rotation:
                                  type: string
                                  nullable: true
                                  enum:
                                    - fair
                                    - random
                                    - new_sender
                                    - prior_engagement
                                  description: >-
                                    Re-pick the sender from the workflow pool by
                                    this strategy instead of a fixed sid,
                                    forward only. Exactly one of the three
                                    shapes (publish check).
                                rotations:
                                  type: array
                                  nullable: true
                                  items:
                                    type: object
                                    properties:
                                      sender_profile_sid:
                                        type: string
                                        nullable: true
                                        minLength: 18
                                        maxLength: 18
                                        pattern: ^ub_sp_
                                        description: >-
                                          The sender profile for this pass; null =
                                          the workflow's rotation strategy picks,
                                          never the sender profile the record
                                          already has. Must be in the workflow's
                                          pool (publish check).
                                      entry_step_id:
                                        type: integer
                                        nullable: true
                                        minimum: 0
                                        exclusiveMinimum: true
                                        description: >-
                                          A step id of THIS document to restart
                                          the journey from (publish check); null =
                                          the workflow's entry step.
                                    required:
                                      - sender_profile_sid
                                      - entry_step_id
                                    additionalProperties: false
                                  minItems: 1
                                  maxItems: 10
                                  description: >-
                                    The legacy gs_rotate_sender_profile list
                                    (D45): each pass through the node consumes
                                    the next entry and RESTARTS the journey from
                                    its entry step with its sender profile
                                    (touches start over;
                                    workflow_records.rotations_done is the
                                    cursor); past the end the journey continues.
                                    Exactly one of the three shapes (publish
                                    check).
                              required:
                                - id
                                - type
                              additionalProperties: false
                        description: >-
                          REQUIRED no-match path (may be []); falls through
                          unless it ends with `end`.
                    required:
                      - id
                      - type
                      - branches
                      - else
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - ab_test
                      branches:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              minimum: 1
                              description: >-
                                Server-assigned small int, unique across the
                                whole document (steps + branch ids); immutable,
                                never reused; user-facing in the editor tree.
                            label:
                              type: string
                              nullable: true
                              maxLength: 255
                              description: Editor caption ("Variant A").
                            weight:
                              type: integer
                              minimum: 1
                              description: >-
                                Relative weight (int >= 1; need not sum to 100).
                                Record assigned by crc32(record.sid) mod
                                sum(weights), first arm whose cumulative range
                                contains it (workflow_versions.md ab_test
                                algorithm).
                            steps:
                              type: array
                              items:
                                type: object
                                additionalProperties: {}
                                description: >-
                                  Recursive node: the same object shape repeats
                                  here. A static OpenAPI document cannot express
                                  the cycle, so this level is documented as an
                                  open object.
                              description: >-
                                Arm sub-flow; falls through to the ab_test
                                successor unless it ends with `end`.
                          required:
                            - id
                            - weight
                            - steps
                          additionalProperties: false
                        minItems: 2
                        maxItems: 9
                        description: >-
                          2..9 weighted arms; the record is assigned to one
                          deterministically by hashing its sid into the weight
                          distribution (workflow_versions.md). No `else` -
                          weights cover the whole distribution.
                    required:
                      - id
                      - type
                      - branches
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      type:
                        type: string
                        enum:
                          - end
                    required:
                      - id
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - api_call
                      method:
                        type: string
                        enum:
                          - GET
                          - POST
                          - PUT
                          - PATCH
                          - DELETE
                        description: >-
                          The request method. POST / PUT / PATCH carry the JSON
                          body; GET / DELETE must publish with body null.
                      url:
                        type: string
                        minLength: 1
                        maxLength: 2048
                        description: >-
                          https-only (publish check), max 2048. A template:
                          {{people.*}} / {{company.*}} / {{record.<slug>}} /
                          {{ai.<key>}} may stand in the path and the query and
                          are URL-encoded where they stand.
                      headers:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                          maxLength: 1024
                        description: >-
                          Up to 20 custom request headers; values are templates.
                          Auth comes from provider_connection_sid, never from a
                          literal here.
                      query:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                          maxLength: 2048
                        description: >-
                          Up to 20 query parameters appended to the URL; values
                          are templates.
                      body:
                        type: string
                        nullable: true
                        maxLength: 16000
                        description: >-
                          A JSON body template with the variables INSIDE quotes
                          ("{{people.full_name}}"), stood in JSON-safely at call
                          time. null = the fixed payload {event, workflow_sid,
                          workflow_record_sid, workflow_task_sid, step_id,
                          people_sid, context}.
                      provider_connection_sid:
                        type: string
                        nullable: true
                        minLength: 18
                        maxLength: 18
                        pattern: ^in_cn_
                        description: >-
                          A `custom` provider connection of the team
                          (provider-connections.search filter provider=custom):
                          the integration platform injects its auth (bearer /
                          basic / header / query) when the call fires. null = no
                          auth (a public API).
                      timeout_secs:
                        type: integer
                        nullable: true
                        minimum: 1
                        maximum: 120
                        description: The call budget in seconds; null = 15.
                      retry_on_error:
                        type: boolean
                        nullable: true
                        description: >-
                          null/true: a 5xx, a 429, a timeout or an unreachable
                          target earns a fresh attempt (3 in all, with backoff);
                          false: the record fails on the first error. A 4xx /
                          auth refusal never retries.
                      remove_empty_values:
                        type: boolean
                        nullable: true
                        description: >-
                          true: empty rendered values leave the query and the
                          body, so they never overwrite the receiver's data;
                          null/false: sent as empty strings.
                      output_key:
                        type: string
                        nullable: true
                        pattern: ^[a-z][a-z0-9_]{0,63}$
                        description: >-
                          The answer's name for the steps after this one
                          (2026-10-11): a slug, unique within the version
                          together with the ask_ai keys (publish check). Later
                          steps read {{api.<output_key>.<path>}} (a dotted path
                          into the decoded JSON answer) and condition leaves
                          filter on api.<output_key>.<path>; the answer is kept
                          on the done task row, capped at 64 KB. null = the
                          answer is not kept.
                    required:
                      - id
                      - type
                      - method
                      - url
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - ask_ai
                      prompt:
                        type: string
                        minLength: 1
                        maxLength: 8000
                        description: >-
                          Prompt template, 1..8000 - same variable namespaces as
                          message templates.
                      output_key:
                        type: string
                        pattern: ^[a-z][a-z0-9_]{0,63}$
                        description: >-
                          Slug 1..64, unique within the version (publish check);
                          later steps read {{ai.<output_key>}} and condition
                          leaves filter on ai.<output_key>. Outputs live on the
                          completed task row, never on records.
                      preset_sid:
                        type: string
                        nullable: true
                        description: >-
                          gtm-api preset for the AI call (external sid, opaque);
                          null/omitted = team default (service KNOWLEDGE §1).
                    required:
                      - id
                      - type
                      - prompt
                      - output_key
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      type:
                        type: string
                        enum:
                          - manual_task
                      title:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: Todo title template, 1..255.
                      instructions:
                        type: string
                        nullable: true
                        maxLength: 4000
                        description: >-
                          Rendered into the human todo, max 4000; the journey
                          waits until the task is completed (workflow_tasks.md
                          manual queue).
                    required:
                      - id
                      - type
                      - title
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - move_to_workflow
                      target_workflow_sid:
                        type: string
                        minLength: 18
                        maxLength: 18
                        pattern: ^wf_wf_
                        description: >-
                          Enroll the person into this campaign (wf_wf_…); reuses
                          the existing record per the re-entry policy
                          (workflow_records.md). THIS record then completes -
                          terminal-for-this-record.
                      mode:
                        type: string
                        nullable: true
                        enum:
                          - from_start
                          - from_current
                        description: >-
                          Re-entry mode when the person is ALREADY in the target
                          (workflow_records.md, Re-entry): from_start (default;
                          reset to the entry step) | from_current (resume the
                          pinned step, else the entry step). A re-entry is
                          loop-guarded at re_entered_count 10.
                    required:
                      - id
                      - type
                      - target_workflow_sid
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - add_tag
                      tag_sids:
                        type: array
                        items:
                          type: string
                          minLength: 18
                          maxLength: 18
                          pattern: ^cr_tg_
                          description: CRM tag sid (cr_tg_…).
                        minItems: 1
                        maxItems: 20
                        description: >-
                          1..20 CRM tags (cr_tg_…) attached to the person
                          mid-flow, then falls through (tags.md).
                    required:
                      - id
                      - type
                      - tag_sids
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - remove_tag
                      tag_sids:
                        type: array
                        items:
                          type: string
                          minLength: 18
                          maxLength: 18
                          pattern: ^cr_tg_
                          description: CRM tag sid (cr_tg_…).
                        minItems: 1
                        maxItems: 20
                        description: >-
                          1..20 CRM tags (cr_tg_…) detached from the person
                          mid-flow, then falls through.
                    required:
                      - id
                      - type
                      - tag_sids
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - set_field
                      field_slug:
                        type: string
                        pattern: ^[a-z][a-z0-9_]{0,63}$
                        description: >-
                          Playtable field slug to write (pipeline_stage is a
                          scalar_select field - service KNOWLEDGE §3).
                      value:
                        anyOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - {}
                          - {}
                        description: >-
                          Scalar cell value written for the person (one cell; no
                          arrays/objects); null clears the field
                          (playtable_field_values.md).
                    required:
                      - id
                      - type
                      - field_slug
                      - value
                    additionalProperties: false
                  - type: object
                    properties:
                      id:
                        type: integer
                        minimum: 1
                        description: >-
                          Server-assigned small int, unique across the whole
                          document (steps + branch ids); immutable, never
                          reused; user-facing in the editor tree.
                      name:
                        type: string
                        nullable: true
                        maxLength: 255
                        description: Editor label.
                      delay:
                        type: string
                        nullable: true
                        pattern: ^[1-9][0-9]*(m|h|d)$
                        description: >-
                          How long the record waits at this step before it runs:
                          "45m" / "12h" / "2d"; null/omitted = runs as soon as
                          it arrives. Not allowed on wait (use `for`),
                          wait_for_event, manual_task, end.
                      type:
                        type: string
                        enum:
                          - change_sender
                      sender_profile_sid:
                        type: string
                        nullable: true
                        minLength: 18
                        maxLength: 18
                        pattern: ^ub_sp_
                        description: >-
                          Explicit forward-only re-pin of
                          workflow_records.sender_profile_sid (ub_sp_…). Exactly
                          one of the three shapes (publish check).
                      rotation:
                        type: string
                        nullable: true
                        enum:
                          - fair
                          - random
                          - new_sender
                          - prior_engagement
                        description: >-
                          Re-pick the sender from the workflow pool by this
                          strategy instead of a fixed sid, forward only. Exactly
                          one of the three shapes (publish check).
                      rotations:
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            sender_profile_sid:
                              type: string
                              nullable: true
                              minLength: 18
                              maxLength: 18
                              pattern: ^ub_sp_
                              description: >-
                                The sender profile for this pass; null = the
                                workflow's rotation strategy picks, never the
                                sender profile the record already has. Must be
                                in the workflow's pool (publish check).
                            entry_step_id:
                              type: integer
                              nullable: true
                              minimum: 0
                              exclusiveMinimum: true
                              description: >-
                                A step id of THIS document to restart the
                                journey from (publish check); null = the
                                workflow's entry step.
                          required:
                            - sender_profile_sid
                            - entry_step_id
                          additionalProperties: false
                        minItems: 1
                        maxItems: 10
                        description: >-
                          The legacy gs_rotate_sender_profile list (D45): each
                          pass through the node consumes the next entry and
                          RESTARTS the journey from its entry step with its
                          sender profile (touches start over;
                          workflow_records.rotations_done is the cursor); past
                          the end the journey continues. Exactly one of the
                          three shapes (publish check).
                    required:
                      - id
                      - type
                    additionalProperties: false
              minItems: 1
              maxItems: 100
              description: >-
                Immutable chain-and-blocks snapshot: array order = execution
                order, entry = steps[0], root-array exhaustion completes the
                record; 1..100 steps TOTAL incl. nested, <=512 KB serialized.
                Step ids are stable across versions.
            steps_count:
              type: integer
              minimum: 1
              maximum: 100
              description: >-
                Denormalized total step count (incl. nested) at insert - lets
                lists/events skip the JSON.
            entry_step_id:
              type: integer
              minimum: 1
              description: >-
                = steps[0].id, denormalized at publish; every enrollment starts
                here.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: >-
                    The OAuth client that acted ("Claude", "n8n"); null for a
                    user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: >-
                    Why a system actor wrote the row (snapshot_capture_job,
                    ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: >-
                    Internal audit context: the grant set the actor held at
                    write time. Not a contract.
                cluster_id:
                  type: integer
                  nullable: true
                  description: 'Internal audit context: the cluster that served the write.'
                trace_id:
                  type: string
                  nullable: true
                  description: >-
                    Internal audit context: the trace id of the request that
                    wrote the row.
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: >-
                The PUBLISHER - actor of workflows.publish; answers "who shipped
                v7".
            created_at:
              type: string
              description: >-
                ISO 8601 UTC - the publish moment. No updated_at: the row never
                changes.
          required:
            - sid
            - team_sid
            - workflow_sid
            - version
            - steps
            - steps_count
            - entry_step_id
            - created_by
            - created_at
        included:
          type: object
          properties:
            workflow:
              type: object
              properties:
                sid:
                  type: string
                name:
                  type: string
                status:
                  type: string
                published_version_sid:
                  type: string
                  nullable: true
              required:
                - sid
                - name
                - status
                - published_version_sid
              description: >-
                Parent workflow (WorkflowDomain - entities/workflows.md):
                name/status + published_version_sid to check whether THIS row is
                the live pointer.
            workflow_records_counts:
              type: object
              properties:
                total_count:
                  type: integer
                  minimum: 0
                  description: Records pinned to this version.
                groups:
                  type: object
                  properties:
                    status:
                      anyOf:
                        - type: object
                          additionalProperties:
                            type: integer
                            minimum: 0
                        - type: array
                          items: {}
                      description: >-
                        Funnel by WorkflowRecordStatusEnum - non-terminal
                        buckets = "who is still running this version".
                  required:
                    - status
                  description: >-
                    Axes per WorkflowRecordGroupableFieldsEnum (canonical shape
                    - entities/workflow_records.md). PHP empty map serialises as
                    [].
              required:
                - total_count
                - groups
              description: >-
                Parent-include counts (§4.17) computed against
                {workflow_version_sid: parent.sid}: how many records are pinned
                to this version and in which statuses, without loading rows.
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: >-
                The team this call ran in (the token team, or the team_sid
                override). Null when unauthenticated; absent from pre-2026-08-20
                backends.
            actor_type:
              type: string
              nullable: true
              description: >-
                user | agent | api_key | system. Null when unauthenticated;
                absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    McpError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
                - nothing_to_update
                - not_found
                - relation_not_found
                - invalid_transition
                - limit_exceeded
                - payment_required
                - duplicate_rejected
                - conflict
                - delete_blocked
                - unauthorized
                - forbidden
                - rate_limited
                - internal_error
                - service_unavailable
                - not_implemented
            message:
              type: string
            recoverable:
              type: boolean
            suggestion:
              type: string
            field_errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    rule:
                      type: string
                    message:
                      type: string
                  required:
                    - rule
                    - message
            blockers:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: >-
                      Machine-readable blocker type (active_flow, pending_tasks,
                      …).
                  severity:
                    type: string
                    enum:
                      - hard
                      - soft
                    description: >-
                      hard = external action required; soft = acknowledge is
                      enough.
                  description:
                    type: string
                  entity_sid:
                    type: string
                    nullable: true
                  count:
                    type: integer
                  resolution:
                    type: string
                    description: 'Hard: tool name to call. Soft: code for acknowledge[].'
                  resolution_hint:
                    type: string
                required:
                  - type
                  - severity
                  - description
                  - entity_sid
                  - resolution
                  - resolution_hint
            context:
              type: object
              additionalProperties: {}
          required:
            - code
            - message
            - recoverable
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: >-
                The team this call ran in (the token team, or the team_sid
                override). Null when unauthenticated; absent from pre-2026-08-20
                backends.
            actor_type:
              type: string
              nullable: true
              description: >-
                user | agent | api_key | system. Null when unauthenticated;
                absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - error
  responses:
    McpClientError:
      description: >-
        MCP error envelope. `error.code` is one of validation_failed,
        nothing_to_update, not_found, relation_not_found, invalid_transition,
        limit_exceeded, payment_required, duplicate_rejected, conflict,
        delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/McpError'
    McpServerError:
      description: >-
        MCP error envelope with `error.code` internal_error or
        service_unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/McpError'
  securitySchemes:
    BearerJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token issued by gs.service.id. Its `access_identity` claim
        carries `team_sid`, `actor_sid` and `actor_type`, and that team scope is
        authoritative.
    TeamSid:
      type: apiKey
      in: header
      name: Team-SID
      description: >-
        Team scope for tokens that do not carry one. Ignored when the token
        already names a team.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.