Welcome to the sfn-wait-for-callback
repository! This project complements our blog post, demonstrating a real-world application of AWS Step Functions using the callback pattern.
We implement a basic UI that starts a Step Function, let's it wait for a specific input (title forbidden), and continues it only on user input.
You can use any package manager, we've used pnpm. Follow these commands to deploy the project to your AWS default profile:
pnpm install
pnpm run deploy:prod
To run the project on your local machine:
- Install dependencies:
pnpm install
- Start the development server:
pnpm run dev
- For the frontend, navigate to the
packages/frontend
directory and start its development server:
cd packages/frontend
pnpm run dev
Technology: Next.js
Submit Articles: We've implemented a mock form that submits new articles. We only send new article titles. If you send the title forbidden
a step Function will halt.
Admin Page: In /admin
we've built an admin page that shows you all waiting step functions.
On approve
or reject
you will continue the Step Function with the respective decision.
More details are available in our blog post.
-
Step Function: Built using AWS CDK, employing the chain syntax for state management.
-
Lambda Functions:
- REST API: Starts Step Functions and retrieves items from DynamoDB.
- Approval Receiver: Handles decision and task token reception.
- Manual Approval Request: Records Step Functions awaiting approval in DynamoDB.
-
DynamoDB: Stores active Step Functions and related metadata.
This project is serverless, meaning it is 100% usage-based. Testing should be free under the AWS Free Tier. For larger-scale operations, be mindful of DynamoDB scan costs and Step Function state changes.
Interested in contributing? Great! 🚀 Simply create an issue or a pull request, and we'll take a look.