> ## 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.

# Search workflow tasks

> One row per step of one record's journey, the execution ledger, and a play's acts. Person timeline: filter people_sid (open statuses = the plan, terminal = history). Manual queue: type eq manual_task, status eq pending, assignee_user_sid. Needs me: initiator eq play, status eq pending; the acts under one event: trigger_activity_sid. counts.groups is the funnel; page_size 0 = counts only. Not for message bodies (search_messages).

Contract:
- MCP tool `search_workflow_tasks`, registry package `mcp.playtables/workflow_tasks`, mount `playtables.journeys`.
- Operation `search`, response envelope `search`.
- Flags: read only.



## OpenAPI

````yaml /api-reference/playtables/openapi.yaml post /api/workflow-tasks/search
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-tasks/search:
    post:
      tags:
        - workflow_tasks
      summary: Search workflow tasks
      description: >-
        One row per step of one record's journey, the execution ledger, and a
        play's acts. Person timeline: filter people_sid (open statuses = the
        plan, terminal = history). Manual queue: type eq manual_task, status eq
        pending, assignee_user_sid. Needs me: initiator eq play, status eq
        pending; the acts under one event: trigger_activity_sid. counts.groups
        is the funnel; page_size 0 = counts only. Not for message bodies
        (search_messages).


        Contract:

        - MCP tool `search_workflow_tasks`, registry package
        `mcp.playtables/workflow_tasks`, mount `playtables.journeys`.

        - Operation `search`, response envelope `search`.

        - Flags: read only.
      operationId: search_workflow_tasks
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchWorkflowTasksRequest'
      responses:
        '200':
          description: '`search` success envelope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchWorkflowTasksResponse'
        4XX:
          $ref: '#/components/responses/McpClientError'
        5XX:
          $ref: '#/components/responses/McpServerError'
components:
  schemas:
    SearchWorkflowTasksRequest:
      type: object
      description: Request body of `search_workflow_tasks`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^wf_tk_
                  description: Workflow task sid (wf_tk_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^wf_tk_
                    description: Workflow task sid (wf_tk_…).
              additionalProperties: false
              description: >-
                Task sid(s), wf_tk_ prefix - also the point-lookup path (no get
                tool).
            initiator:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - workflow_record
                    - play
                    - user
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - workflow_record
                      - play
                      - user
              additionalProperties: false
              description: >-
                Who bore the task (2026-10-14). Needs me = { eq: "play" } with
                status eq pending: the drafts and questions waiting in the
                Signals feed.
            play_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^pt_pl_
                  description: Play sid (pt_pl_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^pt_pl_
                    description: Play sid (pt_pl_…).
                is_null:
                  type: boolean
              additionalProperties: false
              description: One play's acts (pt_pl_…); is_null:true = a journey's tasks.
            trigger_activity_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^cr_ac_
                  description: Activity (fact) sid (cr_ac_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^cr_ac_
                    description: Activity (fact) sid (cr_ac_…).
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                The acts under one event (cr_ac_…): what a play left waiting or
                did on that fact.
            workflow_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^wf_wf_
                  description: Workflow sid (wf_wf_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^wf_wf_
                    description: Workflow sid (wf_wf_…).
              additionalProperties: false
              description: Per-campaign execution view (wf_wf_…).
            workflow_record_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^wf_rc_
                  description: Workflow record sid (wf_rc_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^wf_rc_
                    description: Workflow record sid (wf_rc_…).
              additionalProperties: false
              description: One record's task history (wf_rc_…).
            people_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^cr_pp_
                  description: Person sid (cr_pp_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^cr_pp_
                    description: Person sid (cr_pp_…).
              additionalProperties: false
              description: >-
                Person timeline (cr_pp_…); resolve names via people search
                first.
            sender_profile_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_sp_
                  description: Sender profile sid (ub_sp_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^ub_sp_
                    description: Sender profile sid (ub_sp_…).
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                Per-sender queue/load (ub_sp_…); is_null:true =
                orchestration-class.
            step_id:
              type: object
              properties:
                eq:
                  type: integer
                  minimum: 0
                in:
                  type: array
                  items:
                    type: integer
                    minimum: 0
              additionalProperties: false
              description: >-
                Step drill-down - meaningful only combined with a workflow_sid
                filter.
            type:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - linkedin_send_connection_request
                    - linkedin_send_message
                    - linkedin_send_inmail
                    - linkedin_visit_profile
                    - linkedin_endorse_skills
                    - linkedin_withdraw_connection_request
                    - email_send
                    - wait
                    - wait_for_event
                    - condition
                    - api_call
                    - ask_ai
                    - manual_task
                    - linkedin_like_latest_post
                    - linkedin_comment_latest_post
                    - ab_test
                    - move_to_workflow
                    - add_tag
                    - remove_tag
                    - set_field
                    - change_sender
                    - run_column
                ne:
                  type: string
                  enum:
                    - linkedin_send_connection_request
                    - linkedin_send_message
                    - linkedin_send_inmail
                    - linkedin_visit_profile
                    - linkedin_endorse_skills
                    - linkedin_withdraw_connection_request
                    - email_send
                    - wait
                    - wait_for_event
                    - condition
                    - api_call
                    - ask_ai
                    - manual_task
                    - linkedin_like_latest_post
                    - linkedin_comment_latest_post
                    - ab_test
                    - move_to_workflow
                    - add_tag
                    - remove_tag
                    - set_field
                    - change_sender
                    - run_column
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - linkedin_send_connection_request
                      - linkedin_send_message
                      - linkedin_send_inmail
                      - linkedin_visit_profile
                      - linkedin_endorse_skills
                      - linkedin_withdraw_connection_request
                      - email_send
                      - wait
                      - wait_for_event
                      - condition
                      - api_call
                      - ask_ai
                      - manual_task
                      - linkedin_like_latest_post
                      - linkedin_comment_latest_post
                      - ab_test
                      - move_to_workflow
                      - add_tag
                      - remove_tag
                      - set_field
                      - change_sender
                      - run_column
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - linkedin_send_connection_request
                      - linkedin_send_message
                      - linkedin_send_inmail
                      - linkedin_visit_profile
                      - linkedin_endorse_skills
                      - linkedin_withdraw_connection_request
                      - email_send
                      - wait
                      - wait_for_event
                      - condition
                      - api_call
                      - ask_ai
                      - manual_task
                      - linkedin_like_latest_post
                      - linkedin_comment_latest_post
                      - ab_test
                      - move_to_workflow
                      - add_tag
                      - remove_tag
                      - set_field
                      - change_sender
                      - run_column
              additionalProperties: false
              description: 'Manual queue = { eq: "manual_task" }.'
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - pending
                    - scheduled
                    - dispatched
                    - done
                    - failed
                    - skipped
                    - skipped_reply
                    - skipped_stoplisted
                    - cancelled
                    - expired
                ne:
                  type: string
                  enum:
                    - pending
                    - scheduled
                    - dispatched
                    - done
                    - failed
                    - skipped
                    - skipped_reply
                    - skipped_stoplisted
                    - cancelled
                    - expired
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - scheduled
                      - dispatched
                      - done
                      - failed
                      - skipped
                      - skipped_reply
                      - skipped_stoplisted
                      - cancelled
                      - expired
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - scheduled
                      - dispatched
                      - done
                      - failed
                      - skipped
                      - skipped_reply
                      - skipped_stoplisted
                      - cancelled
                      - expired
              additionalProperties: false
              description: Open = pending | scheduled | dispatched; the rest are terminal.
            assignee_user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                "My manual tasks" scope (external user sid); is_null:true =
                unassigned team queue.
            error_code:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Failure triage on failed | expired rows.
            scheduled_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: '"What dispatches in the next hour" - ISO 8601 bounds.'
            finished_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Executed-history window; is_null:true = still open.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: Planning window, ISO 8601.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: 'Default scope is { is_null: true } (live rows).'
          description: >-
            Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt |
            lt | is_null}}; q inside it is free text. Omit for every row.
        include:
          type: array
          items:
            type: string
            enum:
              - people
              - workflow_record
              - workflow
              - sender_profile
              - eta
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - scheduled_at
                - finished_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchWorkflowTasksResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: >-
                      Task sid (wf_tk_…) - one row per step of a journey, kept
                      across retries; rides gtm's rows as client_reference.
                  team_sid:
                    type: string
                    description: Owning team (ts_tm_…, external - gs.service.id).
                  workflow_sid:
                    type: string
                    nullable: true
                    description: >-
                      Parent workflow (wf_wf_…), denormalized for gates and
                      filters. null on a play's task, unless it is a question
                      about a journey (2026-10-14).
                  workflow_version_sid:
                    type: string
                    nullable: true
                    description: >-
                      Pinned version (wf_vr_…); (workflow_version_sid, step_id)
                      resolves the step definition. null on a play's task.
                  workflow_record_sid:
                    type: string
                    nullable: true
                    description: >-
                      Owning record (wf_rc_…) - the person×workflow journey this
                      task executes one step of. On a play's task only the
                      journey its question is about, else null.
                  people_sid:
                    type: string
                    description: >-
                      The person (cr_pp_…), denormalized for the person
                      timeline.
                  step_id:
                    type: integer
                    nullable: true
                    description: >-
                      Step id within the pinned version (small int,
                      server-assigned, unique per workflow). null on a play's
                      task.
                  type:
                    type: string
                    enum:
                      - linkedin_send_connection_request
                      - linkedin_send_message
                      - linkedin_send_inmail
                      - linkedin_visit_profile
                      - linkedin_endorse_skills
                      - linkedin_withdraw_connection_request
                      - email_send
                      - wait
                      - wait_for_event
                      - condition
                      - api_call
                      - ask_ai
                      - manual_task
                      - linkedin_like_latest_post
                      - linkedin_comment_latest_post
                      - ab_test
                      - move_to_workflow
                      - add_tag
                      - remove_tag
                      - set_field
                      - change_sender
                      - run_column
                    description: >-
                      Step kind copied at planning: 7 send-class (Messaging) + 6
                      orchestration-class values.
                  attempt:
                    type: integer
                    description: >-
                      Which attempt the row is on (>= 1; the executor's own
                      retries stop at 3, a human retry_workflow_task may go past
                      it). A retry re-arms the SAME row: attempt+1, the outcome
                      before it archived in previous_attempts, the sid kept.
                  status:
                    type: string
                    enum:
                      - pending
                      - scheduled
                      - dispatched
                      - done
                      - failed
                      - skipped
                      - skipped_reply
                      - skipped_stoplisted
                      - cancelled
                      - expired
                    description: >-
                      Execution state; terminal = done | failed | skipped |
                      skipped_reply | skipped_stoplisted | cancelled | expired.
                      skipped = nothing to do (error_code already_invited: an
                      invite from the sender profile is pending;
                      already_connected: the person is a connection) and the
                      record moved on.
                  initiator:
                    type: string
                    enum:
                      - workflow_record
                      - play
                      - user
                    description: >-
                      workflow_record = one step of one record's journey (every
                      task until 2026-10-14); play = a play's act on a fact: a
                      draft waiting in Signals, a scheduled send, a question
                      about a journey; user = a person's act by hand on an event
                      of the feed (2026-10-15, act_on_activity): a Like, a
                      comment, a message.
                  play_sid:
                    type: string
                    nullable: true
                    description: >-
                      The play that bore the task (pt_pl_…); null on a journey's
                      task.
                  trigger_activity_sid:
                    type: string
                    nullable: true
                    description: >-
                      The fact a play's or a person's task answers (cr_ac_…: a
                      birthday, a job change, a post, a visit, any event a
                      person acted on by hand): the join from an event to the
                      act waiting or done under it; a play never acts on one
                      fact twice. On a journey's task only a wait the event
                      woke, or (2026-10-15) a Like or comment naming the post
                      its read picked; else null.
                  act:
                    type: object
                    nullable: true
                    properties:
                      do:
                        type: string
                        enum:
                          - send_message
                          - add_to_workflow
                          - like
                          - comment
                          - ask
                        description: >-
                          What the task does: a LinkedIn message
                          (variables_snapshot.message), the person entering
                          target_workflow_sid, a reaction on post_urn, a comment
                          under post_urn (variables_snapshot.comment), a
                          question (options).
                      about:
                        type: string
                        enum:
                          - birthday
                          - work_anniversary
                          - job_change
                          - post
                          - website_visit
                          - event
                        description: >-
                          The fact kind the act answers; event = a person's act
                          by hand on a kind no play answers (an accept, a
                          profile view, a follow).
                      actor_sid:
                        type: string
                        description: >-
                          A person's act by hand (initiator user, 2026-10-15):
                          who pressed it, the caller's actor sid.
                      target_workflow_sid:
                        type: string
                        description: >-
                          add_to_workflow, and a question whose move or add
                          names one.
                      post_urn:
                        type: string
                        description: >-
                          like, comment: the post the act goes to (an activity
                          URN).
                      reaction:
                        type: string
                        description: >-
                          like: the reaction as the network names it (like,
                          celebrate, support, love, insightful, funny), the
                          play's own or the one the AI picked from the post.
                      options:
                        type: array
                        items:
                          type: string
                          enum:
                            - remove
                            - keep
                            - move
                            - add
                        description: >-
                          ask: the choices complete_workflow_task takes. remove
                          | keep | move about a journey the play paused; add for
                          a person in no journey.
                      suggested:
                        type: string
                        enum:
                          - remove
                          - keep
                          - move
                          - add
                        description: >-
                          ask: the choice the play's own Do would have made
                          (remove for Remove from every workflow, move for Move
                          to a workflow), shown first; absent for pause-and-ask.
                    required:
                      - do
                      - about
                    description: >-
                      A play's act frozen at birth (what the task does, the post
                      or workflow it names, a question's options); null on a
                      journey's task.
                  sender_profile_sid:
                    type: string
                    nullable: true
                    description: >-
                      Sending identity (ub_sp_…) - send-class only; pinned at
                      planning, re-stamped at dispatch. null =
                      orchestration-class.
                  assignee_user_sid:
                    type: string
                    nullable: true
                    description: >-
                      manual_task only: assignee user sid (external -
                      gs.service.id, prefix TBD); fallback = sender profile
                      assignee; null = team queue.
                  scheduled_at:
                    type: string
                    nullable: true
                    description: >-
                      ISO 8601 UTC - when the dispatcher may act; doubles as the
                      manual_task due hint. null for pending-born types.
                  timeout_at:
                    type: string
                    nullable: true
                    description: >-
                      ISO 8601 UTC - wait_for_event only: give-up clock for the
                      timeout edge.
                  dispatched_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC - stamped on scheduled → dispatched.
                  expires_at:
                    type: string
                    nullable: true
                    description: >-
                      ISO 8601 UTC - dispatched commands only; the executor
                      refuses to START after it (send-class: dispatch+24h,
                      ask_ai: +1h).
                  finished_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC - stamped once on any terminal status.
                  variables_snapshot:
                    type: object
                    nullable: true
                    additionalProperties:
                      type: string
                    description: >-
                      Resolved template variables frozen at dispatch (people.* /
                      record.<slug> / ai.* keys) - send-class + ask_ai only.
                  result:
                    type: object
                    nullable: true
                    additionalProperties: {}
                    description: >-
                      Terminal outcome payload, keys per type (message_sid,
                      branch_id, next_step_id, output, note, …). A failure on
                      the sender profile's browser adds error_cause
                      (proxy_failed, linkedin_session, …) and cause_owner
                      (client: the team fixes it; support: we do).
                  error_code:
                    type: string
                    nullable: true
                    description: >-
                      Machine reason token when status = failed | expired (max
                      64), or skipped (already_invited, already_connected).
                      send_unconfirmed: gtm-api could not tell for a day whether
                      the send went out, so it may have reached the person (see
                      retry_workflow_task).
                  error_message:
                    type: string
                    nullable: true
                    description: Human detail of the failure (max 1024); null on a skip.
                  previous_attempts:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        attempt:
                          type: integer
                          description: The attempt number it was.
                        status:
                          type: string
                          enum:
                            - pending
                            - scheduled
                            - dispatched
                            - done
                            - failed
                            - skipped
                            - skipped_reply
                            - skipped_stoplisted
                            - cancelled
                            - expired
                          description: >-
                            How it ended: failed | expired | skipped_stoplisted
                            (the retryable outcomes).
                        error_code:
                          type: string
                          nullable: true
                          description: Its reason token.
                        error_message:
                          type: string
                          nullable: true
                        result:
                          type: object
                          nullable: true
                          additionalProperties: {}
                          description: >-
                            Its result payload, when it had one (an api_call's
                            http_status; a browser failure's error_cause and
                            cause_owner).
                        dispatched_at:
                          type: string
                          nullable: true
                          description: ISO 8601 UTC.
                        finished_at:
                          type: string
                          nullable: true
                          description: ISO 8601 UTC.
                      required:
                        - attempt
                        - status
                        - error_code
                        - error_message
                        - result
                        - dispatched_at
                        - finished_at
                    description: >-
                      The outcomes this row was re-armed past, oldest first (a
                      retry, the executor's own or a person's, keeps the row and
                      archives the attempt here); null until the first retry.
                  created_at:
                    type: string
                    description: ISO 8601 UTC - the planning moment.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: >-
                      ISO 8601 UTC - set ONLY by the owning record's cascade (no
                      delete verb on this entity); null = live.
                required:
                  - sid
                  - team_sid
                  - workflow_sid
                  - workflow_version_sid
                  - workflow_record_sid
                  - people_sid
                  - step_id
                  - type
                  - attempt
                  - status
                  - initiator
                  - play_sid
                  - trigger_activity_sid
                  - act
                  - sender_profile_sid
                  - assignee_user_sid
                  - scheduled_at
                  - timeout_at
                  - dispatched_at
                  - expires_at
                  - finished_at
                  - variables_snapshot
                  - result
                  - error_code
                  - error_message
                  - previous_attempts
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                properties:
                  people:
                    type: object
                    additionalProperties: {}
                    description: The person row (PeopleDomain - entities/people.md), 1:1.
                  workflow_record:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Owning record (WorkflowRecordDomain -
                      entities/workflow_records.md), 1:1.
                  workflow:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Parent workflow (WorkflowDomain - entities/workflows.md),
                      1:1 - campaign name for queue cards.
                  sender_profile:
                    type: object
                    nullable: true
                    additionalProperties: {}
                    description: >-
                      Sending identity (SenderProfileDomain -
                      entities/sender_profiles.md), 1:1; null for
                      orchestration-class tasks.
                  eta:
                    type: object
                    nullable: true
                    properties:
                      eta_at:
                        type: string
                        nullable: true
                        description: >-
                          ISO 8601 UTC. A send: the minute the sender profile
                          pick is expected to hand it off, laid over the send
                          window. A wait: when it will be decided, never before
                          the timeout pass reads it again (a sync that is
                          overdue backs off, up to a day). Null while the
                          account does not sync at all, or the journey is
                          paused.
                      position:
                        type: integer
                        nullable: true
                        description: >-
                          A send: 1-based position in its (sender profile,
                          action type) bucket's order. A wait: null.
                      days_ahead:
                        type: integer
                        nullable: true
                        description: >-
                          A send: whole days of the bucket's cap ahead of it. A
                          wait: calendar days from today (UTC).
                      waits_for:
                        type: string
                        enum:
                          - deadline
                          - linkedin_sync
                          - journey
                          - send_outcome
                        description: >-
                          What the time waits for. A wait: linkedin_sync = an
                          accept wait is decided on the account's first
                          connections sync after the wait ends, which can be
                          days later (2026-09-27). A send: send_outcome =
                          gtm-api could not confirm whether the last attempt
                          went out, and eta_at is the next time it is asked, not
                          a send; it goes out again only on gtm's proof that it
                          did not (2026-10-04).
                      account_status:
                        type: string
                        nullable: true
                        enum:
                          - reconnect_required
                          - disconnected
                          - stopped
                        description: >-
                          A wait only: the sender profile's LinkedIn state when
                          the account does not sync at all (eta_at is null
                          then).
                      journey_status:
                        type: string
                        enum:
                          - paused_on_reply
                          - paused_manual
                          - paused_blocked
                        description: 'waits_for journey only: the pause that holds the wait.'
                      expires_at:
                        type: string
                        nullable: true
                        description: >-
                          ISO 8601 UTC. waits_for linkedin_sync: when the wait
                          fails (wait_expired, the journey with it) if its
                          account never syncs its connections, 30 days past the
                          wait's deadline. waits_for send_outcome: when the step
                          fails send_unconfirmed for a person if gtm-api still
                          cannot tell, a day after the doubt began. Null for
                          every other task.
                    required:
                      - eta_at
                      - position
                      - days_ahead
                    description: >-
                      When a planned task is expected to run, computed on read:
                      the sender profile scheduler's estimate for a scheduled
                      send-class task (or, for a send in doubt, when gtm-api is
                      asked again about its last attempt), and for a pending
                      wait with a deadline when it will be decided (an accept
                      wait after its account's connections sync past the
                      deadline) or the pause that holds it. Null for every other
                      task.
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        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
        counts:
          type: object
          properties:
            total_count:
              type: integer
              minimum: 0
              description: Tasks matching the filter (full filter scope, not the page).
            groups:
              type: object
              properties:
                status:
                  anyOf:
                    - type: object
                      additionalProperties:
                        type: number
                    - type: array
                      items: {}
                  description: Execution funnel by WorkflowTaskStatusEnum (9 values).
                type:
                  anyOf:
                    - type: object
                      additionalProperties:
                        type: number
                    - type: array
                      items: {}
                  description: Step-kind mix by WorkflowTaskTypeEnum (13 values).
                workflow_sid:
                  anyOf:
                    - type: object
                      additionalProperties:
                        type: number
                    - type: array
                      items: {}
                  description: Per-campaign task load, keyed by wf_wf_ sid.
                sender_profile_sid:
                  anyOf:
                    - type: object
                      additionalProperties:
                        type: number
                    - type: array
                      items: {}
                  description: >-
                    Per-sender queue depth; the "null" bucket =
                    orchestration-class.
                error_code:
                  anyOf:
                    - type: object
                      additionalProperties:
                        type: number
                    - type: array
                      items: {}
                  description: >-
                    Failure triage ("what is breaking"), keyed by error_code or
                    "null".
              required:
                - status
                - type
                - workflow_sid
                - sender_profile_sid
                - error_code
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - 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.