Durable Workflow Patterns for Openclaw

A comprehensive set of patterns and scripts for building AI agent workflows that maintain state and survive external failures.

old-greggyboy
v1.0.1
Mar 25, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install durable-workflow

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install durable-workflow using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Durable Workflow Patterns?

Durable Workflow Patterns is a specialized toolkit designed to help developers build robust, multi-step automations that won't lose progress when things go wrong. By implementing core principles like checkpointing, recovery, and alerting, this skill ensures that AI agents can handle real-world challenges such as API timeouts, network failures, and unexpected crashes.

This collection of Openclaw Skills provides ready-to-use implementations for common reliability patterns, including exponential backoff, circuit breakers, and dead letter queues. It shifts the focus from simple script execution to managed, resilient process lifecycles that are essential for professional-grade AI deployments.

Durable Workflow Patterns Use Cases

  • Automating complex multi-step pipelines involving external API integrations.
  • Building long-running agent loops that must resume progress after a restart.
  • Creating background tasks that require strict error handling and alerting.
  • Preventing concurrent execution of critical scripts using file-based locks.
  • Designing idempotent operations where repeated execution does not cause data duplication.

How Durable Workflow Patterns Works

  1. Checkpointing: The workflow saves its current state to a persistent JSON file after every successful step completion.
  2. State Loading: Upon execution or re-run, the script checks for an existing state path to determine the last successful checkpoint.
  3. Step Execution: The workflow iterates through defined steps, skipping those already marked as completed in the state file.
  4. Failure Handling: If a step fails, the skill applies retry logic with exponential backoff and jitter to mitigate transient errors.
  5. DLQ Management: Persistent failures are routed to a Dead Letter Queue file for manual review instead of failing silently.
  6. Safe Exit: An exit handler ensures final state saves and sends alerts via Telegram if configured.

Durable Workflow Patterns Setup

To start using these resilient patterns in your Openclaw Skills, copy the template script and configure your environment:

# Copy the workflow skeleton
cp scripts/workflow-template.js my-workflow.js

# Run the workflow with an optional custom state path
WORKFLOW_STATE_PATH=/tmp/state.json node my-workflow.js

# Configure alerting (Optional)
export ALERT_TELEGRAM_TOKEN="your_bot_token"
export ALERT_CHAT_ID="your_chat_id"

Durable Workflow Patterns Data Schema & Taxonomy

The skill manages workflow progress through a structured state object and handles failures via metadata-rich queues.

Data Component Format Description
State File JSON Stores step index and results array to track progress.
Lock File File (.lock) Contains the PID of the running process to prevent concurrency.
DLQ File JSON Array of objects containing the failed item, error message, and failedAt timestamp.
Alerting Payload JSON Markdown-formatted message sent via HTTPS POST to the Telegram Bot API.

Durable Workflow Patterns Advanced Features

  • Circuit Breaker: Automatically pauses calls to failing external services to prevent resource exhaustion.
  • PID-Aware Locking: Uses lock.js to automatically reclaim stale locks from previously crashed processes.
  • Exponential Backoff with Jitter: Smart retry timing that prevents 'thundering herd' problems on API endpoints.
  • Atomic State Saves: Ensures that the progress file is never left in a corrupted state during a crash.
  • Telegram Integration: Built-in alerting system using only native HTTPS modules for minimal dependency overhead.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*