The `serverless-step-functions` plugin provides deep integration for AWS Step Functions within the Serverless Framework. It allows developers to define, deploy, and manage complex serverless workflows directly within their `serverless.yml` configuration. As of version `3.29.1`, the project maintains a rapid release cadence, frequently pushing out new features and bug fixes, often several times per month. Key differentiators include automatic IAM role generation tailored to state machine definitions, comprehensive event source integrations (such as API Gateway, Scheduled events, and CloudWatch Events), support for advanced features like Blue-Green deployments, pre-deployment validation, CloudWatch Alarms, and X-Ray tracing. It significantly streamlines the orchestration of AWS services by abstracting away much of the underlying CloudFormation complexity required for Step Functions.
npm install serverless-step-functionsVerified import paths — ran on the pinned version, not inferred.
This `serverless.yml` configuration demonstrates how to define a simple AWS Step Functions state machine with a basic `Wait` and `Succeed` state. It also shows how to trigger this workflow asynchronously via an AWS HTTP API endpoint, configuring the necessary API Gateway integration. This configuration should be placed in your `serverless.yml` file and deployed using `sls deploy`.
Upgrade your Serverless Framework CLI and project configuration to `v3.0.0` or newer. Run `npm install -g serverless@latest` or `npm install serverless@latest` in your project.
Ensure your development environment and deployment environment (if running local `sls deploy`) use Node.js version 22 or newer. Consider using `nvm` to manage Node.js versions.
Carefully review the CloudFormation generated IAM policies and add any missing permissions under the `iamRoleStatements` section in your `serverless.yml` or the `custom` section of the plugin configuration.
Avoid deeply nested `Fn::Sub` within Lambda resource references if possible. If necessary, use `Fn::Join` or define the ARN as a separate CloudFormation resource/variable for clarity and to prevent improper parsing.
Always define `apiKeys` as an array of objects, e.g., `- { name: 'my-api-key', value: '...' }` instead of just string names, to ensure compatibility and full feature support.Upgrade the Serverless Framework CLI: `npm install -g serverless@latest` and ensure your project's `package.json` specifies `serverless` v3 or greater.
Carefully review your `serverless.yml` for correct YAML syntax, especially indentation, dashes for lists, and proper key-value pairs. Use a YAML linter or IDE support for validation.
Add `states:StartExecution` permission for the specific state machine ARN to the IAM role that triggers the workflow. This might be a `iamRoleStatements` entry in your `serverless.yml` provider section or a custom role defined for the event.
Verify that any ARNs specified in your state machine definition or event configurations are correct and that the resources they refer to exist and are deployed in the same region/account. Ensure any Serverless variables (e.g., `${self:provider.region}`) are correctly resolved.