LangGraph Recoverable Actions Starter

Human-approved tool actions for LangGraph that survive a timeout or a crash without blindly repeating the write.

LangGraph Recoverable Actions Starter product illustration

The problem

LangGraph re-runs a node from the top when you resume after an interrupt or a failure (documented replay behavior; LangGraph issue #9185). If a node sent a CRM update and then timed out, the replay sends it again. The pack's restart demo shows exactly this with the naive pattern: notes_in_crm: 2.

What you get

  • recoverable_actions/ledger.py: SQLite operation ledger with stable operation ids, approvals bound to the exact arguments (sha256), compare-and-set state changes, leases with crash detection, lease-token fencing and audit events
  • recoverable_actions/executor.py: runs an approved operation; on an unknown outcome it retries with the same idempotency key, confirms by read-back, or stops for a person, never a blind retry
  • recoverable_actions/graph.py: propose, approve (interrupt), execute, reconcile (interrupt), every node safe to re-run; plus the naive graph for the failing-first tests
  • recoverable_actions/app.py: FastAPI service to start, approve, resume after restart, reconcile, inspect and revoke
  • A file-backed mock CRM adapter with fault injection (commit-then-timeout, timeout-before-commit, crash-after-commit, reject)
  • scripts/demo_restart.py: two real processes, the first crashes right after the CRM commits, the second resumes
  • 2 agent skills (Claude Code, Cursor, Codex): add a side-effecting tool safely, and reconcile unknown operations
  • docs/FAILURE-MATRIX.md and docs/ADAPTERS.md

Failure matrix (each row is a test)

  • Naive node, provider commits then times out, run resumed: 2 writes (reproduced)
  • Naive node, crash after commit, new process resumes: 2 writes (reproduced)
  • Commit then timeout, provider dedupes by idempotency key: 1 write, SUCCEEDED
  • Commit then timeout, provider supports read-back: 1 write, SUCCEEDED
  • Commit then timeout, provider has neither: 1 write, stops at NEEDS_RECONCILIATION for a person
  • Timeout before commit, provider has neither: 0 writes, stops for a person; retry then writes once
  • Resume again after success: stored result returned, provider not called
  • 8 workers race on one operation: provider called once
  • Arguments changed after approval, or a stale hash: refused, nothing sent
  • Approval revoked or expired: BLOCKED, nothing sent
  • Late result from an abandoned attempt: ignored (lease-token fencing)
  • Provider rejects (4xx): FAILED, never retried

Honest limits

  • Not universal exactly-once. Exactly-once effects need the provider's help (an idempotency key or a read-back). Without either, this starter guarantees no blind retry and hands the decision to a person.
  • One mock CRM adapter is included; real adapters are yours to write (docs/ADAPTERS.md shows how).
  • No payments or financial integrations in v1. SQLite is the ledger; crash detection by process id works on one host.

Requirements

Python 3.10+. Pinned: langgraph 1.0.10, langgraph-checkpoint-sqlite 3.1.3, FastAPI. No API keys needed to run the tests or demos. 25 tests.

Format and license

Zip, 28 KB, v1.0. Use in your own and client projects (one buyer: a person, or one company and its employees); no resale or giving the files away. Full terms in LICENSE.md.

FAQ

Does it work with my CRM or payment provider?
You write a small adapter (docs/ADAPTERS.md). Exactly-once needs your provider to support idempotency keys or read-back. Otherwise unknown outcomes go to a person.
Postgres?
The ledger is SQLite. The adapter and ledger interfaces are small enough to port, but only SQLite is tested.
Does it make payments?
No. v1 ships a mock CRM only.
Which agents can use the skills?
Claude Code, Cursor, Codex, or anything that reads SKILL.md.
How do I get the files?
Right after payment, Stripe’s confirmation page shows your download link.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get LangGraph Recoverable Actions Starter

Human-approved LangGraph tool calls that survive a timeout or crash without repeating the write.

Save with a bundle

Pairs well with

Download$39

Claude Agent SDK Guardrails Kit

Tool policy, single-use approvals, spend caps and offline hook tests for the Claude Agent SDK (Python).

View Claude Agent SDK Guardrails Kit
Download$49

AI Receptionist Booking Backend

Booking backend for Retell AI and Vapi receptionists: availability, book, reschedule, cancel, transfer. Retry-safe, 44 tests (Python).

View AI Receptionist Booking Backend
Download$59

x402 Developer Bundle

Build with x402 payments: builder skills, a paid agent API starter, Hermes and ElizaOS plugin templates. 4 tested kits, $59 ($96 separately).

View x402 Developer Bundle

Related