Official agent skill

AWS Lambda Durable Functions

by awslabs in awslabs/agent-plugins

Build 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 awslabs/agent-plugins --skill aws-lambda-durable-functions -a claude-code

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

GitHub CLI
$ gh skill install awslabs/agent-plugins 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/awslabs/agent-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/aws-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
915
Token cost
~2.3k tokens
SKILL.md length
774 words
Files
12 (incl. references)
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

Build 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 3 steps: Validate Prerequisites → Select language and IaC framework → Install SDK
  • Phrases like: lambda durable functions
  • SKILL.md covers Onboarding, When to Load Reference Files, Quick Reference and IAM Permissions, plus 2 more sections
  • Calls aws, npm and pip

What it does

AWS Lambda Durable Functions is an agent skill from awslabs/agent-plugins, published by the product's own GitHub organization. Build 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, workflow orchestration, state machines, retry/checkpoint patterns, long-running stateful Lambda functions, saga pattern…

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, Amazon Web Services, Python and Model Context Protocol. The repository describes itself as: Agent Plugins for AWS equip AI coding agents with the skills to help you architect, deploy, and operate on AWS. The licence is Apache-2.0.

When your agent uses it

  • Phrases like: lambda durable functions
  • Workflow orchestration
  • Retry/checkpoint patterns
  • Long-running stateful Lambda functions

Example prompts

  • “/aws-lambda-durable-functions”

Requirements

  • Python 3
  • Node.js

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Validate Prerequisites
  2. Select language and IaC framework
  3. Install SDK

What it can do on your machine

Read from SKILL.md and the folder at commit da51970. 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
    • npm
    • pip
    • node
    • python

    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 149 tokens; SKILL.md has 774 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~149
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 awslabs/agent-plugins at commit da51970, republished under its Apache-2.0 licence (© awslabs). 774 words, ~2,297 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
Build 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, workflow orchestration, state machines, retry/checkpoint patterns, long-running stateful Lambda functions, saga pattern, human-in-the-loop callbacks, and reliable serverless applications.

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.

Onboarding

Step 1: Validate Prerequisites

Before using AWS Lambda durable functions, verify:

  1. AWS CLI is installed (2.33.22 or higher) and configured:

    bash
    aws --version
    aws sts get-caller-identity
  2. Runtime environment is ready:

    • For TypeScript/JavaScript: Node.js 22+ (node --version)
    • For Python: Python 3.11+ (python --version. Note that currently only Lambda runtime environments 3.13+ come with the Durable Execution SDK pre-installed. 3.11 is the min supported Python version by the Durable SDK itself, however, you could use OCI to bring your own container image with your own Python runtime + Durable SDK.)
  3. Deployment capability exists (one of):

    • AWS SAM CLI (sam --version) 1.153.1 or higher
    • AWS CDK (cdk --version) v2.237.1 or higher
    • Direct Lambda deployment access
Step 2: Select language and IaC framework
Language Selection

Default: TypeScript

Override syntax:

  • "use Python" → Generate Python code
  • "use JavaScript" → Generate JavaScript code

When not specified, ALWAYS use TypeScript

IaC framework selection

Default: CDK

Override syntax:

  • "use CloudFormation" → Generate YAML templates
  • "use SAM" → Generate YAML templates

When not specified, ALWAYS use CDK

Error Scenarios
Unsupported Language
  • List detected language
  • State: "Durable Execution SDK is not yet available for [framework]"
  • Suggest supported languages as alternatives
Unsupported IaC Framework
  • List detected framework
  • State: "[framework] might not support Lambda durable functions yet"
  • Suggest supported frameworks as alternatives
Serverless MCP Server Unavailable
  • Inform user: "AWS Serverless MCP not responding"
  • Ask: "Proceed without MCP support?"
  • DO NOT continue without user confirmation
Step 3: Install SDK

For TypeScript/JavaScript:

bash
npm install @aws/durable-execution-sdk-js
npm install --save-dev @aws/durable-execution-sdk-js-testing

For Python:

bash
pip install aws-durable-execution-sdk-python
pip install aws-durable-execution-sdk-python-testing

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
Critical Rules
  1. All non-deterministic code MUST be in steps (Date.now, Math.random, API calls)
  2. Cannot nest durable operations - use runInChildContext to group operations
  3. Closure mutations are lost on replay - return values from steps
  4. Side effects outside steps repeat - use context.logger (replay-aware)
Show full SKILL.md (309 more words)Show less
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:prod output.json

# Invalid - will fail
aws lambda invoke --function-name my-function output.json

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
MCP Server Configuration

Write access is enabled by default. The plugin ships with --allow-write in .mcp.json, so the MCP server can create projects, generate IaC, and deploy on behalf of the user.

Access to sensitive data (like Lambda and API Gateway logs) is not enabled by default. To grant it, add --allow-sensitive-data-access to .mcp.json.

Resources

© awslabs, 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 plugins/aws-serverless/skills/aws-lambda-durable-functions of awslabs/agent-plugins.

  • 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 da51970

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 skillawslabs/agent-plugins915—~2.3kAutomated safety check: PassApache-2.0
AWS Lambda Durable Functionsaws/agent-toolkit-for-aws2.8k—~2.3kAutomated safety check: PassApache-2.0
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
AWS Lambda Python Integrationgiuseppe-trisciuoglio/developer-kit355—~2.4kAutomated safety check: NotesMIT
AWS Lambda Typescript Integrationgiuseppe-trisciuoglio/developer-kit355—~2.9kAutomated safety check: NotesMIT
AWS Cdk Developmentzxkane/aws-skills3672 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • AWS Lambda Durable Functions

    aws/agent-toolkit-for-aws

    Official

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

    2.8k GitHub stars~2.3k tokensUpdated today
    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 Python Integration

    giuseppe-trisciuoglio/developer-kit

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

    355 GitHub stars~2.4k tokensUpdated 27 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 27 days ago
    Backend & APIsAuto-check: notes
  • AWS Cdk Development

    zxkane/aws-skills

    AWS Cloud Development Kit (CDK) expert for building cloud infrastructure with TypeScript/Python.

    367 GitHub starsUsed in 2 repos~2.5k tokens
    DevOps & CloudAuto-check passed
  • AWS Step Functions

    aws/agent-toolkit-for-aws

    Official

    Authors and edits AWS Step Functions state machines: writes Amazon States Language (ASL) in JSONata, and chooses and structures state types (Task, Choice, Map, Parallel, Pass, Wait, Succeed, Fail).

    2.8k GitHub stars~3.4k tokensUpdated today
    Backend & APIsAuto-check passed

More from awslabs/agent-plugins

All 33 skills in this repo
  • Dataset Evaluation

    awslabs/agent-plugins

    Official

    Validates dataset formatting and quality for SageMaker model fine-tuning (SFT, DPO, or RLVR).

    915 GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check passed
  • Dataset Transformation

    awslabs/agent-plugins

    Official

    Generates code that transforms datasets between ML schemas for model training or evaluation.

    915 GitHub starsUsed in 2 repos~3.5k tokens
    Auto-check passed
  • Finetuning Technique

    awslabs/agent-plugins

    Official

    Selects a fine-tuning technique (SFT, DPO, RLVR, or RLAIF) for the user's use case and validates it against the selected model's available recipes.

    915 GitHub starsUsed in 1 repo~604 tokens
    Auto-check passed
  • Hyperpod Issue Report

    awslabs/agent-plugins

    Official

    Generate comprehensive issue reports from HyperPod clusters (EKS and Slurm) by collecting diagnostic logs and configurations for troubleshooting and AWS Support cases.

    915 GitHub starsUsed in 1 repo~890 tokens
    Auto-check passed
  • Hyperpod Performance Debugger

    awslabs/agent-plugins

    Official

    Diagnose performance issues on Amazon SageMaker HyperPod clusters — uneven NCCL bandwidth across nodes and poor filesystem throughput.

    915 GitHub starsUsed in 1 repo~4.1k tokens
    Auto-check passed
  • Hyperpod Ssm

    awslabs/agent-plugins

    Official

    Remote command execution and file transfer on SageMaker HyperPod cluster nodes via AWS Systems Manager (SSM).

    915 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check: notes

Questions about AWS Lambda Durable Functions

What does AWS Lambda Durable Functions do?

Build 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 awslabs/agent-plugins, published by the product's own GitHub organization. Build 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; workflow orchestration; retry/checkpoint patterns; long-running stateful Lambda functions.

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

Run `npx skills add awslabs/agent-plugins --skill aws-lambda-durable-functions -a claude-code`. Or copy the skill folder (plugins/aws-serverless/skills/aws-lambda-durable-functions in awslabs/agent-plugins) 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 awslabs/agent-plugins --skill aws-lambda-durable-functions -a codex`. Or copy the skill folder (plugins/aws-serverless/skills/aws-lambda-durable-functions in awslabs/agent-plugins) 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 awslabs/agent-plugins --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, npm, pip, node and python). Our summary lists: Python 3; Node.js.

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.2k 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 28k 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 (aws/agent-toolkit-for-aws, 2.8k stars), AWS Serverless Eda (zxkane/aws-skills, 367 stars), AWS Lambda Python Integration (giuseppe-trisciuoglio/developer-kit, 355 stars) and AWS Lambda Typescript 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?

awslabs (a GitHub organization, an official publisher) maintains it in awslabs/agent-plugins, which has 915 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 5, 2026.

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