

How to Build AI-Powered Q&A Bot with Power Automate
Automatically send Slack mentions to GPT-4 and post AI responses as thread replies when team members ask your bot questions.
Steps and UI details are based on platform versions at time of writing β check each platform for the latest interface.
Best for
Microsoft 365 teams who want an AI bot without managing separate bot infrastructure or coding webhook handlers.
Not ideal for
Teams needing sub-second response times or complex conversation threading beyond basic Q&A.
Sync type
real-timeUse case type
notificationReal-World Example
A 25-person marketing team uses this to answer campaign questions in their #marketing channel. Team members type '@qa-bot How do we track UTM parameters?' and get GPT-4 responses within 15 seconds. Before this, the same 5 questions got asked weekly and senior marketers spent 30+ minutes daily answering repeats.
What Will This Cost?
Drag the slider to your expected monthly volume.
Each platform counts differently β Zapier: 1 task per trigger. Make: 1 operation per module per record. n8n: 1 execution per run.





Prices shown for annual billing. Based on published pricing as of April 2026.
Estimated ROI
1000
min saved/mo
$583
labor value/mo
Free
no platform cost
Based on ~2 min manual effort per operation at $35/hr fully loaded labor cost.
Implementation
Import this workflow directly into Power Automate
Copy the pre-built Power Automate blueprint and paste it straight into Power Automate. All modules, filters, and field mappings are already configured β you just need to connect your accounts.
Before You Start
Make sure you have everything ready.
Field Mapping
Map these fields between your apps.
| Field | API Name | |
|---|---|---|
| Required | ||
| Message Text | ||
| Cleaned Question | ||
| System Prompt | ||
| GPT Model | ||
| Temperature | ||
| AI Response | ||
| Thread Timestamp | ||
Step-by-Step Setup
My flows > + New flow > Automated cloud flow
Create new automated flow
Navigate to make.powerautomate.com and sign in with your Microsoft account. Click 'My flows' in the left sidebar, then the blue '+ New flow' button. Select 'Automated cloud flow' from the dropdown menu. Name your flow 'Slack AI Q&A Bot' and search for 'Slack' in the trigger selection.
- 1Click 'My flows' in the left navigation
- 2Click the blue '+ New flow' button
- 3Select 'Automated cloud flow'
- 4Name it 'Slack AI Q&A Bot'
- 5Search for 'Slack' in the trigger picker
Triggers > Slack > When a message is posted to a channel
Configure Slack mention trigger
Select 'When a message is posted to a channel' as your trigger. You'll need to authenticate with Slack by clicking 'Sign in' and granting Power Automate permission to read messages. Choose the specific channel where your bot will operate, or select multiple channels if needed. Set the trigger to fire on all messages - we'll filter for mentions in the next step.
- 1Click 'When a message is posted to a channel'
- 2Click 'Sign in' and authenticate with Slack
- 3Select your target channel from the dropdown
- 4Leave message filters empty for now
+ New step > Control > Condition
Add mention detection condition
Click '+ New step' and search for 'Condition' in the actions list. This built-in logic control will filter messages that mention your bot. In the condition builder, select 'Message text' from the Slack trigger output on the left side. Set the operator to 'contains' and enter your bot mention format like '@qa-bot' in the value field.
- 1Click '+ New step' below the Slack trigger
- 2Search for 'Condition' and select it
- 3Click the left value field and select 'Message text'
- 4Set dropdown to 'contains'
- 5Type '@qa-bot' in the right value field
Condition > Yes > + Add an action > Data Operation > Compose
Clean the question text
In the 'Yes' branch of your condition, add a 'Compose' action to strip the bot mention from the message text. Click '+ Add an action' under the Yes branch and search for 'Compose'. In the Inputs field, you'll create an expression to remove '@qa-bot' from the message text, leaving just the actual question.
- 1Click '+ Add an action' in the Yes branch
- 2Search for 'Compose' and select it
- 3Click in the Inputs field
- 4Select 'Expression' tab and enter: replace(triggerOutputs()?['body/text'],'@qa-bot','')
- 5Click OK to save the expression
Add this expression in a Compose action before the OpenAI call to include conversation context and user info in your GPT prompt for more personalized responses.
JavaScript β Code Stepconcat(βΈ Show code
concat( 'User: ', triggerOutputs()?['body/user/name'], ' in channel ', triggerOutputs()?['body/channel/name'], '\n', 'Previous context: ', if(empty(triggerOutputs()?['body/thread_ts']), 'New conversation', 'Continuing thread'), '\n',
... expand to see full code
concat( 'User: ', triggerOutputs()?['body/user/name'], ' in channel ', triggerOutputs()?['body/channel/name'], '\n', 'Previous context: ', if(empty(triggerOutputs()?['body/thread_ts']), 'New conversation', 'Continuing thread'), '\n', 'Question: ', replace(triggerOutputs()?['body/text'], '@qa-bot', ''), '\n', 'Instructions: Answer as a helpful team assistant with knowledge of our company processes.' )
Yes branch > + Add an action > OpenAI > Create chat completion
Connect to OpenAI
Add another action and search for 'OpenAI'. If this is your first time, you'll need to create a new connection by providing your OpenAI API key from platform.openai.com. Select 'Create chat completion' as the action. This will send your cleaned question text to GPT-4 and return the AI's response for posting back to Slack.
- 1Click '+ Add an action' below the Compose step
- 2Search for 'OpenAI' and select the connector
- 3Choose 'Create chat completion' action
- 4Click 'Sign in' and paste your OpenAI API key
- 5Name the connection 'OpenAI GPT'
OpenAI action > Configuration parameters
Configure GPT-4 parameters
Set the Model to 'gpt-4' for best results, though 'gpt-3.5-turbo' works if you want lower costs. In the Messages array, create a system message with role 'system' and content describing your bot's purpose. Add a user message with role 'user' and content from your Compose output. Set Temperature to 0.7 for balanced creativity and Max Tokens to 500 to keep responses concise.
- 1Set Model field to 'gpt-4'
- 2Click 'Add new item' in Messages array
- 3Set Role to 'system', Content to 'You are a helpful Q&A bot for our team'
- 4Click 'Add new item' again
- 5Set Role to 'user', Content to output from Compose step
- 6Set Temperature to 0.7 and Max tokens to 500
Yes branch > + Add an action > Data Operation > Compose
Extract AI response text
Add another Compose action to extract just the text content from OpenAI's response object. The API returns a complex JSON structure, but you only need the actual message text to post in Slack. Use an expression to navigate to the first choice's message content in the response.
- 1Click '+ Add an action' after the OpenAI step
- 2Search for 'Compose' and select it
- 3Click in Inputs field and select Expression tab
- 4Enter: body('Create_chat_completion')?['choices'][0]['message']['content']
- 5Click OK to save the expression
Yes branch > + Add an action > Slack > Post message
Post reply to Slack thread
Add a Slack action to post the AI response as a threaded reply. Search for 'Post message' in Slack actions. Set the Channel to the same channel from your trigger. Set Message text to the output from your second Compose action. Most importantly, set Thread timestamp to the original message's timestamp to create a proper thread.
- 1Click '+ Add an action' after the second Compose
- 2Search for 'Slack' and select 'Post message'
- 3Set Channel to same channel as trigger
- 4Set Message text to output from second Compose
- 5Set Thread timestamp to 'Timestamp' from trigger output
Flow designer > Save button
Test the complete flow
Save your flow by clicking the Save button in the top right. Go to your Slack channel and post a test message like '@qa-bot What is Power Automate?' The flow should trigger within 30 seconds, send your question to GPT-4, and post the response as a threaded reply. Check the flow's run history to debug any issues.
- 1Click 'Save' in the top right corner
- 2Go to your Slack channel
- 3Type '@qa-bot What is Power Automate?'
- 4Wait 15-30 seconds for the response
- 5Check flow run history if no response appears
Going live
Production Checklist
Before you turn this on for real, confirm each item.
Troubleshooting
Common errors and how to fix them.
Frequently Asked Questions
Common questions about this workflow.
Analysis
Use Microsoft Power Automate for this if you're already deep in the Microsoft ecosystem and want your AI bot to integrate with SharePoint, Teams, or Dynamics data sources. The built-in Slack and OpenAI connectors handle authentication cleanly, and you can extend the bot to query company data from other Microsoft services without additional API work. Skip this if you need sub-5-second response times - Power Automate's flow execution adds 15-30 seconds of latency that Zapier or Make handle faster.
Costs run about $15/month for a team generating 100 Q&A pairs daily with GPT-4. That breaks down to $12 for OpenAI API calls and $3 for Power Automate runs at the standard premium connector rate. Make costs the same $12 for OpenAI but only $1 for automation runs, saving you $24 yearly. However, most Microsoft 365 business plans include Power Automate premium connectors, making the actual cost difference negligible.
Zapier beats Power Automate on response speed - their webhook triggers fire in 2-3 seconds vs Power Automate's 15-30 second channel polling lag. Make offers better error handling with built-in retry logic and cleaner JSON parsing for OpenAI responses. n8n gives you full conversation memory with its built-in database nodes, something you'd need separate Dataverse storage for in Power Automate. But Power Automate wins if you need the bot to query SharePoint documents or Surface company data from Dynamics - those integrations work out of the box.
You'll hit OpenAI rate limits fast if multiple team members ask questions simultaneously - GPT-4 allows 3 requests per minute on basic API plans. The Slack connector occasionally misses messages during channel high-traffic periods, requiring manual flow re-triggers. Power Automate's expression syntax for parsing OpenAI JSON responses is clunkier than Make's built-in JSON parser, leading to more debugging when OpenAI changes their response format.
Ideas for what to build next
- βAdd conversation memory β Store recent Q&A pairs in SharePoint or Dataverse to give your bot context about previous questions in the same thread.
- βCreate response templates β Build conditional logic to detect common question types and use pre-written responses instead of GPT calls to save API costs.
- βMulti-channel deployment β Duplicate this flow for other Slack channels or modify it to work across multiple channels with different system prompts per channel.
Related guides
How to Share Notion Meeting Notes to Slack with Pipedream
~15 min setup
How to Share Notion Meeting Notes to Slack with Power Automate
~15 min setup
How to Share Notion Meeting Notes to Slack with n8n
~20 min setup
How to Send Notion Meeting Notes to Slack with Zapier
~8 min setup
How to Share Notion Meeting Notes to Slack with Make
~12 min setup
How to Create Notion Tasks from Slack with Pipedream
~15 min setup