8
n8n 中文网amn8n.com

使用 GPT-4.1-mini 为新 Google Sheets 条目生成 AI 描述

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 GoogleSheets, Agent, GoogleSheetsTrigger, LmChatOpenAi, OutputParserStructured 等节点。 使用 GPT-4.1-mini 为新 Google Sheets 条目生成 AI 描述

前置要求
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "0ad754e7-e05a-4935-a792-f3178248099a",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1024,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7f83e0b2-5561-480f-b3c6-9bba76158752",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -832,
        128
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"description\": \"description\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "d88108ee-e1a0-43d2-948a-37bd706a33b5",
      "name": "在表格中更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -672,
        -336
      ],
      "parameters": {
        "columns": {
          "value": {
            "topic": "={{ $('Row added - Google Sheet').item.json.topic }}",
            "description": "={{ $json.output.description }}"
          },
          "schema": [
            {
              "id": "topic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "topic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "description",
              "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": [
            "topic"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs/edit#gid=0",
          "cachedResultName": "data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs/edit?usp=drivesdk",
          "cachedResultName": "Sheets Triggers"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "bfa0fde3-6ddb-4e69-a1d5-b6d86ef89672",
      "name": "在表格中追加行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -656,
        -32
      ],
      "parameters": {
        "columns": {
          "value": {
            "Update": "={{ $('Row added - Google Sheet').item.json.topic }} was added"
          },
          "schema": [
            {
              "id": "Update",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Update",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "topic"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 196803262,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs/edit#gid=196803262",
          "cachedResultName": "actions"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs/edit?usp=drivesdk",
          "cachedResultName": "Sheets Triggers"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "ae9c19db-71eb-4b38-adba-ca5d7468bdc2",
      "name": "便签 16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        -656
      ],
      "parameters": {
        "width": 2016,
        "content": "## 📬 需要帮助或想要自定义?"
      },
      "typeVersion": 1
    },
    {
      "id": "6196c4fc-679c-4b5e-bbcc-685917d4fa5a",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 904,
        "height": 860,
        "content": "### 步骤 1:设置您的 Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "ab630ed2-52a0-42ac-9e3d-3d9826ceb7e4",
      "name": "行已添加 - Google Sheet",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1376,
        96
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs/edit#gid=0",
          "cachedResultName": "data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d8O_Iwg5UtDjHM22zWHMegORatYzaQUYmzrcYnG5OSs/edit?usp=drivesdk",
          "cachedResultName": "Sheets Triggers"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "5qZk3IRejGCu9qrm",
          "name": "Google Sheets Trigger account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5b4d1f11-89c8-4b38-89f1-2e353eaa9b40",
      "name": "描述编写器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -992,
        -112
      ],
      "parameters": {
        "text": "={{ $json.topic }}",
        "options": {
          "systemMessage": "write a description of the topic. \n\noutput like this. \n\n{\n\t\"description\": \"description\"\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "8150251e-63e2-43a0-8952-85b86c796df0",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 1096,
        "height": 860,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Row added - Google Sheet": [
      {
        "topic": "n8n",
        "description": ""
      }
    ]
  },
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Description Writer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Description Writer": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Row added - Google Sheet": {
      "main": [
        [
          {
            "node": "Description Writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Description Writer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

作者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部链接
在 n8n.io 查看

分享此工作流