When a step's result was wrong — a decision took the wrong branch, a report was mis-stated — ccw_step_back resumes the instance from an earlier step instead of restarting the whole run.
Parameters
| Name | Type | Required | Meaning |
|---|---|---|---|
instance_id |
string | yes | The instance to rewind. |
to_step_id |
string | no | The step to resume from — its most recent occurrence. |
steps_back |
number | no | How many steps to go back when to_step_id is not given. Default 1. |
reason |
string | yes | Why the rewind is needed. Kept in the instance's audit trail. |
What it rewinds, and what it cannot
The engine rewinds its own state: the current step, and the stored results of the steps being undone. It cannot undo effects outside the engine, and it says so in its response:
- a shell command that ran — its effects stay;
- a child workflow that completed — its work stays;
- a file a step reported writing — still on disk;
- a human approval at a gate being rewound past — discarded, and must be given again.
Treat the response as a checklist of what to clean up by hand before continuing.