8
n8n 中文网amn8n.com

Instagram自动关注 - 创作者中心

高级

这是一个Social Media领域的自动化工作流,包含 22 个节点。主要使用 Set, Wait, Phantombuster, Agent, ExtractFromFile 等节点。 通过Phantombuster和SharePoint自动关注Instagram个人资料

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "nM8KB1VpIzL1qQAM",
  "meta": {
    "instanceId": "2cf742429c2e3ee4e5a20069d3d8a75208519303b864f026a79464efa726bd95",
    "templateCredsSetupCompleted": true
  },
  "name": "Instagram 自动关注 - 创作者中心",
  "tags": [],
  "nodes": [
    {
      "id": "c8aa6db4-9ac4-4dd6-a6e5-199fc00e91f6",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        -480,
        -1600
      ],
      "webhookId": "a863956e-9993-4723-bab6-116be5b6483b",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "040e11d3-58be-48ed-b927-3d3d23c7d76f",
      "name": "启动代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -704,
        -1600
      ],
      "parameters": {
        "agentId": "={{ $('Get Follower Collector').item.json.id }}",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"numberofProfilesperLaunch\": {{ $('Set ENV Variables').item.json.ENV_PROFILES_TO_PROCESS }},\n  \"sessionCookie\": \"{{ $('Set ENV Variables').item.json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $json['@content.downloadUrl'] }}\",\n  \"numberMaxOfFollowers\": {{ $('Set ENV Variables').item.json.ENV_AMOUNT_FOLLOWERS_PER_PROFILE }}\n} "
        }
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4a236261-c86d-4ffe-870f-dcd671e5df6d",
      "name": "启动 AC 代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -976,
        -1216
      ],
      "parameters": {
        "agentId": "798529539709482",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"numberOfProfilesPerLaunch\": {{ $('Set ENV Variables').first().json.ENV_PROFILES_TO_PROCESS }},\n  \"sessionCookie\": \"{{ $('Set ENV Variables').first().json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $('Get Followers').first().json.profileUrl }}\"\n}"
        }
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0151529b-c837-46cd-9206-a9aa852a245c",
      "name": "获取响应",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -576,
        -1216
      ],
      "parameters": {
        "agentId": "798529539709482",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d02ecaab-1458-4c7f-aa42-8ca090502861",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1424,
        -1744
      ],
      "parameters": {
        "color": 5,
        "width": 1324,
        "height": 412,
        "content": "## 获取账户列表及该账户的所有关注者"
      },
      "typeVersion": 1
    },
    {
      "id": "74e88554-9696-49d1-bf60-26e715c21dca",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1424,
        -1312
      ],
      "parameters": {
        "width": 1316,
        "height": 348,
        "content": "## 启动自动关注代理以关注账户"
      },
      "typeVersion": 1
    },
    {
      "id": "175074db-a8d4-42fe-97bb-ef45394bc666",
      "name": "获取关注者收集器",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -1152,
        -1600
      ],
      "parameters": {
        "agentId": "1481471730276201",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b93020ae-5c68-42d4-b100-13bab41fb7f3",
      "name": "获取关注者",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -272,
        -1600
      ],
      "parameters": {
        "agentId": "1481471730276201",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "81c0399f-db23-40a8-a3ee-039db367d6ee",
      "name": "获取账户列表",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -928,
        -1600
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA2DXMAMDIHRJ5DLNZFFQRKUD25O",
          "cachedResultName": "accounts_to_follow.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": "accounts_to_follow.csv",
        "operation": "update",
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fcab1649-9f85-4dd6-ae96-b6b9756ed7dc",
      "name": "获取自动关注代理",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -1216,
        -1216
      ],
      "parameters": {
        "agentId": "798529539709482",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c9a884f0-6ccb-4ae3-ab1e-724bbd96a1e7",
      "name": "等待结果",
      "type": "n8n-nodes-base.wait",
      "position": [
        -784,
        -1216
      ],
      "webhookId": "ed20e8e0-6e55-41d7-bda6-4cf1c0d32b1e",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "5604adb6-3ddf-4c64-8589-170caa1813df",
      "name": "设置环境变量",
      "type": "n8n-nodes-base.set",
      "position": [
        -1328,
        -1600
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a897adc5-6c18-4bc6-b1ae-6db02b884f2f",
              "name": "ENV_SESSION_COOKIE",
              "type": "string",
              "value": "={{ $('Select Cookie').first().json.output.parseJson().session_cookie }}"
            },
            {
              "id": "3d571e3c-7110-48c5-af2d-7727079b3747",
              "name": "ENV_PROFILES_TO_PROCESS",
              "type": "string",
              "value": "1"
            },
            {
              "id": "fc8e2505-be84-4cfd-973a-5dd7d717a9a5",
              "name": "ENV_AMOUNT_FOLLOWERS_PER_PROFILE",
              "type": "string",
              "value": "1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "01f1c2cc-59aa-467f-94f1-874d157e460d",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1264,
        -2032
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "triggerAtMinute": 35
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "afb4b5f2-3288-41cc-9b65-e73cc7785a93",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -640,
        -1856
      ],
      "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": "e225ded4-30c6-41e1-99f6-354d3ec32282",
      "name": "获取可用会话 Cookie",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -1040,
        -2032
      ],
      "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": "be9bcd84-c3d0-464e-9db2-0aedd4b3c6c2",
      "name": "提取 Cookie",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -832,
        -2032
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "7396cbf4-8078-4eb2-866b-2baa63cf4812",
      "name": "选择 Cookie",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -624,
        -2032
      ],
      "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": "0e998d01-aab5-40b7-8659-4562ac6afbed",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1424,
        -2176
      ],
      "parameters": {
        "color": 6,
        "width": 1324,
        "height": 412,
        "content": "## 启动工作流并检索会话 Cookie"
      },
      "typeVersion": 1
    },
    {
      "id": "f0d9133c-ec1e-48ea-bb33-af1c3597bf88",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        -2176
      ],
      "parameters": {
        "width": 464,
        "height": 288,
        "content": "### 1) Cookie 轮换"
      },
      "typeVersion": 1
    },
    {
      "id": "d7bab9f3-4b87-4a55-ab65-4472e68a7897",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        -1744
      ],
      "parameters": {
        "width": 464,
        "height": 272,
        "content": "### 2) 种子资料处理"
      },
      "typeVersion": 1
    },
    {
      "id": "5c8f8d24-dc66-4082-b562-d80d729568dc",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1872,
        -1312
      ],
      "parameters": {
        "width": 432,
        "height": 288,
        "content": "### 3) 自动关注执行"
      },
      "typeVersion": 1
    },
    {
      "id": "d3e9b8ed-349a-4b2c-a258-a8158dce5f84",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -1312
      ],
      "parameters": {
        "width": 448,
        "height": 272,
        "content": "### 4) 速率限制与调度"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "959522e3-de06-4bb2-92c5-ecb1a2cca62f",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get Followers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Response": {
      "main": [
        []
      ]
    },
    "Launch Agent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Followers": {
      "main": [
        [
          {
            "node": "Get Autofollow Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Cookie": {
      "main": [
        [
          {
            "node": "Set ENV Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Cookies": {
      "main": [
        [
          {
            "node": "Select Cookie",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Launch AC Agent": {
      "main": [
        [
          {
            "node": "Wait for result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for result": {
      "main": [
        [
          {
            "node": "Get Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Available Session Cookies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Select Cookie",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set ENV Variables": {
      "main": [
        [
          {
            "node": "Get Follower Collector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Autofollow Agent": {
      "main": [
        [
          {
            "node": "Launch AC Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List of Accounts": {
      "main": [
        [
          {
            "node": "Launch Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Follower Collector": {
      "main": [
        [
          {
            "node": "Get List of Accounts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Available Session Cookies": {
      "main": [
        [
          {
            "node": "Extract Cookies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体

需要付费吗?

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

工作流信息
难度等级
高级
节点数量22
分类1
节点类型9
难度说明

适合高级用户,包含 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 查看

分享此工作流