Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expense-approval-durable-lambda

A human-in-the-loop expense approval workflow built with AWS Lambda Durable Execution — no Step Functions, no DynamoDB, no SQS. Just TypeScript.

Companion code for the Medium article "Is Step Functions Still Necessary? The Case for Lambda Durable Functions in 2026"


How It Works

  1. POST /expenses → Orchestrator starts a Durable Worker, which pauses at waitForCallback and sends an approval email
  2. POST /approve?callbackId=xxx → Orchestrator calls SendDurableExecutionCallbackSuccess → Worker resumes and finalizes

Project Structure

├── lib/
│   └── durable-approval-stack.ts  # CDK stack
├── lambda/
│   ├── worker.ts                  # Durable workflow (pauses, resumes)
│   └── orchestrator.ts            # API router
└── cdk.json

Getting Started

Prerequisites: Node.js 20+, AWS CDK v2, AWS CLI configured

npm install
cdk bootstrap   # first time only
cdk deploy

Then submit an expense:

curl -X POST https://<api-url>/expenses \
  -H "Content-Type: application/json" \
  -d '{ "expenseId": "exp-001", "amount": 450, "submittedBy": "alice@example.com" }'

And approve it:

curl -X POST "https://<api-url>/approve?callbackId=<id>"

References


License

MIT

About

Expense approval workflow using AWS Lambda Durable Execution — human-in-the-loop, no Step Functions required.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages