Skip to main content

Answer code of conduct questions in Slack with GPT-4 & RAG technology

Workflow preview

Workflow preview
100%
Answer code of conduct questions in Slack with GPT-4 & RAG technology preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Code of Conduct Q&A Slack Chatbot with RAG Powered [ ](https://www.y...

Best for

  • AI RAG automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.if, n8n-nodes-base.noop, n8n-nodes-base.webhook, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.slack, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.vectorstoreinmemory

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Answer code of conduct questions in Slack with GPT-4 & RAG technology
Workflow name
Answer code of conduct questions in Slack with GPT-4 & RAG technology

πŸ“˜ Code of Conduct Q&A Slack Chatbot with RAG Powered

> Empower employees to instantly access and understand the company’s Code of Conduct via a Slack chatbot, powered by Retrieval-Augmented Generation (RAG) and LLMs.

πŸ§‘β€πŸ’Ό Who’s it for

This workflow is designed for:

  • HR and compliance teams to automate policy-related inquiries
  • Employees who want quick answers to Code of Conduct questions directly inside Slack
  • Startups or enterprises that need internal compliance self-service tools powered by AI

βš™οΈ How it works / What it does

This RAG-powered Slack chatbot answers user questions based on your uploaded Code of Conduct PDF using GPT-4 and embedded document chunks. Here's the flow:

  1. Receive Message from Slack: A webhook triggers when a message is posted in Slack.
  2. Check if it’s a valid query: Filters out non-user messages (e.g., bot mentions).
  3. Run Agent with RAG:
    • Uses GPT-4 with Query Data Tool to retrieve relevant document chunks.
    • Returns a well-formatted, context-aware answer.
  4. Send Response to Slack: Fetches user info and posts the answer back in the same channel.
  5. Document Upload Flow:
    • HR can upload the PDF Code of Conduct file.
    • It’s parsed, chunked, embedded using OpenAI, and stored for future query retrieval.
    • A backup copy is saved to Google Drive.

πŸ› οΈ How to set up

  1. Prepare your environment:

  2. Upload the Code of Conduct PDF:

  3. Deploy the chatbot:

    • Host the webhook and connect it to your Slack app.
    • Share the command format with employees (e.g., @CodeBot Can I accept gifts from partners?)
  4. Monitor and iterate:

    • Improve chunk size or embed model if queries aren’t accurate.
    • Review unanswered queries to enhance coverage.

πŸ“‹ Requirements

  • n8n (Self-hosted or Cloud)
  • Slack App (with chat:write, users:read, commands)
  • OpenAI account (embedding + GPT-4 access)
  • Google Drive integration (for backups)
  • Uploaded Code of Conduct in PDF format

🧩 How to customize the workflow

What to Customize How to Do It
πŸ”€ Prompt style Edit the System & User prompts inside the Code Of Conduct Agent node
πŸ“„ Document types Upload additional policy PDFs and tag them differently in metadata
πŸ€– Agent behavior Tune GPT temperature or replace with different LLM
πŸ’¬ Slack interaction Customize message formats or trigger phrases
πŸ“ Data Store engine Swap to Pinecone, Weaviate, Supabase, etc. depending on use case
🌐 Multilingual support Preprocess text and support locale detection via Slack metadata

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 - Is user message?

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

Block 2 - No Operation, do nothing

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

Block 3 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - gpt4-1 model

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

Block 5 - Send result in the mentioned channel

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

Block 6 - Get information about a user

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

Block 7 - Sticky Note

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

Block 8 - Default Data Loader

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

Block 9 - Insert Data to Store

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

Block 10 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Upload your PDF document here

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

Block 12 - Backup document(s) to Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 13 - Embeddings OpenAI

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

Block 14 - Query Data Tool

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

Block 15 - Code Of Conduct Agent

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

Block 16 - Sticky Note1

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

Block 17 - Sticky Note2

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

Block 18 - Sticky Note3

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

Block 19 - Sticky Note4

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

Block 20 - Sticky Note5

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

Block 21 - Sticky Note6

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

Block 22 - Sticky Note7

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

Block 23 - Sticky Note8

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

Block 24 - Sticky Note9

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

3. Summary Table

Workflow Answer code of conduct questions in Slack with GPT-4 & RAG technology
Complexity advanced
Nodes 24
Categories AI RAG, Multimodal AI
Author Trung Tran
Published 22 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7722/7722.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 Answer code of conduct questions in Slack with GPT-4 & RAG technology do?

Code of Conduct Q&A Slack Chatbot with RAG Powered [ ](https://www.y...

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 AI RAG, Multimodal AI use case.