> step-functions
You are an expert in AWS Step Functions, the serverless orchestration service for building workflows as state machines. You help developers coordinate Lambda functions, API calls, and AWS services using visual workflows with branching, parallel execution, error handling, retries, and human approval steps — building reliable, observable distributed systems without custom orchestration code.
curl "https://skillshub.wtf/TerminalSkills/skills/step-functions?format=md"AWS Step Functions — Serverless Workflow Orchestration
You are an expert in AWS Step Functions, the serverless orchestration service for building workflows as state machines. You help developers coordinate Lambda functions, API calls, and AWS services using visual workflows with branching, parallel execution, error handling, retries, and human approval steps — building reliable, observable distributed systems without custom orchestration code.
Core Capabilities
State Machine Definition
{
"Comment": "Order processing workflow",
"StartAt": "ValidateOrder",
"States": {
"ValidateOrder": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:validate-order",
"Next": "CheckInventory",
"Catch": [{
"ErrorEquals": ["ValidationError"],
"Next": "RejectOrder"
}],
"Retry": [{
"ErrorEquals": ["States.TaskFailed"],
"IntervalSeconds": 2,
"MaxAttempts": 3,
"BackoffRate": 2.0
}]
},
"CheckInventory": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:check-inventory",
"Next": "InventoryDecision"
},
"InventoryDecision": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.inStock",
"BooleanEquals": true,
"Next": "ProcessPayment"
},
{
"Variable": "$.backorderAvailable",
"BooleanEquals": true,
"Next": "CreateBackorder"
}
],
"Default": "NotifyOutOfStock"
},
"ProcessPayment": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:process-payment",
"Next": "ParallelFulfillment"
},
"ParallelFulfillment": {
"Type": "Parallel",
"Branches": [
{
"StartAt": "ShipOrder",
"States": {
"ShipOrder": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:ship-order",
"End": true
}
}
},
{
"StartAt": "SendConfirmation",
"States": {
"SendConfirmation": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:send-email",
"End": true
}
}
},
{
"StartAt": "UpdateAnalytics",
"States": {
"UpdateAnalytics": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:update-analytics",
"End": true
}
}
}
],
"Next": "OrderComplete"
},
"OrderComplete": {
"Type": "Succeed"
},
"RejectOrder": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:reject-order",
"Next": "OrderFailed"
},
"NotifyOutOfStock": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:notify-out-of-stock",
"Next": "OrderFailed"
},
"OrderFailed": {
"Type": "Fail",
"Error": "OrderProcessingFailed",
"Cause": "Order could not be fulfilled"
}
}
}
Direct SDK Integrations
{
"WriteToDynamo": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:putItem",
"Parameters": {
"TableName": "orders",
"Item": {
"id": { "S.$": "$.orderId" },
"status": { "S": "processing" },
"total": { "N.$": "States.Format('{}', $.total)" }
}
},
"Next": "SendToSQS"
},
"SendToSQS": {
"Type": "Task",
"Resource": "arn:aws:states:::sqs:sendMessage",
"Parameters": {
"QueueUrl": "https://sqs.us-east-1.amazonaws.com/123/notifications",
"MessageBody.$": "States.JsonToString($.notification)"
},
"Next": "WaitForApproval"
},
"WaitForApproval": {
"Type": "Task",
"Resource": "arn:aws:states:::sqs:sendMessage.waitForTaskToken",
"Parameters": {
"QueueUrl": "https://sqs.us-east-1.amazonaws.com/123/approvals",
"MessageBody": {
"taskToken.$": "$$.Task.Token",
"orderId.$": "$.orderId"
}
},
"TimeoutSeconds": 86400,
"Next": "FinalStep"
}
}
Installation
# SAM / CDK / CloudFormation for deployment
# AWS SDK for starting executions
npm install @aws-sdk/client-sfn
# Start execution
import { SFNClient, StartExecutionCommand } from "@aws-sdk/client-sfn";
const sfn = new SFNClient({});
await sfn.send(new StartExecutionCommand({
stateMachineArn: "arn:aws:states:...",
input: JSON.stringify({ orderId: "123", items: [...] }),
}));
Best Practices
- Express for high-volume — Use Express Workflows for event processing (100K+ executions/sec, cheaper); Standard for long-running
- Catch + Retry — Add
CatchandRetryon every Task state; handle transient failures gracefully - Direct integrations — Call DynamoDB, SQS, SNS, ECS directly without Lambda; reduces latency and cost
- Parallel for fan-out — Use Parallel state for concurrent operations; Map state for processing arrays
- Wait for callback — Use
.waitForTaskTokenfor human approval, external webhook, or async processing - Input/output processing — Use
InputPath,OutputPath,ResultPathto control data flow between states - Visual debugging — Step Functions console shows execution flow visually; each state shows input/output/errors
- Idempotency — Pass idempotency tokens through the workflow; retries may re-execute steps
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> xero-accounting
Integrate with the Xero accounting API to sync invoices, expenses, bank transactions, and contacts — and generate financial reports like P&L and balance sheet. Use when: connecting apps to Xero, automating bookkeeping workflows, syncing accounting data, or pulling financial reports programmatically.
> windsurf-rules
Configure Windsurf AI coding assistant with .windsurfrules and workspace rules. Use when: customizing Windsurf for a project, setting AI coding standards, creating team-shared Windsurf configurations, or tuning Cascade AI behavior.