Prompt chaining with AWS AppSync, AWS Step Functions and Amazon Bedrock.

AWS Appsync → AWS Step Functions → Amazon Bedrock

Prompt chaining no-code example with AWS AppSync, AWS Step Functions and Amazon Bedrock.

The provided example demonstrates the deployment of a serverless application using the AWS Serverless Application Model (SAM) template.
This serverless application includes an AWS AppSync serverless GraphQL endpoint that is connected to an AWS Step Functions state machine.
The state machine is designed to invoke an Express workflow synchronously.
It utilizes AWS Step Functions' intrinsic functions to chain two prompts, which are then used to invoke the Amazon Bedrock language model.
The output from the state machine execution is returned to the client within 29 seconds through the GraphQL API.
This no-code example showcases how the results from the first prompt can be used to provide context for the second prompt, allowing the language model to deliver a highly-curated response.
By chaining these prompts, the system can leverage the capabilities of the language model to generate more meaningful and contextual outputs.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/appsync-stepfunctions-express-sync-bedrock-sam

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

sam delete

Created by:

Mike Hume

Mike Hume

AWS Senior Solutions Architect & UKPS Serverless Lead.

Follow on LinkedIn