Intermediate~15 min setupAI & CommunicationVerified April 2026
OpenAI logo
Slack logo

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-time

Use case type

notification

Real-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.

/mo
505005K50K

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

Skip the setup

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.

OpenAI API key with GPT-4 access and available credits
Slack workspace admin permissions to create bot integrations
Microsoft 365 account with Power Automate license (included in most business plans)
Bot user invited to target Slack channels where it will respond

Field Mapping

Map these fields between your apps.

FieldAPI Name
Required
Message Text
Cleaned Question
System Prompt
GPT Model
Temperature
AI Response
Thread Timestamp

Step-by-Step Setup

1

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.

  1. 1Click 'My flows' in the left navigation
  2. 2Click the blue '+ New flow' button
  3. 3Select 'Automated cloud flow'
  4. 4Name it 'Slack AI Q&A Bot'
  5. 5Search for 'Slack' in the trigger picker
βœ“ What you should see: You should see the Slack connector options with triggers like 'When a message is posted to a channel'.
⚠
Common mistake β€” Don't pick 'Instant cloud flow' - you need the automated trigger to catch Slack mentions in real-time.
2

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.

  1. 1Click 'When a message is posted to a channel'
  2. 2Click 'Sign in' and authenticate with Slack
  3. 3Select your target channel from the dropdown
  4. 4Leave message filters empty for now
βœ“ What you should see: You should see a green connection status and your selected channel name displayed in the trigger configuration.
⚠
Common mistake β€” The Slack app needs to be invited to your target channel first, or Power Automate won't see messages there.
Power Automate
+
click +
search apps
OpenAI
OP
OpenAI
Configure Slack mention trig…
OpenAI
OP
module added
3

+ 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.

  1. 1Click '+ New step' below the Slack trigger
  2. 2Search for 'Condition' and select it
  3. 3Click the left value field and select 'Message text'
  4. 4Set dropdown to 'contains'
  5. 5Type '@qa-bot' in the right value field
βœ“ What you should see: The condition should show 'Message text contains @qa-bot' with two branches labeled 'Yes' and 'No' below it.
⚠
Common mistake β€” Use your exact bot mention syntax - '@botname' works differently than 'botname' in Slack's message parsing.
OpenAI
OP
trigger
filter
Condition
matches criteria?
yes β€” passes through
no β€” skipped
Slack
SL
notified
4

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.

  1. 1Click '+ Add an action' in the Yes branch
  2. 2Search for 'Compose' and select it
  3. 3Click in the Inputs field
  4. 4Select 'Expression' tab and enter: replace(triggerOutputs()?['body/text'],'@qa-bot','')
  5. 5Click OK to save the expression
βœ“ What you should see: The Compose action should show your replace expression in the Inputs field, ready to strip the bot mention.
⚠
Common mistake β€” Match your bot mention exactly in the replace function - extra spaces or different formatting will leave mentions in the GPT prompt.

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.'
)
5

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.

  1. 1Click '+ Add an action' below the Compose step
  2. 2Search for 'OpenAI' and select the connector
  3. 3Choose 'Create chat completion' action
  4. 4Click 'Sign in' and paste your OpenAI API key
  5. 5Name the connection 'OpenAI GPT'
βœ“ What you should see: You should see OpenAI connection established with the chat completion action ready to configure.
⚠
Common mistake β€” Get your API key from platform.openai.com/api-keys, not from the ChatGPT web interface - they're different systems.
6

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.

  1. 1Set Model field to 'gpt-4'
  2. 2Click 'Add new item' in Messages array
  3. 3Set Role to 'system', Content to 'You are a helpful Q&A bot for our team'
  4. 4Click 'Add new item' again
  5. 5Set Role to 'user', Content to output from Compose step
  6. 6Set Temperature to 0.7 and Max tokens to 500
βœ“ What you should see: Your OpenAI action should show gpt-4 model selected with a 2-message array configured for system prompt and user question.
⚠
Common mistake β€” GPT-4 costs 20x more than GPT-3.5-turbo per token - monitor your usage if you expect high volume.
7

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.

  1. 1Click '+ Add an action' after the OpenAI step
  2. 2Search for 'Compose' and select it
  3. 3Click in Inputs field and select Expression tab
  4. 4Enter: body('Create_chat_completion')?['choices'][0]['message']['content']
  5. 5Click OK to save the expression
βœ“ What you should see: The second Compose action should show the expression that will extract the AI response text from the OpenAI output.
⚠
Common mistake β€” The expression is case-sensitive and must match OpenAI's exact JSON structure - test with a simple question first.
8

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.

  1. 1Click '+ Add an action' after the second Compose
  2. 2Search for 'Slack' and select 'Post message'
  3. 3Set Channel to same channel as trigger
  4. 4Set Message text to output from second Compose
  5. 5Set Thread timestamp to 'Timestamp' from trigger output
βœ“ What you should see: The Slack post action should be configured to reply in thread using the original message timestamp.
⚠
Common mistake β€” Without Thread timestamp, responses post as new top-level messages instead of threaded replies, cluttering your channel.
9

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.

  1. 1Click 'Save' in the top right corner
  2. 2Go to your Slack channel
  3. 3Type '@qa-bot What is Power Automate?'
  4. 4Wait 15-30 seconds for the response
  5. 5Check flow run history if no response appears
βœ“ What you should see: You should see a threaded reply from Power Automate with GPT-4's answer to your test question within 30 seconds.
⚠
Common mistake β€” First runs often take 60+ seconds while Power Automate initializes connections - don't panic if the initial test is slow.
Power Automate
β–Ά Test flow
executed
βœ“
OpenAI
βœ“
Slack
Slack
πŸ”” notification
received

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

VerdictWhy n8n for this workflow

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.

Cost

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.

Tradeoffs

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

Was this guide helpful?
← OpenAI + Slack overviewPower Automate profile β†’