Apply and run a pipeline
Apply resource files with the CLI and control the tapstate pipeline lifecycle
Use this guide for CLI authoring and automation. For the web workflow, see Build a pipeline.
apply validates resource files and stores them on the server. Lifecycle
commands then request the state that the runtime converges toward. Applying a
changed pipeline does not restart its active run.
Before you begin
- Validate the workspace locally.
- Register the required connector JARs.
- Apply and test source and target connections from the server environment.
- Use a non-production data set for the preview.
See Register and test connectors for the preceding sequence.
Apply the workspace
Start an authenticated session in the workspace:
tapstate -w workconnect http://127.0.0.1:8080
login admin
applyWith no operand, apply sends the workspace as one batch. To apply one file or directory:
apply source/orders_source.tap.ymlThe server reparses and validates each draft. The result reports:
CREATEDfor a new artifact;UPDATEDwhen canonical content changed;UNCHANGEDwhen the stored content hash already matches.
Some checks require the source's discovered schema and therefore run only on
the server. If apply returns dsl.upsert-needs-key, every selected source table
written with the default upsert mode needs a discovered primary key. Discover
the source again and select keyed tables, or use append only when the delivery
is insert-only. A unique index or tables[].pk does not satisfy this runtime
check.
Confirm the server-held resources:
ls
get orders_source
get orders_to_operational_stateLocal files remain authoring input; connected get and ls show the stored
resources. Source configuration is omitted from generic artifact output to
protect credentials; this output is not a complete configuration backup.
Start the pipeline
start orders_to_operational_state
status orders_to_operational_state --watchstart writes a RUNNING intent at the latest applied pipeline revision. status --watch reports observed runtime state, which can lag the command briefly.
Verify data at the destination. A lifecycle command succeeding proves that the intent was accepted, not that rows arrived.
Lifecycle transitions
| Command | Legal starting state | Target state | Progress behavior |
|---|---|---|---|
start | NEW, STOPPED, COMPLETED | RUNNING | Starts at the latest applied revision, using retained progress when available. |
pause | RUNNING | PAUSED | Retains the current revision and in-run progress. |
resume | PAUSED | RUNNING | Continues from retained progress. Compatible edits can rebuild the run at the latest revision. |
stop | RUNNING, PAUSED, FAILED | STOPPED | Asks for confirmation, then clears this pipeline's recovery position and operator state. |
stop --keep-state | RUNNING, PAUSED, FAILED | STOPPED | Retains recovery positions and operator state for the next run. |
An illegal transition returns lifecycle.illegal-transition. If edits cannot
reuse a paused pipeline's state, resume returns
lifecycle.incompatible-revision. Review the change and decide whether the
next run can retain state or needs a full reload.
A lifecycle request can be accepted before the runtime finishes the transition.
Before starting again, wait for the status API's observedState to reach
STOPPED.
Plain stop clears state. Use --keep-state when you intend to continue from
retained progress. To accept clearing in a script, use stop <id> -y.
Clearing leaves this pipeline without a recovery position. Shared capture state is cleared only when its last dependent pipeline clears state, so stopping one consumer does not guarantee a full source reload. Neither choice deletes existing destination rows; reconcile them with your chosen write strategy. See State and storage.
Recover a failed pipeline deliberately:
logs orders_to_operational_state
stop orders_to_operational_state --keep-state
start orders_to_operational_stateDo not start directly from FAILED. Keeping state does not repair an invalid
recovery position; investigate recovery diagnostics before retrying or clearing
progress.
Verify the outcome
Use all three evidence types:
statusreaches the expected state;metricsandlogsshow active work without unresolved errors;- source and destination queries show the expected snapshot and later insert, update, and delete behavior.
The server retains recovery positions and durable operator state. A restart can resume from a retained position and replay records; it does not provide exactly-once delivery. Snapshot-only reads may restart their load. Retaining a checkpoint is safe only while its corresponding operator state is also retained. See State and storage and Configure a cluster.