AutomationFlowsAI & RAG › N8n Agent

N8n Agent

N8N Agent. Uses httpRequest, lmChatGoogleGemini, outputParserStructured, googleSheets. Webhook trigger; 16 nodes.

Webhook trigger★★★★☆ complexityAI-powered16 nodesHTTP RequestGoogle Gemini ChatOutput Parser StructuredGoogle SheetsChat TriggerGoogle Sheets ToolAgent
AI & RAG Trigger: Webhook Nodes: 16 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": "My workflow",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "line-chatbot-9527",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -320,
        368
      ],
      "id": "38b12dba-3e6e-442b-866d-e98ef6236a23",
      "name": "Webhook"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "5e880bf1-cc57-4689-9184-5f49e455ddf8",
              "name": "type",
              "value": "={{ $json.body.events[0].message.type }}",
              "type": "string"
            },
            {
              "id": "1329d613-afb4-48c0-9e41-b231270adcfe",
              "name": "message_id",
              "value": "={{ $json.body.events[0].message.id }}",
              "type": "string"
            },
            {
              "id": "ce2d4013-92e3-4f55-adde-3f7ccd3f1cae",
              "name": "reply_token",
              "value": "={{ $json.body.events[0].replyToken }}",
              "type": "string"
            },
            {
              "id": "74b08efb-8842-4656-8f9f-4526f470645e",
              "name": "message_text",
              "value": "={{ $json.body.events[0].message.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -144,
        368
      ],
      "id": "4ce3fbed-19ef-422e-af87-36acada1bbb6",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "text",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "1edebd08-ffd2-49eb-90d5-c4fec716aa1c"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "\u6587\u5b57\u8a0a\u606f"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "d17021cc-45a0-4f73-b924-33d79eaad644",
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "\u5716\u7247"
            }
          ]
        },
        "options": {
          "fallbackOutput": 0
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        16,
        368
      ],
      "id": "49ed032b-1d9d-4c32-9cc4-42b575a77bc6",
      "name": "Switch"
    },
    {
      "parameters": {
        "url": "=https://api-data.line.me/v2/bot/message/{{ $json.message_id }}/content",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer j9aEmTyzt3+CgLcpiFQEVjYVv8fYvgij3tFDoIfmLpVWe9bsTX7TQH6VZjkHvDzeXE0KeI2DF53sJuMul1JZyXxCdVejr5waFKgCCvVjn1SvC9fZUu8jAedzMMqSG6v63LMQUW0tJsICeKIjSiRI3QdB04t89/1O/w1cDnyilFU="
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "output.jpg"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        528
      ],
      "id": "8ce10268-d978-4bc8-9f96-ff870d80a4c4",
      "name": "\u62ff\u7167\u7247"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        320,
        704
      ],
      "id": "7ce316d3-ac31-42fb-9ddc-52e79d471167",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"name\": \"\u5f35\u4e09\",\n  \"email\": \"three@5xcampus.com\", \n  \"title\": \"\u6383\u5730\u7684\",\n  \"company_name\": \"\u4e94\u500d\u5b78\u9662\", \n  \"phone\": \"0928123123\", \n  \"address\": \"\u8861\u967d\u8def\u4e03\u865f 100 \u6a13\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        624,
        704
      ],
      "id": "f97c7d58-de3c-443d-b4a2-2b99bcd60283",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"replyToken\":\"{{ $('Edit Fields').item.json.reply_token }}\",\n    \"messages\":[\n        {\n            \"type\":\"text\",\n            \"text\":\"\u540d\u7247\uff08{{ $json['\u59d3\u540d'] }}\uff09\u5df2\u5efa\u6a94\uff01\"\n        }\n    ]\n} ",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1168,
        432
      ],
      "id": "b9c3041b-b912-4f14-9c91-32d479e5c666",
      "name": "\u804a\u5929\u56de\u61c9",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"replyToken\":\"{{ $('Edit Fields').item.json.reply_token }}\",\n    \"messages\":[\n        {\n            \"type\":\"text\",\n            \"text\":\"\u9019\u597d\u50cf\u4e0d\u662f\u540d\u7247...\"\n        }\n    ]\n} ",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        976,
        640
      ],
      "id": "5a99b1d9-60b2-4cbc-a926-793457b52ac6",
      "name": "\u804a\u5929\u56de\u61c91",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1TuRMfxDlKJv54aXsyfXYW2nDTJK8Ey-U-_yd-ej1SEA",
          "mode": "list",
          "cachedResultName": "n8n \u540d\u7247\u738b v1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TuRMfxDlKJv54aXsyfXYW2nDTJK8Ey-U-_yd-ej1SEA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\u901a\u8a0a\u9304",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TuRMfxDlKJv54aXsyfXYW2nDTJK8Ey-U-_yd-ej1SEA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Email": "={{ $json.output.email }}",
            "\u59d3\u540d": "={{ $json.output.name }}",
            "\u96fb\u8a71": "={{ $json.output.phone.replaceAll(\"-\", \"\") }}",
            "\u516c\u53f8\u540d\u7a31": "={{ $json.output.company_name }}",
            "\u8077\u7a31": "={{ $json.output.title }}",
            "\u5730\u5740": "={{ $json.output.address }}",
            "\u5efa\u6a94\u65e5\u671f": "={{ $now }}"
          },
          "matchingColumns": [
            "Email"
          ],
          "schema": [
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "\u59d3\u540d",
              "displayName": "\u59d3\u540d",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u96fb\u8a71",
              "displayName": "\u96fb\u8a71",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u516c\u53f8\u540d\u7a31",
              "displayName": "\u516c\u53f8\u540d\u7a31",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u8077\u7a31",
              "displayName": "\u8077\u7a31",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u5730\u5740",
              "displayName": "\u5730\u5740",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u5efa\u6a94\u65e5\u671f",
              "displayName": "\u5efa\u6a94\u65e5\u671f",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "cellFormat": "RAW"
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        976,
        432
      ],
      "id": "132478f3-f6b8-4f14-8218-749c1250ec47",
      "name": "\u540d\u7247\u901a\u8a0a\u9304",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "d8fee4a8-ee4c-429e-b652-d004a04d340c",
              "leftValue": "={{ $json.output.email }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        736,
        528
      ],
      "id": "c03ec1a9-c3ca-450a-86e6-e1765e644158",
      "name": "\u662f\u5426\u70ba\u540d\u7247"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        256,
        320
      ],
      "id": "1452a0fa-5ea0-4442-bb00-03193458be56",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.3,
      "position": [
        48,
        32
      ],
      "id": "8f1af726-c159-4f6b-9276-9e88f557355d",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "\u7528\u4f86\u67e5\u8a62\u901a\u8a0a\u9304\u6216\u540d\u7247\u7684\u5de5\u5177",
        "documentId": {
          "__rl": true,
          "value": "1TuRMfxDlKJv54aXsyfXYW2nDTJK8Ey-U-_yd-ej1SEA",
          "mode": "list",
          "cachedResultName": "n8n \u540d\u7247\u738b v1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TuRMfxDlKJv54aXsyfXYW2nDTJK8Ey-U-_yd-ej1SEA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\u901a\u8a0a\u9304",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TuRMfxDlKJv54aXsyfXYW2nDTJK8Ey-U-_yd-ej1SEA/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        512,
        320
      ],
      "id": "aeb2bccb-d451-469e-97ba-3c1f03bc9b2b",
      "name": "\u540d\u7247\u76d2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"replyToken\":\"{{ $('Edit Fields').item.json.reply_token }}\",\n    \"messages\":[\n        {\n            \"type\":\"text\",\n            \"text\":\"{{ $json.output.replaceAll(\"\\n\", \"\") }}\"\n        }\n    ]\n} ",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        640,
        80
      ],
      "id": "c5f97800-f805-4492-8a66-7a216adbe86b",
      "name": "\u804a\u5929\u56de\u61c92",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.chatInput || $json.message_text }}",
        "options": {
          "systemMessage": "=\u4f60\u662f\u300c\u83dc\u5e02\u5834\u963f\u9f8d\u300d\uff0c\u8077\u52d9\u662f\u52a9\u7406\u3002\u4f60\u7684\u4e3b\u8981\u5de5\u4f5c\u662f\u5e6b\u52a9\u4f7f\u7528\u8005\u67e5\u8a62\u548c\u7ba1\u7406\u901a\u8a0a\u9304\u3002\n\n# \u91cd\u8981\uff1a\u4f55\u6642\u4f7f\u7528\u5de5\u5177\n\n- \u7576\u4f7f\u7528\u8005\u8a62\u554f\u300c\u67d0\u500b\u4eba\u7684\u8cc7\u6599\u300d\u3001\u300c\u806f\u7d61\u65b9\u5f0f\u300d\u3001\u300c\u96fb\u8a71\u300d\u3001\u300cemail\u300d\u6642 \u2192 \u5fc5\u9808\u4f7f\u7528 `\u540d\u7247\u76d2` \u5de5\u5177\u67e5\u8a62\n- \u7576\u4f7f\u7528\u8005\u554f\u300c\u6709\u8ab0\u300d\u3001\u300c\u6709\u54ea\u4e9b\u516c\u53f8\u300d\u3001\u300c\u67e5\u8a62 XXX\u300d\u6642 \u2192 \u5fc5\u9808\u4f7f\u7528 `\u540d\u7247\u76d2` \u5de5\u5177\u67e5\u8a62\n- \u7576\u4f7f\u7528\u8005\u63d0\u5230\u4eba\u540d\u3001\u516c\u53f8\u540d\u3001\u96fb\u8a71\u865f\u78bc\u6642 \u2192 \u5fc5\u9808\u4f7f\u7528 `\u540d\u7247\u76d2` \u5de5\u5177\u67e5\u8a62\n- \u5176\u4ed6\u4e00\u822c\u804a\u5929 \u2192 \u76f4\u63a5\u56de\u8986\u5373\u53ef\uff0c\u4e0d\u9700\u8981\u4f7f\u7528\u5de5\u5177\n\n# \u67e5\u8a62\u898f\u5247\n\n1. \u6536\u5230\u67e5\u8a62\u8acb\u6c42\u6642\uff0c\u4f60\u5fc5\u9808\u5148\u4f7f\u7528 `\u540d\u7247\u76d2` \u5de5\u5177\u9032\u884c\u67e5\u8a62\n2. \u67e5\u8a62\u95dc\u9375\u5b57\u53ef\u4ee5\u662f\uff1a\u59d3\u540d\u3001\u516c\u53f8\u540d\u7a31\u3001\u96fb\u8a71\u3001Email \u7b49\n3. \u5373\u4f7f\u4f60\u4e0d\u78ba\u5b9a\u80fd\u5426\u627e\u5230\uff0c\u4e5f\u8981\u5148\u5617\u8a66\u67e5\u8a62\n\n# \u56de\u8986\u898f\u5247 - \u91cd\u8981\uff01\n\n1. \u53ea\u56de\u7b54\u4f7f\u7528\u8005\u554f\u7684\u8cc7\u8a0a\uff0c\u4e0d\u8981\u591a\u7d66\n2. \u5982\u679c\u67d0\u500b\u6b04\u4f4d\u6c92\u6709\u8cc7\u6599\uff08\u7a7a\u767d\u6216 null\uff09\uff0c\u5c31\u4e0d\u8981\u986f\u793a\u8a72\u6b04\u4f4d\n3. \u4e0d\u8981\u986f\u793a\u7a7a\u503c\u3001null\u3001undefined \u6216\u300c\u672a\u63d0\u4f9b\u300d\u7b49\u5b57\u6a23\n\n- \u5982\u679c\u53ea\u554f\u300c\u96fb\u8a71\u300d\u2192 \u53ea\u56de\u8986\u96fb\u8a71\n- \u5982\u679c\u53ea\u554f\u300cemail\u300d\u2192 \u53ea\u56de\u8986 email\n- \u5982\u679c\u53ea\u554f\u300c\u5728\u54ea\u5bb6\u516c\u53f8\u300d\u2192 \u53ea\u56de\u8986\u516c\u53f8\n- \u5982\u679c\u554f\u300cXXX \u7684\u8cc7\u6599\u300d\u6216\u300c\u5168\u90e8\u8cc7\u6599\u300d\u2192 \u624d\u56de\u8986\u5b8c\u6574\u8cc7\u8a0a\n\n# \u56de\u8986\u683c\u5f0f\n\n\u67e5\u8a62\u55ae\u4e00\u8cc7\u8a0a\u6642\uff08\u7cbe\u7c21\u56de\u8986\uff09\uff1a\n\n- \u554f\u96fb\u8a71 \u2192 \u300c{\u59d3\u540d} \u7684\u96fb\u8a71\u662f {\u96fb\u8a71}\u300d\n- \u554f email \u2192 \u300c{\u59d3\u540d} \u7684 email \u662f {email}\u300d\n- \u554f\u516c\u53f8 \u2192 \u300c{\u59d3\u540d} \u5728 {\u516c\u53f8}\u300d\n- \u554f\u8077\u7a31 \u2192 \u300c{\u59d3\u540d} \u662f {\u8077\u7a31}\u300d\n- \u5982\u679c\u8a72\u6b04\u4f4d\u6c92\u8cc7\u6599 \u2192 \u300c\u62b1\u6b49\uff0c\u901a\u8a0a\u9304\u88e1\u6c92\u6709 {\u59d3\u540d} \u7684{\u96fb\u8a71/email/...}\u300d\n\n\u67e5\u8a62\u5b8c\u6574\u8cc7\u6599\u6642\uff08\u8a73\u7d30\u56de\u8986\uff09\uff1a\n\u627e\u5230\u4e86\uff01\u4ee5\u4e0b\u662f {\u59d3\u540d} \u7684\u8cc7\u6599\uff1a\nEmail: xxx \uff08\u6709\u8cc7\u6599\u624d\u986f\u793a\uff09\n\u96fb\u8a71: xxx \uff08\u6709\u8cc7\u6599\u624d\u986f\u793a\uff09\n\u516c\u53f8: xxx \uff08\u6709\u8cc7\u6599\u624d\u986f\u793a\uff09\n\u8077\u7a31: xxx \uff08\u6709\u8cc7\u6599\u624d\u986f\u793a\uff09\n\u5730\u5740: xxx \uff08\u6709\u8cc7\u6599\u624d\u986f\u793a\uff09\n\n\u627e\u4e0d\u5230\u8cc7\u6599\u6642\uff1a\n\u62b1\u6b49\uff0c\u6211\u5728\u901a\u8a0a\u9304\u88e1\u627e\u4e0d\u5230\u76f8\u95dc\u8cc7\u6599\u8036\u3002\u8981\u4e0d\u8981\u63db\u500b\u95dc\u9375\u5b57\u8a66\u8a66\u770b\uff1f\n\n\u4e00\u822c\u804a\u5929\u6642\uff1a\n\u7528\u8f15\u9b06\u53cb\u5584\u7684\u8a9e\u6c23\u56de\u61c9\u5373\u53ef\n\n# \u7bc4\u4f8b\u5c0d\u8a71\n\n\u4f7f\u7528\u8005\uff1a\u300c\u5f35\u4e09\u7684\u96fb\u8a71\uff1f\u300d\n\u4f60\uff1a\u300c\u5f35\u4e09\u7684\u96fb\u8a71\u662f 0928617687\u300d\n\n\u4f7f\u7528\u8005\uff1a\u300c\u5f35\u4e09\u7684\u8cc7\u6599\u300d\n\u4f60\uff1a\u300c\u627e\u5230\u4e86\uff01\u4ee5\u4e0b\u662f\u5f35\u4e09\u7684\u8cc7\u6599\uff1a\nEmail: three@5xcampus.com\n\u96fb\u8a71: 0928617687\n\u8077\u7a31: \u6253\u6383\u7684\u300d\n\uff08\u6ce8\u610f\uff1a\u56e0\u70ba\u516c\u53f8\u548c\u5730\u5740\u662f\u7a7a\u7684\uff0c\u6240\u4ee5\u4e0d\u986f\u793a\uff09\n\n\u4f7f\u7528\u8005\uff1a\u300c\u5f35\u4e09\u7684\u5730\u5740\u300d\n\u4f60\uff1a\u300c\u62b1\u6b49\uff0c\u901a\u8a0a\u9304\u88e1\u6c92\u6709\u5f35\u4e09\u7684\u5730\u5740\u300d\n\n\u4f7f\u7528\u8005\uff1a\u300c\u4eca\u5929\u5929\u6c23\u5982\u4f55\uff1f\u300d\n\u4f60\uff1a\u300c\uff08\u4e00\u822c\u804a\u5929\u56de\u8986\uff09\u300d\n\n\u8a18\u4f4f\uff1a\n\n1. \u4f7f\u7528\u8005\u554f\u4ec0\u9ebc\uff0c\u5c31\u56de\u7b54\u4ec0\u9ebc\n2. \u6c92\u6709\u8cc7\u6599\u7684\u6b04\u4f4d\uff0c\u76f4\u63a5\u8df3\u904e\u4e0d\u986f\u793a\n3. \u4fdd\u6301\u7c21\u6f54\u53cb\u5584"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        304,
        80
      ],
      "id": "c8644d67-fe19-42a1-9d62-fe8a2e26cccf",
      "name": "\u67e5\u8a62 Agent"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "data",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "\u4f60\u662f\u6211\u6700\u5f97\u529b\u7684\u52a9\u7406\uff0c\u4f60\u6703\u62ff\u5230\u4e00\u5f35\u7167\u7247\uff0c\u8acb\u4f60\u8a66\u8457\u8fa8\u8b58\u770b\u770b\uff0c\u5982\u679c\u4f60\u8a8d\u70ba\u9019\u662f\u4e00\u5f35\u540d\u7247\uff0c\u8acb\u628a\u8b58\u5225\u51fa\u4f86\u7684\u6240\u6709\u6587\u5b57\u7522\u751f\u7d50\u69cb\u5316\u8cc7\u6599\u3002\n\n\u5982\u679c\u6709\u7f3a\u7684\u8cc7\u6599\u586b\u5beb\u7a7a\u767d\u5373\u53ef"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        400,
        528
      ],
      "id": "011ca477-9a87-4736-b363-faaf865a41d8",
      "name": "\u540d\u7247\u738b Agent"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "\u67e5\u8a62 Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u62ff\u7167\u7247",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u62ff\u7167\u7247": {
      "main": [
        [
          {
            "node": "\u540d\u7247\u738b Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "\u540d\u7247\u738b Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "\u540d\u7247\u738b Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "\u540d\u7247\u901a\u8a0a\u9304": {
      "main": [
        [
          {
            "node": "\u804a\u5929\u56de\u61c9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u662f\u5426\u70ba\u540d\u7247": {
      "main": [
        [
          {
            "node": "\u540d\u7247\u901a\u8a0a\u9304",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u804a\u5929\u56de\u61c91",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "\u67e5\u8a62 Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "\u67e5\u8a62 Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u540d\u7247\u76d2": {
      "ai_tool": [
        [
          {
            "node": "\u67e5\u8a62 Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "\u67e5\u8a62 Agent": {
      "main": [
        [
          {
            "node": "\u804a\u5929\u56de\u61c92",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u540d\u7247\u738b Agent": {
      "main": [
        [
          {
            "node": "\u662f\u5426\u70ba\u540d\u7247",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "97e66fa6-6a97-4feb-bed9-e1007c03dda9",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "F5NpxaKCJzEBiyUq",
  "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

N8N Agent. Uses httpRequest, lmChatGoogleGemini, outputParserStructured, googleSheets. Webhook trigger; 16 nodes.

Source: https://github.com/puremars2015/TextBook/blob/7dde31a9c0dd7589b3c6a79b44306c761fc6fd81/n8n/n8n_agent.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

⏺ 🚀 How it works

Agent, Anthropic Chat, Output Parser Structured +6
AI & RAG

This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expense receipts into a folder, or add bank statements - the system a

Chat Trigger, HTTP Request, Google Sheets +8
AI & RAG

Enhance your support, onboarding, and internal knowledge workflows with an intelligent RAG-powered chatbot that responds using live data stored in Google Sheets. 🤖📚 Built for teams that rely on struct

Chat Trigger, Output Parser Structured, Memory Buffer Window +6
AI & RAG

LineOA. Uses httpRequest, agent, lmChatGoogleGemini, outputParserStructured. Webhook trigger; 69 nodes.

HTTP Request, Agent, Google Gemini Chat +3
AI & RAG

Resume Screening & Behavioral Interviews with Gemini, Elevenlabs, & Notion ATS copy. Uses outputParserStructured, chainLlm, googleDrive, stickyNote. Webhook trigger; 67 nodes.

Output Parser Structured, Chain Llm, Google Drive +9