Amazon S3 to AWS Step Functions Express Workflows

Amazon S3 → Step Functions Express Workflows

Creates a Lambda function that stores a payload in S3 and starts an Express Workflow

This pattern creates a Lambda function that puts an object to S3, which triggers a Step Functions Express Workflow.
This is useful when processing uploaded files larger than the current task execution limits.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Launch Stack

Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-s3-sfn

Deploy

sam deploy --guided


Testing

Run the following command to invoke the function to start the Step Functions workflow. Note: edit the {SavePayloadAndStartStateMachineFunction} placeholder with the ARN of the deployed Lambda function. This is provided in the stack outputs. Replace the payload with something larger than the current task execution limit.
aws lambda invoke --function-name {SavePayloadAndStartStateMachineFunction} --payload '{ "payload": "hello world"}' --cli-binary-format raw-in-base64-out response.json

Cleanup

1. Empty and delete the S3 bucket: aws s3 rm s3://lambda-s3-sfn-uploads --recursive
2. Delete the stack: sam delete --stack-name STACK_NAME.
3. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Alper Sunar

Architect