acoustic-carpenter-78188
04/05/2026, 2:53 AM# Replay remotely with original task template
flyte.replay("my-run-name")
# Replay a specific action within a run
flyte.replay("my-run-name", action_name="a1")
# Replay with updated code
flyte.replay("my-run-name", task_template=my_updated_task)
# Replay locally (requires a task_template with executable code)
flyte.with_replaycontext(mode="local").replay(
"my-run-name", task_template=my_task
)
# Replay remotely with explicit mode
flyte.with_replaycontext(mode="remote").replay("my-run-name")
Implementation notes:
• Follows the same _Runner/with_runcontext pattern: _Replayer holds config, with_replaycontext() returns a _Replayer, top-level replay() uses defaults
• Local replay always requires a task_template (validated early, before network calls) since there is no Python function to execute without one
• Extracts shared local execution logic into run_task_locally() in _run.py, eliminating duplication between _Runner._run_local and _Replayer._replay_local
flyteorg/flyte-sdk