n8n

How to Automate Slack AI Support Replies?

Turn Slack posts into clear AI answers. Team members send a message and get a follow up reply in the same channel. Good for handling common support questions, internal FAQs, and quick coaching for agents.

An n8n Webhook receives a POST from Slack and forwards key fields to an AI Agent. The agent uses a Google Gemini chat model and a window buffer that stores conversation history. The session key comes from the Slack body token and keeps up to ten recent messages for context. Slack has a short response window, so the bot sends a fresh message that shows the original text and the AI result, with markdown removed for clean formatting. This design supports fast replies without blocking Slack.

Use a public https webhook URL, connect your Slack app, and add your Google Gemini API key in n8n. Map channel id, user name, and text from the incoming payload, and leave memory set to ten to balance context and cost. Expect faster first replies, less repetitive typing, and better triage in channels that handle many requests every day. Many teams cut first response time from minutes to seconds and keep a steady tone across threads.

What are the key features?

  • POST Webhook trigger at path slack bot collects user name, text, and channel id from Slack
  • AI Agent powered by Google Gemini 1.5 Flash processes prompts and returns answers quickly
  • Window Buffer Memory uses the Slack token as the session id and stores the last 10 turns
  • New Slack message posting avoids the short response window and keeps the channel flow smooth
  • Reply shows the original user text and the AI output with markdown cleaned using removeMarkdown
  • Channel routing uses channel id from the request so responses land in the right place
  • Model can be swapped so you can change the LLM without rebuilding the flow

What are the benefits?

  • Reduce first reply time from 10 minutes to under 30 seconds
  • Automate up to 60 percent of repeat questions in Slack channels
  • Keep context across the last 10 messages for more accurate answers
  • Handle five times more requests per hour with the same team
  • Connect Slack and Google Gemini without switching tools

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Slack and Google Gemini. See the Tools Required section above for links to create accounts with these services.
  3. In Slack, create or open your Slack app and add a Slash Command. Set the Request URL to the production https URL of the n8n Webhook node. Add the commands permission and chat write scope for the bot.
  4. Open the Webhook node in n8n. Confirm the path is slack bot and copy the production URL. Do not use localhost. Paste the URL into your Slack command settings.
  5. In the n8n credentials manager, create a Slack OAuth credential. Copy the Client ID and Client Secret from your Slack app, set the n8n redirect URL in Slack, then authorize the workspace.
  6. Open the Slack Send node in the workflow. Select the Slack credential you created, keep mrkdwn enabled, and leave the channel field mapped to the incoming channel id expression.
  7. In the n8n credentials manager, create a Google Gemini API Key credential. In Google AI Studio, generate an API key and paste it into the credential. Name it clearly for easy reuse.
  8. Open the Google Gemini Chat Model node and select your Google Gemini credential. Keep the model as Gemini 1.5 Flash or choose another model that fits your needs.
  9. Check the Window Buffer Memory node. Confirm the session key expression uses the Slack body token and the window length is set to 10 messages.
  10. Open the Agent node and verify it is linked to the Gemini model and the memory node. Save the workflow and activate it.
  11. Test in Slack by sending your slash command with a question. You may see a timeout in Slack, but a new message should appear in the channel with the AI reply. Verify logs in n8n for any errors.
  12. Troubleshoot common issues. If no reply appears, confirm the webhook URL is https and reachable. If the AI reply is empty, check your Gemini API key and model choice. If the message posts to the wrong place, confirm the channel id mapping in the Slack node. If formatting looks off, make sure markdown cleaning is enabled.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

Slack

Sign up

Free plan: $0 / mo; limited to 10 apps (third-party or custom) and usable via Slack API

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.