Bulk-update documents matching a filter
wflow_bulk_update_documentsBulk update documents matching a query by applying a single partial patch across one or all organizations, with a dry-run mode for safe testing.
Instructions
Find every document matching a wflow query (optionally across organizations) and apply the SAME partial patch to each. This powers requests like 'set all documents with order Z01 to cost centre Centrála'.
SAFETY: runs as a DRY RUN by default (apply=false) — it returns the matched documents and the patch that would be applied, but changes nothing. Re-run with apply=true to execute.
patch is a partial DocumentUpdate merged with each document's id, e.g. {accounting:{costCenter:{code:"CENTRALA"}}}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | false = dry run (default); true = actually write. | |
| patch | Yes | Partial DocumentUpdate applied to every matched document. | |
| query | Yes | wflow filter selecting the documents to change, e.g. `orderNo = "Z01"`. | |
| maxItems | No | Cap on documents processed per org. | |
| ignoreLock | No | Unlock locked documents to apply the patch. | |
| organization | No | Single organization slug. Defaults to WFLOW_ORG. | |
| organizations | No | Explicit list of org slugs (cross-organization). | |
| allOrganizations | No | Operate over ALL accessible organizations. |