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

How to Auto-Translate Slack Messages with N8n and OpenAI

Automatically translate Slack messages to different languages when users react with flag emojis using N8n and OpenAI's API.

Steps and UI details are based on platform versions at time of writing β€” check each platform for the latest interface.

Best for

Teams that want instant message translation with custom language handling and don't mind writing basic JavaScript for emoji mapping.

Not ideal for

Non-technical teams who prefer plug-and-play solutions without any custom code or function nodes.

Sync type

real-time

Use case type

notification

Real-World Example

πŸ’‘

A 25-person software startup with team members in 6 countries uses this to break down language barriers in their #general channel. Before automation, non-English speakers would post in their native language and wait hours for someone to translate, slowing down urgent discussions. Now anyone reacts with a flag emoji and gets instant translation as a thread reply, keeping conversations moving at startup speed.

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

Slack admin permissions to install N8n app in your workspace
OpenAI API key with available credits ($5+ recommended for testing)
N8n account (self-hosted or cloud instance running)
Basic understanding of which flag emojis your team will use

Field Mapping

Map these fields between your apps.

FieldAPI Name
Required
Original Message Textitem.message.text
Reaction Emojireaction
Channel IDitem.channel
Message Timestampitem.ts
Target Languagelanguage
Translation Resultchoices[0].message.content

Step-by-Step Setup

1

Workflows > New > Add Node > Slack Trigger

Create New N8n Workflow

Start a new workflow in N8n and add the Slack trigger node. This will listen for emoji reactions on messages in your workspace.

  1. 1Click 'New workflow' in the N8n dashboard
  2. 2Click the '+' button to add your first node
  3. 3Search for 'Slack' and select 'Slack Trigger'
  4. 4Choose 'Reaction Added' from the events dropdown
βœ“ What you should see: You should see a Slack Trigger node with 'Reaction Added' selected as the event type.
2

Node Settings > Credentials > Create New

Connect Slack Account

Link your Slack workspace to N8n using OAuth. You'll need admin permissions to install the N8n app in your workspace.

  1. 1Click 'Create New' next to Credentials
  2. 2Select 'Slack OAuth2 API' from the dropdown
  3. 3Click 'Connect my account' and authorize in the popup
  4. 4Select your workspace and click 'Allow'
βœ“ What you should see: The credentials dropdown should show 'Slack account connected' with a green checkmark.
⚠
Common mistake β€” Don't use a Slack webhook URL here β€” the OAuth connection lets N8n listen for reactions in real-time.
n8n settings
Connection
Choose a connection…Add
click Add
OpenAI
Log in to authorize
Authorize n8n
popup window
βœ“
Connected
green checkmark
3

Slack Node > Additional Fields > Filters

Configure Reaction Trigger

Set up the trigger to fire only on flag emoji reactions. This prevents the workflow from running on every reaction in your workspace.

  1. 1In the Slack node, click 'Add Filter' under Additional Fields
  2. 2Set Filter Key to 'reaction'
  3. 3Set Filter Value to 'flag-*' to match any flag emoji
  4. 4Enable 'Use Regex' checkbox for the wildcard pattern
βœ“ What you should see: The trigger settings should show a filter for 'reaction' matching 'flag-*' with regex enabled.
⚠
Common mistake β€” Without the flag filter, this workflow triggers on every emoji reaction and will burn through your execution quota fast.
n8n
+
click +
search apps
OpenAI
OP
OpenAI
Configure Reaction Trigger
OpenAI
OP
module added
4

Add Node > Function > Code Editor

Add Function Node for Language Detection

Create a function node to map flag emojis to language codes. This converts reactions like :flag-fr: into 'French' for OpenAI's API.

  1. 1Click '+' to add a new node after Slack
  2. 2Search for 'Function' and select it
  3. 3Paste the flag-to-language mapping code in the code editor
  4. 4Set the output to include both language name and original message text
βœ“ What you should see: The Function node should show your JavaScript code and output the detected language plus message content.
5

Add Node > OpenAI > Chat

Connect OpenAI Translation Node

Add OpenAI node to handle the actual translation. Configure it to use GPT-3.5-turbo for cost efficiency since translation doesn't need GPT-4.

  1. 1Add a new node and select 'OpenAI'
  2. 2Choose 'Chat' as the resource type
  3. 3Create new OpenAI credentials with your API key
  4. 4Set Model to 'gpt-3.5-turbo' in the options
βœ“ What you should see: OpenAI node shows 'Chat' resource selected with gpt-3.5-turbo model and connected credentials.
⚠
Common mistake β€” Don't use text-davinci-003 β€” it costs 10x more than gpt-3.5-turbo for the same translation quality.
6

OpenAI Node > Messages

Configure Translation Prompt

Set up the chat prompt to translate messages accurately. Include context about preserving formatting and handling technical terms appropriately.

  1. 1In the OpenAI node, set System Message to 'You are a translator. Translate the following message accurately, preserving any formatting or technical terms.'
  2. 2Set User Message to reference the function output: 'Translate this to {{$node["Function"].json["language"]}}: {{$node["Function"].json["message"]}}'
  3. 3Set Max Tokens to 500 to handle longer messages
  4. 4Set Temperature to 0.1 for consistent translations
βœ“ What you should see: The prompt fields should show your system message and user message template with proper node references.
⚠
Common mistake β€” Higher temperature values make translations inconsistent β€” keep it at 0.1 for reliability.
7

Add Node > Slack > Message > Post

Add Slack Reply Node

Configure a Slack node to post the translation as a thread reply. This keeps translations organized under the original message.

  1. 1Add another Slack node after OpenAI
  2. 2Set Resource to 'Message' and Operation to 'Post'
  3. 3Use the same Slack credentials from step 2
  4. 4Set Channel to reference the original channel: {{$node["Slack Trigger"].json["item"]["channel"]}}
βœ“ What you should see: New Slack node configured for posting messages with channel dynamically set from the trigger data.
8

Slack Message Node > Text and Thread Settings

Configure Thread Reply

Set the message to post as a threaded reply with the translation. Include the target language for clarity.

  1. 1Set Text field to: 'Translation ({{$node["Function"].json["language"]}}): {{$node["OpenAI"].json["choices"][0]["message"]["content"]}}'
  2. 2Set Thread TS to: {{$node["Slack Trigger"].json["item"]["ts"]}}
  3. 3Enable 'As User' to false so it posts as the N8n bot
  4. 4Test the workflow with Execute Workflow button
βœ“ What you should see: Message configuration shows your template text and thread timestamp reference from the trigger data.
⚠
Common mistake β€” Without Thread TS, replies post as new messages instead of threads and clutter your channels.
9

OpenAI Node > Settings > Error Handling

Add Error Handling

Configure error handling for API failures and unsupported languages. This prevents the workflow from breaking on edge cases.

  1. 1Click Settings on the OpenAI node
  2. 2Under 'On Error', select 'Continue With Default Value'
  3. 3Set Default Value to 'Translation unavailable'
  4. 4Enable 'Always Output Data' checkbox
βœ“ What you should see: OpenAI node settings show error handling enabled with your fallback message configured.
⚠
Common mistake β€” Without error handling, unsupported flag emojis crash the entire workflow instead of gracefully failing.
10

Workflow > Activate > Test in Slack

Test with Real Reactions

Activate the workflow and test it with actual flag emoji reactions in Slack. Verify translations appear as threaded replies.

  1. 1Click 'Save' then 'Activate' in the top right
  2. 2Go to any Slack channel where the N8n app is installed
  3. 3Post a test message and react with a flag emoji like :flag-es:
  4. 4Check that the translation appears as a thread reply within 30 seconds
βœ“ What you should see: Your test message should get a threaded reply with the Spanish translation of your original text.
⚠
Common mistake β€” The N8n app needs to be in the specific channel to detect reactions β€” invite @N8n to channels where you want translation.

Drop this into an n8n Code node.

JavaScript β€” Code Nodeconst flagToLanguage = {
β–Έ Show code
const flagToLanguage = {
  'flag-es': 'Spanish',
  'flag-fr': 'French', 

... expand to see full code

const flagToLanguage = {
  'flag-es': 'Spanish',
  'flag-fr': 'French', 
  'flag-de': 'German',
  'flag-it': 'Italian',
  'flag-pt': 'Portuguese',
  'flag-jp': 'Japanese',
  'flag-kr': 'Korean',
  'flag-cn': 'Chinese',
  'flag-ru': 'Russian'
};

const reaction = $input.item.json.reaction.replace(/:/g, '');
const language = flagToLanguage[reaction] || 'English';
const message = $input.item.json.item.message.text;

return { language, message, original_reaction: reaction };
n8n
β–Ά Run once
executed
βœ“
OpenAI
βœ“
Slack
Slack
πŸ”” notification
received

Scaling Beyond 50+ translations per day+ Records

If your volume exceeds 50+ translations per day records, apply these adjustments.

1

Cache Common Translations

Add a Google Sheets node to cache frequently translated phrases. Check the cache first before calling OpenAI to reduce API costs and speed up responses for repeated content.

2

Batch Similar Requests

Use N8n's SplitInBatches node to group multiple translation requests into single OpenAI calls. The API handles multiple translations in one request more efficiently than individual calls.

3

Monitor OpenAI Costs

Add a function node to log token usage after each translation. Set up alerts when daily costs exceed your budget threshold to avoid surprise bills during high-usage periods.

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 N8n for this if you want full control over the translation logic and don't mind writing some JavaScript. N8n's function nodes let you build custom flag-to-language mapping that handles edge cases Zapier's pre-built apps miss. The webhook triggers fire instantly when someone reacts, unlike polling-based tools. Skip N8n if your team has zero coding comfort β€” Zapier's drag-and-drop interface handles basic flag translation without any custom code.

Cost

This workflow burns about 3 executions per translation: trigger, function processing, and OpenAI call. At 100 translations per month, that's 300 executions total. N8n's Starter plan covers 5,000 executions for $20/month, so you're well within limits. Add $2-3 in OpenAI costs using gpt-3.5-turbo. Zapier would cost $30/month for the same volume since their Slack reactions require a Professional plan. Make comes out cheaper at $15/month but caps you at 10,000 operations.

Tradeoffs

Zapier wins on setup speed β€” their Slack reaction trigger connects in 2 clicks without custom code for language detection. Make's visual debugger shows exactly which emoji triggered each run, making troubleshooting easier than N8n's execution logs. But N8n beats both on customization depth. You can add custom translation rules, handle business-specific terminology, or route certain languages to human translators instead of AI.

OpenAI's chat completions work differently than their legacy text completions β€” the response structure changed from 'choices[0].text' to 'choices[0].message.content' in early 2023. Old tutorials reference the wrong path and break silently. Slack's emoji format varies by client: mobile apps send 'flag-us' while desktop sends ':flag-us:' with colons. Your function node needs to handle both formats or reactions from mobile users will fail. The Slack app permissions are sticky β€” if you change scopes later, you must reinstall the entire N8n app in your workspace.

Ideas for what to build next

  • β†’
    Add Translation Confidence Scoring β€” Enhance the OpenAI prompt to include confidence scores and flag uncertain translations for human review in a separate Slack channel.
  • β†’
    Create Translation Usage Dashboard β€” Send translation logs to Google Sheets or Airtable to track which languages are most requested and optimize your flag emoji mappings.
  • β†’
    Build Reverse Translation Flow β€” Add a second workflow that translates the translation back to English when someone reacts to the translated message, helping verify accuracy.

Related guides

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