---
title: "Add people to workflow source"
method: POST
path: "/api/workflow-sources/{sid}/add-people"
tags: ["workflow_sources"]
---

# Add people to workflow source

`POST /api/workflow-sources/{sid}/add-people`

## Request

- Base URL: `https://beta.getsales.io/playtables/v1`
- URL: `https://beta.getsales.io/playtables/v1/api/workflow-sources/{sid}/add-people`
- Auth: HTTP bearer and API key in header `Team-SID`

Add specific people to a workflow through a manual source - THE "add selected to campaign" surface (valid on type=manual sources only; create one first if none exists). Runs the full entry pipeline synchronously per person, reading MySQL (never ES): person exists → not stoplisted (stoplist_entries + people.status) → within active_limit / coworkers_limit (over-cap people WAIT). A NEW person gets a workflow_records row pinned to the published version, sender pinned by rotation_strategy; a person ALREADY in the workflow is RE-ENTERED (existing record reused + reset to the top - deliberate re-run). Requires a published version (422 invalid_transition) and a non-archived workflow (409 conflict).

All-or-nothing input: any unknown people_sid → 422 relation_not_found and nobody is enrolled - resolve sids via people search first. NOT idempotent for already-enrolled people: each call re-runs them. result = THIS call's counts (entered / re_entered / blocked_stoplisted / blocked_limit / blocked_other) - relay them ("4 entered, 1 re-run, 1 blocked: stoplisted"); item = the source row after the call.

When NOT: a living audience that keeps growing (create a view/filter source with auto_add:true); removing an enrolled person (workflow-records exit); importing new contacts into the CRM (data-sources).

Contract:
- MCP tool `add_workflow_source_people`, registry package `mcp.playtables/workflow_sources`, mount `playtables.workflows`.
- Operation `action`, response envelope `action`.
- Flags: none.

## Path parameters

- `sid` string, required: Manual source (wf_sr_…, type=manual) - any other type → 422 validation_failed.

## Request body

- AddWorkflowSourcePeopleRequest: Request body of `add_workflow_source_people`.
  - `people_sids` string[], required: 1..500 people (cr_pp_…). Any unknown sid → 422 relation_not_found and the WHOLE call is rejected (nothing partial).
  - `restart` 'from_start' | 'from_current', nullable: People ALREADY in the workflow. Omitted: a terminal record restarts from_start, an in-flight one is skipped (skipped_in_flight_count). from_start | from_current also re-run in-flight records (from_current: the pinned step); terminal ones restart anyway.

## Response `200`

`action` success envelope.

- AddWorkflowSourcePeopleResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` object, nullable, required
    - `sid` string, required: Source sid (wf_sr_…).
    - `team_sid` string, required: Owning team (ts_tm_…, external - gs.service.id).
    - `workflow_sid` string, required: [ro] Parent workflow (wf_wf_…) - see ./workflows.md.
    - `view_sid` string, nullable, required: Audience view (pt_vw_…) - set on type=view only, null otherwise; repointable via update - see ./playtable_views.md.
    - `name` string, nullable, required: Optional label ("Conference batch"), max 255; null = unlabeled.
    - `type` 'view' | 'filter' | 'manual' | 'event', required: [ro] view = playtable view membership | filter = inline AST | manual = hand-picked people. Immutable - repoint = delete + create.
    - `event` 'linkedin_connection_request_accepted' | 'linkedin_message_replied' | 'linkedin_inmail_replied' | 'email_replied' | 'email_opened' | 'email_link_clicked' | 'linkedin_invitation_received' | 'linkedin_followed' | 'website_visited' | 'website_key_page_visited' | 'website_form_submitted', nullable: type=event only: the activity type that enrolls a person (required at create for an event source, 422 otherwise); null on the other types.
    - `filter` union, required: Inline audience AST (type=filter only, null otherwise) over the team's people; ES resolves membership, record.<slug> leaves resolve per person's playtable (missing slug ⇒ false).
      - object
        - `and` object[], required
      - object
        - `or` object[], required
      - object
        - `not` object, required: 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.
      - object
        - `any` object, required
          - `path` string, required: Array-valued path - the only way to reach inside an array.
          - `where` object, required: 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.
      - object
        - `field` string, required: Namespaced path: built-in people attribute or "record.<slug>" resolved per person's playtable (missing slug ⇒ leaf false); element-relative inside any.where.
        - `op` object, required
          - `eq` union: Scalar equality. eq: null is rejected - use is_null.
            - string
            - number
            - boolean
          - `ne` union: Scalar inequality. ne: null is rejected - use is_null.
            - string
            - number
            - boolean
          - `in` union[]: Value in list, 1..100 scalars.
            - union
              - …
          - `nin` union[]: Value not in list, 1..100 scalars.
            - union
              - …
          - `gt` union: Greater than; string operand = ISO 8601 datetime.
            - number
            - string
          - `gte` union: >= bound; pair with lte in the SAME op for a range.
            - number
            - string
          - `lt` union: Less than; string operand = ISO 8601 datetime.
            - number
            - string
          - `lte` union: <= bound; pair with gte in the SAME op for a range.
            - number
            - string
          - `is_null` boolean: true = absent-or-null; false = present and non-null.
          - `contains` string: Case-insensitive substring match.
          - `not_contains` string: Negated case-insensitive substring match.
          - `contains_any` string[]: 1..50 strings; true when ANY is a ci substring.
          - `not_contains_any` string[]: 1..50 strings; true when NONE is a ci substring.
          - `starts_with` string: Case-insensitive prefix match.
      - unknown
    - `auto_add` boolean, required: Poller toggle (view/filter): true = every cycle (~10 min) ES lists current audience members and MySQL decides entry; false = dormant pointer. Always false on manual.
    - `active_limit` integer, nullable, required: Max simultaneous in-flight (non-terminal) records entered via THIS source; null = unlimited. Reached => new candidates wait (blocked_limit_count).
    - `coworkers_limit` integer, nullable, required: Max simultaneous in-flight records from THIS source for people of the SAME company; null = unlimited. Reached for a company => that company's candidates wait.
    - `entered_count` integer, required: [ro] Total workflow_records ever inserted via this source - monotonic on ALL types (cache of the entered_via_source_sid count).
    - `blocked_stoplisted_count` integer, required: [ro] Stoplist entry blocks. view/filter: LIVE backlog gauge, recomputed each poll cycle over current audience members (un-stoplisted people drop out and enter); manual: cumulative per call.
    - `blocked_duplicate_in_workflow_count` integer, required: [ro] Poller-only: candidates skipped as already enrolled in this workflow via ANY source (auto_add never re-enters). view/filter: live gauge per poll cycle; ~0 on manual (add-people re-enters instead).
    - `blocked_limit_count` integer, required: [ro] Candidates WAITING because active_limit / coworkers_limit is reached this cycle; they enter automatically once a slot frees. view/filter: live gauge; manual: cumulative per call.
    - `blocked_other_count` integer, required: [ro] Blocked as deleted/missing/otherwise ineligible people. view/filter: live gauge per poll cycle; manual: cumulative per call.
    - `last_evaluated_at` string, nullable, required: [ro] Last poll cycle (view/filter) or last add-people / inline-create batch (manual); ISO 8601 UTC, null = never evaluated.
    - `created_by` object, required: Actor that attached the feed (AccessIdentityValue).
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `deleted_by` object, nullable, required: Actor that soft-deleted the feed (own verb or workflows.delete cascade); null while live.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
    - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live (soft delete - the poller gates on it).
  - `result` object, required
    - `entered_count` integer, required: NEW workflow_records inserted by THIS call.
    - `re_entered_count` integer, required: People already in the workflow RE-ENTERED THIS call - existing record reused + reset (deliberate re-run - workflow_records.md re-entry policy). A TERMINAL record is always restarted (from_start); an IN-FLIGHT record is restarted only when `restart` is passed.
    - `skipped_in_flight_count` integer, required: SKIPPED THIS call: an IN-FLIGHT (active/waiting/paused*) record was left running because no `restart` mode was passed (founder re-entry model §5). Not a duplicate block - the live journey is untouched.
    - `blocked_stoplisted_count` integer, required: Blocked THIS call: stoplist_entries hit or people.status=stoplisted.
    - `blocked_limit_count` integer, required: WAITED THIS call: active_limit / coworkers_limit reached (not enrolled, re-tried when a slot frees).
    - `blocked_other_count` integer, required: Blocked THIS call: person deleted or otherwise ineligible.
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: 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` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.

## Other responses

- `4XX`: 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.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/revisions/aa394506515d?raw)
