8
n8n 中文网amn8n.com

Reddit问题的AI自动化

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 20 个节点。主要使用 If, Set, Merge, Reddit, GoogleSheets 等节点。 使用Google Gemini和Sheets检测Reddit问题并自动评论解决方案

前置要求
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "BEji2e0zxDfm2TCt",
  "meta": {
    "instanceId": "f678cb66f902ee934e7c819f39c2d7d59eee478ead5d09104fa91cfa2f204413",
    "templateCredsSetupCompleted": true
  },
  "name": "Reddit 问题的 AI 自动化",
  "tags": [],
  "nodes": [
    {
      "id": "35fec5df-e393-4d93-b2b5-cc244e34c7fd",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -3328,
        208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "756450ba-a661-4a3f-a7cf-062c1d97d35f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2352,
        192
      ],
      "parameters": {
        "text": "=Define weather the reddit post is talking about the problems faced by the users of AI Automation or they need a solution on how they want  bew features in AI Automation. the post should mention a specific problem faced by the users.\n\nReddit Post:  {{ $json.selftext }}\n\nIs this post is about a problem that users are facing about AI Automation or they need new features, Just answer with Yes or No.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "933d79ab-cabf-4a4c-8e23-e795ee59e92e",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -2320,
        368
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "3d1ee156-858b-477f-a1f9-92cb89ff04d2",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2064,
        208
      ],
      "parameters": {
        "mode": "combine",
        "options": {
          "includeUnpaired": true
        },
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "eb9a9ebb-0352-4968-9b5d-70c91d05df0c",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1584,
        192
      ],
      "parameters": {
        "text": "=Based on the reddit post, suggest  a plan or a solution on how i fix the issues  the users are facing with Sora 2.\n\nReddit Post: {{ $json.selftext }}\n\nProvide a concise solution on how we can fix the problems in slack based on the reddit post. \nExplain the solution",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "8c17f645-76ed-4806-ad95-77a4ca5352e9",
      "name": "Google Gemini聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1344,
        304
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "typeVersion": 1
    },
    {
      "id": "b6de179b-ff6d-4d3a-a175-b0aa7754e499",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1264,
        176
      ],
      "parameters": {
        "mode": "combine",
        "options": {
          "clashHandling": {
            "values": {
              "resolveClash": "preferInput1"
            }
          }
        },
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "c8affa4e-c19e-40ec-b16c-84a123886e5d",
      "name": "在帖子中创建评论",
      "type": "n8n-nodes-base.reddit",
      "position": [
        -864,
        176
      ],
      "parameters": {
        "postId": "={{ $json.Bio }}",
        "resource": "postComment",
        "commentText": "={{ $json['Full Name'] }}"
      },
      "typeVersion": 1
    },
    {
      "id": "8a69784f-8906-4e0c-b950-e8bcf2e09a99",
      "name": "在表格中追加行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1056,
        176
      ],
      "parameters": {
        "columns": {
          "value": {
            "Bio": "={{ $json.created }}",
            "username": "={{ $json.selftext }}",
            "Full Name": "={{ $json.output }}",
            "Profile ID,": "={{ $json.title }}",
            "Follower Count": "={{ $json.subreddit_id }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Full Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Full Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Profile ID,",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Profile ID,",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follower Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Follower Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Bio",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Bio",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follower Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Follower Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1703783376,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ic80xnSBq5RsNC5CDUEuaEoze4PDzhL9IPS0jj8z45I/edit#gid=1703783376",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ic80xnSBq5RsNC5CDUEuaEoze4PDzhL9IPS0jj8z45I",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ic80xnSBq5RsNC5CDUEuaEoze4PDzhL9IPS0jj8z45I/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5fd3bc9a-5782-4433-86ff-da5b26ac6b90",
      "name": "帖子搜索",
      "type": "n8n-nodes-base.reddit",
      "position": [
        -2976,
        208
      ],
      "parameters": {
        "limit": 10,
        "keyword": "Why i stopped using",
        "operation": "search",
        "subreddit": "n8n",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "25b867fb-60cd-4515-bc31-ef0cd676dda2",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        -2768,
        208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "751771bf-3129-4806-a686-11d98ecfce3e",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.ups }}",
              "rightValue": 2
            },
            {
              "id": "cda8f6cf-9c1f-49bd-afb0-6b404a9d054d",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.selftext }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a0b43120-0737-426a-a3c4-84e25d95fc04",
      "name": "值设置",
      "type": "n8n-nodes-base.set",
      "position": [
        -2528,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7fc31f22-be37-4195-a26a-40054f74001b",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "da1b8bf9-c1a8-4c6b-b85d-379c91b45241",
              "name": "selftext",
              "type": "string",
              "value": "={{ $json.selftext }}"
            },
            {
              "id": "fea02618-7f96-474c-bcb5-a3e24508ecdb",
              "name": "ups",
              "type": "number",
              "value": "={{ $json.ups }}"
            },
            {
              "id": "b3c743d2-8e5a-48d9-a835-d53d178fb4da",
              "name": "created",
              "type": "number",
              "value": "={{ $('Post Searching').item.json.created }}"
            },
            {
              "id": "75c7a180-6451-4a07-aa09-4d54019c3257",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            },
            {
              "id": "a314d8bd-aa43-4b3a-bb35-acd777979939",
              "name": "subreddit_id",
              "type": "string",
              "value": "={{ $json.subreddit_id }}"
            },
            {
              "id": "87e595d0-e201-4b3f-a75b-396aa4202fd9",
              "name": "id",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "dc1e2c07-9cbd-4cfd-ba6a-c86c67aabe4c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3472,
        -64
      ],
      "parameters": {
        "width": 440,
        "height": 592,
        "content": "## 手动触发器(模板演示)"
      },
      "typeVersion": 1
    },
    {
      "id": "4e5dc346-052c-4dfb-9bc3-7095cc1322df",
      "name": "条件判断 2",
      "type": "n8n-nodes-base.if",
      "position": [
        -1872,
        208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a80000e7-0860-41f4-a64f-087c176ca5a3",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": "Yes"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f48bffbe-c4de-4072-a2e0-dc5e5dcc5f0c",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3024,
        -64
      ],
      "parameters": {
        "color": 6,
        "width": 640,
        "height": 584,
        "content": "## 搜索和筛选 Reddit 帖子(数据源)"
      },
      "typeVersion": 1
    },
    {
      "id": "aae71a32-f119-4536-ae33-7b4f568ee7dc",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 584,
        "content": "## 问题分类器(AI 分析器)"
      },
      "typeVersion": 1
    },
    {
      "id": "5a23ac83-1cbf-470c-a31f-9b78cfb49c83",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 1008,
        "height": 544,
        "content": "## 解决方案生成器(AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "6717c8a9-d983-4f8a-889a-2fb1a2057c02",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        496
      ],
      "parameters": {
        "width": 1008,
        "height": 264,
        "content": "## 存储结果和(可选)回复"
      },
      "typeVersion": 1
    },
    {
      "id": "77196185-7cf5-499e-baa1-6acff8328ff6",
      "name": "便签 - 凭据",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3472,
        544
      ],
      "parameters": {
        "color": 6,
        "width": 1096,
        "height": 200,
        "content": "## 凭据与安全"
      },
      "typeVersion": 1
    },
    {
      "id": "0b3851c9-5cb8-46ef-838d-5271ee4e8991",
      "name": "便签 - 如何重用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2352,
        544
      ],
      "parameters": {
        "color": 6,
        "width": 704,
        "height": 208,
        "content": "## 如何重用/自定义"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "488ed89a-1f72-4aac-9f75-08d59d1ccbd0",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "If Condition 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Value setup": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "If Condition": {
      "main": [
        [
          {
            "node": "Value setup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Condition 2": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Post Searching": {
      "main": [
        [
          {
            "node": "If Condition",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Create a comment in a post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Post Searching",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流