8
n8n 中文网amn8n.com

InstaTest

中级

这是一个AI, Marketing领域的自动化工作流,包含 11 个节点。主要使用 Set, Webhook, Agent, RespondToWebhook, LmChatOpenAi 等节点,结合人工智能技术实现智能自动化。 Instagram私信/收件箱AI代理 - Manychat与OpenAI集成

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "qww129cm4TM9N8Ru",
  "meta": {
    "instanceId": "038da3428bba4563b42be267feeca21b4922693db254331ac640a5c56ee7cadf",
    "templateCredsSetupCompleted": true
  },
  "name": "InstaTest",
  "tags": [
    {
      "id": "8PlqXsDyqVlHJ7RC",
      "name": "AI",
      "createdAt": "2024-07-10T14:12:10.657Z",
      "updatedAt": "2024-07-10T14:12:10.657Z"
    }
  ],
  "nodes": [
    {
      "id": "51dcaa84-d1f9-4abc-aebc-24a06801e42d",
      "name": "为 AI 设置您的系统提示",
      "type": "n8n-nodes-base.set",
      "notes": "In this node in \"prompt\" variable you can set your system prompt",
      "position": [
        1120,
        620
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0b3c3d71-5627-4b8c-91f0-ac44eaedf196",
              "name": "prompt",
              "type": "string",
              "value": "=Persona: You are a instagram influencer.\nContext: You receive a messages from your subscribers\nTask: Answer questions in your writing style and patterns according to your previous posts text. Use your post only for style and patterns reference.\nStyle rules:\nsimple answers"
            },
            {
              "id": "c2a9e272-5c0d-4685-ad0e-ce6995f92a1c",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.body.session_id }}"
            },
            {
              "id": "b3c20ee3-07a1-4584-b0d9-7310a2c6b723",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.body.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "0fb36573-d632-4403-8809-3973f9caa32a",
      "name": "本地 n8n 内存",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1500,
        780
      ],
      "parameters": {
        "sessionKey": "={{ $('Set your system promt for AI').last().json.sessionId }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "2f0471a7-2a84-41ce-aab1-896d5ea95ac3",
      "name": "ChatGPT 模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1360,
        780
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "HxWZhtJcnqTXVHAA",
          "name": "General"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "49abc3a3-faf9-4249-b874-908138a84aea",
      "name": "发送响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1720,
        620
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "49382508-9307-4ffa-8b31-78fac3a7db10",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        360
      ],
      "parameters": {
        "color": 5,
        "width": 458.4028599661066,
        "height": 447.98321744507007,
        "content": "## 简易 Instagram(通过 ManyChat)机器人"
      },
      "typeVersion": 1
    },
    {
      "id": "5d14544c-7039-435f-a53c-615b5722bb99",
      "name": "从 Instagram 获取消息",
      "type": "n8n-nodes-base.webhook",
      "position": [
        900,
        620
      ],
      "webhookId": "68d3fbc9-6e49-4bdc-851c-2a532be911ab",
      "parameters": {
        "path": "instagram_chat",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "3770f558-341b-4d67-a7f0-0bb2fecf51a3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        300
      ],
      "parameters": {
        "width": 313.9634922216307,
        "height": 614.7475040550845,
        "content": "## 3) AI 块"
      },
      "typeVersion": 1
    },
    {
      "id": "cbb6c5a2-9b96-4305-afce-5ac560ae2dec",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1340,
        620
      ],
      "parameters": {
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "={{ $json.prompt }}"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "4e28119f-b1aa-4b20-a8ed-28bd137f9627",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        360
      ],
      "parameters": {
        "height": 440,
        "content": "## 1) HTTP Post webhook"
      },
      "typeVersion": 1
    },
    {
      "id": "b18a8890-b420-4086-91c8-8edbc845c8af",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        480
      ],
      "parameters": {
        "width": 220,
        "height": 320,
        "content": "## 2) 编辑提示"
      },
      "typeVersion": 1
    },
    {
      "id": "74d4e6f5-069e-4b37-8005-8c03226b05df",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1660,
        480
      ],
      "parameters": {
        "height": 300,
        "content": "## 4) 响应 webhook"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2f36fc7a-0a69-4af3-a958-25e9d278f058",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send respond ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ChatGPT model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Local n8n memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Set your system promt for AI": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Getting message from Instagram": {
      "main": [
        [
          {
            "node": "Set your system promt for AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, 营销

需要付费吗?

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

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

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Alex Hi no code

Alex Hi no code

@alex-nocode

AI + Low-code development agency founder. Main focus: AI solutions for businesses in sales. .

外部链接
在 n8n.io 查看

分享此工作流