Blog: Hey Slack! Answer my questions on my Confluence!
A Slack Bot powered by AWS Bedrock Knowledge with the Datasource being Confluence Cloud to answer questions regarding to confluence contents.
Mention the bot along with the questions you have about the your Confluence content, it will then respond with the result together with some related links to the confluence resources.
Also, since we will have a lambda to perform some incremental data synchronization for us everyday, automatically, the contents to generate the results based on will be (hopefully) pretty up to date!
- Vector Database: OpenSearch Serverless
- App (Bot) Mention Event Handling: API Gateway + Lambda + SQS + Lambda
- Daily Incremental Data Ingestion: Lambda with EventBridge Trigger
- Create a knowledge base with Confluence as datasource like what I have shared with you previously in Confluence + Bedrock KnowledgeBase + OpenSearch Serverless: Console & CDK.
- Memo down the Knowledge Base Id.
- Create a Slack App from the Apps Console for the workspace that you would like to use this bot for.
- Navigate to Basic Information and obtain Signing Secret
- Navigate to OAuth & Permissions to Obtain the Bot OAuth Token, and Add
chat:writeandchat:write.publicto Bot Token Scopes
- In
cdk.json, set up the following environment variables.
"develop": {
"AWS_REGION": "us-east-1",
"SLACK_SIGNING_SECRET": "...",
"BOT_OAUTH_TOKEN": "....",
"CHAT_MODEL_ID": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"KNOWLEDGE_BASE_ID": "..."
}
- Deploy the stack by running
cdk deploy. This will deploy the queue, the API Gateway and its proxy Lambda, the event bridge as well as its handler lambda, with necessary permission configured. - Obtain the API Gateway Endpoint URL. This should be something like
https://xxx.execute-api.us-east-1.amazonaws.com/prod/.
- Navigate to Event Subscriptions in the app settings page.
- Enable Events by toggle the switch to On.
- For Request URL, enter the API GAteway endpoint URL. You should see the Verified checkmark if success.
- For Subscribe to events on behalf of users, add
app_mentions:read. This will add the necessary OAuth scope automatically. - Navigate to Installed App Settings page and install the app to the workspace.
For more details on setting up Slack Events API, please check out my blog here.
Above is all we need to get the Bot running.
Head to the Slack Workspace that we have installed the bot on, select any channel, and send a message mentioning the bot!
If this is your first time @ the bot in a specific channel, you will be prompted to add it as member! The message will be delivered after that!
Add those as the datasources to the same Knowledge base, and without changing a single line of code, our slack bot will now be able to answer the request using ALL those sources!
And the data from those sources will also be AUTOMATICALLY ingested daily as well!
If Simply Retrieving from the knowledge base and Generate the response doesn’t seem to be enough, and you want responses more tailor-made and Better matching your scenarios / usages, you can create an Agent with the knowledge base and invoke the agent instead, for example, Strands with Knowledge base Workflow!

