Processing Flow
Configuration
Add apreprocessor section to the pipeline configuration:
Fields
Synchronous Mode
In synchronous mode (async: false), the pipeline POSTs the data to the endpoint and waits for the response. The response replaces the pipeline data (with batchSize > 0, the stitched responses do — see Batching).
Request Payload
header and rows are omitted and rawData contains the raw content (null fields are left out of the payload rather than sent as null).
Expected Response
Return the (optionally modified) data in the same format:header, rows, or rawData you leave out of the response keeps its original value.
You can modify, add, or remove rows. The pipeline continues with whatever data is returned. If you return an error field, processing is aborted:
Batching
By default (batchSize = 0) the pipeline makes exactly one call carrying every row, and that call has to fit in memory (it is subject to PIPELINE_MATERIALIZE_MAX_MB). Set batchSize to a positive number to send row-based (CSV) payloads in batches of that many rows, one call per batch, in source order, streamed from disk. Each batched request carries the same envelope plus two extra top-level fields, batch (1-based) and ofBatches, and its data.rows holds only that batch. Every response is read exactly like the single-call response — data.rows replaces that batch’s rows, and a response that leaves rows out keeps them — and the results are stitched, in call order, into the data the pipeline continues with. The header from the first response that carries one applies to the whole payload. JSON/XML payloads and async callbacks are unaffected by batchSize beyond one callback being awaited per batch.
Asynchronous Mode
In asynchronous mode (async: true), the pipeline POSTs the data and then waits for a callback rather than using the response directly. This is useful for long-running preprocessing tasks.
Flow
- Pipeline POSTs data to the preprocessor endpoint
- Preprocessor returns immediately (e.g.,
200 OK) - Preprocessor processes data in the background
- Preprocessor POSTs the result back to the pipeline’s callback endpoint
- Pipeline resumes with the returned data
Callback Endpoint
The preprocessor sends the result to:pipelineToken must match the token from the original request so the pipeline can correlate the callback with the waiting job.
If the callback is not received within timeoutMs milliseconds, the pipeline aborts with a timeout error.
Example: Preprocessor Service
A complete working example is provided inexamples/preprocessor/app.py. This Python Flask application implements both synchronous and asynchronous preprocessing:
