AutomationFlowsAI & RAG › Simple RAG

Simple RAG

simple_rag. Uses chatTrigger, agent, googleSheetsTool, lmChatOpenAi. Chat trigger; 6 nodes.

Chat trigger trigger★★☆☆☆ complexityAI-powered6 nodesChat TriggerAgentGoogle Sheets ToolOpenAI ChatMemory Buffer Window
AI & RAG Trigger: Chat trigger Nodes: 6 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Agent → Chat Trigger 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": "simple_rag",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -20,
        0
      ],
      "id": "e3561d16-a655-486e-b405-84192a608a2f",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=You are a helpful assistant with tools. Today is {{ $now }}.\n\n**Column Definitions and Data Types**\n- The data you handle must have the following columns and types:\n  - `date`: date, format `yyyy-mm-dd`\n  - `item`: string\n  - `cat`: string\n  - `unit`: string\n  - `price`: integer\n  - `qty`: integer\n  - `amount`: integer\n\n**Rules**\n1. When the user requests, create new rows in Google Sheets with the above columns and types.\n2. Do not modify or delete existing rows in Google Sheets; only add or create new rows.\n3. Ensure that:\n   - `price`, `qty`, and `amount` are integers only.\n   - `date` must be a valid date in the format `yyyy-mm-dd`.\n   - `item`, `cat`, and `unit` are strings.\n4. Use data validation rules in Google Sheets to enforce these data types and formats for each column.\n5. If the input does not match the required type or format, reject the input and prompt the user to correct it.\n\n**Example Row**\n| date      | item      | cat      | unit   | price | qty | amount |\n|-----------|-----------|----------|--------|-------|-----|--------|\n| 25/05/01  | Apple     | Fruit    | kg     | 3000  | 2   | 6000   |\n\n**Additional Notes**\n- Always validate the data before adding to the sheet.\n- Only allow data entry that matches the specified column types and formats.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        220,
        0
      ],
      "id": "724e43b5-da75-4d19-ab4d-0c609c3ff3e3",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1MBQqwE8mL_KiG-1jHvgGUg5Jr26l1nzoV4ShwNAZefk",
          "mode": "list",
          "cachedResultName": "test",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1MBQqwE8mL_KiG-1jHvgGUg5Jr26l1nzoV4ShwNAZefk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1MBQqwE8mL_KiG-1jHvgGUg5Jr26l1nzoV4ShwNAZefk/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        500,
        220
      ],
      "id": "5808b98c-85a7-4874-807e-ce7663001fb9",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        60,
        220
      ],
      "id": "58d00563-f19f-4b86-8837-196163eca963",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        200,
        220
      ],
      "id": "492bd2c7-c2e0-4e0e-b5c7-cc277a8fa186",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1MBQqwE8mL_KiG-1jHvgGUg5Jr26l1nzoV4ShwNAZefk",
          "mode": "list",
          "cachedResultName": "test",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1MBQqwE8mL_KiG-1jHvgGUg5Jr26l1nzoV4ShwNAZefk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1MBQqwE8mL_KiG-1jHvgGUg5Jr26l1nzoV4ShwNAZefk/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $fromAI('date__using_to_match_', ``, 'string') }}",
            "item": "={{ $fromAI('item', ``, 'string') }}",
            "cat": "={{ $fromAI('cat', ``, 'string') }}",
            "unit": "={{ $fromAI('unit', ``, 'string') }}",
            "price": "={{ $fromAI('price', ``, 'string') }}",
            "qty": "={{ $fromAI('qty', ``, 'string') }}",
            "amount": "={{ $fromAI('amount', ``, 'string') }}"
          },
          "matchingColumns": [
            "date"
          ],
          "schema": [
            {
              "id": "date",
              "displayName": "date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "item",
              "displayName": "item",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "cat",
              "displayName": "cat",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "unit",
              "displayName": "unit",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "price",
              "displayName": "price",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "qty",
              "displayName": "qty",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "amount",
              "displayName": "amount",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        380,
        220
      ],
      "id": "017c9196-a8b6-42d0-97bd-d3a9db1d0c97",
      "name": "Google Sheets1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f126124d-0a8b-4330-a757-5019c239242c",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "RlZMTCPEodSpIKaf",
  "tags": []
}

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

simple_rag. Uses chatTrigger, agent, googleSheetsTool, lmChatOpenAi. Chat trigger; 6 nodes.

Source: https://github.com/aieeiee/fc_nocoderag/blob/main/workflow/1_simple_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

Reservation Medcin. Uses chatTrigger, agent, lmChatOpenAi, memoryBufferWindow. Chat trigger; 12 nodes.

Chat Trigger, Agent, OpenAI Chat +3
AI & RAG

Airbnb Agent. Uses agent, chatTrigger, memoryBufferWindow, lmChatOpenAi. Chat trigger; 12 nodes.

Agent, Chat Trigger, Memory Buffer Window +3
AI & RAG

This workflow template is designed for dental assistants and anyone looking to automate appointment scheduling. It integrates Google Calendar for booking appointments and Google Sheets as a database t

Chat Trigger, Agent, OpenAI Chat +3
AI & RAG

Automate customer conversations with an AI-powered virtual receptionist. This workflow can chat naturally with clients, answer general business questions (like services, location, and hours), check av

Memory Buffer Window, Google Calendar Tool, Google Sheets Tool +5
AI & RAG

This n8n workflow template creates an intelligent data analysis system that converts natural language questions into Google Sheets SQL queries using OpenAI's GPT-4o model. The system generates proper

Agent, Google Sheets Tool, Memory Buffer Window +4