

How to Draft Email Responses from Slack Messages with N8n
Paste a client email into a Slack channel and automatically generate a professional response using OpenAI's GPT-4.
Steps and UI details are based on platform versions at time of writing — check each platform for the latest interface.
Best for
Teams that process client emails regularly and want AI-drafted responses with custom formatting.
Not ideal for
One-off email tasks or teams that need instant setup without any coding.
Sync type
real-timeUse case type
notificationReal-World Example
A 12-person marketing agency uses this to draft client email responses in their #client-emails Slack channel. Account managers paste client requests and get AI-generated professional responses within 30 seconds. Before automation, drafting responses took 5-10 minutes per email and junior staff struggled with tone consistency.
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 n8n
Copy the pre-built n8n blueprint and paste it straight into n8n. 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 | text | |
| Channel ID | channel | |
| Thread Timestamp | ts | |
| GPT Response | choices[0].message.content | |
2 optional fields▸ show
| User ID | user |
| Model Used | model |
Step-by-Step Setup
Dashboard > New Workflow
Create New Workflow
Start a fresh N8n workflow for the email drafting automation. This sets up your canvas for connecting Slack and OpenAI.
- 1Click 'New Workflow' in the N8n dashboard
- 2Name it 'Email Response Drafter'
- 3Click 'Save' to create the workflow
Workflow > Add Node > Triggers > Slack
Add Slack Trigger
Set up a Slack trigger that listens for new messages in your designated channel. This monitors when someone pastes a client email.
- 1Click the '+' button to add a node
- 2Search for 'Slack' and select 'Slack Trigger'
- 3Choose 'On New Message' from the trigger dropdown
- 4Select your target channel from the Channel list
Slack Node > Credentials > Create New
Connect Slack Credentials
Authenticate N8n with your Slack workspace. You need a bot token with channels:read and channels:history permissions.
- 1Click 'Create New' under Credentials
- 2Select 'Slack OAuth2 API' from the dropdown
- 3Paste your Bot User OAuth Token
- 4Click 'Test' then 'Save'
Add Node > Logic > IF
Add Message Filter
Filter messages to only process ones containing email content. This prevents the workflow from running on casual chat messages.
- 1Add an 'IF' node after Slack
- 2Set condition to 'String' > 'Contains'
- 3Set Value 1 to '{{$node["Slack Trigger"].json["text"]}}'
- 4Set Value 2 to '@' (to detect email addresses)
Add Node > Helpers > Code
Extract Email Content
Parse the Slack message to extract the original email text. This cleans up the content before sending to OpenAI.
- 1Add a 'Code' node on the 'true' path
- 2Set Mode to 'Run Once for Each Item'
- 3Paste email extraction code in the JavaScript field
- 4Map input to Slack message text
Add Node > AI > OpenAI
Connect OpenAI
Add OpenAI credentials to enable GPT-4 access. You'll need an API key from platform.openai.com with sufficient credits.
- 1Add an 'OpenAI' node after the Code node
- 2Select 'Chat' operation
- 3Click 'Create New' under Credentials
- 4Paste your OpenAI API key and save
OpenAI Node > Messages > Add Message
Configure GPT-4 Prompt
Set up the prompt that instructs GPT-4 to draft a professional email response. This determines the tone and structure of generated replies.
- 1Set Model to 'gpt-4' in the OpenAI node
- 2Add a system message: 'You are a professional email assistant. Draft polite, concise responses.'
- 3Set user message to include the extracted email content
- 4Set Max Tokens to 300
Add Node > Helpers > Code
Format Response Output
Structure the GPT-4 response for clean display in Slack. This adds formatting and context around the drafted email.
- 1Add another 'Code' node after OpenAI
- 2Extract the response text from OpenAI output
- 3Add formatting with headers and line breaks
- 4Include original message context
Add Node > Communication > Slack
Send to Slack Thread
Post the drafted response as a thread reply to the original message. This keeps conversations organized and provides context.
- 1Add a 'Slack' node set to 'Send Message'
- 2Map Channel to the original channel
- 3Set Thread TS to the original message timestamp
- 4Map Text to your formatted response
Node Settings > On Error
Add Error Handling
Set up error handling for API failures and rate limits. This prevents the workflow from breaking when OpenAI is unavailable.
- 1Click the OpenAI node settings gear
- 2Set 'On Error' to 'Continue With Last Node'
- 3Add an IF node to check for errors
- 4Route errors to a Slack notification
Workflow > Test Workflow
Test the Workflow
Run a complete test with a real client email pasted in Slack. This verifies all connections and data mapping work correctly.
- 1Click 'Test Workflow' in the top bar
- 2Paste a sample client email in your Slack channel
- 3Watch the workflow execution in real-time
- 4Verify the response appears as a thread reply
Workflow > Active Toggle
Activate Production Mode
Enable the workflow to run automatically on new Slack messages. This makes the automation live for your team.
- 1Click the toggle switch to 'Active'
- 2Verify the status shows 'Active' with green indicator
- 3Test with one more real message to confirm
- 4Share the channel with your team
Drop this into an n8n Code node.
JavaScript — Code Node// Extract email body from Slack message▸ Show code
// Extract email body from Slack message const message = $input.first().json.text; const emailMatch = message.match(/From:[\s\S]*?(?=\n\n|$)/i);
... expand to see full code
// Extract email body from Slack message
const message = $input.first().json.text;
const emailMatch = message.match(/From:[\s\S]*?(?=\n\n|$)/i);
if (emailMatch) {
return [{ json: { email_content: emailMatch[0], clean_text: emailMatch[0].replace(/^From:|^To:|^Subject:/gmi, '').trim() } }];
} else {
return [{ json: { error: 'No email format detected' } }];
}Scaling Beyond 100+ emails/day+ Records
If your volume exceeds 100+ emails/day records, apply these adjustments.
Switch to GPT-3.5 Turbo
GPT-4 costs $0.06 per 1K tokens while GPT-3.5 costs $0.002. For simple email responses, the quality difference is minimal but costs drop 30x.
Add Queue Management
Use N8n's HTTP Request Queue to batch OpenAI calls and avoid rate limiting. Queue processes 5 emails at once instead of overwhelming the API.
Cache Common Responses
Store frequently used responses in a Google Sheet lookup table. Check for similar emails first before calling OpenAI to reduce API usage by 40-60%.
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 N8n for this if your team codes occasionally and you want full control over the email parsing logic. The JavaScript nodes handle complex email extraction better than Zapier's limited text formatters, and you can customize the GPT-4 prompts with conditional logic based on email type or sender. Skip N8n if you need this running in 10 minutes - Make's visual OpenAI connector is faster to set up.
This workflow burns 2-3 executions per email (trigger + processing + response). At 50 emails/month, that's 150 executions total. N8n's starter plan includes 5,000 executions for $20/month, so you're well covered. Zapier would cost $30/month for the same volume since their GPT-4 integration requires the Professional tier. Make charges per operation but includes OpenAI calls free - roughly $15/month for 50 emails.
Make wins on speed here - their native OpenAI module connects in 2 clicks versus N8n's manual API configuration. Zapier handles Slack threading more reliably with built-in thread management. But N8n gives you JavaScript processing power that the others can't match. You can parse complex email formats, extract specific data like order numbers or dates, and build conditional prompts based on email content.
OpenAI's API returns different response structures depending on the model version - GPT-4 wraps text in a 'content' field while GPT-3.5 uses 'text'. Your parsing code breaks when OpenAI updates their response format. Rate limits hit at 3 requests per minute on free OpenAI accounts, causing 429 errors during busy periods. Slack's thread timestamps expire after 6 months, so old email threads will fail the reply mapping.
Ideas for what to build next
- →Add Response Approval — Create Slack buttons for 'Approve' and 'Edit' so team members can review AI drafts before sending. Routes to a separate workflow for actual email delivery.
- →Track Email Sentiment — Add sentiment analysis to classify incoming emails as urgent, positive, or complaints. Route different types to different response templates or team members.
- →
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