$npx -y skills add awslabs/agent-plugins --skill aws-step-functionsBuild workflows with AWS Step Functions state machines using the JSONata query language. Covers Amazon States Language (ASL) structure, state types, variables, data transformation, error handling, AWS service integration, and migrating from the JSONPath to the JSONata query langu
| 1 | # AWS Step Functions |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | AWS Step Functions uses Amazon States Language (ASL) to define state machines as JSON. With AWS Step Functions, you can create workflows, also called State machines, to build distributed applications, automate processes, orchestrate microservices, and create data and machine learning pipelines. |
| 6 | |
| 7 | This skill provides comprehensive guidance for writing state machines in ASL, covering: |
| 8 | |
| 9 | - ASL structure and JSONata expression syntax |
| 10 | - Details on the eight available workflow states |
| 11 | - The `$states` reserved variable |
| 12 | - Workflow variables with `Assign` |
| 13 | - Error handling |
| 14 | - AWS Service integration patterns |
| 15 | - Example code for data transformation and architecture |
| 16 | - Validation and testing of state machines |
| 17 | - How to migrate from JSONPath to JSONata |
| 18 | |
| 19 | ## When to Load Reference Files |
| 20 | |
| 21 | Load the appropriate reference file based on what the user is working on: |
| 22 | |
| 23 | - **ASL structure**, **state types**, **Task**, **Pass**, **Choice**, **Wait**, **Succeed**, **Fail**, **Parallel**, **Map** → see [references/asl-state-types.md](references/asl-state-types.md) |
| 24 | - **Error handling**, **troubleshooting**, **Retry**, **Catch**, **fallback**, **error codes**, **States.Timeout**, **States.ALL** → see [references/error-handling.md](references/error-handling.md) |
| 25 | - **Service integrations**, **Lambda invoke**, **DynamoDB**, **SNS**, **SQS**, **SDK integrations**, **Resource ARN**, **sync**, **async** → see [references/service-integrations.md](references/service-integrations.md) |
| 26 | - **Migrating from JSONPath to JSONata**, **migration**, **JSONPath to JSONata**, **InputPath**, **Parameters**, **ResultSelector**, **ResultPath**, **OutputPath**, **intrinsic functions**, **Iterator**, **payload template** → see [references/migrating-from-jsonpath-to-jsonata.md](references/migrating-from-jsonpath-to-jsonata.md) |
| 27 | - **Validation**, **linting**, **testing**, **TestState**, **test state**, **mock**, **mocking**, **unit test**, **inspection level**, **DEBUG**, **TRACE**, **validate state**, **test in isolation** → see [references/validation-and-testing.md](references/validation-and-testing.md) |
| 28 | - **Architecture patterns**, **examples**, **polling**, **saga**, **compensation**, **scatter-gather**, **semaphore**, **lock**, **human-in-the-loop**, **escalation**, **Express to Standard** → see [references/architecture-patterns.md](references/architecture-patterns.md) |
| 29 | - **Data transformation**, **JSONata expressions**, **filtering**, **aggregation**, **string operations**, **$reduce**, **$lookup**, **$toMillis**, **$partition**, **$parse**, **$hash**, **$uuid** → see [references/transforming-data.md](references/transforming-data.md) |
| 30 | - **State input/output**, **$states**, **Assign**, **Output**, **Arguments**, **variable scope**, **variable limits**, **evaluation order**, **passing data between states** → see [references/processing-state-inputs-and-outputs.md](references/processing-state-inputs-and-outputs.md) |
| 31 | - **Deployment**, **SAM**, **CloudFormation**, **IaC**, **DefinitionSubstitutions**, **X-Ray tracing**, **logging** → see the [aws-serverless-deployment skill](../aws-serverless-deployment/) or [deploy-on-aws plugin](../../deploy-on-aws/) |
| 32 | |
| 33 | ## Quick Reference |
| 34 | |
| 35 | ### Standard vs Express Workflows |
| 36 | |
| 37 | | | Standard | Express | |
| 38 | | --------------------------------- | ------------------------------------ | ------------------------------------------- | |
| 39 | | **Max duration** | 1 year | 5 minutes | |
| 40 | | **Execution semantics** | Exactly-once | At-least-once (async) / At-most-once (sync) | |
| 41 | | **Execution history** | Retained 90 days, queryable via API | CloudWatch Logs only | |
| 42 | | **Max throughput** | 2,000 exec/sec | 100,000 exec/sec | |
| 43 | | **Pricing model** | Per state transition | Per execution count + duration | |
| 44 | | **`.sync` / `.waitForTaskToken`** | Supported | Not supported | |
| 45 | | **Best for** | Auditable, non-idempotent operations | High-volume, idempotent event processing | |
| 46 | |
| 47 | **Choose Standard** for: payment processing, order fulfillment, compliance workflows, anything that must never execute twice. |
| 48 | |
| 49 | **Choose Express** for: IoT data ingestion, streaming transformations, mobile backends, high-throughput short-lived processing. |
| 50 | |
| 51 | ### Setting the Stat |