Skip to main content

Slack AI ChatBot : context-aware, replies to mentions AND also DMs

Workflow preview

Workflow preview
100%
Slack AI ChatBot : context-aware, replies to mentions AND also DMs preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Click here to access this Workflow for free . Get your own custom ChatGPT inside your Slack Workspace Descripti...

Best for

  • Internal Wiki automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.vectorstorepinecone, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.toolthink, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Theo Marcadet.

Original n8n.io source

1.1 Workflow description

Title
Slack AI ChatBot : context-aware, replies to mentions AND also DMs
Workflow name
Slack AI ChatBot : context-aware, replies to mentions AND also DMs

Click here to access this Workflow for free.


Get your own custom ChatGPT inside your Slack Workspace

Description

This n8n workflow enables a fully autonomous AI assistant within your Slack Workspace. It listens for both public mentions and direct messages (DMs), and replies in real-time using a large language model (OpenAI's GPT-4o by default). The assistant can dynamically fetch previous messages for better context, providing smart, coherent, and personalized responses.


🔧 Key Features

  • Dual Trigger: Reacts to both public bot mentions and private DMs.
  • Context-Aware AI: Dynamically fetches the last 20 messages from either public or private conversations.
  • Smart Routing: Replies either in the original public channel or via DM, depending on where the message came from.
  • Custom Prompting: Easily modify the system prompt to define the AI’s tone, behavior, and personality.
  • Fully Autonomous: No manual intervention required — the bot always replies instantly.

✅ Requirements

  • An operational n8n instance.
  • A Slack workspace (you can create one for free here)
  • A Slack account with Admin or Owner privileges (required to install apps)

🧰 Setup Instructions

Slack Bot Setup
  • Create a Slack App with the necessary permissions and configurations > You will find in the next step a complete tutorial to craft your own bot with the right confirguration and permissions for this workflow to work
  • Set your Slack bot token in n8n's credential manager.

🤖 How It Works

  • When a public mention is detected, the bot replies directly in the channel, referencing the original message.
  • When a DM is received, it responds privately.
  • The AI uses a tool to read the latest 20 public or private messages to build accurate context before replying.

🛠 Customization Options

  • Change LLM: Swap out OpenAI with any LLM that has an API.
  • Edit Prompt Behavior: Modify the system prompt to control tone and personality.

If you just need a tutorial on setting up your Slack bot, be my guest ➡️ Here


And if you need any help, or have any question, feel free to come discuss about it on Telegram

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Pinecone Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.1

Block 2 - Mapping data for the Agent

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Either the bot should reply in dm or in public channel

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 8 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 10 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Think

Type / Role
@n8n/n8n-nodes-langchain.toolThink - toolThink
Config choices
Version 1

Block 14 - Reply to public mention

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 15 - Reply to DM

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 16 - Get the history of a channel in Slack

Type / Role
n8n-nodes-base.slackTool - slackTool
Config choices
Version 2.3

Block 17 - Slack Trigger

Type / Role
n8n-nodes-base.slackTrigger - slackTrigger
Config choices
Version 1

Block 18 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 19 - Simple Memory1

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

3. Summary Table

Workflow Slack AI ChatBot : context-aware, replies to mentions AND also DMs
Complexity advanced
Nodes 19
Categories Internal Wiki, AI Chatbot
Author Theo Marcadet
Published 10 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5845/5845.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Slack AI ChatBot : context-aware, replies to mentions AND also DMs do?

Click here to access this Workflow for free . Get your own custom ChatGPT inside your Slack Workspace Descripti...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI Chatbot use case.