8
n8n 中文网amn8n.com

Instagram自动评论 - 创作者中心

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 39 个节点。主要使用 If, Set, Code, Wait, ConvertToFile 等节点。 使用GPT-4o、Phantombuster和SharePoint自动评论Instagram帖子

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "LNR9VPUbFEajd57v",
  "meta": {
    "instanceId": "2cf742429c2e3ee4e5a20069d3d8a75208519303b864f026a79464efa726bd95",
    "templateCredsSetupCompleted": true
  },
  "name": "Instagram 自动评论 - 创作者中心",
  "tags": [],
  "nodes": [
    {
      "id": "91bc557b-028a-4778-8e51-8b69590ff2bd",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        -256,
        -1776
      ],
      "webhookId": "50266a01-aebd-4ad8-bd74-feed09568209",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "700968b7-51ba-4ffa-919d-f0da43e3743a",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -512,
        -1184
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "680e81c7-5219-4117-b084-ba951e61ca56",
      "name": "等待1",
      "type": "n8n-nodes-base.wait",
      "position": [
        656,
        -1360
      ],
      "webhookId": "653c31a2-712e-4adb-ac74-f4115c0fe895",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "132707b5-b634-4ada-9c49-43c6e8a227a7",
      "name": "启动代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -416,
        -1776
      ],
      "parameters": {
        "agentId": "={{ $json.id }}",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"maxPosts\": {{ $('Set ENV Variables').item.json.ENV_MAX_POSTS_PER_HASHTAG }},\n  \"sessionCookie\": \"{{ $('Set ENV Variables').item.json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $('Set ENV Variables').item.json.ENV_SEARCH_HASHTAGS }}\"\n} "
        }
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a9e108c7-efb3-488b-9ba8-901c0994093b",
      "name": "获取随机帖子",
      "type": "n8n-nodes-base.code",
      "position": [
        -1840,
        -1360
      ],
      "parameters": {
        "jsCode": "const data = $input.all().map(item => item.json);\n\nif (!data || data.length === 0) {\n  throw new Error('No Instagram posts data found');\n}\n\n// Get a random post\nconst randomPost = data[Math.floor(Math.random() * data.length)];\n\n// Return only postUrl and description\nreturn {\n  json: {\n    postUrl: randomPost.postUrl,\n    description: randomPost.description\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "10116cd5-806c-4604-9447-ed8d8e140ca2",
      "name": "创建评论",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -512,
        -1360
      ],
      "parameters": {
        "text": "=Du bist ein spezialisierter Social Media Content Creator.\n\n**AUFGABE:** {{ $('Set ENV Variables').first().json.ENV_COMMENT_PROMPT }}\n\n**KOMMENTAR RICHTLINIEN:**\n- Antworte NUR auf {{ $('Set ENV Variables').first().json.ENV_COMMENT_LANGUAGE }}\n- Maximal 150 Zeichen (Instagram-optimiert)\n- Beziehe dich subtil auf den Original-Post Inhalt\n\n**POST-INHALT FÜR KOMMENTAR:**\n{{ $('Get Random Post').first().json.description }} \n\nErstelle einen perfekten Instagram-Kommentar.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "fa623878-40ab-45f0-8685-726816927c75",
      "name": "创建 CSV 二进制文件",
      "type": "n8n-nodes-base.code",
      "position": [
        -176,
        -1360
      ],
      "parameters": {
        "jsCode": "// Extract correct values\nconst postUrl = $('Get Random Post').first().json.postUrl;\nconsole.log(\"postUrl: \", postUrl)\nconst commentText = $input.first().json.output;\n\n// Clean utility\nconst clean = str => String(str || \"\").replace(/[\\u200B-\\u200D\\uFEFF]/g, \"\").trim();\n\n// Escape and quote single data row\nconst row = [\n  `\"${clean(postUrl).replace(/\"/g, '\"\"')}\"`,\n  `\"${clean(commentText).replace(/\"/g, '\"\"')}\"`\n];\n\n// Convert to buffer without header or BOM\nconst csvBuffer = Buffer.from(row.join(\",\") + \"\\n\", \"utf8\");\n\n// Return binary file\nreturn [\n  {\n    binary: {\n      data: {\n        data: csvBuffer,\n        mimeType: \"text/csv\",\n        fileName: \"phantombuster_clean.csv\"\n      }\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "93d4a1b3-1b51-4b8e-b2bb-abad737b6d90",
      "name": "上传 CSV",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -16,
        -1360
      ],
      "parameters": {
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "fileName": "instagram_post_to_comment.csv",
        "operation": "upload",
        "fileContents": "data",
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5113c291-24e0-4a4c-ba45-fea45693a99d",
      "name": "获取自动评论代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        240,
        -1360
      ],
      "parameters": {
        "agentId": "5533276466709830",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2f8df366-546b-45b8-affa-2eec0419451f",
      "name": "获取话题标签代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -576,
        -1776
      ],
      "parameters": {
        "agentId": "4031886542434447",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b6fe5490-11df-4875-bd46-3ead76bb803c",
      "name": "获取帖子",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -96,
        -1776
      ],
      "parameters": {
        "agentId": "4031886542434447",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f1213cad-f240-42fe-a02c-7d23949f8e1b",
      "name": "启动 AC 代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        448,
        -1360
      ],
      "parameters": {
        "agentId": "5533276466709830",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"sessionCookie\": \"{{ $('Set ENV Variables').first().json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $('Upload CSV').item.json['@content.downloadUrl'] }}\"\n}"
        }
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "73f3edd0-6339-48a1-8048-249419c7dfd3",
      "name": "获取响应",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        848,
        -1360
      ],
      "parameters": {
        "agentId": "5533276466709830",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dbb2757c-fee3-4b76-a139-cde54ae6c3b1",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -1888
      ],
      "parameters": {
        "color": 5,
        "width": 1260,
        "height": 400,
        "content": "## 通过自定义话题标签获取 Instagram 帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "62f0a062-4794-4dd6-8b83-2d5d38b104d8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        -1472
      ],
      "parameters": {
        "color": 3,
        "width": 2192,
        "height": 400,
        "content": "## 处理帖子并生成评论"
      },
      "typeVersion": 1
    },
    {
      "id": "e128e19c-0341-4c86-adab-1fd9d8add971",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -1472
      ],
      "parameters": {
        "width": 928,
        "height": 400,
        "content": "## 启动自动评论代理发布评论"
      },
      "typeVersion": 1
    },
    {
      "id": "770e3a45-8d4c-4cc1-aadd-fcf3dce2f40c",
      "name": "设置环境变量",
      "type": "n8n-nodes-base.set",
      "position": [
        -736,
        -1776
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7812dbc7-e492-42c4-96a6-71cfbdc71a6d",
              "name": "ENV_SEARCH_HASHTAGS",
              "type": "string",
              "value": "={{ $json.output.parseJson().hashtag }}"
            },
            {
              "id": "debcbe7a-3298-46ec-a8ab-96e8dc0184a7",
              "name": "ENV_SESSION_COOKIE",
              "type": "string",
              "value": "={{ $('Select Cookie').first().json.output.parseJson().session_cookie }}"
            },
            {
              "id": "261b0667-0cbd-4df1-8f3d-4e49a99f4cb1",
              "name": "ENV_MAX_POSTS_PER_HASHTAG",
              "type": "string",
              "value": "10"
            },
            {
              "id": "32531b3f-d01e-4764-9cc5-1f9f37979a3a",
              "name": "ENV_COMMENT_PROMPT",
              "type": "string",
              "value": "Erstelle einen ansprechenden Instagram-Kommentar basierend auf dem gegebenen Post-Inhalt."
            },
            {
              "id": "6e0bf007-ebce-4b39-9920-2f523b5bfe70",
              "name": "ENV_COMMENT_LANGUAGE",
              "type": "string",
              "value": "Deutsch"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "77379241-7ac0-4764-a84e-fdcad65b9261",
      "name": "生成随机话题标签",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1056,
        -1776
      ],
      "parameters": {
        "text": "=Can you generate a single random hashtag related to Artificial Intelligence and Business Process Automation, suitable for fetching Instagram posts?\nThe hashtag should be human like and realistic to appear in posts. Something like \"AIBizAutomation\" is not realistic. The hashtag should not be a combination of multiple words, for example \"smartautomation\" or \"intelligentworkflows\".\nYou can be very vague and also use IT companies as hashtag.\n\nPlease respond only with a **valid, raw JSON object**, like this:\n{\n  \"hashtag\": \"#Automation\"\n}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "523432df-f776-46b9-a1d7-fccbd3bd8f64",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -992,
        -2208
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 2,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7043f25d-3dca-40b5-9f25-b07c86c4dc36",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1072,
        -1616
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e0074e8b-8138-4fd6-b139-d764746984ff",
      "name": "更新文件",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -672,
        -1360
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA37FQNX5XDRVVCYAT6XSISPVTCM",
          "cachedResultName": "instagram_posts_already_commented.csv"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "fileName": "instagram_posts_already_commented.csv",
        "operation": "update",
        "fileContents": "data",
        "requestOptions": {},
        "changeFileContent": true
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d423679a-dcad-4c70-8bce-6b479503c07c",
      "name": "下载文件",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -1664,
        -1360
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA37FQNX5XDRVVCYAT6XSISPVTCM",
          "cachedResultName": "instagram_posts_already_commented.csv"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "edef95e3-c2e4-4e11-aee4-ace49b4608d1",
      "name": "检查是否在列表中",
      "type": "n8n-nodes-base.code",
      "position": [
        -1312,
        -1360
      ],
      "parameters": {
        "jsCode": "const randomPost = normalizeUrl($('Get Random Post').first().json.postUrl);\nconst allItems = $('Extract from File').all();\n\nif (!allItems || allItems.length === 0) {\n  return [{ json: { isDuplicate: false } }];\n}\n\nfunction normalizeUrl(url) {\n  if (typeof url !== 'string') {\n    console.log(\"🚨 NOT A STRING:\", url);\n    return '';\n  }\n  return url.trim().toLowerCase().replace(/\\/$/, '');\n}\n\n// Helper function to get postUrl value regardless of BOM\nfunction getPostUrl(item) {\n  const json = item.json;\n  // Try normal field name first\n  if (json.postUrl) return json.postUrl;\n  \n  // Look for any field containing \"postUrl\"\n  const postUrlKey = Object.keys(json).find(key => key.includes('postUrl'));\n  return postUrlKey ? json[postUrlKey] : null;\n}\n\nconsole.log(\"✅ randomPost:\", randomPost);\nconsole.log(\"✅ allItems:\", allItems);\n\nlet isDuplicate = false;\n\nfor (const item of allItems) {\n  const candidateRaw = getPostUrl(item);\n  const candidate = normalizeUrl(candidateRaw);\n\n  console.log(`🟠 Comparing:\\n→ raw: ${candidateRaw}\\n→ normalized: ${candidate}\\n→ target: ${randomPost}`);\n\n  if (candidate === randomPost) {\n    isDuplicate = true;\n    break;\n  }\n}\n\nreturn [{ json: { isDuplicate } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "afb29b9c-cb02-47fb-bf31-bae6a77c54ce",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        -1152,
        -1360
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bcef43b3-e773-45ba-b245-19ab3fc1e508",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Check if in List').first().json.isDuplicate }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "af4ff58e-bc3c-4b80-9bd9-e9dc479de3ee",
      "name": "等待2",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2000,
        -1360
      ],
      "webhookId": "d78bfa64-04a7-4487-89a6-eb177c518356",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "728c2193-b301-40d8-b327-1de92cfe99a9",
      "name": "准备更新数据",
      "type": "n8n-nodes-base.code",
      "position": [
        -992,
        -1360
      ],
      "parameters": {
        "jsCode": "const existingUrls = $('Extract from File').all().map(item => {\n  // Get the first key (which has the BOM) and use its value\n  const firstKey = Object.keys(item.json)[0];\n  return { postUrl: item.json[firstKey] };\n});\n\nconsole.log(\"existingUrls: \", existingUrls);\n\nconst randomPost = $('Get Random Post').first().json.postUrl;\nconsole.log(\"randomPost: \", randomPost);\n\nreturn [\n  ...existingUrls,\n  { postUrl: randomPost }\n].map(entry => ({ json: entry }));"
      },
      "typeVersion": 2
    },
    {
      "id": "95e7013e-461f-4f4e-87e1-c409c03a9980",
      "name": "从文件提取",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1488,
        -1360
      ],
      "parameters": {
        "options": {
          "headerRow": true
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f67e2b1c-bee6-4740-a680-23412bf2ae9f",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -832,
        -1360
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "e9405e7d-ae94-4737-bb6a-85e570293e9d",
      "name": "获取可用会话 Cookies",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -784,
        -2208
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA5FHBKEDCMCXRBJK64QFIFWOCQE",
          "cachedResultName": "instagram_session_cookies.txt"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bea33381-e12f-4342-9ade-707fad72dac4",
      "name": "提取 Cookies",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -560,
        -2208
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "58dc021e-1631-4068-94b9-9cfe7e1b35ec",
      "name": "选择 Cookie",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -368,
        -2208
      ],
      "parameters": {
        "text": "=##################  PROMPT  ##################\n\n**ROLE:**  You are a session-cookie selector.\n\n**CURRENT BERLIN TIME**  \nDate & time : {{ $now.setZone('Europe/Berlin').format('DD HH:mm:ss') }}  \nHour (00-23): {{ $now.setZone('Europe/Berlin').format('HH') }}\n\n**SESSION COOKIES (keep order):**  \n{{ $json.data }}\n\n**SELECTION LOGIC**\n\n1. Let  \n   • N = number of cookies in the list (2 ≤ N ≤ 4).  \n   • H = current hour as an integer (0–23).  \n   • W = 24 ÷ N  (the width of each time slice in hours, always an integer).\n\n2. Determine the slice index:  \n   sliceIndex = floor(H ÷ W)  // 0-based\n\n3. Choose the cookie at position *(sliceIndex + 1)* in the list.  \n   • Example when N = 4 (W = 6):  \n     00-05 → 1st, 06-11 → 2nd, 12-17 → 3rd, 18-23 → 4th  \n   • Example when N = 3 (W = 8):  \n     00-07 → 1st, 08-15 → 2nd, 16-23 → 3rd  \n   • Example when N = 2 (W = 12):  \n     00-11 → 1st, 12-23 → 2nd\n\n**OUTPUT FORMAT**  \nReturn only the selected session cookie value in a valid JSON-Field called \"session_cookie\", nothing else.\n\n##############################################",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "e8ba7b3c-6ca5-4591-af86-886d4abe9bb8",
      "name": "OpenAI 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -384,
        -2048
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "93e2bae7-adcd-46f3-a818-b4e85329f407",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -2304
      ],
      "parameters": {
        "color": 6,
        "width": 1260,
        "height": 400,
        "content": "## 启动工作流并获取会话 Cookie"
      },
      "typeVersion": 1
    },
    {
      "id": "9272a99c-d2d4-4a8d-900c-7517e62ea201",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -2304
      ],
      "parameters": {
        "width": 432,
        "height": 288,
        "content": "### 1) Cookie 和话题标签选择"
      },
      "typeVersion": 1
    },
    {
      "id": "183dc623-a9aa-4479-bd8a-8717a7a710f9",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -1888
      ],
      "parameters": {
        "width": 384,
        "height": 256,
        "content": "### 2) 抓取 Instagram 帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "edbd080d-5225-49c1-889b-ed083272b8d0",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        -1056
      ],
      "parameters": {
        "width": 384,
        "height": 272,
        "content": "### 3) 评论生成"
      },
      "typeVersion": 1
    },
    {
      "id": "ee36dd67-92fa-4456-b642-098848e9d6da",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        -1056
      ],
      "parameters": {
        "width": 416,
        "height": 272,
        "content": "### 4) CSV 上传与自动评论"
      },
      "typeVersion": 1
    },
    {
      "id": "d6f2287b-2cda-44f8-af9e-00134abec388",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -1056
      ],
      "parameters": {
        "width": 400,
        "height": 288,
        "content": "### 5) 去重处理"
      },
      "typeVersion": 1
    },
    {
      "id": "edfe9418-4ffa-48a8-920e-d2c298204fef",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -1472
      ],
      "parameters": {
        "width": 384,
        "height": 304,
        "content": "### 6) 频率限制与调度"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a66471bb-ceb1-4560-97eb-f4afa2b11569",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Updated Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Get Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Get Random Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Posts": {
      "main": [
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload CSV": {
      "main": [
        [
          {
            "node": "Get Autocomment Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update file": {
      "main": [
        [
          {
            "node": "Create Comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Launch Agent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Cookie": {
      "main": [
        [
          {
            "node": "Generate Random Hashtag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Comment": {
      "main": [
        [
          {
            "node": "Create CSV Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Update file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Cookies": {
      "main": [
        [
          {
            "node": "Select Cookie",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Random Post": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Launch AC Agent": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if in List": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Available Session Cookies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create CSV Binary": {
      "main": [
        [
          {
            "node": "Upload CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Check if in List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Hashtag Agent": {
      "main": [
        [
          {
            "node": "Launch Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Create Comment",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set ENV Variables": {
      "main": [
        [
          {
            "node": "Get Hashtag Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Random Hashtag",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Select Cookie",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Updated Data": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Autocomment Agent": {
      "main": [
        [
          {
            "node": "Launch AC Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Random Hashtag": {
      "main": [
        [
          {
            "node": "Set ENV Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Available Session Cookies": {
      "main": [
        [
          {
            "node": "Extract Cookies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体, 多模态 AI

需要付费吗?

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

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

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

作者
plemeo

plemeo

@plemeo

Hi, I'm Gerhard from Plemeo. At plemeo.ai, we focus on AI-driven automation and workflow optimization. Our deep expertise with n8n enables us to streamline processes and boost efficiency in software development. This allows us to deliver real, measurable improvements. Curious how plemeo.ai and n8n can benefit your business? Reach out at info@plemeo.de or visit plemeo.ai.

外部链接
在 n8n.io 查看

分享此工作流