Data FlowData Flow
DataFlow
  • User Manual
  • Developer Manual
  • Examples
  • API Reference
Overview
Getting Started
Pipeline Authoring
Execution
    Execution LifecycleBatch vs StreamCheckpoints and OffsetsSchedules
Deployment
Troubleshooting
Examples
Execution

Checkpoints and Offsets

Three mechanisms track "where a pipeline left off", and they follow one rule: everything commits only after a fully successful run. A failed or killed run leaves the pipeline exactly where it was.

At a glance

  • One commit rule - offsets and step state advance only after the entire run succeeds.
  • Offsets - incremental batch watermarks, one row per source asset.
  • Checkpoints - streaming position and state, one per destination output.
  • Step state - Parquet state files for stateful batch transforms.
MechanismUsed byStored where
Asset offsetincremental batch sourcespipeline_source_offsets table
Spark checkpointsstreaming pipelinescheckpoints dir / object prefix
Step statestateful batch transformsParquet state files per step

Asset offsets

Offsets make batch reads incremental. Declare one on an asset; each run reads only rows past the stored watermark and stores the new high-water mark:

Code
assets: - name: orders_asset table: public.orders offset: key: ts initial_value: "2024-01-20 00:00:00" type: timestamp

Fields: key (the column, or file_modified / file_name for files), initial_value (the starting watermark), and type (see Sources for the accepted values; internally each normalizes to TIMESTAMP, INTEGER, STRING, or CURSOR). APIs also take an optional response_key + format (iso8601, epoch_millis, epoch_seconds, or a pattern).

How each family applies the watermark is covered in Sources - JDBC pushes it into SQL, NoSQL filters after the read, files use modification times or names, and APIs send it as request parameters.

Commit semantics

The offset lifecycle per run:

  1. Load - current offsets are read before sources
  2. Update in memory - each read produces a new high-water mark
  3. Commit once - after the entire run succeeds, all offsets are written in one go

If any stage fails, the run is killed, or the run is a no-op (an asset read 0 rows with no declared schema:) - nothing commits. The next run re-reads from the previous watermark. Rows may be processed twice on failure (at-least-once), but they are never skipped.

Where they live

One row per (pipeline, source, asset) in the pipeline_source_offsets table - offset_key, offset_key_type, offset_value, updated_at. Inspect them directly in PostgreSQL:

Code
SELECT source_name, asset_name, offset_key, offset_value, updated_at FROM pipeline_source_offsets WHERE pipeline_id = '<pipelineId>' ORDER BY updated_at DESC;

Spark checkpoints

Streaming pipelines don't use the offsets table - their position and state live in Spark structured streaming checkpoints, one query per destination output:

SettingLocation
Default{checkpoints_dir}/{pipeline}_{dest}_{output}_chk
Customoutput option checkpoint_location
Object backends3a://{bucket}/{base_prefix}/checkpoints/…

Checkpoints carry everything a streaming query needs to resume: consumed source positions, stateful transform state, and sink state. Kill the run, start it again, and it resumes from the checkpoint - nothing is reprocessed and nothing is lost.

Delivery semantics depend on the sink:

SinkSemantics
Idempotent sinks (e.g. JDBC upsert by keys)effectively exactly-once
Other sinksat-least-once per micro-batch

Stream sources never declare asset offset or chain - the checkpoint is the single source of truth for their position.

Step state

The stateful transforms - aggregate, forward_fill, gap_fill with state.enabled: true - keep cross-run state so results accumulate over runs instead of restarting:

ModeState storage
batchParquet state file per step, under the pipeline-state dir
streamSpark checkpointed state (with the query checkpoints)

Batch state is written atomically (staged, then swapped - with a backup kept for rollback) only after all destinations succeed. On failure it is discarded entirely: a run that dies mid-way leaves state exactly as the last successful run left it, and the next run picks up from there.

Code
- type: aggregate group_by: [customer_id] columns: - name: lifetime_value expr: "sum(amount)" state: enabled: true

What happens when a run dies

EventOffsetsStep stateCheckpoints
Run succeedscommittedcommittedadvanced
Run failsunchangeddiscarded(stream) unchanged
Run killedunchangeddiscarded(stream) unchanged
No-op rununchanged--

Backfilling a missed range

There is no automatic backfill: a schedule that came due while the platform was down fires once and advances, and offsets only move forward. Editing an asset's offset.initial_value does not rewind an established pipeline either - the committed watermark takes precedence over the starting value in the spec.

To reprocess a time range, run a separate, unscheduled pipeline bounded by an explicit query:

backfill_orders.yaml
pipeline: backfill_orders_q1 mode: batch sources: - name: sales_db type: jdbc provider: postgres settings: connection_name: sales_db assets: - name: orders_q1 query: | SELECT * FROM public.orders WHERE ts >= '2026-01-01' AND ts < '2026-04-01' builds: - name: base from: sources.sales_db.orders_q1 destinations: - name: warehouse type: jdbc provider: postgres settings: connection_name: warehouse outputs: - name: orders from: builds.base mode: upsert table: warehouse.orders keys: [order_id]

No offset is declared - the query bounds the range. Keep the backfill pipeline's schedule disabled, write with upsert (or overwrite) so re-read rows do not duplicate, and work in bounded ranges so each run is easy to monitor and retry.

Related pages

  • Execution Lifecycle - statuses, failure, and kill behavior
  • Batch vs Stream - which mechanism applies to your pipeline
  • Sources - declaring offsets per source family
  • Transforms - stateful steps and their options
  • Destinations - checkpoint_location per output
Suggest edit
Last modified on November 26, 2026
Batch vs StreamSchedules
On this page
  • At a glance
  • Asset offsets
    • Commit semantics
    • Where they live
  • Spark checkpoints
  • Step state
  • What happens when a run dies
  • Backfilling a missed range
  • Related pages
YAML
YAML
YAML