8
n8n 中文网amn8n.com

表格和计算器

中级

这是一个AI Chatbot, Multimodal AI领域的自动化工作流,包含 12 个节点。主要使用 Agent, GoogleSheetsTool, ChatTrigger, LmChatOpenAi, ToolCalculator 等节点。 使用GPT-4自然语言处理和计算器管理Google Sheets数据

前置要求
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "pBNm2caehtwbDPQb",
  "meta": {
    "instanceId": "c6fffa5bc1b2dcfd92357a5ec64832af921376f0ee8e89f229233d1ed315a8c1",
    "templateCredsSetupCompleted": true
  },
  "name": "表格和计算器",
  "tags": [],
  "nodes": [
    {
      "id": "18e19260-c46a-4dad-9eab-490cbee01da3",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1360,
        -352
      ],
      "webhookId": "1bf95244-fbc3-4210-9420-f34a45c4f5f5",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "30b3ac84-1632-4dae-b0f7-d8a45b9b81d8",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1616,
        -352
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "815e0be5-4c6e-48c8-ac9b-a1a46c59d98d",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1616,
        -48
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "65db670b-b985-41cf-bd78-4b72939be418",
      "name": "更新",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1744,
        320
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('ID__using_to_match_', ``, 'string') }}",
            "Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Name', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit?usp=drivesdk",
          "cachedResultName": "Demo"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "p8TFiJI7j90cCF0X",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "00ff76b8-c270-40f5-b6b0-00410c7bb05e",
      "name": "创建",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1552,
        320
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ `${Math.random()}`.replace('0.', '') }}",
            "Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Name', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit?usp=drivesdk",
          "cachedResultName": "Demo"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "p8TFiJI7j90cCF0X",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4b24fbb2-a147-4360-ad66-d0274188d18d",
      "name": "读取",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2096,
        -48
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit?usp=drivesdk",
          "cachedResultName": "Demo"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "p8TFiJI7j90cCF0X",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "ce66d9d2-52e6-43c6-a571-3f83c1bad082",
      "name": "删除",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1952,
        320
      ],
      "parameters": {
        "operation": "delete",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vbFb2dhys1VafAmX-hRtiyrEDgNKj_xaAA6ZmH09EL8/edit?usp=drivesdk",
          "cachedResultName": "Demo"
        },
        "startIndex": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Row_Number', ``, 'number') }}",
        "numberToDelete": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Number_of_Rows_to_Delete', ``, 'number') }}"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "p8TFiJI7j90cCF0X",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f6cde544-c9fa-4bf1-b516-ec7af05cc7a8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -368
      ],
      "parameters": {
        "color": 3,
        "width": 440,
        "height": 460,
        "content": "### 说明文档"
      },
      "typeVersion": 1
    },
    {
      "id": "734f1080-5542-4359-8ec1-27cf481dde86",
      "name": "计算器",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        2240,
        -48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "64f83e07-e9ae-4e5f-8578-6e1bca416514",
      "name": "模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1456,
        -48
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "2p1WdcZp3d7uKHNu",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ec7083eb-b495-4f8f-884a-e0001b2f6f69",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2016,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 224,
        "content": "## 🛠️ 工具集"
      },
      "typeVersion": 1
    },
    {
      "id": "b8efce3b-7831-4546-a5d6-001d4e8218c1",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 320,
        "content": "## 🛠️ 后续步骤"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "341d69bc-48c8-4e3d-90e0-f72065a24521",
  "connections": {
    "Read": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delete": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - AI 聊天机器人, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量12
分类2
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Yar Malik (Asfandyar)

Yar Malik (Asfandyar)

@yar

AI Automation Expert | AI Call Center with Voho

外部链接
在 n8n.io 查看

分享此工作流