In this sample, we’ll use an Amplify custom resource to add an AWS Step Functions workflow to our Amplify project.
- How to create a Step Functions workflow as an Amplify custom resource using the AWS CDK.
- How to connect our custom resource to an existing Amplify-managed GraphQL API.
The proposed solution consists of the following elements:
- Our sample web application is a customer feedback form built using Vite and Amplify UI.
- Submitting the feedback form will trigger a Step Functions express workflow created as an Amplify custom resource via an AWS AppSync API managed by Amplify.
- The Step Function workflow will detect the sentiment of the submitted feedback using Amazon Comprehend’s
DetectSentiment
API. - Next, the workflow will store the feedback and detected sentiment in an Amplify-managed Amazon DynamoDB table.
- If a non-positive sentiment is detected, the workflow will trigger a notification to a customer support email address using the Amazon Simple Notification Service (Amazon SNS).
- Depending on the result of the sentiment analysis, our web application will display different confirmation messages to the customer.
The Step Functions workflow looks like this:
From the perspective of the user of our web application, the result will look like this:
For a walkthrough of the implementation, check out the blog post.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.