8
n8n 中文网amn8n.com

Slack 多语言助手(使用 Gemini 2.5 Flash)

高级

这是一个Miscellaneous, Multimodal AI领域的自动化工作流,包含 29 个节点。主要使用 If, Code, Switch, Webhook, HttpRequest 等节点。 使用Gemini 2.5 Flash自动化多语言Slack通信(日语⇄英语)

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "name": "Slack 多语言助手(使用 Gemini 2.5 Flash)",
  "tags": [],
  "nodes": [
    {
      "id": "613a274c-124d-42cb-bcea-7769e8050eb1",
      "name": "Webhook(Slack /trans)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        3328,
        512
      ],
      "webhookId": "replace-with-your-slash-webhook-id",
      "parameters": {
        "path": "slack/trans",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "1f1ec470-c751-4de8-b2a8-4f9c2841139f",
      "name": "确认(回复 Slack)",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3584,
        416
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/plain; charset=utf-8"
              }
            ]
          }
        },
        "respondWith": "text",
        "responseBody": "Translating..."
      },
      "typeVersion": 1
    },
    {
      "id": "021bfa0c-46a6-45ca-89a2-bee8f1a28270",
      "name": "解析斜杠命令载荷",
      "type": "n8n-nodes-base.code",
      "position": [
        3584,
        576
      ],
      "parameters": {
        "jsCode": "const payload = $json.body || $json;\nconst text = (payload.text || '').trim();\nreturn [{\n  json: {\n    text,\n    response_url: payload.response_url,\n    user_id: payload.user_id,\n    user_name: payload.user_name\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "9229c1c8-99a3-47e9-9e51-9fdf611f3d6f",
      "name": "确认提及事件",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3584,
        736
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/json; charset=utf-8"
              }
            ]
          }
        },
        "respondWith": "json",
        "responseBody": "={{ $json.body && $json.body.challenge ? {\"challenge\": $json.body.challenge } : {\"ok\": true} }}"
      },
      "typeVersion": 1
    },
    {
      "id": "59f4988f-274d-4f5c-b304-7f253d507306",
      "name": "解析提及事件",
      "type": "n8n-nodes-base.code",
      "position": [
        3584,
        896
      ],
      "parameters": {
        "jsCode": "/* app_mention イベント形式:\n{\n  body: {\n    event: {\n      type: 'app_mention',\n      user: 'U123',\n      text: '<@Ubot> @trans これ訳して',\n      channel: 'C123',\n      ts: '1730000000.12345',\n      thread_ts: '1730000000.12345' (optional)\n    }\n  }\n}\n*/\n\nconst body = $json.body || $json;\nconst ev = body.event || {};\n\nlet raw = ev.text || '';\n// <@U...> とか @trans を除去\nraw = raw.replace(/<@[^>]+>/g, '').replace(/@trans/gi, '').trim();\n\nconst thread_ts = ev.thread_ts || ev.ts;\n\nreturn [{\n  json: {\n    textToTranslate: raw,\n    channel: ev.channel,\n    thread_ts,\n    user_id: ev.user\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "313833d3-b896-42e3-8c85-37a5f8140e4f",
      "name": "确认反应事件",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3584,
        1056
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/json; charset=utf-8"
              }
            ]
          }
        },
        "respondWith": "json",
        "responseBody": "={{ $json.body && $json.body.challenge ? {\"challenge\": $json.body.challenge } : {\"ok\": true} }}"
      },
      "typeVersion": 1
    },
    {
      "id": "19651cc6-1157-4baf-a330-b1d999212c32",
      "name": "解析反应事件",
      "type": "n8n-nodes-base.code",
      "position": [
        3584,
        1216
      ],
      "parameters": {
        "jsCode": "/*\n  Slack reaction_added payload 例:\n  {\n    \"event\": {\n      \"type\": \"reaction_added\",\n      \"user\": \"U123456\",\n      \"reaction\": \"jp\",\n      \"item\": {\n        \"type\": \"message\",\n        \"channel\": \"C123456\",\n        \"ts\": \"1730000000.12345\"\n      }\n    }\n  }\n*/\n\nlet body = $json;\n\n// n8nのWebhookノードでは payload が body 下に入る場合と、直下に入る場合がある\nif ($json.body && typeof $json.body === 'object') {\n  body = $json.body;\n}\n\nconst ev = body.event || {};\n\n// デバッグ用ログ(必要なら一時的にON)\nconsole.log('reaction event', ev);\n\nreturn [\n  {\n    json: {\n      reactor_user: ev.user || null,\n      reaction: ev.reaction || null,\n      channel: ev.item?.channel || null,\n      message_ts: ev.item?.ts || null,\n      raw: ev\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "cc79dec9-6da6-4abb-bc92-47b01b6d1e48",
      "name": "获取原始消息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3760,
        1376
      ],
      "parameters": {
        "url": "={{`https://slack.com/api/conversations.replies?channel=${$json.channel}&ts=${$json.message_ts}&limit=1`}}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fc114495-2e73-4a78-ab32-43291dd7b326",
      "name": "准备反应翻译输入",
      "type": "n8n-nodes-base.code",
      "position": [
        3936,
        1376
      ],
      "parameters": {
        "jsCode": "const eventCtx = $node['Parse Reaction Event'].json;\nconst apiRes = $json;\n\nif (!apiRes.ok || !apiRes.messages || !apiRes.messages.length) {\n  return [{ json: { skip: true, reason: 'no message found' } }];\n}\n\nconst msg = apiRes.messages[0];\nconst textToTranslate = msg.text || '';\nconst thread_ts = msg.thread_ts || msg.ts;\nconst channel = eventCtx.channel;\n\nreturn [{\n  json: {\n    textToTranslate,\n    channel,\n    thread_ts\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "b00abedc-8dd1-4193-b825-4b51b79694a5",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3856,
        1072
      ],
      "parameters": {
        "options": {
          "temperature": 0.2,
          "maxOutputTokens": 1024
        }
      },
      "credentials": {
        "googlePalmApi": {
          "id": "kq5tDtSRmEQTrYwt",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "be154439-e6f6-4eed-9715-2fbd5d3cd9b1",
      "name": "基础 LLM 链(/trans)",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        4096,
        736
      ],
      "parameters": {
        "text": "=",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are a bilingual assistant for a Japanese/English mixed team.\nDetect whether the input is mainly Japanese or English.\nReturn exactly two labeled parts:\n\n[Original]\n<the original text>\n\n[Translation]\n<the translation in the OTHER language>\n\nRules:\n- Detect source language automatically (JA or EN).\n- Translate into the opposite language.\n- Do not add explanations or extra comments.\n- Keep both blocks in plain text."
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "={{ $json.textToTranslate || $json.text }}"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "ecbacf69-4903-4643-9398-89ab3d903609",
      "name": "基础 LLM 链(@trans)",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        4096,
        896
      ],
      "parameters": {
        "text": "=",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are a bilingual assistant for a Japanese/English mixed team.\nDetect whether the input is mainly Japanese or English.\nReturn exactly two labeled parts:\n\n[Original]\n<the original text>\n\n[Translation]\n<the translation in the OTHER language>\n\nRules:\n- Detect source language automatically (JA or EN).\n- Translate into the opposite language.\n- Do not add explanations or extra comments.\n- Keep both blocks in plain text."
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "={{ $json.textToTranslate || $json.text }}"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "adeaa1b3-fbcb-4a11-a1cc-84dc75602478",
      "name": "基础 LLM 链(reaction)",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        4096,
        1056
      ],
      "parameters": {
        "text": "=",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are a bilingual assistant for a Japanese/English mixed team.\nDetect whether the input is mainly Japanese or English.\nReturn exactly two labeled parts:\n\n[Original]\n<the original text>\n\n[Translation]\n<the translation in the OTHER language>\n\nRules:\n- Detect source language automatically (JA or EN).\n- Translate into the opposite language.\n- Do not add explanations or extra comments.\n- Keep both blocks in plain text."
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "={{ $json.textToTranslate || $json.text }}"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "c443fefb-b54e-4b7a-b97f-60f115daa471",
      "name": "格式化 Slack 消息(/trans)",
      "type": "n8n-nodes-base.code",
      "position": [
        4400,
        736
      ],
      "parameters": {
        "jsCode": "/* /trans 用フォーマッタ\n   出力イメージ:\n   【from @後藤】\\n(日本語原文...)\\n----------\\n(英語訳...)\n*/\nconst ctx = $node['Parse Slash Payload'].json;\nconst llm = $json;\n\nlet output = llm.text || llm.output || '';\n\n// [Original] と [Translation] を分離\nlet original = '';\nlet translation = '';\nconst match = output.match(/\\[Original\\]([\\s\\S]*?)\\[Translation\\]([\\s\\S]*)/i);\nif (match) {\n  original = match[1].trim();\n  translation = match[2].trim();\n} else {\n  translation = output.trim();\n}\n\nconst fromUser = ctx.user_id ? `<@${ctx.user_id}>` : (ctx.user_name || 'someone');\nconst finalMessage = `【from ${fromUser}】\\n${original}\\n----------\\n${translation}`;\n\nreturn [{\n  json: {\n    response_url: ctx.response_url,\n    message: finalMessage\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "c939414e-b72e-4a70-a60c-809294ba8d58",
      "name": "格式化 Slack 消息(@trans)",
      "type": "n8n-nodes-base.code",
      "position": [
        4400,
        896
      ],
      "parameters": {
        "jsCode": "/* @trans 用フォーマッタ\n   訳文だけ返す(スレッド)\n*/\nconst ctx = $node['Parse Mention Event'].json;\nconst llm = $json;\n\nlet output = llm.text || llm.output || '';\noutput = output\n  .replace(/\\[Original\\][\\s\\S]*?\\[Translation\\]/i, '')\n  .replace(/\\[Translation\\]/i, '')\n  .trim();\n\nreturn [{\n  json: {\n    channel: ctx.channel,\n    thread_ts: String(ctx.thread_ts),\n    text: output\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "05b95459-5234-479d-8455-74504d4fbfa6",
      "name": "格式化 Slack 消息(reaction)",
      "type": "n8n-nodes-base.code",
      "position": [
        4400,
        1056
      ],
      "parameters": {
        "jsCode": "/* reaction 用フォーマッタ\n   訳文だけ返す(スレッド)\n*/\nconst ctx = $node['Prep Reaction Translation Input'].json;\nconst llm = $json;\n\nlet output = llm.text || llm.output || '';\noutput = output\n  .replace(/\\[Original\\][\\s\\S]*?\\[Translation\\]/i, '')\n  .replace(/\\[Translation\\]/i, '')\n  .trim();\n\nreturn [{\n  json: {\n    channel: ctx.channel,\n    thread_ts: String(ctx.thread_ts),\n    text: output\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "3a592c03-37b3-4d68-a22c-1b7bff70c5f1",
      "name": "发布到 Slack(response_url)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4576,
        736
      ],
      "parameters": {
        "url": "={{$json.response_url}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "response_type",
              "value": "in_channel"
            },
            {
              "name": "text",
              "value": "={{ $json.message }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json; charset=utf-8"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "07a8ba81-4fee-4073-b8fa-48de1e829bc9",
      "name": "发布到 Slack(@trans 回复)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4576,
        896
      ],
      "parameters": {
        "url": "https://slack.com/api/chat.postMessage",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "channel",
              "value": "={{ $json.channel }}"
            },
            {
              "name": "text",
              "value": "={{ $json.text }}"
            },
            {
              "name": "thread_ts",
              "value": "={{ $json.thread_ts.toString() }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json; charset=utf-8"
            },
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4a426e04-11a0-4e99-b37a-0aa2580ea043",
      "name": "发布到 Slack(reaction 回复)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4576,
        1056
      ],
      "parameters": {
        "url": "https://slack.com/api/chat.postMessage",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "channel",
              "value": "={{$json.channel}}"
            },
            {
              "name": "text",
              "value": "={{$json.text}}"
            },
            {
              "name": "thread_ts",
              "value": "={{$json.thread_ts}}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json; charset=utf-8"
            },
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a83c3091-3bac-4fe9-ba77-f15fd9051db3",
      "name": "如何设置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        240
      ],
      "parameters": {
        "color": 4,
        "width": 648,
        "height": 200,
        "content": "Slack 多语言助手(Gemini 2.5 Flash)"
      },
      "typeVersion": 1
    },
    {
      "id": "c5f820f6-5027-49d4-89de-a1781aa354e9",
      "name": "Webhook(Slack @trans + reaction)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        2944,
        976
      ],
      "webhookId": "replace-with-your-mention-webhook-id",
      "parameters": {
        "path": "slack/mention",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "0a859374-d091-468f-bd68-ecb898b7a435",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4384,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 720,
        "content": "🔧 创建并配置你的 Slack 应用(TransBot)"
      },
      "typeVersion": 1
    },
    {
      "id": "3e9045e2-e73b-4a23-a30a-9ecc27a16ed8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3824,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 368,
        "content": "🔁 工作流架构"
      },
      "typeVersion": 1
    },
    {
      "id": "11a71607-a154-4a2a-8903-c896f4462551",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        1200
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 272,
        "content": "🚨 常见错误及修复"
      },
      "typeVersion": 1
    },
    {
      "id": "a6cce3e2-180b-45ee-ba6d-b81e1bcdb5b5",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4336,
        1328
      ],
      "parameters": {
        "color": 4,
        "width": 528,
        "height": 144,
        "content": "✅ 工作流在 n8n 中处于活动状态"
      },
      "typeVersion": 1
    },
    {
      "id": "88bac316-9994-466b-8f75-b7d2f8cf1467",
      "name": "按事件类型路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        3328,
        976
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1927dafe-a218-44de-a76b-47eefeabc55e",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json.event_type}}",
                    "rightValue": "app_mention"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "adda84a4-9099-4b3d-8ef2-4968c8ab8670",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json.event_type}}",
                    "rightValue": "reaction_added"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "1a9163a3-bcab-475d-8372-de95de586e4f",
      "name": "未找到消息时跳过反应",
      "type": "n8n-nodes-base.if",
      "position": [
        4112,
        1376
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "922fba50-9c9e-49c7-9bb0-6efe56e2f216",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{$json.skip}}",
              "rightValue": "true"
            },
            {
              "id": "d98fdf6c-83c4-4a66-8bdf-6d5854131727",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{$json.textToTranslate}}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "1eb61e22-6993-4fd0-ac72-0f9b0fbb976d",
      "name": "筛选反应类型",
      "type": "n8n-nodes-base.code",
      "position": [
        3584,
        1376
      ],
      "parameters": {
        "jsCode": "/*\n  :jp: / :jp-flag: / :flag-jp: / :us: / :flag-us: などに対応\n  → それ以外のリアクションはスキップ\n*/\n\nconst allowedPatterns = ['jp', 'us'];\nconst reaction = ($json.reaction || '').toLowerCase();\n\n// 部分一致チェック\nconst isAllowed = allowedPatterns.some(p => reaction.includes(p));\n\nif (!isAllowed) {\n  return [{ json: { skip: true, reason: `irrelevant reaction: ${reaction}` } }];\n}\n\nreturn [{ json: $json }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e3aa1071-f785-4338-a8f4-ae20384ae621",
      "name": "检测 Slack 事件类型",
      "type": "n8n-nodes-base.code",
      "position": [
        3136,
        976
      ],
      "parameters": {
        "jsCode": "const event = $json.body?.event || $json.event;\nreturn [{ json: { event_type: event.type, event } }];"
      },
      "typeVersion": 2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Parse Mention Event": {
      "main": [
        [
          {
            "node": "Basic LLM Chain (@trans)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Slash Payload": {
      "main": [
        [
          {
            "node": "Basic LLM Chain (/trans)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Event Type": {
      "main": [
        [
          {
            "node": "Ack Mention Event",
            "type": "main",
            "index": 0
          },
          {
            "node": "Parse Mention Event",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ack Reaction Event",
            "type": "main",
            "index": 0
          },
          {
            "node": "Parse Reaction Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Reaction Type": {
      "main": [
        [
          {
            "node": "Fetch Original Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Reaction Event": {
      "main": [
        [
          {
            "node": "Filter Reaction Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Original Message": {
      "main": [
        [
          {
            "node": "Prep Reaction Translation Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook (Slack /trans)": {
      "main": [
        [
          {
            "node": "Ack (Respond to Slack)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Parse Slash Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Slack Event Type": {
      "main": [
        [
          {
            "node": "Route by Event Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain (/trans)": {
      "main": [
        [
          {
            "node": "Format Slack Message (/trans)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain (@trans)": {
      "main": [
        [
          {
            "node": "Format Slack Message (@trans)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain (reaction)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Basic LLM Chain (@trans)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Basic LLM Chain (/trans)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain (reaction)": {
      "main": [
        [
          {
            "node": "Format Slack Message (reaction)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message (/trans)": {
      "main": [
        [
          {
            "node": "Post to Slack (response_url)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message (@trans)": {
      "main": [
        [
          {
            "node": "Post to Slack (@trans reply)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message (reaction)": {
      "main": [
        [
          {
            "node": "Post to Slack (reaction reply)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Reaction Translation Input": {
      "main": [
        [
          {
            "node": "Skip Reaction When No Message Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook (Slack @trans + reaction)": {
      "main": [
        [
          {
            "node": "Detect Slack Event Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip Reaction When No Message Found": {
      "main": [
        [
          {
            "node": "Basic LLM Chain (reaction)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 杂项, 多模态 AI

需要付费吗?

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

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

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

作者
Tomohiro Goto

Tomohiro Goto

@taoo

Creative Technologist blending design and automation to make work a little more fun. Exploring how AI and workflow tools like n8n can bring creativity into everyday work.

外部链接
在 n8n.io 查看

分享此工作流