---
title: "Search workflow sources"
method: POST
path: "/api/workflow-sources/search"
tags: ["workflow_sources"]
---

# Search workflow sources

`POST /api/workflow-sources/search`

## Request

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

List a workflow's audience feeds with their entry counters - the "why did only 80 of 120 enter" surface (entered_count vs blocked_*_count per row). Scope with filter.workflow_sid; filter.view_sid answers "which workflows feed from view X". include=workflow_records_counts adds each source's downstream status funnel; include=view hydrates the pointed view. page_size:0 = counts only. Per-person entry state / journey position is workflow-records search, not here.

Contract:
- MCP tool `search_workflow_sources`, registry package `mcp.playtables/workflow_sources`, mount `playtables.workflows`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchWorkflowSourcesRequest: Request body of `search_workflow_sources`.
  - `filter` object: Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row.
    - `sid` object: Prefix-validated wf_sr_ sid(s).
      - `eq` string: Workflow source sid (wf_sr_…).
      - `in` string[]
    - `workflow_sid` object: Primary scope - the audience feeds of one campaign (wf_wf_…).
      - `eq` string
      - `in` string[]
    - `type` object: view | filter | manual.
      - `eq` 'view' | 'filter' | 'manual' | 'event'
      - `ne` 'view' | 'filter' | 'manual' | 'event'
      - `in` string[]
      - `nin` string[]
    - `auto_add` object: true = live feeds; false = dormant pointers + manual buckets.
      - `eq` boolean
    - `view_sid` object: Reverse lookup: "which workflows feed from this view" (pt_vw_…).
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `q` string: Free text over name (MySQL LIKE prefix/infix).
    - `created_at` object: ISO 8601 range; combine bounds in one object.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `deleted_at` object: Default scope is { is_null: true } (live feeds).
      - `gte` string
      - `lte` string
      - `is_null` boolean
  - `include` string[]: Relations to attach to every item; omit for the bare rows.
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'created_at' | 'name', required: The column to order by.
    - `direction` 'asc' | 'desc': asc or desc; default desc.
  - `page_size` integer: 0..500, default 50; 0 = counts only, 1 = the first row.
  - `cursor` string, nullable: pagination.next_cursor of the previous page.

## Response `200`

`search` success envelope.

- SearchWorkflowSourcesResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, 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.
              - …
            - `ne` union: Scalar inequality. ne: null is rejected - use is_null.
              - …
            - `in` union[]: Value in list, 1..100 scalars.
              - …
            - `nin` union[]: Value not in list, 1..100 scalars.
              - …
            - `gt` union: Greater than; string operand = ISO 8601 datetime.
              - …
            - `gte` union: >= bound; pair with lte in the SAME op for a range.
              - …
            - `lt` union: Less than; string operand = ISO 8601 datetime.
              - …
            - `lte` union: <= bound; pair with gte in the SAME op for a range.
              - …
            - `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).
    - `included` object, required
      - `workflow` object: Parent WorkflowDomain (1:1 via workflow_sid) - see ./workflows.md.
        - `sid` string, required
      - `view` object, nullable: PlaytableViewDomain (1:1 via view_sid); null unless type=view - see ./playtable_views.md.
        - `sid` string, required
      - `workflow_records_counts` object: WorkflowRecordCounts computed over { entered_via_source_sid: parent.sid } - the status funnel of everyone who entered through this source, without loading rows (§4.17 parent-include) - see ./workflow_records.md.
        - `total_count` integer, required
        - `groups` object, required
          - `status` union, required: Downstream journey funnel keyed by WorkflowRecordStatusEnum.
            - object
            - unknown[]
              - …
  - `pagination` object, required
    - `next_cursor` string, nullable, required
    - `has_more` boolean, required
    - `total_count` integer, nullable, required
  - `applied_filters` object, required
  - `includes` string[], required
  - `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.
  - `counts` object
    - `total_count` integer, required: Source rows matching the filter scope.
    - `groups` object, required
      - `type` union, required: Feed distribution across the three source types; absent key = zero (PHP empty map serialises as []).
        - object
          - `view` integer
          - `filter` integer
          - `manual` integer
        - unknown[]
          - unknown
      - `auto_add` union, required: Live feeds vs dormant pointers/manual buckets (JSON object keys are strings); absent key = zero (PHP empty map serialises as []).
        - object
          - `true` integer
          - `false` integer
        - unknown[]
          - unknown
      - `workflow_sid` union, required: Sources-per-workflow map keyed by wf_wf_ sid; PHP serialises an empty map as [].
        - object
        - unknown[]
          - unknown

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