---
title: "Update workflow source"
method: PATCH
path: "/api/workflow-sources/{sid}"
tags: ["workflow_sources"]
---

# Update workflow source

`PATCH /api/workflow-sources/{sid}`

## Request

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

Rename, toggle auto_add, repoint view_sid (type=view) or replace filter (type=filter) - a payload key that does not match the source's immutable type → 422. Takes effect next poll cycle; turning auto_add on enqueues an immediate sweep. Already-enrolled records are never touched - entry is one-way (removal = workflow-records exit). Use {auto_add:false} to stop new entries while journeys keep running (NOT workflows pause - that freezes dispatch). Archived parent → 409 conflict.

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

## Path parameters

- `sid` string, required: Workflow source sid (wf_sr_…).

## Request body

- UpdateWorkflowSourceRequest: Request body of `update_workflow_source`.
  - `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': type=event only: replace the enrolling activity type.
  - `name` string, nullable: New label; null clears it.
  - `auto_add` boolean: Poller toggle. Turning it on enqueues an immediate sweep; true on a manual source → 422.
  - `view_sid` string: Repoint a type=view source at another live view (pt_vw_…). Sent on a non-view source → 422; cannot be nulled - a view source always points at a view.
  - `filter` union: Full replace of a type=filter source's AST (not a merge). Sent on a non-filter source → 422. The next cycle honors it; already-enrolled records untouched.
    - 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
            - string
            - number
            - boolean
        - `nin` union[]: Value not in list, 1..100 scalars.
          - union
            - string
            - number
            - boolean
        - `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.
  - `active_limit` integer, nullable: Enrollment throttle: max simultaneous in-flight records from this source; null clears it (unlimited). Lowering below current in-flight evicts no one - new entries just wait.
  - `coworkers_limit` integer, nullable: Enrollment throttle: max simultaneous in-flight records from this source per company; null clears it (unlimited).

## Response `200`

`update` success envelope.

- UpdateWorkflowSourceResponse
  - `success` true, required
  - `operation` 'update', 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.
            - 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).
  - `updated_fields` string[], required
  - `previous_values` object, required
  - `kept_fields` string[]: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
  - `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)
