Skip to content

Commit a50cb80

Browse files
authored
Merge pull request #49 from KestrelAI/add-rollback-and-replay-docs
docs: add workflow rollback and execution replay documentation
2 parents b23ce6c + d23f4e2 commit a50cb80

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

docs/workflows/cli.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ kestrel approvals approve <approval-id> --justification "Emergency fix"
170170
kestrel approvals reject <approval-id>
171171
```
172172

173+
## Version History & Rollback
174+
175+
```bash
176+
kestrel workflows versions <workflow-id> # List version history
177+
kestrel workflows rollback <workflow-id> --version 3 # Roll back to version 3
178+
```
179+
180+
## Execution Replay
181+
182+
Replay failed executions from the beginning or from the failed step:
183+
184+
```bash
185+
kestrel workflows replay <execution-id> # Replay from beginning
186+
kestrel workflows replay <execution-id> --from-failed # Replay from failed step
187+
```
188+
173189
## Request Commands
174190

175191
```bash

docs/workflows/sdk.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,34 @@ client.approvals.approve("approval-id", justification="Looks good")
444444
client.approvals.reject("approval-id")
445445
```
446446

447+
## Version History & Rollback
448+
449+
```python
450+
# List version history
451+
versions = client.workflows.list_versions("workflow-id")
452+
for v in versions["versions"]:
453+
print(f"v{v['version_number']}{v['change_summary']} ({v['created_at']})")
454+
455+
# Roll back to a previous version
456+
client.workflows.rollback("workflow-id", version=3)
457+
```
458+
459+
## Execution Replay
460+
461+
Replay failed executions from the beginning or from the failed step:
462+
463+
```python
464+
# Replay from beginning (re-triggers with same signal data)
465+
new_exec = client.executions.replay("execution-id", mode="full")
466+
467+
# Replay from failed step (preserves outputs from prior steps)
468+
new_exec = client.executions.replay("execution-id", mode="from_failed")
469+
470+
# Wait for replay to complete
471+
result = client.executions.wait(new_exec.id)
472+
print(f"Replay status: {result.status}")
473+
```
474+
447475
## Error Handling
448476

449477
```python

0 commit comments

Comments
 (0)