8
n8n 中文网amn8n.com

批量SEO内容生成与带AI图片的Webflow草稿创建(模板)

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 54 个节点。主要使用 If, Set, Code, Wait, Merge 等节点。 使用GPT、Gemini图片和Webflow草稿创建进行批量SEO内容生成

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "bCM3L5So04TaTb3I",
  "meta": {
    "instanceId": "506e1eb999b7a8cf86103921b3e1b94e371534d9bae39d44754933678dc6697d",
    "templateCredsSetupCompleted": true
  },
  "name": "批量 SEO 内容生成与带 AI 图片的 Webflow 草稿创建(模板)",
  "tags": [
    {
      "id": "T3xhK1cIuPex0boX",
      "name": "Templates",
      "createdAt": "2025-09-03T11:06:03.839Z",
      "updatedAt": "2025-09-03T11:06:03.839Z"
    }
  ],
  "nodes": [
    {
      "id": "6c19a117-9bac-4598-9618-432ca067a02f",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -5712,
        64
      ],
      "parameters": {
        "text": "=Current date and time: {{$now}}\n\nTASK: Create high-quality SEO content and generate a relevant featured image for the keyword below.\n\nKeyword: {{ $json['main keyword'] }}\n\nRequirements:\n1. Write 600-800 words of engaging, professional but accessible content.\n2. Include the keyword naturally 2-3 times: once in the introduction, once in a subheading, and once in the conclusion.\n3. Create a compelling title (50-60 characters).\n4. Write a meta description (150-160 characters).\n5. Structure the article with clear sections:\n   - Introduction\n   - Key Benefits\n   - How It Works / Practical Advice\n   - Conclusion / Next Steps\n6. Target audience: general readers searching for this keyword (not academic or overly technical).\n7. Generate ONE relevant professional image. The image should:\n   - Visually represent the keyword topic (not generic SEO/marketing visuals)\n   - Use a clean, modern, professional style\n   - Be suitable as a blog featured image\n   - IMPORTANT: Generate only ONE image per article\n\nCRITICAL: Call the image generation tool exactly ONCE per article. Do not generate multiple images or variations.\n\n8. Provide descriptive **alt text** for the image, optimized for accessibility and SEO.\n\nOutput Format:\nReturn ONLY this valid JSON structure as raw JSON (no markdown code blocks, no json tags, no extra text, notes, or explanations):\n{\n\"title\": \"SEO optimized title here\",\n\"slug\": \"{{ $('Load Pending Keywords').item.json.slug }}\", \n\"metaDescription\": \"Compelling meta description here\",\n\"content\": \"Full article content here (600-800 words). CRITICAL FORMATTING REQUIREMENTS: Start with ### Introduction as the first heading. Use ### for ALL section headings (Key Benefits, How It Works / Practical Advice, Conclusion / Next Steps). Write complete paragraphs separated by blank lines. Never mix plain text with markdown formatting. Each section must have substantial content with specific examples and actionable advice. Include the target keyword naturally 2-3 times throughout the content. Ensure consistent markdown structure from start to finish.\",\n\"main keyword\": \"{{ $json['main keyword'] }}\",\n\"imageUrl\": \"URL from image generation tool\", \n\"altText\": \"Descriptive and SEO-friendly alt text here\"\n}\n\nFORMATTING VALIDATION: Before returning JSON, verify that:\n1. Content starts with ### Introduction \n2. All headings use ### format consistently\n3. Each paragraph is properly separated with blank lines\n4. No mixing of plain text and markdown syntax\n5. Content flows logically between sections\n6. Target keyword appears naturally in introduction and conclusion\n\nCRITICAL: Your response must start with { and end with }. Do not wrap the JSON in markdown formatting or code blocks. Return the raw JSON object only.",
        "options": {
          "systemMessage": "You are an expert SEO content writer and AI coordinator. Your responsibilities: Always follow the Agent Prompt exactly. Always generate both content and a relevant professional image. Always return valid JSON only, with no extra commentary or notes. Never skip image generation. Never output incomplete or invalid JSON. Ensure the content is engaging, structured, and optimized for readers searching for the keyword."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "9081f1d4-5dac-4350-b910-e17ad918208f",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -5632,
        288
      ],
      "parameters": {
        "sessionKey": "={{ $('Load Pending Keywords').item.json['main keyword'] }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "13743c5a-d649-49a3-8cd6-4c03494d9749",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -5760,
        288
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.1
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "mvWns3smwtPV0N7O",
          "name": "OpenAI (Dummy Account)"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "97ed3faa-f65c-4b47-a024-9800c24763fd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6480,
        -624
      ],
      "parameters": {
        "width": 576,
        "height": 448,
        "content": "### 📋 为 Webflow 自动生成 SEO 内容"
      },
      "typeVersion": 1
    },
    {
      "id": "d10c11b9-0cbe-4725-ae66-fe4c381666c5",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -6432,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "months"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "85a2baaf-7fd0-4cb9-b200-7f56d3781275",
      "name": "加载待处理关键词",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -6208,
        64
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "pending",
              "lookupColumn": "status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 183091813,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit#gid=183091813",
          "cachedResultName": "keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit?usp=drivesdk",
          "cachedResultName": "N8N SHEETS TEST"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "zyEOPkCfmHTXNm4V",
          "name": "Google Sheets (Dummy Account)"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "3474f5e5-84e7-44c5-8751-e53ffedffd1e",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -5984,
        64
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "3403fae8-07ba-4faf-9db5-0ad221b1360e",
      "name": "内容质量检查",
      "type": "n8n-nodes-base.if",
      "position": [
        -5072,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "word-count-check",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.wordCount }}",
              "rightValue": 600
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ebe7106d-a3bb-4396-989c-5aba594e828d",
      "name": "处理代理输出",
      "type": "n8n-nodes-base.code",
      "position": [
        -5296,
        64
      ],
      "parameters": {
        "jsCode": "// Original keyword item from the loop\nconst original = $json;\n\n// Extract and clean the agent output with multiple fallbacks\nlet agentOutput = {};\ntry {\n  let rawOutput = original.output || \"\";\n  \n  // Security: Handle multiple markdown variations\n  let cleanedOutput = rawOutput\n    .replace(/```json\\s*/g, '')    // Remove ```json\n    .replace(/```\\s*$/g, '')       // Remove closing ```\n    .replace(/^```\\s*/g, '')       // Remove opening ``` \n    .replace(/```$/g, '')          // Remove trailing ```\n    .trim();\n  \n  // Try parsing the cleaned output\n  agentOutput = JSON.parse(cleanedOutput);\n  \n} catch (parseError) {\n  // Security fallback: Create safe structure if parsing fails\n  console.log(\"JSON Parse Error:\", parseError.message);\n  \n  agentOutput = { \n    title: `Error: ${original[\"main keyword\"] || \"Unknown keyword\"}`,\n    slug: `error-${Date.now()}`,\n    metaDescription: \"Content generation failed\",\n    content: \"Failed to generate content. Please check agent configuration.\",\n    \"main keyword\": original[\"main keyword\"] || \"unknown\",\n    imageUrl: \"\",\n    altText: \"Error generating content\",\n    parseError: parseError.message,\n    rawAgentOutput: original.output\n  };\n}\n\n// Compute word count from the content\nconst content = agentOutput.content || \"\";\nconst wordCount = content.split(/\\s+/).filter(Boolean).length;\n\n// Return wrapped in json object to avoid n8n reserved key conflicts\nreturn [{\n  json: {\n    ...original,          \n    ...agentOutput,       \n    wordCount,\n    status: wordCount >= 600 ? \"content_ready\" : \"needs_expansion\",\n    generatedAt: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "457c8c37-c678-4299-8676-4ec41c2ba56d",
      "name": "扩展内容",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -4848,
        160
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {
          "maxTokens": 4000,
          "temperature": 0.3
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an expert content expansion specialist. Always return ONLY valid JSON with no extra text, notes, or explanations. Follow the exact format specified in the user prompt."
            },
            {
              "content": "=Expand the following content from {{ $json.wordCount }} words to 600+ words while maintaining the same structure, tone, and keyword optimization.\n\nTARGET KEYWORD: {{ $('Loop Over Items').item.json['main keyword'] }}\n\nORIGINAL CONTENT: {{ $json.content }}\n\nEXPANSION GUIDELINES:\n1. Keep all existing headings and sections intact\n2. Add specific examples, real-world scenarios, and practical tips within each section  \n3. Include 2-3 brand mentions or product examples where relevant\n4. Add actionable advice readers can implement immediately\n5. Maintain the same markdown formatting (###, **, etc.)\n6. Preserve keyword density and natural integration\n7. Keep the original writing style and tone\n\nReturn ONLY this valid JSON structure (no extra text, notes, or explanations):\n\n{\n  \"title\": \"{{ $json.title }}\",\n  \"slug\": \"{{ $json.slug }}\",\n  \"metaDescription\": \"{{ $json.metaDescription }}\",\n  \"content\": \"Expanded article content here (600+ words)\",\n  \"main keyword\": \"{{ $json['main keyword'] }}\",\n  \"imageUrl\": \"{{ $json.imageUrl }}\",\n  \"altText\": \"{{ $json.altText }}\"\n}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "mvWns3smwtPV0N7O",
          "name": "OpenAI (Dummy Account)"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1.8
    },
    {
      "id": "6a7bc453-cf01-4bed-88a9-7b8d478793a2",
      "name": "格式化代理输出",
      "type": "n8n-nodes-base.code",
      "position": [
        -4496,
        160
      ],
      "parameters": {
        "jsCode": "const originalData = $json;\nconst expandedResponse = $('Expand Content').first().json.message.content;\n\n// Parse the JSON response from the expanded content\nlet expandedData = {};\ntry {\n  expandedData = JSON.parse(expandedResponse);\n} catch (e) {\n  expandedData = { \n    error: \"Invalid JSON from expansion\", \n    raw: expandedResponse,\n    content: expandedResponse // fallback to raw content\n  };\n}\n\n// Calculate word count from the expanded content\nconst content = expandedData.content || \"\";\nconst wordCount = content.split(/\\s+/).filter(Boolean).length;\n\nreturn [{\n  json: {\n    ...originalData,     // Keep original data (main keyword, etc.)\n    ...expandedData,     // Add all expanded fields\n    wordCount,\n    status: wordCount >= 600 ? \"content_ready\" : \"needs_expansion\",\n    wasExpanded: true,\n    expandedAt: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "0a272acd-2853-45c9-bdc6-c69d876648f8",
      "name": "合并内容路径",
      "type": "n8n-nodes-base.merge",
      "position": [
        -4272,
        64
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "mergeByPosition"
      },
      "typeVersion": 2.1
    },
    {
      "id": "7554230a-0c6b-4654-ab87-5f527675912f",
      "name": "转换为 HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        -4048,
        64
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {},
        "markdown": "={{ $json.content }}"
      },
      "typeVersion": 1
    },
    {
      "id": "0bcdca31-1f50-41fe-b748-91a732a730a2",
      "name": "与现有文章合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -3600,
        64
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "advanced": true,
        "joinMode": "keepEverything",
        "mergeByFields": {
          "values": [
            {
              "field1": "fieldData.slug",
              "field2": "slug"
            }
          ]
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "ad6944f8-67ac-4454-b011-61f833541b97",
      "name": "获取现有文章",
      "type": "n8n-nodes-base.webflow",
      "position": [
        -3824,
        -48
      ],
      "parameters": {
        "siteId": "653a17a1b31a397763f3ce40",
        "operation": "getAll",
        "returnAll": true,
        "collectionId": "68c01d34f15ae8b8c30ead31"
      },
      "credentials": {
        "webflowOAuth2Api": {
          "id": "NqkfDWqbJpAotiw2",
          "name": "Webflow (Dummy Account)"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "7f443fca-2d0f-43e2-83be-74f096c0c92b",
      "name": "获取新文章别名",
      "type": "n8n-nodes-base.set",
      "position": [
        -3824,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6f6f5935-eb33-41bd-804c-dc62c085b000",
              "name": "slug",
              "type": "string",
              "value": "={{ $json.slug }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5c7c7872-e391-479c-b9de-c82c9e1af5f8",
      "name": "路由:更新或创建",
      "type": "n8n-nodes-base.switch",
      "position": [
        -3376,
        64
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Route 1",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f22dbd15-9e3d-4dcd-ac02-b6763223b916",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Route 2",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6915f663-8bd2-4e60-ad37-409ea961f89f",
                    "operator": {
                      "type": "string",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "ac01b0a4-ecda-4f20-afc8-9aa582fda210",
      "name": "更新现有文章",
      "type": "n8n-nodes-base.webflow",
      "maxTries": 3,
      "position": [
        -3152,
        -48
      ],
      "parameters": {
        "itemId": "={{ $json.id }}",
        "siteId": "653a17a1b31a397763f3ce40",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "name",
              "fieldValue": "={{ $('Convert to HTML').item.json.title }}"
            },
            {
              "fieldId": "page-content",
              "fieldValue": "={{ $('Convert to HTML').item.json.data }}"
            },
            {
              "fieldId": "metadescription",
              "fieldValue": "={{ $('Convert to HTML').item.json.metaDescription }}"
            },
            {
              "fieldId": "featured-image",
              "fieldValue": "={{ $('Convert to HTML').item.json.imageUrl }}"
            }
          ]
        },
        "operation": "update",
        "collectionId": "68c01d34f15ae8b8c30ead31"
      },
      "credentials": {
        "webflowOAuth2Api": {
          "id": "NqkfDWqbJpAotiw2",
          "name": "Webflow (Dummy Account)"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "a3f5e05d-a525-4fdd-a214-998806a344b0",
      "name": "创建新文章",
      "type": "n8n-nodes-base.webflow",
      "maxTries": 3,
      "position": [
        -3152,
        160
      ],
      "parameters": {
        "siteId": "653a17a1b31a397763f3ce40",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "name",
              "fieldValue": "={{ $('Convert to HTML').item.json.title }}"
            },
            {
              "fieldId": "slug",
              "fieldValue": "={{ $('Convert to HTML').item.json.slug }}"
            },
            {
              "fieldId": "page-content",
              "fieldValue": "={{ $('Convert to HTML').item.json.data }}"
            },
            {
              "fieldId": "metadescription",
              "fieldValue": "={{ $('Convert to HTML').item.json.metaDescription }}"
            },
            {
              "fieldId": "featured-image",
              "fieldValue": "={{ $('Convert to HTML').item.json.imageUrl }}"
            }
          ]
        },
        "operation": "create",
        "collectionId": "68c01d34f15ae8b8c30ead31"
      },
      "credentials": {
        "webflowOAuth2Api": {
          "id": "NqkfDWqbJpAotiw2",
          "name": "Webflow (Dummy Account)"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "42e4fb72-e16f-4dd3-a1ea-9aa94443f5ec",
      "name": "合并文章结果",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2928,
        64
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "4755da23-5ea0-4420-b5a2-7976e41411d1",
      "name": "检查成功",
      "type": "n8n-nodes-base.if",
      "position": [
        -2704,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "success-check",
              "operator": {
                "type": "string",
                "operation": "isNotEmpty"
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            },
            {
              "id": "4bdc0525-b8fe-4faa-a3a0-d701102ed47a",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "a013bc1b-70af-4c27-9c88-c5df8a913bd1",
      "name": "标记为完成",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2480,
        -48
      ],
      "parameters": {
        "columns": {
          "value": {
            "status": "created",
            "main keyword": "={{ $('Convert to HTML').item.json['main keyword'] }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "main keyword",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "main keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "head terms",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "head terms",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "modifiers",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "modifiers",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "slug",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "slug",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "main keyword"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 183091813,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit#gid=183091813",
          "cachedResultName": "keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit?usp=drivesdk",
          "cachedResultName": "N8N SHEETS TEST"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "zyEOPkCfmHTXNm4V",
          "name": "Google Sheets (Dummy Account)"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d833be28-654b-41f1-af4d-bcf18e8aa3ec",
      "name": "记录错误",
      "type": "n8n-nodes-base.code",
      "position": [
        -2480,
        160
      ],
      "parameters": {
        "jsCode": "const error = $json.error || 'Creation failed';\nconst keyword = $('Convert to HTML').first()?.json?.['main keyword'] || 'Unknown';\n\nreturn {\n  json: {\n    keyword: keyword,\n    error: error,\n    timestamp: new Date().toISOString(),\n    status: 'failed'\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "ab10a761-91e4-4b64-8164-c87134bcbb45",
      "name": "保存成功结果",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2256,
        -48
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $('Merge post result').item.json.id }}",
            "slug": "={{ $('Merge post result').item.json.fieldData.slug }}",
            "content": "={{ $('Merge post result').item.json.fieldData['page-content'] }}",
            "updated on": "={{ $('Merge post result').item.json.lastUpdated }}",
            "generatedAt": "={{ $('Merge post result').item.json.createdOn }}",
            "meta description": "={{ $('Merge post result').item.json.fieldData.metadescription }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "slug",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "slug",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "meta description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "meta description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "generatedAt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "generatedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "updated on",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "updated on",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "published on",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "published on",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 977377122,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit#gid=977377122",
          "cachedResultName": "content_created"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit?usp=drivesdk",
          "cachedResultName": "N8N SHEETS TEST"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "zyEOPkCfmHTXNm4V",
          "name": "Google Sheets (Dummy Account)"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "632a7c39-687c-4ea9-95e0-dd57b302c191",
      "name": "保存错误",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2256,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "error": "={{ $json.error }}",
            "status": "={{ $json.status }}",
            "keyword": "={{ $('Convert to HTML').item.json['main keyword'] }}",
            "timestamp": "={{ $json.timestamp }}"
          },
          "schema": [
            {
              "id": "keyword",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "keyword"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1205462190,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit#gid=1205462190",
          "cachedResultName": "webflow_error_logs"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qd1H_IY_KEtB1C-ZJzpdmw9_yQEqdpnrf4ZdlV02gW4/edit?usp=drivesdk",
          "cachedResultName": "N8N SHEETS TEST"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "zyEOPkCfmHTXNm4V",
          "name": "Google Sheets (Dummy Account)"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5f4abc50-4c29-4424-9668-b3eb1494fb66",
      "name": "等待几秒钟",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2032,
        160
      ],
      "webhookId": "6d8fa6b9-a084-4656-a950-cf477ab7329d",
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "af480c9a-5086-45af-9d1e-0b403a387463",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6464,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "content": "## 步骤 1"
      },
      "typeVersion": 1
    },
    {
      "id": "7747856f-3922-46a8-8f09-ecc007cabeb0",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5728,
        -128
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 144,
        "content": "## 步骤 2"
      },
      "typeVersion": 1
    },
    {
      "id": "99d5b7cd-b330-4519-b166-76c3fdd1ac51",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4896,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 144,
        "content": "## 步骤 3"
      },
      "typeVersion": 1
    },
    {
      "id": "2100b5a6-2e31-42d5-bbe1-259b81f38933",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4096,
        -128
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 144,
        "content": "## 步骤 4"
      },
      "typeVersion": 1
    },
    {
      "id": "b4478d43-86f7-453b-977d-7bec723d77f8",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3824,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 336,
        "height": 144,
        "content": "## 步骤 5"
      },
      "typeVersion": 1
    },
    {
      "id": "57f327c8-15c0-4d61-a2bc-afe23897add6",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3280,
        -208
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 112,
        "content": "## 步骤 6"
      },
      "typeVersion": 1
    },
    {
      "id": "c444b15e-d08f-474d-a10b-30414590af77",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2672,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 528,
        "height": 144,
        "content": "## 步骤 7"
      },
      "typeVersion": 1
    },
    {
      "id": "af2bab6c-5315-4c8a-9ebe-e0d71b2def54",
      "name": "无可用关键词",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -5760,
        -336
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bc529bba-49c5-4ba7-95f2-9388f4440ede",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3920,
        416
      ],
      "parameters": {
        "color": 5,
        "width": 704,
        "height": 400,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c3becf95-359b-4a4a-8dc7-4e9faacf5b81",
      "name": "AI 图片生成工具",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -5504,
        288
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "iYw38zcdqp4HuOZR",
          "cachedResultName": "AI image generation for automatic content creation"
        },
        "description": "为内容生成一张 AI 图片。传递 imagePrompt、imageTitle 和 keyword 以创建一张相关图片。每篇文章应恰好调用此工具一次。",
        "workflowInputs": {
          "value": {
            "altText": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('altText', `A clear, descriptive, and SEO-friendly alternative text for the image. Should naturally include the image and remain under 125 characters for accessibility.`, 'string') }}",
            "keyword": "={{ $json['main keyword'] }}",
            "imageTitle": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imageTitle', `A concise, professional title for the featured image that clearly reflects the main topic of the article`, 'string') }}",
            "imagePrompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('imagePrompt', `A concise, professional title for the featured image that clearly reflects the main topic of the article`, 'string') }}"
          },
          "schema": [
            {
              "id": "imageTitle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "imageTitle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imagePrompt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "imagePrompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keyword",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "altText",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "altText",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4aa37110-3c5b-4086-bf30-3c3f0c2b47c7",
      "name": "当由另一个工作流执行时",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -6224,
        2416
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "imageTitle"
            },
            {
              "name": "imagePrompt"
            },
            {
              "name": "keyword"
            },
            {
              "name": "altText"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "af3cac37-624f-41f1-b9cf-1136e23d06c1",
      "name": "处理图片响应",
      "type": "n8n-nodes-base.code",
      "position": [
        -5696,
        2416
      ],
      "parameters": {
        "jsCode": "const response = $json;\nlet imageUrl = '';\n\ntry {\n  // OpenRouter returns images in the assistant message\n  if (response.choices && response.choices.length > 0) {\n    const message = response.choices[0].message;\n    \n    // Check for images array in the message\n    if (message.images && message.images.length > 0) {\n      // Extract the base64 data URL from the first image\n      imageUrl = message.images[0].image_url.url;\n    }\n  }\n  \n  // Fallback checks\n  if (!imageUrl && response.data && response.data.length > 0) {\n    imageUrl = response.data[0].url;\n  }\n  \n} catch (error) {\n  console.error('Error processing OpenRouter image response:', error);\n}\n\nconst originalInputs = $('When Executed by Another Workflow').item.json;\n\nreturn {\n  json: {\n    imageUrl: imageUrl,\n    imageTitle: originalInputs.imageTitle,\n    keyword: originalInputs.keyword,\n    imagePrompt: originalInputs.imagePrompt,\n    altText: originalInputs.altText || `${originalInputs.keyword} featured image`,\n    imageGenerated: !!imageUrl,\n    generatedAt: new Date().toISOString(),\n    status: imageUrl ? 'success' : 'failed',\n    rawResponse: response\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1a9080e8-19e5-4aa1-afee-a938fc89615d",
      "name": "检查图片生成",
      "type": "n8n-nodes-base.if",
      "position": [
        -5408,
        2416
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "image-check",
              "operator": {
                "type": "string",
                "operation": "isNotEmpty"
              },
              "leftValue": "={{ $json.imageUrl }}",
              "rightValue": ""
            },
            {
              "id": "68f8678d-2c93-4335-aa18-bcaa0df7985f",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.imageUrl }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "558fd78f-7410-44ea-8af3-8ab5580989aa",
      "name": "处理生成失败",
      "type": "n8n-nodes-base.code",
      "position": [
        -5056,
        2128
      ],
      "parameters": {
        "jsCode": "const originalData = $('Process Image Response').item.json;\nconst error = $json.error || 'Image generation failed';\n\nconsole.error(`Image generation failed for: ${originalData.keyword}`);\nconsole.error(`Error: ${error}`);\n\nreturn {\n  json: {\n    imageUrl: '',\n    imageTitle: originalData.imageTitle,\n    keyword: originalData.keyword,\n    imagePrompt: originalData.imagePrompt,\n    imageGenerated: false,\n    status: 'failed',\n    error: error,\n    generatedAt: new Date().toISOString(),\n    message: `Failed to generate image for '${originalData.imageTitle}'`\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "4828babb-1f1c-4e19-86a3-effc98f5e4f4",
      "name": "结果",
      "type": "n8n-nodes-base.set",
      "position": [
        -4320,
        2544
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c66c7c13-57ca-4191-9af3-5ab306dfedfc",
              "name": "Response",
              "type": "string",
              "value": "=The image was created and named \"{{ $json.name }}\" and the following altText \"{{ $('Convert Base64 to Binary').item.json.altText }}\"\n\nHere is the link to the image in Google Drive: {{ $json.webViewLink }}\n\nHere's the download link: {{ $json.webContentLink }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6756130b-2e51-4457-a28d-f810f9968fac",
      "name": "将 Base64 转换为二进制",
      "type": "n8n-nodes-base.code",
      "position": [
        -5024,
        2544
      ],
      "parameters": {
        "jsCode": "// Extract base64 from data URL and convert to binary\nconst input = $input.first().json;\nconst base64String = input.imageUrl.replace(/^data:image\\/\\w+;base64,/, '');\nconst buffer = Buffer.from(base64String, 'base64');\n\n// Pass through other data and add binary\nreturn {\n  json: {\n    imageTitle: input.imageTitle,\n    imageUrl: input.imageUrl,\n    altText: input.altText || `${input.keyword} featured image`,  \n    keyword: input.keyword,  \n    imagePrompt: input.imagePrompt  \n  },\n  binary: {\n    data: await this.helpers.prepareBinaryData(\n      buffer,\n      `${input.imageTitle || input.keyword}_raw.png`,\n      'image/png'\n    )\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9830cce4-9d2f-450f-a61a-2937b3d9831c",
      "name": "上传到 Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -4784,
        2544
      ],
      "parameters": {
        "name": "={{ $json.imageTitle }}.png",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1CYgRUELLCpM1tHx5cM6hBpf5RdfxItR0",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1CYgRUELLCpM1tHx5cM6hBpf5RdfxItR0",
          "cachedResultName": "AI images"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "0tTY9psJ9CGds01o",
          "name": "Google Drive Dummy Account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "4c611c1f-8a67-482f-a8c2-3faccc234d84",
      "name": "获取下载链接",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -4528,
        2544
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $json.webViewLink }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "0tTY9psJ9CGds01o",
          "name": "Google Drive Dummy Account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "281da2fe-0d6e-47c7-9073-ada1b0f83343",
      "name": "生成图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -5952,
        2416
      ],
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"google/gemini-2.5-flash-image-preview\",\n  \"messages\": [\n    {\n      \"role\": \"user\", \n      \"content\": \"Generate an image: {{ $json.imagePrompt }}\"\n    }\n  ],\n  \"modalities\": [\"image\", \"text\"],\n  \"max_tokens\": 1000\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "057b7038-0135-486c-9d85-e58c420280a2",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4032,
        2224
      ],
      "parameters": {
        "width": 528,
        "height": 496,
        "content": "### 🎨 AI 图片生成子工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "610f756e-b237-4712-b602-4fae1cf0d842",
      "name": "便签 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6016,
        2224
      ],
      "parameters": {
        "color": 7,
        "height": 352,
        "content": "## 步骤 1"
      },
      "typeVersion": 1
    },
    {
      "id": "6051dd14-fc03-4a39-b781-67c7a8c405e4",
      "name": "便签 11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5744,
        2224
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 352,
        "content": "## 步骤 2"
      },
      "typeVersion": 1
    },
    {
      "id": "f6299361-eb86-4f48-86cf-8d4c661d198d",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5456,
        2224
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 352,
        "content": "## 步骤 3"
      },
      "typeVersion": 1
    },
    {
      "id": "07b288ff-289c-489a-99d3-0c1f0ad36d61",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5088,
        1952
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 352,
        "content": "## 额外步骤"
      },
      "typeVersion": 1
    },
    {
      "id": "8c05b88e-eb47-4c9d-9d68-ddc3e50115e5",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5072,
        2400
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 352,
        "content": "## 步骤 4"
      },
      "typeVersion": 1
    },
    {
      "id": "b743d732-0624-4572-b286-f30e6839784b",
      "name": "便签15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4816,
        2400
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 352,
        "content": "## 步骤 5"
      },
      "typeVersion": 1
    },
    {
      "id": "7cfff106-510f-46d9-aed2-f8d5cde4369b",
      "name": "便签16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4368,
        2400
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 352,
        "content": "## 步骤 6"
      },
      "typeVersion": 1
    },
    {
      "id": "8a0e7ba0-5c3d-4c72-a5c6-10318074769c",
      "name": "便签18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6272,
        1680
      ],
      "parameters": {
        "color": 3,
        "width": 2896,
        "height": 144,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f48990ab-4845-4d5f-9050-6abb325afe3a",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Process Agent Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Error": {
      "main": [
        [
          {
            "node": "Save Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Error": {
      "main": [
        [
          {
            "node": "Wait a few seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Success": {
      "main": [
        [
          {
            "node": "Mark as Complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Expand Content": {
      "main": [
        [
          {
            "node": "Format Agent Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Process Image Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to HTML": {
      "main": [
        [
          {
            "node": "Get new post slug",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Existing Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create New Post": {
      "main": [
        [
          {
            "node": "Merge post result",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Keywords Available",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Complete": {
      "main": [
        [
          {
            "node": "Save Success Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Load Pending Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get new post slug": {
      "main": [
        [
          {
            "node": "Merge with Existing Posts",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge post result": {
      "main": [
        [
          {
            "node": "Check Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Download Links": {
      "main": [
        [
          {
            "node": "Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Existing Posts": {
      "main": [
        [
          {
            "node": "Merge with Existing Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait a few seconds": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Agent Output": {
      "main": [
        [
          {
            "node": "Merge Content Paths",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Content Paths": {
      "main": [
        [
          {
            "node": "Convert to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Agent Output": {
      "main": [
        [
          {
            "node": "Content Quality Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Success Results": {
      "main": [
        [
          {
            "node": "Wait a few seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Existing Post": {
      "main": [
        [
          {
            "node": "Merge post result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Content Quality Check": {
      "main": [
        [
          {
            "node": "Merge Content Paths",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Expand Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Pending Keywords": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Image Generation": {
      "main": [
        [
          {
            "node": "Handle Generation Failure",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert Base64 to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Image Response": {
      "main": [
        [
          {
            "node": "Check Image Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Get Download Links",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route: Update or Create": {
      "main": [
        [
          {
            "node": "Update Existing Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create New Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Image Generation Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Convert Base64 to Binary": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge with Existing Posts": {
      "main": [
        [
          {
            "node": "Route: Update or Create",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

工作流信息
难度等级
高级
节点数量54
分类2
节点类型21
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Dahiana

Dahiana

@mssporto

No-Code Specialist with more than 10 years of experience in Digital Marketing. Currently working with Bubble. Webflow, AI, Agents and N8N.

外部链接
在 n8n.io 查看

分享此工作流