8
n8n 中文网amn8n.com

使用Google表格和Puppeteer自动化Instagram私信与互动

高级

这是一个Lead Nurturing领域的自动化工作流,包含 43 个节点。主要使用 If, Code, Wait, Limit, Filter 等节点。 使用Google表格和Puppeteer自动化Instagram私信与互动

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "bae91d9fd2fc59568657e329a7acafce827a5e83337ea795ba08c6589321900f"
  },
  "nodes": [
    {
      "id": "1c02bf82-9e11-42ce-a2bd-2f003c01f0e8",
      "name": "等待2",
      "type": "n8n-nodes-base.wait",
      "position": [
        496,
        208
      ],
      "webhookId": "1f2864af-8b9b-419f-9098-0260745d0d9f",
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "377f7600-363e-4aad-8097-2bb274643682",
      "name": "在 sheet1 中追加或更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        272,
        208
      ],
      "parameters": {
        "columns": {
          "value": {
            "Active": "=TRUE",
            "username": "={{ $json.user }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "password",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "password",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "proxy",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "proxy",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Active",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Active",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "username"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1434077398,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit#gid=1434077398",
          "cachedResultName": "acc"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit?usp=drivesdk",
          "cachedResultName": "next-task"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "cqlGJZJdttZJP57A",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d993d7e3-d356-4bf4-bf5f-ee5a64eefb06",
      "name": "遍历项目2",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -400,
        304
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "669710b2-a3d4-4d51-ad13-9d67b766cc83",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -176,
        304
      ],
      "parameters": {
        "url": "http://host.docker.internal:3001/login",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $json.username }}"
            },
            {
              "name": "password",
              "value": "={{ $json.password }}"
            },
            {
              "name": "proxy",
              "value": "={{ $json.proxy }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "861616b3-236b-49f0-9386-cec32ff0d253",
      "name": "获取表格中的行2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -624,
        304
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1434077398,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit#gid=1434077398",
          "cachedResultName": "acc"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit?usp=drivesdk",
          "cachedResultName": "next-task"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "cqlGJZJdttZJP57A",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7674e75b-ee5c-4d8c-b4cd-66c4521fc502",
      "name": "遍历项目3",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -880,
        -480
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "5513f903-2bc6-486c-9ca0-9a296f4647cc",
      "name": "过滤器1",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1328,
        -480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1f33fb41-ca94-4dd6-8303-b099d518b915",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": "s"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "91395ea6-306d-4af7-8fe2-ab6c4961ce09",
      "name": "限制1",
      "type": "n8n-nodes-base.limit",
      "position": [
        -1104,
        -480
      ],
      "parameters": {
        "maxItems": 100
      },
      "typeVersion": 1
    },
    {
      "id": "5ec859af-480e-4f23-bae1-9baf9d19061c",
      "name": "获取 sheet3 中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1552,
        -480
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit#gid=0",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit?usp=drivesdk",
          "cachedResultName": "next-task"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "cqlGJZJdttZJP57A",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "87c9ec8e-263f-4a02-af79-3b18acfd66a0",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        144
      ],
      "parameters": {
        "color": 3,
        "width": 2528,
        "height": 384,
        "content": "## 使用 Instagram 帐户登录"
      },
      "typeVersion": 1
    },
    {
      "id": "de2e47a4-70e5-47e1-8bb2-a5f52ee05cd8",
      "name": "HTTP 请求5",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        -848
      ],
      "parameters": {
        "url": "http://host.docker.internal:3001/instagram",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "to",
              "value": "={{ $json['username '] }}"
            },
            {
              "name": "message",
              "value": "={{ $json.message }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bd720946-8b7a-45b1-9f99-460c876dd3f1",
      "name": "开始查看故事",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        16,
        -1040
      ],
      "parameters": {
        "url": "http://host.docker.internal:3001/viewstory",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "status",
              "value": "start"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6eeeeb17-6b55-43da-b548-9d0dfa3c7fa7",
      "name": "JavaScript 代码3",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        -1040
      ],
      "parameters": {
        "jsCode": "// n8n Function Node code\n\n// Generate random delay between min and max seconds\nfunction randomDelaySeconds(minSec = 0.2, maxSec = 0.5) {\n  return Math.floor(Math.random() * (maxSec - minSec + 1) + minSec);\n}\n\n// Example: get current message (from previous node)\nconst messages = items.map(item => item.json.message);\n\n// Output array\nconst output = [];\n\nfor (let i = 0; i < messages.length; i++) {\n  output.push({\n    json: {\n      message: messages[i],\n      delaySeconds: randomDelaySeconds(20, 30), // random 20–25 sec delay\n    }\n  });\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1be9b1d3-c190-4d40-86e8-4aed3b0cbeb5",
      "name": "等待5",
      "type": "n8n-nodes-base.wait",
      "position": [
        688,
        -1040
      ],
      "webhookId": "7dc4be61-a5f8-4345-b67f-d1ea9366969f",
      "parameters": {
        "amount": "={{ $('Code in JavaScript3').item.json.delaySeconds }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "e06d8545-f63e-4eb2-93bb-63cc14a9cbd8",
      "name": "开始查看故事1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        912,
        -1040
      ],
      "parameters": {
        "url": "http://host.docker.internal:3001/viewstory",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "status",
              "value": "stop"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f66656c8-d966-491f-914c-1e165523d87a",
      "name": "JavaScript 代码4",
      "type": "n8n-nodes-base.code",
      "position": [
        1136,
        -1040
      ],
      "parameters": {
        "jsCode": "// n8n Function Node code\n\n// Generate random delay between min and max seconds\nfunction randomDelaySeconds(minSec = 0.2, maxSec = 0.5) {\n  return Math.floor(Math.random() * (maxSec - minSec + 1) + minSec);\n}\n\n// Example: get current message (from previous node)\nconst messages = items.map(item => item.json.message);\n\n// Output array\nconst output = [];\n\nfor (let i = 0; i < messages.length; i++) {\n  output.push({\n    json: {\n      message: messages[i],\n      delaySeconds: randomDelaySeconds(10, 20), // random 20–25 sec delay\n    }\n  });\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "133b62ba-976c-4ccb-a9fb-6fb2e17a6161",
      "name": "等待6",
      "type": "n8n-nodes-base.wait",
      "position": [
        1584,
        -672
      ],
      "webhookId": "7dc4be61-a5f8-4345-b67f-d1ea9366969f",
      "parameters": {
        "amount": "={{ $('Code in JavaScript4').item.json.delaySeconds }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "3386ddd7-4762-4882-9294-9cf5a9474cdd",
      "name": "在表格中更新行6",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -208,
        -1040
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "send",
            "username ": "={{ $('Loop Over Items3').item.json['username '] }}",
            "Time Stamp": "= {{ $now.format('hh:mm a') }} / {{ $now.format('yyyy-MM-dd') }}\n"
          },
          "schema": [
            {
              "id": "username ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "username ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time Stamp",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Time Stamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "username "
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit#gid=0",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit?usp=drivesdk",
          "cachedResultName": "next-task"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "cqlGJZJdttZJP57A",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "451acdd9-036b-4214-95fb-764a9d79ed5b",
      "name": "条件判断3",
      "type": "n8n-nodes-base.if",
      "position": [
        -432,
        -848
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "54987f58-a3ac-499b-b114-27b2364a6c5e",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.success }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7f3b39ed-41e7-4bc3-8349-2dbc00fc9e00",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        48,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ba487652-ef4d-4d00-8423-e826224ba7aa",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.success }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1e96c3e5-badd-425a-8ef7-86ee6dfd2cb4",
      "name": "停止并报错",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        272,
        400
      ],
      "parameters": {
        "errorMessage": "Try again login with the account"
      },
      "typeVersion": 1
    },
    {
      "id": "78cd6011-7119-44a9-9118-c752f77fddb7",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -992
      ],
      "parameters": {
        "color": 7,
        "content": "## 向来自 Google 表格的用户名发送消息"
      },
      "typeVersion": 1
    },
    {
      "id": "d47a8301-3f04-4bba-bbad-5f334f8a3f74",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -320
      ],
      "parameters": {
        "color": 7,
        "content": "## 获取潜在客户信息"
      },
      "typeVersion": 1
    },
    {
      "id": "f1abd827-e986-4147-babb-e037fd7f1584",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1296,
        -672
      ],
      "parameters": {
        "color": 7,
        "content": "## 基于 Google 表格中可用的发送状态进行过滤"
      },
      "typeVersion": 1
    },
    {
      "id": "a7515f90-f95a-4ce5-b46f-b65d28345467",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -1216
      ],
      "parameters": {
        "color": 7,
        "content": "## 如果消息已发送,则在 Google 表格中更新"
      },
      "typeVersion": 1
    },
    {
      "id": "2a4d7a4f-d5b2-4289-81a5-66af8b232f8b",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -912
      ],
      "parameters": {
        "color": 7,
        "content": "## 等待15-20秒,然后运行故事查看"
      },
      "typeVersion": 1
    },
    {
      "id": "1a3d96c8-70a1-4537-9c2e-ba8b7287664f",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -880
      ],
      "parameters": {
        "color": 7,
        "content": "## 开始故事查看和滚动交互"
      },
      "typeVersion": 1
    },
    {
      "id": "2dd2a338-8e0d-48a1-8d4e-0bad64108cf5",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -1104
      ],
      "parameters": {
        "color": 7,
        "height": 128,
        "content": "## 停止故事查看和滚动交互"
      },
      "typeVersion": 1
    },
    {
      "id": "e7cd0cc9-6ad2-4325-8356-63c5d4a08af6",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        -1264
      ],
      "parameters": {
        "color": 7,
        "content": "## 等待4.5到5.5分钟进行故事查看等操作"
      },
      "typeVersion": 1
    },
    {
      "id": "6fe6d696-984a-4e2e-9ed0-db427d9b13dc",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        -768
      ],
      "parameters": {
        "color": 7,
        "content": "## 在发送下一条消息前等待2到3分钟"
      },
      "typeVersion": 1
    },
    {
      "id": "f5bdf1cb-d4a0-4629-a274-0496f0abe5bc",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2032,
        -464
      ],
      "parameters": {
        "color": 7,
        "content": "## 在运行此工作流之前,先运行下面的工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "9b0172e1-6818-4ade-9afa-0e8d75571832",
      "name": "如果4",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        -752
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "54987f58-a3ac-499b-b114-27b2364a6c5e",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.requestExceeded }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d05a438a-62ae-4cbd-8037-b2749196bf76",
      "name": "停止和错误1",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        16,
        -848
      ],
      "parameters": {
        "errorMessage": "={{ $json.error }}"
      },
      "typeVersion": 1
    },
    {
      "id": "882b350f-c63b-4abb-82d6-589cc3023162",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -688
      ],
      "parameters": {
        "color": 7,
        "content": "## 检查是否超过速率限制,如果超过则停止"
      },
      "typeVersion": 1
    },
    {
      "id": "41afbdb4-abe3-472c-8fa7-cb53531ab00d",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -848,
        304
      ],
      "webhookId": "3cb5f159-4fc0-426e-8b16-8da1049fa7f1",
      "parameters": {
        "path": "3cb5f159-4fc0-426e-8b16-8da1049fa7f1",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "212a64c7-a5f8-4467-b1c4-70c0d891b490",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        720,
        208
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"success\": {{ $('HTTP Request1').item.json.success }} ,\n  \"message\": \"{{ $('HTTP Request1').item.json.message }}\",\n  \"user\": \"{{ $('HTTP Request1').item.json.user }}\"\n} "
      },
      "typeVersion": 1.4
    },
    {
      "id": "484d9c0d-7079-4ecf-ab52-ec73da08b950",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1776,
        -480
      ],
      "webhookId": "cdf1fb17-2208-4676-bc41-70e5fa0a2ecc",
      "parameters": {
        "path": "cdf1fb17-2208-4676-bc41-70e5fa0a2ecc",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "785f23e0-56ce-4fbc-a3c5-432c5265512a",
      "name": "在工作表中更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        16,
        -656
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "=not-send ( Error :  {{ $json.error }} ) ",
            "username ": "={{ $('Loop Over Items3').item.json['username '] }}",
            "Time Stamp": "= {{ $now.format('hh:mm a') }} / {{ $now.format('yyyy-MM-dd') }}\n"
          },
          "schema": [
            {
              "id": "username ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "username ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time Stamp",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Time Stamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "username "
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit#gid=0",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZNX9fypcwyObMT5tXV6U7iQ7lth2xYul-q8diaiohlo/edit?usp=drivesdk",
          "cachedResultName": "next-task"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "cqlGJZJdttZJP57A",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7b98d241-28f9-47cf-bf8e-2389aea05984",
      "name": "HTTP 请求2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        -1040
      ],
      "parameters": {
        "url": "http://host.docker.internal:3001/logthis",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "message",
              "value": "=🧠 Simulating user actions | Delay {{ $json.delaySeconds }}s\n"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d04dd361-a343-4c42-913b-9e324edca763",
      "name": "HTTP 请求4",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        -1040
      ],
      "parameters": {
        "url": "http://host.docker.internal:3001/logthis",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "message",
              "value": "=⏳ Waiting {{ $json.delaySeconds }}s before next user\n"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2ece54c4-6bd2-4b4e-a8d9-0287e323b46e",
      "name": "响应Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -656,
        -560
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "{\n  \"myField\": \"done man \"\n}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "fa1d0ba2-6548-4cea-a6dc-0f82c94e4b24",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2544,
        -1584
      ],
      "parameters": {
        "width": 1040,
        "height": 1008,
        "content": "### **🤖 Instagram 私信自动化工作流**"
      },
      "typeVersion": 1
    },
    {
      "id": "9a3b41f6-9c3c-44c0-b457-223368b26728",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        288
      ],
      "parameters": {
        "color": 7,
        "content": "## 这是使用 Instagram 帐户登录的流程"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Append or update row in sheet1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If3": {
      "main": [
        [
          {
            "node": "Update row in sheet6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If4": {
      "main": [
        [
          {
            "node": "Stop and Error1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait5": {
      "main": [
        [
          {
            "node": "start-viewing-storeies1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait6": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit1": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter1": {
      "main": [
        [
          {
            "node": "Limit1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "Wait5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request4": {
      "main": [
        [
          {
            "node": "Wait6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request5": {
      "main": [
        [
          {
            "node": "If3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [],
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items3": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript3": {
      "main": [
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript4": {
      "main": [
        [
          {
            "node": "HTTP Request4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet2": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet3": {
      "main": [
        [
          {
            "node": "Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet6": {
      "main": [
        [
          {
            "node": "start-viewing-storeies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "start-viewing-storeies": {
      "main": [
        [
          {
            "node": "Code in JavaScript3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "start-viewing-storeies1": {
      "main": [
        [
          {
            "node": "Code in JavaScript4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet1": {
      "main": [
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 客户培育

需要付费吗?

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

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

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

作者

AI Automation Consultant & Founder @ Brezix Studio, helping service businesses streamline operations with custom AI assistants, CRMs, and workflow automation. Skilled in MERN, Next.js, and Python, I design solutions that save time and boost efficiency. Open to collaborations and automation projects that drive growth.

外部链接
在 n8n.io 查看

分享此工作流