8
n8n 中文网amn8n.com

使用Dumpling AI + GPT-4o根据自动补全建议生成标题

中级

这是一个Design, AI, Marketing领域的自动化工作流,包含 8 个节点。主要使用 Set, SplitOut, HttpRequest, GoogleSheets, ScheduleTrigger 等节点,结合人工智能技术实现智能自动化。 使用Dumpling AI + GPT-4o从自动补全建议生成标题

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "pHuWdTQCyMMPFqdV",
  "meta": {
    "instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Dumpling AI + GPT-4o 根据自动补全建议生成标题",
  "tags": [],
  "nodes": [
    {
      "id": "6beee45f-5f13-4dff-b560-ed1da4df5479",
      "name": "每天中午 12 点运行",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1180,
        -120
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 12
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "795fe08c-bcb3-4563-a49c-527c09dc52a9",
      "name": "从 Google Sheets 获取搜索关键词",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -940,
        -120
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkLQ4ZZ3qSv8HybYuKyW2BgViUij68ux4_SnoBphmWE/edit#gid=645811013",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkLQ4ZZ3qSv8HybYuKyW2BgViUij68ux4_SnoBphmWE/edit?usp=drivesdk",
          "cachedResultName": "Google places"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "GaJqJHuS5mQxap7q",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "b85f5817-7b6d-4c18-8d30-7a9927ad22b2",
      "name": "获取自动补全建议(Dumpling AI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -720,
        -120
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/get-autocomplete",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"query\": \"{{ $json.Keywords }}\",\n  \"country\": \"US\",\n  \"language\": \"en\"\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RLFzAcGRepr5eXZB",
          "name": "Dumpling AI-n8n"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "199fad98-e64a-4da1-8cdc-9ac86fe0e418",
      "name": "将建议格式化为数组",
      "type": "n8n-nodes-base.set",
      "position": [
        -500,
        -120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "44db444a-283b-4576-85ae-d964cf761324",
              "name": "suggestions",
              "type": "array",
              "value": "={{ $json.suggestions }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "00a81bf6-91a8-4f72-9bdf-723b0b122d68",
      "name": "遍历每个自动补全建议",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -280,
        -120
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "suggestions"
      },
      "typeVersion": 1
    },
    {
      "id": "8f6dcb3e-dc41-4ce8-a521-2826329efe79",
      "name": "根据建议生成标题(GPT-4o)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -60,
        -120
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=You are a creative content writer for social media. Write a short, engaging, and relevant caption based on the search phrase below. The tone should be friendly and inspiring, and the caption should be optimized to grab attention on platforms like Instagram, LinkedIn, or Twitter.\n\n\nMake sure the caption:\n- Feels human and conversational\n- Includes a subtle hook or curiosity element\n- Stays under 280 characters\n- Does not repeat the phrase verbatim\n\nRespond with just the caption, nothing else.\n"
            },
            {
              "content": "=Search phrase: \"{{ $json.value }}\""
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "fdhWALG84tBLgSZT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e3483193-439c-4261-8791-82a18259efcf",
      "name": "将关键词和生成的标题保存到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        300,
        -120
      ],
      "parameters": {
        "columns": {
          "value": {
            "Caption": "={{ $json.message.content }}",
            "Keyword": "={{ $('Loop Through Each Autocomplete Suggestion').item.json.value }}"
          },
          "schema": [
            {
              "id": "Keyword",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Caption",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkLQ4ZZ3qSv8HybYuKyW2BgViUij68ux4_SnoBphmWE/edit#gid=1972422557",
          "cachedResultName": "content"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkLQ4ZZ3qSv8HybYuKyW2BgViUij68ux4_SnoBphmWE/edit?usp=drivesdk",
          "cachedResultName": "Google places"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "GaJqJHuS5mQxap7q",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9b7c800e-112e-45ae-bc2a-a5fc0ad7c2ed",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        -360
      ],
      "parameters": {
        "width": 1020,
        "height": 200,
        "content": "### ✨ 根据热门 Google 自动补全自动生成社交媒体标题"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d7f0397d-853a-48c7-ac92-c4cdeb410548",
  "connections": {
    "Run Every Day at 12 PM": {
      "main": [
        [
          {
            "node": "Get Search Keywords from Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Suggestions into Array": {
      "main": [
        [
          {
            "node": "Loop Through Each Autocomplete Suggestion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Search Keywords from Google Sheet": {
      "main": [
        [
          {
            "node": "Fetch Autocomplete Suggestions (Dumpling AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Caption from Suggestion (GPT-4o)": {
      "main": [
        [
          {
            "node": "Save Keyword & Generated Caption to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Each Autocomplete Suggestion": {
      "main": [
        [
          {
            "node": "Generate Caption from Suggestion (GPT-4o)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Autocomplete Suggestions (Dumpling AI)": {
      "main": [
        [
          {
            "node": "Format Suggestions into Array",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 设计, 人工智能, 营销

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流