Multifile Extraction in Workflows
Multifile extraction is not limited to standalone /extract_runs calls. A workflow can accept a package of files and run one extraction across all of them, with validation, review, and routing applied to the combined result.
For the core concept, the package parameter, and the response shape, start with Multifile Extraction. This page covers what changes when you run it inside a workflow.
How it works
A standard workflow run takes one file and processes it end to end. A package run takes 2 to 50 files and processes them as a single unit, producing one workflow run.
Inside that run, a Collect step gathers all the files, and any Extract step placed downstream of Collect performs a multifile extraction: one extraction, one output object, shared context across every file in the package.
- You submit a package of 2 to 50 files against a workflow.
- Extend creates one workflow run containing every file.
- The Trigger and Parse steps run once per file. Each file is parsed independently.
- The Collect step waits for every file to finish upstream processing, then accumulates them into a single step run.
- Every step downstream of Collect runs in multi-file mode. An Extract step there receives all collected files at once and performs a single multifile extraction.
- Downstream Validation, Router, Human Review, and Webhook Response steps operate on that one combined result.
Configure the workflow
Add a COLLECT step between your parse step and the extract step.
Quick start
Python
TypeScript
Java
Go
cURL
Steps accumulate on the workflow’s draft. Deploy a version before running it. See Workflow Versioning.
Start a package run
Use package instead of file on POST /workflow_runs. The two are mutually exclusive. You can mix file URLs and file IDs in the same package.
Python
TypeScript
Java
Go
cURL
For the full list of package constraints (file count, accepted input shapes, duplicates, and outputs), see Package runs.
Response
A package run returns a single workflow_run object. Workflow runs always expose a files array, so the response shape does not change between single-file and package runs. For a package run, that array holds every file you submitted, in submission order.
Inside the run:
- The Parse step has one step run per file.
- The Extract step has a single step run whose extraction run covers the whole corpus. Its
fileisnulland itsfilesarray lists every input file in order. output.valueis one object for the entire package.- Citations carry a
fileIdso you can trace each extracted value back to the source document. See Citations and file provenance for the field shape.
In the dashboard, the workflow run review screen shows a tab per step. The extraction tab shows the single combined output with per-file citations.
Comparison
Use a package run when the answer spans documents. Use batch runs when the documents are independent and you want a result per file.

