Official agent skill

AWS Lambda Durable Functions

by aws in aws/agent-toolkit-for-aws

Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

OfficialApache-2.0Auto-check passedBackend & APIs

Install AWS Lambda Durable Functions

skills CLI
$ npx skills add aws/agent-toolkit-for-aws --skill aws-lambda-durable-functions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aws/agent-toolkit-for-aws aws-lambda-durable-functions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/specialized-skills/serverless-skills/aws-lambda-durable-functions .claude/skills/aws-lambda-durable-functions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
aws-lambda-durable-functions
GitHub stars
2.8k
Token cost
~2.3k tokens
SKILL.md length
786 words
Files
12 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
Apache-2.0

At a glance

Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

  • Works in 6 steps: Durable execution must be enabled at… → Durable functions must be invoked with a… → Durable operations cannot be nested. You… → …
  • Phrases like lambda durable functions
  • SKILL.md covers Critical Rules, When to Load Reference Files, Quick Reference and IAM Permissions, plus 3 more sections
  • Calls aws

What it does

AWS Lambda Durable Functions is an agent skill from aws/agent-toolkit-for-aws, published by the product's own GitHub organization. Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions. Covers the critical replay model, step operations, wait/callback patterns, error handling with saga pattern, testing with LocalDurableTestRunner. Triggers on phrases like lambda durable functions, durable execution, workflow orchestration, state machines, retry/checkpoint patterns, long-running stateful Lambda functions, saga…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including reference files (for example `references/advanced-error-handling.md`, `references/advanced-patterns.md` and `references/concurrent-operations.md`).

It sits in Backend & APIs, covering Serverless, Error handling and Microservices. It works with AWS Lambda and Amazon Web Services. The repository describes itself as: Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on AWS. The licence is Apache-2.0.

When your agent uses it

  • Phrases like lambda durable functions
  • Durable execution
  • Workflow orchestration
  • Retry/checkpoint patterns

Example prompts

  • “Use the aws-lambda-durable-functions skill to build resilient, long-running, multi-step applications with AWS Lambda durable functions with…”
  • “/aws-lambda-durable-functions”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Durable execution must be enabled at function creation time — it cannot be retrofitted. A new Lambda function must be created with durable…
  2. Durable functions must be invoked with a qualified ARN — a specific version, an alias, or the literal $LATEST suffix. An unqualified…
  3. Durable operations cannot be nested. You cannot call context.step(), context.wait(), or context.invoke() from inside another step's…
  4. All non-deterministic code must run inside steps. Date.now(), Math.random(), UUID generation, API calls, and database queries outside a…
  5. Closure mutations are lost on replay - return values from steps
  6. Side effects outside steps repeat - use context.logger (replay-aware)

What it can do on your machine

Read from SKILL.md and the folder at commit 188af2f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • aws

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.aws.amazon.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AWS Lambda Durable Functions loads about 2.3k tokens when it runs, and up to ~31k if it reads all its reference files. Until then it costs about 207 tokens; SKILL.md has 786 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~207
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~31k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aws/agent-toolkit-for-aws at commit 188af2f, republished under its Apache-2.0 licence (© aws). 786 words, ~2,267 tokens.

Download SKILL.mdSave it as .claude/skills/aws-lambda-durable-functions/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
aws-lambda-durable-functions
description
Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions. Covers the critical replay model, step operations, wait/callback patterns, error handling with saga pattern, testing with LocalDurableTestRunner. Triggers on phrases like lambda durable functions, durable execution, workflow orchestration, state machines, retry/checkpoint patterns, long-running stateful Lambda functions, saga pattern, human-in-the-loop callbacks, reliable serverless applications, context.step, context.wait, context.invoke, context.runInChildContext, withDurableExecution, DurableContext, UnrecoverableInvocationError, durable-execution-sdk, qualified ARN invocation, and durable handler replay.
version
1

AWS Lambda durable functions

Build resilient multi-step applications and AI workflows that can execute for up to 1 year while maintaining reliable progress despite interruptions.

Works best with the AWS MCP server but is not required. All AWS interactions in this skill use standard AWS CLI commands that work in any environment with configured AWS credentials.

Critical Rules

Read these before writing any code. Each one is a constraint that will silently break a function if violated.

  1. Durable execution must be enabled at function creation time — it cannot be retrofitted. A new Lambda function must be created with durable execution turned on. Migrate the logic into the new function; do not attempt to install the SDK and wrap the handler of the existing function and expect it to work.
  2. Durable functions must be invoked with a qualified ARN — a specific version, an alias, or the literal $LATEST suffix. An unqualified function name will fail. See the Invocation Requirements section below for examples.
  3. Durable operations cannot be nested. You cannot call context.step(), context.wait(), or context.invoke() from inside another step's callback. Use context.runInChildContext() to group operations instead.
  4. All non-deterministic code must run inside steps. Date.now(), Math.random(), UUID generation, API calls, and database queries outside a step will produce different values on replay and corrupt execution state.
  5. Closure mutations are lost on replay - return values from steps
  6. Side effects outside steps repeat - use context.logger (replay-aware)

When to Load Reference Files

Load the appropriate reference file based on what the user is working on:

  • Getting started, basic setup, example, ESLint, or Jest setup -> see getting-started.md
  • Understanding replay model, determinism, or non-deterministic errors -> see replay-model-rules.md
  • Creating steps, atomic operations, or retry logic -> see step-operations.md
  • Waiting, delays, callbacks, external systems, or polling -> see wait-operations.md
  • Parallel execution, map operations, batch processing, or concurrency -> see concurrent-operations.md
  • Error handling, retry strategies, saga pattern, or compensating transactions -> see error-handling.md
  • Advanced error handling, timeout handling, circuit breakers, or conditional retries -> see advanced-error-handling.md
  • Testing, local testing, cloud testing, test runner, or flaky tests -> see testing-patterns.md
  • Deployment, CloudFormation, CDK, SAM, log groups, deploy, or infrastructure -> see deployment-iac.md
  • Advanced patterns, GenAI agents, completion policies, step semantics, or custom serialization -> see advanced-patterns.md
  • troubleshooting, stuck execution, failed execution, debug execution ID, execution history, execution error, why did my execution fail, execution timed out, callback not received, diagnose execution, or root cause execution -> see troubleshooting-executions.md

Quick Reference

Basic Handler Pattern

TypeScript:

typescript
import { withDurableExecution, DurableContext } from '@aws/durable-execution-sdk-js';

export const handler = withDurableExecution(async (event, context: DurableContext) => {
  const result = await context.step('process', async () => processData(event));
  return result;
});

Python:

python
from aws_durable_execution_sdk_python import durable_execution, DurableContext

@durable_execution
def handler(event: dict, context: DurableContext) -> dict:
    result = context.step(lambda _: process_data(event), name='process')
    return result
Python API Differences

The Python SDK differs from TypeScript in several key areas:

  • Steps: Use @durable_step decorator + context.step(my_step(args)), or inline context.step(lambda _: ..., name='...'). Prefer the decorator for automatic step naming.
  • Wait: context.wait(duration=Duration.from_seconds(n), name='...')
  • Exceptions: ExecutionError (permanent), InvocationError (transient), CallbackError (callback failures)
  • Testing: Use DurableFunctionTestRunner class directly - instantiate with handler, use context manager, call run(input=...)
Invocation Requirements

Durable functions require qualified ARNs (version, alias, or $LATEST):

bash
# Valid
aws lambda invoke --function-name my-function:1 output.json
aws lambda invoke --function-name my-function:live output.json

# Invalid - will fail
aws lambda invoke --function-name my-function output.json
Show full SKILL.md (321 more words)Show less

IAM Permissions

Your Lambda execution role MUST have the AWSLambdaBasicDurableExecutionRolePolicy managed policy attached. This includes:

  • lambda:CheckpointDurableExecution - Persist execution state
  • lambda:GetDurableExecutionState - Retrieve execution state
  • CloudWatch Logs permissions

Additional permissions needed for:

  • Durable invokes: lambda:InvokeFunction on target function ARNs
  • External callbacks: Systems need lambda:SendDurableExecutionCallbackSuccess and lambda:SendDurableExecutionCallbackFailure

Validation Guidelines

When writing or reviewing durable function code, ALWAYS check for these replay model violations:

  1. Non-deterministic code outside steps: Date.now(), Math.random(), UUID generation, API calls, database queries must all be inside steps
  2. Nested durable operations in step functions: Cannot call context.step(), context.wait(), or context.invoke() inside a step function — use context.runInChildContext() instead
  3. Closure mutations that won't persist: Variables mutated inside steps are NOT preserved across replays — return values from steps instead
  4. Side effects outside steps that repeat on replay: Use context.logger for logging (it is replay-aware and deduplicates automatically)

When implementing or modifying tests for durable functions, ALWAYS verify:

  1. All operations have descriptive names
  2. Tests get operations by NAME, never by index
  3. Replay behavior is tested with multiple invocations
  4. Use LocalDurableTestRunner for local testing

Security Considerations

  • Checkpoint data encryption: Execution state is persisted automatically. Enable KMS encryption on associated CloudWatch Log Groups to protect checkpointed data at rest.
  • Sensitive data in step results: Step return values are checkpointed and persisted. Do not return secrets, raw credentials, or PII from steps — store sensitive data in Secrets Manager or SSM Parameter Store and return references instead.
  • Input validation: Validate and sanitize event payloads at the handler entry point before passing data to steps.
  • Credential management: Retrieve secrets from AWS Secrets Manager or SSM Parameter Store within steps.
  • Callback payload validation: Data received via waitForCallback originates from external systems — validate and sanitize before processing.
  • Logging: Avoid DEBUG log level in non-development environments as it may expose step results and execution state. Enable CloudWatch Logs encryption with KMS.

Resources

© aws, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (references) in skills/specialized-skills/serverless-skills/aws-lambda-durable-functions of aws/agent-toolkit-for-aws.

  • SKILL.md
  • references/advanced-error-handling.md
  • references/advanced-patterns.md
  • references/concurrent-operations.md
  • references/deployment-iac.md
  • references/error-handling.md
  • references/getting-started.md
  • references/replay-model-rules.md
  • references/step-operations.md
  • references/testing-patterns.md
  • references/troubleshooting-executions.md
  • references/wait-operations.md

Open the folder on GitHubat commit 188af2f

Compare with similar skills

AWS Lambda Durable Functions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AWS Lambda Durable Functions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AWS Lambda Durable Functions this skillaws/agent-toolkit-for-aws2.8k—~2.3kAutomated safety check: PassApache-2.0
AWS Lambda Durable Functionsawslabs/agent-plugins915—~2.3kAutomated safety check: PassApache-2.0
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
AWS Lambda Java Integrationgiuseppe-trisciuoglio/developer-kit355—~1.9kAutomated safety check: NotesMIT
AWS Lambda Php Integrationgiuseppe-trisciuoglio/developer-kit355—~2.3kAutomated safety check: NotesMIT
AWS Lambda Python Integrationgiuseppe-trisciuoglio/developer-kit355—~2.4kAutomated safety check: NotesMIT

Similar skills

  • AWS Lambda Durable Functions

    awslabs/agent-plugins

    Official

    Build resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

    915 GitHub stars~2.3k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • AWS Lambda Java Integration

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Lambda integration patterns for Java with cold start optimization.

    355 GitHub stars~1.9k tokensUpdated 28 days ago
    Backend & APIsAuto-check: notes
  • AWS Lambda Php Integration

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework.

    355 GitHub stars~2.3k tokensUpdated 28 days ago
    Backend & APIsAuto-check: notes
  • AWS Lambda Python Integration

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Lambda integration patterns for Python with cold start optimization.

    355 GitHub stars~2.4k tokensUpdated 28 days ago
    Backend & APIsAuto-check: notes
  • AWS Lambda Typescript Integration

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Lambda integration patterns for TypeScript with cold start optimization.

    355 GitHub stars~2.9k tokensUpdated 28 days ago
    Backend & APIsAuto-check: notes

More from aws/agent-toolkit-for-aws

All 138 skills in this repo
  • Agent Advisor

    aws/agent-toolkit-for-aws

    Official

    Entry point for AI-agent work on AWS: pick a runtime, plan a migration for existing workloads, and build an executable POC — one phased flow.

    2.8k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Agents Build

    aws/agent-toolkit-for-aws

    Official

    A skill your agent uses to extend an existing agent project with memory, app integration, VPC, multi-agent, migration, model, browser, code interpreter, payments, or resource removal.

    2.8k GitHub stars~2.3k tokensUpdated today
    Auto-check: notes
  • Launch With AWS

    aws/agent-toolkit-for-aws

    Official

    Migrates vibe-coded web applications to AWS. An agent skill from aws/agent-toolkit-for-aws.

    2.8k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Official

    Deploy an event-driven workflow that routes S3 uploads to either Lambda or Fargate via Step Functions based on file size.

    2.8k GitHub stars~4k tokensUpdated today
    Auto-check passed
  • AWS Marketplace Metering

    aws/agent-toolkit-for-aws

    Official

    Deploys, queries, and debugs AWS Marketplace usage-based (PAYG) metering — the pipeline (ResolveCustomer, BatchMeterUsage, EventBridge via SAM) and querying/debugging metering records, statuses…

    2.8k GitHub stars~18k tokensUpdated today
    Auto-check passed
  • Agents Pay

    aws/agent-toolkit-for-aws

    Official

    A skill your agent uses when THIS agent needs to pay for x402-protected content at runtime: hitting a paywall mid-task, settling it via AgentCore Payments, and applying operator-defined spend limits.

    2.8k GitHub stars~6.5k tokensUpdated today
    Auto-check: notes

Questions about AWS Lambda Durable Functions

What does AWS Lambda Durable Functions do?

Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions. AWS Lambda Durable Functions is an agent skill from aws/agent-toolkit-for-aws, published by the product's own GitHub organization. Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

When should I use AWS Lambda Durable Functions?

AWS Lambda Durable Functions fits situations like: phrases like lambda durable functions; durable execution; workflow orchestration; retry/checkpoint patterns.

How do I install AWS Lambda Durable Functions in Claude Code?

Run `npx skills add aws/agent-toolkit-for-aws --skill aws-lambda-durable-functions -a claude-code`. Or copy the skill folder (skills/specialized-skills/serverless-skills/aws-lambda-durable-functions in aws/agent-toolkit-for-aws) into .claude/skills/aws-lambda-durable-functions in your project. Claude Code loads it when a task matches its description.

How do I install AWS Lambda Durable Functions in Codex?

Run `npx skills add aws/agent-toolkit-for-aws --skill aws-lambda-durable-functions -a codex`. Or copy the skill folder (skills/specialized-skills/serverless-skills/aws-lambda-durable-functions in aws/agent-toolkit-for-aws) into .agents/skills/aws-lambda-durable-functions in your project. Codex loads it when a task matches its description.

Can I use AWS Lambda Durable Functions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aws/agent-toolkit-for-aws --skill aws-lambda-durable-functions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aws-lambda-durable-functions, .gemini/skills/aws-lambda-durable-functions, .github/skills/aws-lambda-durable-functions and .opencode/skills/aws-lambda-durable-functions in your project.

What does AWS Lambda Durable Functions need to run?

Going by SKILL.md and its folder, AWS Lambda Durable Functions needs the command-line tools its instructions call (aws). Our summary lists: Python 3.

Does AWS Lambda Durable Functions access the network?

SKILL.md names 2 domains. As links in the text: docs.aws.amazon.com and github.com. This is read from the text; nothing was executed.

Is AWS Lambda Durable Functions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does AWS Lambda Durable Functions use?

AWS Lambda Durable Functions is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AWS Lambda Durable Functions use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 29k tokens, read only when the agent opens those files.

What are the alternatives to AWS Lambda Durable Functions?

Skills that share tags, products or a category with AWS Lambda Durable Functions: AWS Lambda Durable Functions (awslabs/agent-plugins, 915 stars), AWS Serverless Eda (zxkane/aws-skills, 367 stars), AWS Lambda Java Integration (giuseppe-trisciuoglio/developer-kit, 355 stars) and AWS Lambda Php Integration (giuseppe-trisciuoglio/developer-kit, 355 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AWS Lambda Durable Functions?

aws (a GitHub organization, an official publisher) maintains it in aws/agent-toolkit-for-aws, which has 2,825 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on October 7, 2026.

Source: aws/agent-toolkit-for-aws on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.