Replaying runs and steps
Re-run pipelines or individual steps using artifacts from a previous execution.
A replay re-executes a pipeline or step using the same input artifacts (and parameters) as a previous run. This is useful when you want to:
Debug a failed step without re-running the entire pipeline.
Re-run a pipeline after a code fix, skipping steps that already succeeded.
Test local changes against production data by replaying in debug mode.
Replaying a pipeline
Replay a pipeline either from local pipeline code (.replay()) or directly via the server (Client().replay_pipeline_run(...)).
ZenML resolves the run to replay using the first match:
pipeline_run— replay that exact run.pipeline— replay the latest run of that pipeline name/ID.Neither — replay the latest run whose name matches the current pipeline instance.
from zenml import pipeline, step
@step
def load_data() -> dict:
...
@step
def train(data: dict) -> None:
...
@pipeline
def training_pipeline(data: dict):
train(data=load_data())
# Replay the latest run of this pipeline
training_pipeline.replay()
# Replay a specific run
training_pipeline.replay(pipeline_run="run_name_or_id")Skipping steps
You can skip steps that don't need to be re-executed. Skipped steps reuse their output artifacts from the original run.
Overriding pipeline parameters
Pass input_overrides to change parameters for the replayed run. Any parameters you don't override are carried over from the original run.
Pass parameters in the run configuration to override pipeline parameters.
Overriding step inputs
Use step_input_overrides to replace specific step inputs for a replayed pipeline run.
step_input_overrides expects a mapping of invocation_id -> input_name -> value.
For server-side replay, step_input_overrides values can be either:
UUIDs of existing artifact versions (no new upload), or
inline values (server uploads them to the active artifact store before replay starts).
Overriding an input for every invocation of a step
If you want to override inputs for every invocation of a step, you can use step_default_input_overrides. It is keyed by the step's name instead of the invocation ID. Per-invocation overrides in step_input_overrides take precedence per input key.
Replaying a single step
Call .replay() on any @step-decorated function. ZenML loads the original input artifacts, feeds them to your (potentially updated) step code, and runs it as a single-step pipeline on the active stack.
The step to replay is resolved using the first match:
step_run_id— replay that exact step run.pipeline_run+ optionalinvocation_id— find the step in that run.pipeline+ optionalinvocation_id— find the step in the latest run of that pipeline.
Overriding inputs
You can replace any of the original input artifacts with new values:
Using invocation_id
If a step appears more than once in a pipeline, specify which invocation to replay:
Debug mode
Both pipeline and step replays accept debug=True. This runs the replay on a local orchestrator while keeping the rest of your active stack (artifact store, etc.), so you can iterate quickly without waiting for remote infrastructure.
Last updated
Was this helpful?