Soul ID
Soul IDAI AGENTS

⚑ Workflows

Retry & Rollback (resilient task execution)

Ensure tasks complete reliably by retrying on transient failures, rolling back partial changes on permanent failures, and escalating when recovery is impossible.

Bundle files

πŸ“„ORCHESTRATION.mdβ€” Orchestration
1# ORCHESTRATION.md
2
3## Diagram
4
5 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
6 β”‚ Task Assigned β”‚
7 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
8 β–Ό
9 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
10 β”‚ Executor Agent β”‚
11 β”‚ (attempt task) β”‚
12 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
13 β–Ό
14 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
15 β”‚ Success?β”‚
16 β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
17 yes β”‚ no
18 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
19 β–Ό β–Ό
20 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
21 β”‚ Deliver β”‚ β”‚ Retry budget β”‚
22 β”‚ Result β”‚ β”‚ exhausted? β”‚
23 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
24 no β”‚ yes
25 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
26 β–Ό β–Ό
27 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
28 β”‚ Backoff + β”‚ β”‚ Rollback Agent β”‚
29 β”‚ Retry β”‚ β”‚ (compensate + β”‚
30 β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ restore state) β”‚
31 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
32 β–Ό β–Ό
33 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
34 β”‚ Executor β”‚ β”‚ Escalate to β”‚
35 β”‚ (re-attempt)β”‚ β”‚ Human β”‚
36 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
37
38
39## Workflow
40Retry & Rollback (resilient task execution)
41
42## Objective
43Ensure tasks complete reliably by retrying on transient failures, rolling back partial changes on permanent failures, and escalating when recovery is impossible.
44
45## Roles
46- **Executor:** attempts the task and reports success/failure with context.
47- **Retry Controller:** decides whether to retry (transient) or abort (permanent), manages backoff.
48- **Rollback Agent:** reverses partial changes using compensation actions.
49- **Escalation Target:** human or supervisor notified when all recovery is exhausted.
50
51## When to use
52- Tasks that modify state (deployments, data migrations, API calls).
53- Environments with transient failures (network, rate limits, timeouts).
54- Any workflow where partial completion is worse than no completion.
55
56## Protocol
571. Executor attempts the task and checkpoints state before mutations.
582. On failure, classify error:
59 - **Transient** (timeout, 429, 503): retry with exponential backoff.
60 - **Permanent** (4xx, validation, logic error): skip to rollback.
613. Retry up to N attempts (configurable budget).
624. If retries exhausted β†’ trigger Rollback Agent.
635. Rollback Agent executes compensation actions in reverse order.
646. If rollback succeeds β†’ report clean failure with context.
657. If rollback fails β†’ escalate to human immediately.
66
67## Retry policy
68- **Max retries:** 3 (configurable per task)
69- **Backoff:** exponential (1s, 2s, 4s) with jitter
70- **Timeout per attempt:** 30s default
71- **Circuit breaker:** after 3 consecutive failures, pause all retries for cooldown
72
73## Rollback rules
74- Compensation actions must be idempotent.
75- Execute in reverse chronological order.
76- Each rollback step is itself retried once on failure.
77- Full rollback log with timestamps.
78
79## Rules
80- Never retry permanent errors.
81- Always checkpoint before mutation.
82- Rollback must leave system in a known-good state.
83- All attempts and outcomes logged for audit.
84
85## Deliverables
86- Execution attempt log (attempt #, error, classification)
87- Rollback action log (if triggered)
88- Final status: success | rolled-back | escalated
89- Metrics: attempts used, total elapsed time
90

Lines: 90 | Words: 415

Install

Copy bundle to your OpenClaw workspace.

curl -fsSL https://raw.githubusercontent.com/cerealskill/openclaw-agents/main/install.sh | bash -s workflow retry-rollback EN
Download .tar.gz

Rate this agent

Loading...

Sign in to rate this agent

Includes

  • βœ“ ORCHESTRATION.md

Info

Slug
retry-rollback
Lines
90
Words
415