

How to build an AI-powered Q&A bot with Pipedream
When someone mentions your bot in Slack, automatically send their question to GPT-4 and post the response as a thread reply.
Steps and UI details are based on platform versions at time of writing — check each platform for the latest interface.
Best for
Teams that need instant AI responses in Slack without switching to ChatGPT tabs or apps
Not ideal for
High-security environments where sending data to external AI models violates compliance rules
Sync type
real-timeUse case type
notificationReal-World Example
A 25-person engineering team uses this to get instant code explanations and debugging help in their #dev-questions channel. Before automation, developers would paste questions into ChatGPT separately, losing context and slowing down troubleshooting. Now they just mention @ai-helper and get GPT-4 responses directly in thread within 3-5 seconds.
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 Pipedream
Copy the pre-built Pipedream blueprint and paste it straight into Pipedream. 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 | ||
| Question Text | ||
| Channel ID | ||
| Thread Timestamp | ||
| User ID | ||
| GPT Response | ||
| Model Name | ||
Step-by-Step Setup
Workflows > + New Workflow
Create new Pipedream workflow
Go to pipedream.com and click the green 'New Workflow' button in the top right. You'll land on the workflow builder with an empty trigger step. This is where you'll configure the Slack mention detection that kicks off your AI bot.
- 1Click 'New Workflow' from the dashboard
- 2Name your workflow 'AI Q&A Bot'
- 3Leave the default trigger step selected
Step 1 > Select app > Slack > New Mention
Add Slack mention trigger
Click the trigger dropdown and search for Slack. Select 'New Mention' as your trigger type. This fires every time someone mentions your bot in any channel or DM. You'll need to connect your Slack workspace and choose which bot user to monitor for mentions.
- 1Type 'Slack' in the app search box
- 2Click 'Slack' from the results
- 3Select 'New Mention' trigger type
- 4Click 'Connect Account' to authorize Slack
Slack Trigger > Configuration
Configure bot mention settings
Select your bot user from the dropdown - if you don't have one, create it in Slack's app settings first. Set the trigger to fire on mentions in any channel. Test the trigger by mentioning your bot in Slack and clicking 'Generate Test Event' to confirm Pipedream receives the message data.
- 1Select your bot user from the 'Bot User' dropdown
- 2Leave 'Channel' set to 'Any Channel'
- 3Click 'Generate Test Event'
- 4Go mention your bot in Slack with a test question
Step 2 > + Add Step > OpenAI > Chat
Add GPT-4 processing step
Click the + button below your trigger to add a new step. Search for OpenAI and select it. Choose 'Chat' as the action type since you're sending conversational questions to GPT-4. This step will take the mention text and send it to OpenAI's API.
- 1Click the + button below Step 1
- 2Search for 'OpenAI' in the app list
- 3Select 'Chat' action
- 4Click 'Connect Account' and enter your OpenAI API key
OpenAI Step > Configuration
Configure GPT-4 model settings
Set the model to 'gpt-4' for best results. In the messages array, create a system message that defines your bot's role and a user message containing the actual question. Map the question text from the Slack trigger data using Pipedream's step picker.
- 1Select 'gpt-4' from the Model dropdown
- 2Set Max Tokens to 500 to control response length
- 3Add system message: 'You are a helpful technical assistant'
- 4Add user message and map it to steps.trigger.event.text
Between Steps > + Code (Node.js)
Clean up the question text
Add a Code step between Slack and OpenAI to strip out the bot mention from the question. Raw Slack mentions include '@botname' at the start, which you don't want to send to GPT-4. This step extracts just the actual question text using JavaScript string manipulation.
- 1Click + between your Slack and OpenAI steps
- 2Select 'Code' then 'Run Node.js code'
- 3Paste the question parsing code
- 4Update the OpenAI step to use this cleaned text
This code step cleans the question text by removing bot mentions and extracting just the user's actual question. Paste it in a Node.js code step between your Slack trigger and OpenAI step.
JavaScript — Code Stepexport default defineComponent({▸ Show code
export default defineComponent({
async run({ steps, $ }) {
const originalText = steps.trigger.event.text;... expand to see full code
export default defineComponent({
async run({ steps, $ }) {
const originalText = steps.trigger.event.text;
const botUserId = steps.trigger.event.bot_id || '<@U1234567890>';
// Remove bot mention and clean up the question
let cleanQuestion = originalText
.replace(/<@[UW][A-Z0-9]+>/g, '') // Remove all user mentions
.replace(/^\s+|\s+$/g, '') // Trim whitespace
.replace(/\s+/g, ' '); // Normalize spaces
// Check if there's actually a question
if (!cleanQuestion || cleanQuestion.length < 3) {
cleanQuestion = "Please ask me a specific question and I'll help you find an answer.";
return {
question: cleanQuestion,
shouldRespond: false
};
}
// Add context about the channel for better responses
const channelName = steps.trigger.event.channel_name || 'general';
const contextualQuestion = `In a ${channelName} channel discussion: ${cleanQuestion}`;
return {
question: contextualQuestion,
originalQuestion: cleanQuestion,
shouldRespond: true,
channelContext: channelName
};
}
});Step 4 > + Add Step > Slack > Send Message to Channel
Add Slack thread reply step
Add another step and select Slack again. Choose 'Send Message to Channel' as the action. Configure it to reply in a thread by setting the thread_ts to the original message timestamp. This keeps the AI response organized under the original question.
- 1Click + to add a final step
- 2Select Slack > Send Message to Channel
- 3Map Channel to steps.trigger.event.channel
- 4Map Text to the GPT response from OpenAI step
- 5Set Thread TS to steps.trigger.event.ts
Workflow > Deploy > Test in Slack
Test the complete workflow
Click 'Deploy' to activate your workflow, then test it end-to-end. Go to your Slack workspace and mention your bot with a real question. Watch for the threaded AI response to appear within 5-10 seconds. Check Pipedream's execution logs if anything fails.
- 1Click the green 'Deploy' button at the top
- 2Go to Slack and mention your bot: '@aibot What is React?'
- 3Wait 5-10 seconds for the threaded response
- 4Check execution logs in Pipedream 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 Pipedream for this if you need instant webhook processing and want to customize the AI logic with real code. Unlike Zapier's limited AI actions, you get full control over GPT prompts, response formatting, and error handling. The instant webhook triggers beat Make's 1-minute polling for real-time chat responses. Skip Pipedream if you're on a tight budget - Zapier's AI actions bundle multiple API calls into one task.
At 100 bot mentions per month, you'll spend $0 on Pipedream (free tier) plus about $3-5 in OpenAI costs for GPT-4. Zapier charges $20/month minimum for AI features, making it 4x more expensive. Make costs $9/month but adds 1-minute delays that kill the chat experience. N8N self-hosted is free but requires server management.
Make handles complex conditional logic better with its visual branching system - great if you want different AI models for different question types. Zapier's built-in AI actions are simpler to set up but less flexible than custom OpenAI calls. N8N offers the most customization but requires technical setup. Power Automate integrates well with Microsoft teams but lacks decent Slack triggers. Pipedream wins on the webhook speed and code flexibility that chat bots demand.
You'll hit OpenAI rate limits in active channels - GPT-4 allows 200 requests per minute for paid accounts, but only 3/minute on free tiers. Slack's thread_ts timestamp format is finicky and breaks threaded replies if mapped wrong. The bot will respond to its own messages if you mention other users in responses, creating infinite loops that burn through your API quota fast.
Ideas for what to build next
- →Add conversation memory — Store recent thread history in a database so the bot remembers context from previous messages in the same thread.
- →Create topic-specific bots — Deploy separate workflows with specialized system prompts for different channels like #dev-help, #marketing-questions, or #hr-support.
- →Add response moderation — Use OpenAI's moderation API to filter inappropriate questions and responses before posting to maintain professional Slack environments.
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