8
n8n 中文网amn8n.com

Instagram影响者交付物和合同合规性自动化

高级

这是一个Social Media, AI Summarization领域的自动化工作流,包含 26 个节点。主要使用 If, Set, Code, Cron, Slack 等节点。 使用Claude AI和Slack提醒自动化Instagram影响者合同合规性

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "xl4Z2irVR0uBoHoJ",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "Instagram 影响者交付物和合同合规性自动化",
  "tags": [],
  "nodes": [
    {
      "id": "03e0f79e-fd01-474c-8135-4bf0f0faeb1d",
      "name": "计划触发器",
      "type": "n8n-nodes-base.cron",
      "position": [
        -624,
        -176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "33aa1cec-3a0b-418a-b0ed-9af18722ef10",
      "name": "获取合同",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -400,
        -176
      ],
      "parameters": {
        "options": {},
        "sheetId": "your-contracts-sheet-id!A:H"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5516f33e-16a1-4beb-bf07-f573ba8ccd08",
      "name": "遍历合同",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -176,
        -176
      ],
      "parameters": {
        "options": {},
        "batchSize": 1
      },
      "typeVersion": 1
    },
    {
      "id": "af25ad56-9311-49e8-842c-204b328d0ced",
      "name": "计算截止日期状态",
      "type": "n8n-nodes-base.code",
      "position": [
        48,
        -176
      ],
      "parameters": {
        "jsCode": "const deadline = new Date($json['deadline']);\nconst now = new Date();\nconst daysToDeadline = Math.ceil((deadline - now) / (1000 * 60 * 60 * 24));\n\nreturn {\n  json: {\n    ...$json,\n    daysToDeadline,\n    isApproaching: daysToDeadline > 0 && daysToDeadline <= 3,\n    isPassed: daysToDeadline <= 0\n  }\n};"
      },
      "typeVersion": 1
    },
    {
      "id": "6cb537be-9f88-4ef3-a6a7-d730ab782227",
      "name": "如果 接近截止日期",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        -272
      ],
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json[\"isApproaching\"] }}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fb583c49-8842-49c1-92ac-45511abeb67b",
      "name": "发送提醒 (Slack)",
      "type": "n8n-nodes-base.slack",
      "position": [
        496,
        -272
      ],
      "parameters": {
        "text": "=Reminder: Influencer {{ $json[\"influencerName\"] }} - Post due in {{ $json[\"daysToDeadline\"] }} days for campaign {{ $json[\"campaignId\"] }}. Required hashtag: {{ $json[\"requiredHashtag\"] }}",
        "channel": "your-slack-channel",
        "attachments": [],
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "MQ0fgwuS8AzfwFvy",
          "name": "Slack account - test "
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2b15e005-aee0-4b23-a078-cb0f07004b1d",
      "name": "如果 截止日期已过",
      "type": "n8n-nodes-base.if",
      "position": [
        288,
        112
      ],
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json[\"isPassed\"] }}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a08ad880-39e2-46e4-9428-56f019e43072",
      "name": "获取影响者帖子",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        544,
        96
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v12.0/{{ $json[\"influencerUserId\"] }}/media?access_token=YOUR_INSTAGRAM_ACCESS_TOKEN",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "07a09646-85c3-4b67-a69b-8386e13589d2",
      "name": "检查帖子合规性 (Claude AI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        784,
        96
      ],
      "parameters": {
        "url": "https://api.anthropic.com/v1/messages",
        "options": {},
        "requestMethod": "POST",
        "jsonParameters": true,
        "bodyParametersJson": "={\"model\": \"claude-3-5-sonnet-20241022\", \"max_tokens\": 1024, \"messages\": [{\"role\": \"user\", \"content\": \"Check if any of these recent Instagram posts contain the required hashtag '{{ $json[\"requiredHashtag\"] }}' and match the campaign description '{{ $json[\"campaignDescription\"] }}'. Posts: {{ JSON.stringify($json[\"data\"]) }}. Output: is_compliant: yes/no\"}]}"
      },
      "typeVersion": 1
    },
    {
      "id": "dcbc21bb-95b1-4041-9bde-50fb12edc097",
      "name": "如果 检测到违规",
      "type": "n8n-nodes-base.if",
      "position": [
        992,
        96
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json[\"content\"][0][\"text\"].toLowerCase().split(':')[1].trim() }}",
              "value2": "no"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cf595681-b060-4f83-9733-b8e7fb3966b1",
      "name": "通知违规 (Slack)",
      "type": "n8n-nodes-base.slack",
      "position": [
        1200,
        -144
      ],
      "parameters": {
        "text": "=Contract Breach Alert! Influencer {{ $json[\"influencerName\"] }} failed to post for campaign {{ $json[\"campaignId\"] }} by deadline {{ $json[\"deadline\"] }}.",
        "channel": "manager-slack-channel",
        "attachments": [],
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "MQ0fgwuS8AzfwFvy",
          "name": "Slack account - test "
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0f2431e2-d59e-4051-ac2c-29c6708cc529",
      "name": "记录违规",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1200,
        48
      ],
      "parameters": {
        "options": {},
        "sheetId": "your-logs-sheet-id!A:F",
        "operation": "append"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "17dc2dd5-0e30-47e6-98a3-2ab651b9486e",
      "name": "结束(合规路径)",
      "type": "n8n-nodes-base.set",
      "position": [
        1200,
        288
      ],
      "parameters": {
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1
    },
    {
      "id": "99da3762-46c3-4f66-b95d-84b818e71011",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -368
      ],
      "parameters": {
        "color": 3,
        "width": 176,
        "height": 480,
        "content": "每天上午 9 点运行或通过 webhook (/influencer-compliance) 运行"
      },
      "typeVersion": 1
    },
    {
      "id": "11643a92-6d5d-4899-aef5-a6fc4787eeb9",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -368
      ],
      "parameters": {
        "color": 5,
        "width": 176,
        "height": 336,
        "content": "单独处理每个合同"
      },
      "typeVersion": 1
    },
    {
      "id": "a37ac9a7-71b4-4c4a-b835-cb730aef9074",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -64
      ],
      "parameters": {
        "color": 4,
        "width": 176,
        "height": 336,
        "content": "从影响者的 Instagram 获取最近的帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "afd669d8-0961-4204-bc74-f04f27d6b25a",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -64
      ],
      "parameters": {
        "width": 176,
        "height": 336,
        "content": "如果截止日期已过则分支"
      },
      "typeVersion": 1
    },
    {
      "id": "5d3990be-46b6-49f7-89e8-98a7d5a974a2",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -448
      ],
      "parameters": {
        "color": 3,
        "width": 176,
        "height": 336,
        "content": "通知影响者/团队即将到来的截止日期"
      },
      "typeVersion": 1
    },
    {
      "id": "a6f8c630-09e3-41ee-93d1-98d2a9463a69",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -448
      ],
      "parameters": {
        "color": 6,
        "width": 176,
        "height": 336,
        "content": "如果在 3 天内则分支"
      },
      "typeVersion": 1
    },
    {
      "id": "656ce4fc-f52d-477d-83f4-b40f2969bb7a",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -368
      ],
      "parameters": {
        "color": 4,
        "width": 176,
        "height": 336,
        "content": "计算距离截止日期天数,标记接近/已过"
      },
      "typeVersion": 1
    },
    {
      "id": "c1844ae1-a433-47af-8d61-b979bd283676",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -368
      ],
      "parameters": {
        "width": 176,
        "height": 336,
        "content": "从合同表中加载影响者合同"
      },
      "typeVersion": 1
    },
    {
      "id": "a69a2e61-b0c5-4430-9dd8-da77a0003450",
      "name": "便签 8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -64
      ],
      "parameters": {
        "color": 2,
        "width": 176,
        "height": 336,
        "content": "如果不合规则分支"
      },
      "typeVersion": 1
    },
    {
      "id": "fada9646-ea1a-41dc-a727-9e2233de03ba",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -64
      ],
      "parameters": {
        "color": 5,
        "width": 176,
        "height": 336,
        "content": "使用 AI 验证帖子是否符合合同要求"
      },
      "typeVersion": 1
    },
    {
      "id": "8327329c-e485-4c3f-a75b-a9c8699e6dd4",
      "name": "便签 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -544
      ],
      "parameters": {
        "color": 3,
        "width": 176,
        "height": 976,
        "content": "提醒经理合同违规"
      },
      "typeVersion": 1
    },
    {
      "id": "318f9ab4-7200-4975-8e0c-9c401c1c48af",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -624,
        -16
      ],
      "webhookId": "f50af7ff-5c16-4985-9f9f-d10b805b11d4",
      "parameters": {
        "path": "f50af7ff-5c16-4985-9f9f-d10b805b11d4",
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "ff7449ef-d08d-4a4f-b5f6-b2f83433aaa9",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1200,
        -336
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.4
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a53b3923-88f0-485d-a994-5eee37e4b1f5",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Get Contracts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Contracts": {
      "main": [
        [
          {
            "node": "Loop Over Contracts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Contracts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Breach Detected": {
      "main": [
        [
          {
            "node": "Notify Breach (Slack)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Breach",
            "type": "main",
            "index": 0
          },
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "End (Compliant Path)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Deadline Passed": {
      "main": [
        [
          {
            "node": "Get Influencer Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Contracts": {
      "main": [
        [
          {
            "node": "Calculate Deadline Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Influencer Posts": {
      "main": [
        [
          {
            "node": "Check Post Compliance (Claude AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Approaching Deadline": {
      "main": [
        [
          {
            "node": "Send Reminder (Slack)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Deadline Status": {
      "main": [
        [
          {
            "node": "IF Approaching Deadline",
            "type": "main",
            "index": 0
          },
          {
            "node": "IF Deadline Passed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Post Compliance (Claude AI)": {
      "main": [
        [
          {
            "node": "IF Breach Detected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体, AI 摘要总结

需要付费吗?

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

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

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

作者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部链接
在 n8n.io 查看

分享此工作流