Execution Lifecycle
Runs are asynchronous: triggering a pipeline returns 202 Accepted with a runId immediately, the Spark driver executes in the background, and everything about the run - status, stages, row counts, samples, logs - is observable through the API.
At a glance
- Asynchronous - trigger returns
202 Acceptedwith arunId; the driver runs in the background. - Five statuses -
PENDING, thenRUNNING, then a terminalSUCCESS,FAILED, orCANCELLED. - Observable through the API - stages, row counts, samples, logs, and the executed spec snapshot.
Triggering a run
| Path | What it does |
|---|---|
POST /api/pipelines/{id}/exec | Runs a saved pipeline |
POST /api/pipelines/save-and-exec | Creates the pipeline and runs it in one call |
| Scheduler | Fires due schedules automatically (attributed to the system user) |
POST /api/local/run | Local profile only - runs in-process Spark |
Every submission path checks the license first, then creates a PipelineRun row and submits the job to the Spark Master REST API (/v1/submissions/create) with the engine jar and arguments --spec, --pipelineParams, --runId. Spec execution.settings override the Spark submit defaults for that run.
Statuses
A run moves from PENDING to RUNNING to one terminal state; the control plane reconciles active runs against Spark every 30 seconds:
| Status | Meaning |
|---|---|
PENDING | Run row created, submission in flight |
RUNNING | Spark driver executing |
SUCCESS | All stages done - offsets and state committed |
FAILED | A stage failed - state discarded, offsets unchanged |
CANCELLED | Killed via the API |
What happens during a run
The driver reports progress straight to PostgreSQL - not back through the API:
RUNNINGis set when the driver starts- Sources read, builds join, transforms apply, destinations write - each stage emits start/success/failure events with row counts and a 5-row sample
- On success: stateful step state commits, offsets commit, run completes as
SUCCESS - On failure: state is discarded, the run ends as
FAILEDwith the failing stage named in the error
The control plane reconciles status on its own schedule - every 30 seconds (pipeline.run-status-checker.interval-ms) it polls Spark for every RUNNING run:
| Spark driver state | Run status |
|---|---|
FINISHED | SUCCESS |
FAILED / ERROR | FAILED |
KILLED | CANCELLED |
RUNNING / SUBMITTED / ACCEPTED | no change |
Stages
Every run tracks its stages by FQN - sources.<s>.<a>, builds.<b>, transforms.<t>, destinations.<d>.<o> - each with a status (RUNNING / SUCCESS / FAILED), output row count, failure reason, and a lineage sample:
Code
Killing a run
Code
The app kills the Spark submission and marks the run CANCELLED; stages still RUNNING are marked FAILED. Terminal runs (SUCCESS, FAILED, CANCELLED) refuse the kill. Because the run never completed, offsets and state are not committed.
Run history
Every run snapshots the exact spec that executed - updates create new immutable versions, so history stays accurate:
Code
Read status from the runs list - the single-run status endpoint is not implemented yet. Filter with status, startedAtFrom/To, or just read the latest entry.
Driver logs
Code
Parameters: stream (stdout | stderr), tail (last N lines, default 2000), grep (filter). While a run is RUNNING, poll every 3-5 seconds with a tail; when it reaches a terminal status, fetch the final logs once.
When driver-log archiving is enabled (object/single modes), logs are read from the archive first - final logs, then live snapshots, then the Spark Master UI proxy - so logs stay readable after the containers are gone.
Failure semantics
| Event | Offsets | Stateful step state |
|---|---|---|
| Run succeeds | committed | committed |
| Run fails | unchanged | discarded |
| Run killed | unchanged | discarded |
A failed or killed run leaves the pipeline exactly where it was - the next run re-reads from the previous watermark (at-least-once). See Checkpoints and Offsets.
Related pages
- Checkpoints and Offsets - commit semantics in depth
- Schedules - cron triggers and missed-run behavior
- Batch vs Stream - run behavior per mode
- Execution Settings - Spark resources per run
- Common Errors - decoding failed runs
- API Reference - the full runs surface