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

# Complete workflow task

> Close a manual task (pending to done); the note lands in result.note and the record advances. Any other type or status is 409; a repeat answers already_completed true. A question a play asked is answered with choice: remove ends the journey, keep lets it go on, move ends it and puts the person into workflow_sid, add puts an unenrolled person there. Skipping an automated step is cancel_workflow_task; a play's draft is approve_workflow_task.

Contract:
- MCP tool `complete_workflow_task`, registry package `mcp.playtables/workflow_tasks`, mount `playtables.journeys`.
- Operation `action`, response envelope `action`.
- Flags: none.



## OpenAPI

````yaml /api-reference/playtables/openapi.yaml post /api/workflow-tasks/{sid}/complete
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/{sid}/complete:
    post:
      tags:
        - workflow_tasks
      summary: Complete workflow task
      description: >-
        Close a manual task (pending to done); the note lands in result.note and
        the record advances. Any other type or status is 409; a repeat answers
        already_completed true. A question a play asked is answered with choice:
        remove ends the journey, keep lets it go on, move ends it and puts the
        person into workflow_sid, add puts an unenrolled person there. Skipping
        an automated step is cancel_workflow_task; a play's draft is
        approve_workflow_task.


        Contract:

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

        - Operation `action`, response envelope `action`.

        - Flags: none.
      operationId: complete_workflow_task
      parameters:
        - name: sid
          in: path
          required: true
          description: Workflow task sid (wf_tk_…).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^wf_tk_
            description: Workflow task sid (wf_tk_…).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompleteWorkflowTaskRequest'
      responses:
        '200':
          description: '`action` success envelope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteWorkflowTaskResponse'
        4XX:
          $ref: '#/components/responses/McpClientError'
        5XX:
          $ref: '#/components/responses/McpServerError'
components:
  schemas:
    CompleteWorkflowTaskRequest:
      type: object
      description: Request body of `complete_workflow_task`.
      properties:
        note:
          type: string
          maxLength: 2000
          description: >-
            Outcome note - stored in result.note and in the
            manual_task_completed activity payload.
        choice:
          type: string
          enum:
            - remove
            - keep
            - move
            - add
          description: >-
            A play's question (act.do = ask): one of act.options. remove = the
            journey ends; keep = it goes on; move = it ends and the person
            enters workflow_sid (default: the act's target); add = a person in
            no journey enters workflow_sid. Required on a question.
        workflow_sid:
          type: string
          minLength: 18
          maxLength: 18
          pattern: ^wf_wf_
          description: >-
            The workflow a move or an add puts the person into, when the act
            names none.
    CompleteWorkflowTaskResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          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
        result:
          type: object
          properties:
            already_completed:
              type: boolean
              description: >-
                true = idempotent repeat on an already-done manual task (no side
                effects; activity is null).
            activity:
              type: object
              nullable: true
              additionalProperties: {}
              description: >-
                Full manual_task_completed row (ActivityDomain -
                entities/activities.md; §4.12a embed); null on idempotent repeat
                and on a play's question.
            updated_workflow_record:
              type: object
              nullable: true
              additionalProperties: {}
              description: >-
                The owning record AFTER the advance (WorkflowRecordDomain -
                entities/workflow_records.md): current_step_id / status show
                what happens next. A question about a journey: that record after
                the choice; null for a question about a person in no journey.
          required:
            - already_completed
            - activity
            - updated_workflow_record
        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
        - action
        - item
        - result
        - 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.