Job State Management

This page deails job states and state transitions.

Use the following endpoint to change a job's state:

PATCH /api/pipelines/{pipeline_id}/components/{step_id}/jobs/{job_id}/state/{job_state}

Where

  • pipeline_id,step_id The pipeline and component ids of the pipeline that will execute the job
  • job_id The id of the job being updated.

Use these state values: not_ready, ready, scheduled, running, succeeded, failed, disabled, cancelled, and deleted.

State values are case-insensitive; not_ready and NotReady are equivalent. Repeating a request for the job's current state succeeds without changing it.

State Definitions

StateMeaning
not_readyThe job is retained but not eligible to run. Use while a job needs review, configuration, or a deliberate pause before scheduling.
readyThe job is enabled and waiting for its next execution to be arranged.
scheduledThe job has an upcoming execution time.
runningAn execution is currently in progress.
succeededA one-time job completed successfully. Periodic jobs normally schedule their next run instead of entering this state.
failedA one-time job completed unsuccessfully. Periodic jobs normally schedule their next run instead of entering this state.
disabledA recurring job is deliberately disabled and will not run again unless re-enabled.
cancelledThe job has been stopped. It will not be scheduled again.
deletedThe job has been removed from the active lifecycle. This is a terminal state.

The normal system-managed lifecycle is:

  • One-time: ready -> scheduled -> running -> succeeded or failed
  • Periodic: ready -> scheduled -> running -> scheduled for the next run

"OneTime" Job States

Current stateStates you can request
not_readyready, cancelled
readynot_ready, cancelled
schedulednot_ready, cancelled
runningcancelled
succeededready, deleted
failedready, deleted
disabledready, deleted
cancelledNone
deletedNone

Notes:

  • disabled is not a state that can be requested for a one-time job, though an existing disabled one-time job can be re-enabled or deleted.
  • Re-requesting ready after succeeded or failed allows the job to run again.
  • Cancelling a running job will not interrupt work already in progress. No new work will be scheduled, and the job will terminate once all in-flight work has completed.

"Periodic" Job States

This applies to Periodic and the other recurring job types.

Current stateStates you can request
not_readyready, disabled, cancelled
readynot_ready, disabled, cancelled
schedulednot_ready, disabled, cancelled
runningnot_ready, disabled, cancelled
succeededready, deleted
failedready, deleted
disabledready, deleted
cancelledNone
deletedNone

Notes:

  • Use disabled for a reversible pause of a recurring job.
  • Use not_ready to take a job out of service before re-enabling it with ready.
  • cancelled and deleted are terminal through this state-change endpoint.
  • A periodic job normally returns to scheduled after an execution, ready for its next run.

Did this page help you?