Shopify产品列表AI博客生成器:使用GPT-4o和Google表格

高级

这是一个AI、Marketing领域的自动化工作流,包含 19 个节点。主要使用 If、Set、Shopify、SplitOut、ManualTrigger 等节点,结合人工智能技术实现智能自动化。 Shopify产品列表AI博客生成器:使用GPT-4o和Google表格

前置要求
  • Shopify Admin API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "d73282515b90623d4a8783919a2d772c706425d649e1512792f37ac51e07e4a8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "096ccd11-0ae4-4e3d-aeac-d180c09512ae",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        300,
        180
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c95491ab-6e4e-4671-bfaf-b8a362d2ec01",
      "name": "Shopify",
      "type": "n8n-nodes-base.shopify",
      "position": [
        580,
        180
      ],
      "parameters": {
        "resource": "product",
        "operation": "getAll",
        "returnAll": true,
        "authentication": "accessToken",
        "additionalFields": {}
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "id": "oPLCxaUiftgs7Mna",
          "name": "Shopify Access Token account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1620e19b-cd01-4798-858c-8f2fb3d58087",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        840,
        180
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "images"
      },
      "typeVersion": 1
    },
    {
      "id": "944ab8ba-6e41-4e04-b442-9468ff341ba0",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1060,
        180
      ],
      "parameters": {
        "text": "=You are an expert OCR and nutrition facts extractor. You carefully extract only the exact nutritional data present in the image without fabricating or guessing. You can recognize nutritional facts tables, and you know how to distinguish between actual nutrition data and promotional or partial text. You return null if no clear nutrition facts table or readable nutritional information is present.\n\n\nYou will analyze an image containing a product's nutritional information. Extract all nutritional data exactly as shown in the image, including nutrient names, amounts, units, and daily values if present.\n\n- If the image clearly contains a nutritional facts table or full nutritional data, output it in clean JSON format, where each nutrient is a key and the value contains the amount, unit, and daily value if available.\n- If the image shows only partial, blurry, or promotional text like \"20% protein\" or any incomplete nutritional data, do NOT fabricate any values; instead, return null.\n- If there is no clear nutritional facts table or nutritional data visible in the image, return null.\n- Do not guess or invent any numbers.\n- Only include information that is confidently present and readable in the image.\n\nExample output when nutrition facts are present:\n\n{\n  \"Calories\": \"190\",\n  \"Total Fat\": {\n    \"amount\": \"8g\",\n    \"daily_value\": \"10%\"\n  },\n  \"Cholesterol\": {\n    \"amount\": \"0mg\",\n    \"daily_value\": \"0%\"\n  },\n  ...\n}\n\nExample output when no valid nutritional facts table or data is visible:\n\nnull\n",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {
          "detail": "auto",
          "maxTokens": 900
        },
        "resource": "image",
        "imageUrls": "={{ $json.src }}",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "OizdHUANhz9NIHyd",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "390bd7e4-b7bc-4575-9fe4-36a81445c7d3",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1480,
        580
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "OizdHUANhz9NIHyd",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "de84b88d-e96e-4c3c-a9f9-71cfc413022e",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1240,
        180
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6aa4dfe1-d907-47e8-b97e-3a77bb30c1d0",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.content }}",
              "rightValue": "null"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9ef20e21-7ad8-409f-a13e-e1088ec4e4a3",
      "name": "无操作,不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1240,
        440
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0cfadf47-06c7-4b00-b660-87241cc4bf4c",
      "name": "创建博客ID",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2500,
        620
      ],
      "parameters": {
        "url": "=https://smartworkflow.myshopify.com/admin/api/2024-01/blogs.json",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi"
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "id": "oPLCxaUiftgs7Mna",
          "name": "Shopify Access Token account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "059199d7-0f80-40fc-9f45-ee4ef8d6475b",
      "name": "创建文章",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2060,
        620
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi"
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "id": "oPLCxaUiftgs7Mna",
          "name": "Shopify Access Token account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "60d74f7d-cc66-4af6-bb8d-686c3eb320cb",
      "name": "读取表格",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1880,
        600
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit#gid=0",
          "cachedResultName": "blog_details"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit?usp=drivesdk",
          "cachedResultName": "Blog update sheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "0RSJGMBcFzxY9GkS",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "75976a59-7017-4e2c-ab12-d2e3448b6566",
      "name": "更新表格",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2280,
        600
      ],
      "parameters": {
        "columns": {
          "value": {
            "Error": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Error', ``, 'string') }}",
            "Retry": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Retry', ``, 'string') }}",
            "Blog url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_url', ``, 'string') }}",
            "Blog Html": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_Html', ``, 'string') }}",
            "Timestamp": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Timestamp', ``, 'string') }}",
            "Product Id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Product_Id', ``, 'string') }}",
            "Blog title ": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_title_', ``, 'string') }}",
            "Proudct name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Proudct_name', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Product Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Product Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Proudct name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Proudct name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Blog title ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Blog title ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Blog url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Blog url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Blog Html",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Blog Html",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Retry",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Retry",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Error",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Product Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit#gid=0",
          "cachedResultName": "blog_details"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit?usp=drivesdk",
          "cachedResultName": "Blog update sheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "0RSJGMBcFzxY9GkS",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "49448095-a73a-4fdb-9354-f3e442f100b4",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1700,
        580
      ],
      "parameters": {
        "sessionKey": "={{ $('Main Product info').item.json.id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "adc154d2-a1b0-4f27-b1fd-689484132308",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        40
      ],
      "parameters": {
        "width": 260,
        "height": 360,
        "content": "## 获取商品"
      },
      "typeVersion": 1
    },
    {
      "id": "d7de0bdd-2544-45fd-b4ac-264fed0d6c25",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        -80
      ],
      "parameters": {
        "color": 3,
        "height": 500,
        "content": "## 获取商品图片URL"
      },
      "typeVersion": 1
    },
    {
      "id": "f51c03f3-a137-48ae-9b44-dee4505d1bb8",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -80
      ],
      "parameters": {
        "color": 6,
        "width": 380,
        "height": 500,
        "content": "## OCR:"
      },
      "typeVersion": 1
    },
    {
      "id": "486be3b5-dc25-4c5a-bde7-daaeff56308e",
      "name": "主要商品信息",
      "type": "n8n-nodes-base.set",
      "position": [
        1540,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "93cb8cc0-cdcd-44da-8187-9df85b770293",
              "name": "title",
              "type": "string",
              "value": "={{ $('Shopify').item.json.title }}"
            },
            {
              "id": "95990abc-b64d-4cb4-8d4e-88145395a3fc",
              "name": "id",
              "type": "number",
              "value": "={{ $('Shopify').item.json.id }}"
            },
            {
              "id": "d833cfa1-9abf-4a9d-86ed-a713acbc1974",
              "name": "body_html",
              "type": "string",
              "value": "={{ $('Shopify').item.json.body_html }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "894b47e8-7da2-4a3c-b6ec-afe2e4d6f4cf",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1460,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 920,
        "height": 460,
        "content": "## Shopify商品博客机制:"
      },
      "typeVersion": 1
    },
    {
      "id": "6d708bbb-9c9c-419a-883b-d7e48e89e82a",
      "name": "AI博客发布器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1760,
        160
      ],
      "parameters": {
        "text": "=Product id : {{ $json.id }}\nProduct title : {{ $json.title }}    \n\nProduct Description html : {{ $json.body_html }}\n\nProduct Nutrition Facts : {{ $json.content }}\n\n",
        "options": {
          "systemMessage": "=You are an AI agent responsible for automating blog creation for Shopify products using Google Sheets as a tracking system.\n\n## Step-by-step Workflow:\n\n### 1. Read Google Sheet\nBefore doing anything, call the Read Sheet tool to check if a blog has already been created for the Product ID. The sheet contains columns:\n\n- Timestamp\n- Product Id\n- Product name\n- Blog title\n- Blog url\n- Blog Html\n- Retry\n- Error\n\nCall this tool first and look up the row with the same Product Id.\n\n### 2. Check Conditions:\n- If the Product Id exists and Retry = No, skip this item.\n- If Retry = Yes, retry blog creation from Step 3.\n- If the Product Id is not found, proceed to Step 3 to generate and post a new blog.\n\n---\n\n### 3. Generate Blog Content\nBased on the following provided in the user message:\n- Product ID\n- Product Title\n- Product Description HTML\n- Product Nutrition Facts \n\nGenerate:\n- SEO-Friendly Blog Title\n- Meta Description\n- Formatted Blog Content in clean, structured HTML:\n  - Introduction summary\n  - H2/H3 subheadings\n  - Bullet points (key benefits, nutrients)\n  - Nutrient callouts or tables (if available)\n  - Closing paragraph or CTA\n  - Add internal keywords (tags)\n\n---\n\n### 4. Create Blog (HTTP Tool Call)\nCall the Shopify API to create a blog:\n\njson\n{\n  \"tool_call\": {\n    \"tool\": \"http\",\n    \"name\": \"Create Blog\",\n    \"method\": \"POST\",\n    \"url\": \"https://smartworkflow.myshopify.com/admin/api/2024-01/blogs.json\",\n    \"body\": {\n      \"blog\": {\n        \"title\": \"[SEO Blog Title]\"\n      }\n    }\n  }\n}\nOnce the blog.id is returned, post the article to:\n\n\nhttps://smartworkflow.myshopify.com/admin/api/2024-01/blogs/{{blog.id}}/articles.json\njson\nCopy\nEdit\n{\n  \"tool_call\": {\n    \"tool\": \"http\",\n    \"name\": \"Create Article\",\n    \"method\": \"POST\",\n    \"url\": \"https://smartworkflow.myshopify.com/admin/api/2024-01/blogs/{{blog.id}}/articles.json\",\n    \"body\": {\n      \"article\": {\n        \"title\": \"[Same Blog Title]\",\n        \"body_html\": \"[Generated HTML content]\",\n        \"tags\": \"nutrition, wellness, product, shopify\",\n        \"published\": false\n      }\n    }\n  }\n}\n6. Update Google Sheet\nIf Blog is Posted Successfully\nCall Update Sheet tool and set:\n\n\n{\n  \"Timestamp\":{{ $now }} ,\n  \"Product Id\": \"{{ $json.id }}\",\n  \"Product name\": \"{{ $json.title }}\",\n  \"Blog title\": \"[SEO Blog Title]\",\n  \"Blog url\": \"[Generated URL from blog.id and article.id]\",\n  \"Blog Html\": \"[Generated HTML]\",\n  \"Retry\": \"No\",\n  \"Error\": \"\"\n}\nIf Blog or Article Fails\nLog the error in Error column and set Retry = Yes.\n\n\n{\n  \"Product Id\": \"{{ $json.id }}\",\n  \"Retry\": \"Yes\",\n  \"Error\": \"[Detailed error message]\"\n}\n\nNotes:\nAlways call Read Sheet first before blog generation.\n\nRetry logic is based strictly on the Retry column.\n\nAll tool call responses should be handled using proper try-catch/error-check patterns.\n\nEnsure HTML is clean and includes correct spacing, paragraphs, H2s, bullet lists, and optionally nutrient tables.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "3538388e-7222-48e1-bec8-daf882e8c316",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -100
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 520,
        "content": "## 作者"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Main Product info",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shopify": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Sheet": {
      "ai_tool": [
        [
          {
            "node": "AI Blog Poster",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet": {
      "ai_tool": [
        [
          {
            "node": "AI Blog Poster",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Blog Poster",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Create Blog id": {
      "ai_tool": [
        [
          {
            "node": "AI Blog Poster",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Articles": {
      "ai_tool": [
        [
          {
            "node": "AI Blog Poster",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Main Product info": {
      "main": [
        [
          {
            "node": "AI Blog Poster",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Blog Poster",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Shopify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个高级难度的工作流,适用于AI、Marketing等场景。适合高级用户,包含 16+ 个节点的复杂工作流

需要付费吗?

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

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

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

作者
Kumar Shivam

Kumar Shivam

@shivam840708

I'm an automation specialist who helps startups, agencies, and growth teams save time and scale faster using n8n. I design smart, reliable workflows that connect tools like HubSpot, Slack, OpenAI, Claude, Pipedrive, Google Ads, and vector databases (Qdrant, Pinecone). Whether it's auto-assigning leads, generating AI-powered reports, triggering Slack alerts, or syncing APIs — I build automations that just work. Let’s turn your manual processes into automated systems that scale.

外部链接
在 n8n.io 上查看 →

分享此工作流