agentleFS
asmamestasmamest/Nexus-Skills/skills/agentic-engineering/durable-agent-workflows/SKILL.md

durable-agent-workflows

Skill1 starsChanged 17 days agoMITView on GitHub

Build long-running, stateful agent workflows with checkpoints, resumability, idempotent side effects, retries, cancellation, and recovery after failure.

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure a workflow can pause, fail, resume, or wait for human input without losing state or repeating irreversible actions unexpectedly.

    line 9
  2. Distinctive:

    Put external side effects in explicit tasks with idempotency keys or an action ledger.

    line 15
  3. Distinctive:

    Ensure resumption revalidates permissions and relevant external state.

    line 17
  4. Distinctive:

    Add cancellation and deadlines.

    line 18
  5. Distinctive:

    Use transactional outbox, deduplication, or reconciliation patterns when a database update and external side effect cannot be atomic.

    line 19
  6. Distinctive:

    Test process crashes between every side effect and checkpoint boundary, duplicate resume requests, expired credentials, and partial …

    line 21
  7. Distinctive:

    Use unique thread/run IDs and validate access before loading a checkpoint.

    line 27
  8. Distinctive:

    Do not resume from untrusted or tampered state without integrity checks.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Durable Agent Workflows

Goal

Ensure a workflow can pause, fail, resume, or wait for human input without losing state or repeating irreversible actions unexpectedly.

Workflow

  1. Model the process as explicit states and transitions, including success, failure, waiting-for-approval, cancelled, and exhausted-budget states.
  2. Define a serializable state schema with task ID, owner/tenant, checkpoint version, progress, artifacts, pending action, and budget counters.
  3. Persist checkpoints at meaningful boundaries. Choose durability/latency trade-offs based on the consequences of losing progress.
  4. Put external side effects in explicit tasks with idempotency keys or an action ledger.
  5. Make retries bounded and classify transient vs permanent errors.
  6. Ensure resumption revalidates permissions and relevant external state; authorization can change while a workflow is paused.
  7. Add cancellation and deadlines. Stop future tool calls when cancellation is confirmed, and document limits for already-started external actions.
  8. Use transactional outbox, deduplication, or reconciliation patterns when a database update and external side effect cannot be atomic.
  9. Version state schemas and define migration/compatibility behavior for long-lived checkpoints.
  10. Test process crashes between every side effect and checkpoint boundary, duplicate resume requests, expired credentials, and partial failures.

Critical correctness rules

  • A checkpoint does not make an external API call exactly-once by itself.
  • Resuming a workflow may replay code; isolate side effects and make them safe to repeat.
  • Store secrets outside serialized state; store references to secret managers instead.
  • Use unique thread/run IDs and validate access before loading a checkpoint.
  • Do not resume from untrusted or tampered state without integrity checks.

Operational signals

Track age of pending runs, checkpoint failures, resume success, duplicate actions, retry counts, stuck workflows, queue depth, and completion latency. Provide operator tools to inspect, cancel, retry, or safely abandon a run.

Deliverable

Provide state diagram, checkpoint boundaries, idempotency plan, retry matrix, schema versioning, recovery runbook, and fault-injection tests.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.