AutomationFlowsAI & RAG › Agent with RAG

Agent with RAG

agent_with_rag. Uses slackTrigger, agent, toolWorkflow, slack. Event-driven trigger; 4 nodes.

Event trigger★★☆☆☆ complexityAI-powered4 nodesSlack TriggerAgentTool WorkflowSlack
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Agent → Slack recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "agent_with_rag",
  "nodes": [
    {
      "id": "Slack Trigger",
      "name": "Slack Trigger",
      "type": "n8n-nodes-base.slackTrigger",
      "typeVersion": 1,
      "position": [
        -560,
        120
      ],
      "parameters": {
        "event": "message.channels"
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "AI Agent",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1,
      "position": [
        -280,
        120
      ],
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.event.text }}",
        "options": {
          "systemMessage": "Route product queries to search_products; use search_web for live web data."
        }
      }
    },
    {
      "id": "Tool - search_products",
      "name": "Tool - search_products",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 1,
      "position": [
        -280,
        -40
      ],
      "parameters": {
        "name": "search_products",
        "description": "Search product knowledge base for specs, prices and IDs.",
        "workflowId": "tool_search_products"
      }
    },
    {
      "id": "Reply",
      "name": "Reply",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        -20,
        120
      ],
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channel": "={{ $('Slack Trigger').item.json.event.channel }}",
        "text": "={{ $json.output || $json.text }}"
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Slack Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tool - search_products": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

agent_with_rag. Uses slackTrigger, agent, toolWorkflow, slack. Event-driven trigger; 4 nodes.

Source: https://github.com/ogu83/n8n-ai-agent-lab/blob/main/ep3-rag-pipeline/workflows/agent_with_rag.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Slack-Ai-Assistant. Uses agent, lmChatOpenAi, memoryBufferWindow, slackTrigger. Event-driven trigger; 13 nodes.

Agent, OpenAI Chat, Memory Buffer Window +9
AI & RAG

main_agent. Uses slackTrigger, agent, memoryRedisChat, slack. Event-driven trigger; 7 nodes.

Slack Trigger, Agent, Memory Redis Chat +2
AI & RAG

generalist_agent. Uses slackTrigger, agent, toolWorkflow, slack. Event-driven trigger; 4 nodes.

Slack Trigger, Agent, Tool Workflow +1
AI & RAG

Chat with a multi-agent system to write a blog. The orchestrator advances through research, headlines, hooks, outline, intro, draft, and final polish–one phase per reply—outputting options and asking

Agent, Tool Workflow, Memory Buffer Window +9
AI & RAG

Jarvisbiz. Uses slackTrigger, lmChatOpenAi, memoryBufferWindow, slack. Event-driven trigger; 10 nodes.

Slack Trigger, OpenAI Chat, Memory Buffer Window +3