
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
aws-workflow
Advanced tools
AWS World implementation for Workflow DevKit - Run durable workflows on AWS Lambda with DynamoDB, SQS, and S3
⚠️ EXPERIMENTAL & BETA: This package is in active development and should be used with caution in production.
AWS World implementation for Workflow DevKit - Run durable, resumable workflows on AWS Lambda with DynamoDB, SQS, and S3.
Workflow DevKit brings durability, reliability, and observability to async JavaScript. Build workflows and AI Agents that can suspend, resume, and maintain state with ease - all with simple TypeScript functions.
aws-workflow is a World implementation that runs your workflows on AWS infrastructure, providing:
npm install aws-workflow workflow
This creates the required AWS infrastructure (DynamoDB tables, SQS queues, S3 bucket, Lambda function):
npx aws-workflow bootstrap -y
What this does:
.env.awsCost estimate: Free tier eligible. Typical cost: $5-20/month for moderate usage.
Copy the generated environment variables from .env.aws to your Next.js .env.local:
# From bootstrap output
WORKFLOW_QUEUE_URL=https://sqs.us-east-1.amazonaws.com/...
WORKFLOW_STEP_QUEUE_URL=https://sqs.us-east-1.amazonaws.com/...
WORKFLOW_RUNS_TABLE=workflow_runs
WORKFLOW_STEPS_TABLE=workflow_steps
WORKFLOW_EVENTS_TABLE=workflow_events
WORKFLOW_HOOKS_TABLE=workflow_hooks
WORKFLOW_STREAM_CHUNKS_TABLE=workflow_stream_chunks
WORKFLOW_STREAM_BUCKET=workflow-streams-...
# Add your AWS credentials
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
Add to your next.config.ts:
import { withWorkflow } from 'workflow/next';
export default withWorkflow({
experimental: {
serverActions: {
bodySizeLimit: '10mb',
},
},
});
Create workflows/user-signup.ts:
import { sleep } from 'workflow';
export async function handleUserSignup(email: string) {
'use workflow';
// Step 1: Create user
const user = await createUser(email);
// Step 2: Send welcome email
await sendWelcomeEmail(email);
// Step 3: Wait 7 days (workflow suspends - no resources consumed!)
await sleep('7 days');
// Step 4: Send follow-up
await sendFollowUpEmail(email);
return { userId: user.id, status: 'completed' };
}
async function createUser(email: string) {
'use step';
// Your user creation logic
return { id: '123', email };
}
async function sendWelcomeEmail(email: string) {
'use step';
// Send email via Resend, SendGrid, etc.
}
async function sendFollowUpEmail(email: string) {
'use step';
// Send follow-up email
}
Whenever you add or update workflows, deploy them:
npm run deploy
What this does:
From your Next.js API route or Server Action:
import { handleUserSignup } from '@/workflows/user-signup';
export async function POST(request: Request) {
const { email } = await request.json();
// Start the workflow
const handle = await handleUserSignup(email);
return Response.json({
workflowId: handle.id,
status: 'started'
});
}
That's it! Your workflow is now running on AWS Lambda. 🚀
┌─────────────────┐
│ Next.js App │
│ (Your Code) │
└────────┬────────┘
│
│ Triggers workflow
▼
┌─────────────────┐ ┌──────────────┐
│ SQS Queues │─────▶│ Lambda Worker│
│ (Orchestration) │ │ (Executes) │
└─────────────────┘ └──────┬───────┘
│
┌───────────┴───────────┐
│ │
┌──────────▼────────┐ ┌─────────▼────────┐
│ DynamoDB │ │ S3 Bucket │
│ (State & Runs) │ │ (Large Payloads) │
└───────────────────┘ └──────────────────┘
Steps automatically retry on failure with exponential backoff.
Workflow state is persisted to DynamoDB - resume from any point.
Use sleep() to pause workflows for minutes, hours, or days without consuming resources.
Query workflow status, inspect step execution, view history:
import { getWorkflowRun } from 'aws-workflow';
const run = await getWorkflowRun(workflowId);
console.log(run.status); // 'running' | 'completed' | 'failed'
Run multiple steps concurrently:
export async function processOrder(orderId: string) {
'use workflow';
const [payment, inventory, shipping] = await Promise.all([
processPayment(orderId),
reserveInventory(orderId),
calculateShipping(orderId),
]);
return { payment, inventory, shipping };
}
# Bootstrap AWS infrastructure (first time only)
npm run bootstrap
# Deploy workflows to Lambda
npm run deploy
# View Lambda logs in real-time
npm run logs
# Tear down all AWS resources
npm run teardown
# Get current AWS resource info
npm run outputs
| Variable | Description | Required |
|---|---|---|
WORKFLOW_QUEUE_URL | SQS queue URL for workflow orchestration | ✅ |
WORKFLOW_STEP_QUEUE_URL | SQS queue URL for step execution | ✅ |
WORKFLOW_RUNS_TABLE | DynamoDB table for workflow runs | ✅ |
WORKFLOW_STEPS_TABLE | DynamoDB table for step execution | ✅ |
WORKFLOW_STREAM_BUCKET | S3 bucket for large payloads | ✅ |
AWS_REGION | AWS region | ✅ |
AWS_ACCESS_KEY_ID | AWS access key (local dev) | ✅* |
AWS_SECRET_ACCESS_KEY | AWS secret key (local dev) | ✅* |
*Not required when running on AWS (uses IAM roles)
Typical monthly cost for moderate usage: $5-20
⚠️ Beta Software Warnings:
Status: 🔴 Critical runtime issue in @workflow/core (not AWS-specific)
Symptoms:
Runtime.NodeJsExit error when workflow attempts to resumeRoot Cause: The workflow runtime's replay mechanism has a bug that causes promise rejections when resuming execution after a step completes. This is a core runtime issue affecting all environments, not specific to AWS infrastructure.
Workaround: Use single-step workflows for production:
// ✅ Works - Single step
export async function processPayment(orderId: string) {
'use workflow';
const result = await handlePayment(orderId);
return result;
}
// ❌ Broken - Multiple steps
export async function processOrder(orderId: string) {
'use workflow';
const payment = await processPayment(orderId); // ✅ First step works
const shipping = await calculateShipping(orderId); // ❌ Crashes on resume
}
For complex workflows, chain single-step workflows using AWS Step Functions or your own orchestration.
# Clean and rebuild
rm -rf cdk.out .next node_modules/.cache
npm run deploy
# Check Lambda logs
npm run logs
# Verify environment variables
npm run outputs
Ensure your Next.js app uses npm (not pnpm) for flat node_modules structure:
rm -rf node_modules pnpm-lock.yaml
npm install
Check out the example Next.js app for a complete implementation including:
Contributions are welcome! Please read our Contributing Guide first.
Apache-2.0 - see LICENSE.md
Built with ❤️ by Langtrace
GitHub: https://github.com/karthikscale3/aws-workflow
Part of the Workflow DevKit ecosystem
FAQs
AWS World implementation for Workflow DevKit - Run durable workflows on AWS Lambda with DynamoDB, SQS, and S3
The npm package aws-workflow receives a total of 1 weekly downloads. As such, aws-workflow popularity was classified as not popular.
We found that aws-workflow demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.