AWS Lambda durable functions to Slack via Amazon Bedrock AgentCore

Amazon API Gateway → Slack Handler → Orchestrator (Durable) → Callbacks Table → Bedrock AgentCore

Slack chatbot using AWS Lambda Durable Functions for stateful, multi-turn conversations with HITL interactions, generating travel itineraries via Amazon Bedrock AgentCore.

The Slack Handler Lambda receives webhook events from Slack via API Gateway, verifies the request signature, deduplicates events, and starts a new Durable Function execution for new conversations.
The Orchestrator (Durable Function) manages the multi-turn conversation flow using wait_for_callback() to pause execution while waiting for user responses — the Lambda is not running during the wait.
When the user replies, the callback resumes the orchestrator exactly where it left off. The AgentCore Agent invokes Amazon Bedrock (Claude) via the Strands framework to generate a personalized itinerary.
The key innovation is the wait-for-callback pattern: the orchestrator suspends (costs nothing while waiting) and automatically resumes when the user responds — enabling multi-turn conversations without managing state manually.

< 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/lambda-df-slack

Deploy

terraform initterraform apply -auto-approve


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Change directory: cd terraform
Delete the stack: terraform destroy -auto-approve
Confirm all resources have been deleted: terraform show

Created by:

Rajil Paloth

Rajil Paloth

ProServe Delivery Consultant at AWS

Follow on LinkedIn