Asistente multilingüe de Slack (usando Gemini 2.5 Flash)

Avanzado

Este es unMiscellaneous, Multimodal AIflujo de automatización del dominio deautomatización que contiene 29 nodos.Utiliza principalmente nodos como If, Code, Switch, Webhook, HttpRequest. Automatización de la comunicación multilingüe en Slack (Japonés ⇄ Inglés) con Gemini 2.5 Flash

Requisitos previos
  • Punto final de HTTP Webhook (n8n generará automáticamente)
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Clave de API de Google Gemini
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "name": "Slack Multilingual Assistant with 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": "Acuse de recibo (Responder a 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": "Analizar carga útil de comando",
      "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": "Acuse de recibo de evento de mención",
      "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": "Analizar evento de mención",
      "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": "Acuse de recibo de evento de reacción",
      "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": "Analizar evento de reacción",
      "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": "Obtener mensaje original",
      "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": "Preparar entrada para traducción de reacción",
      "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 Chat Model",
      "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": "Cadena básica de 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": "Cadena básica de 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": "Cadena básica de LLM (reacción)",
      "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": "Formatear mensaje 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": "Formatear mensaje 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": "Formatear mensaje Slack (reacción)",
      "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": "Publicar en 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": "Publicar en Slack (respuesta a @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": "Publicar en Slack (respuesta a reacción)",
      "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": "Cómo configurar",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        240
      ],
      "parameters": {
        "color": 4,
        "width": 648,
        "height": 200,
        "content": "Slack Multilingual Assistant (Gemini 2.5 Flash)\n\n🔧 Three translation modes unified in one workflow:\n1️⃣ /trans — Public bilingual announcements  \n  Format: 【from @user】 Original ---------- Translation  \n2️⃣ @trans — Mention trigger for thread translation (translation only)  \n3️⃣ 🇯🇵 / 🇺🇸 Reaction — Private on-demand translation  \n\n💡 All modes share the same Google Gemini 2.5 Flash core for automatic JA⇄EN detection."
      },
      "typeVersion": 1
    },
    {
      "id": "c5f820f6-5027-49d4-89de-a1781aa354e9",
      "name": "Webhook (Slack @trans + reacción)",
      "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": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4384,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 720,
        "content": "🔧 Create and Configure your Slack App (TransBot)\n\n1️⃣ Create App  \n → From scratch → Name it “TransBot” → Select your workspace  \n\n2️⃣ Add Bot Token Scopes in OAuth & Permissions\n • commands  \n • chat:write  \n • app_mentions:read  \n • reactions:read  \n • channels:history  \n • groups:history (optional for private channels)\n\n3️⃣ Event Subscriptions  \n Enable Events ✅  \n Request URL →  \n   https://<your-n8n-domain>/webhook/slack/mention  \n Once verified, subscribe to bot events:  \n   – app_mention  \n   – message.channels  \n and subscribe on behalf of users:  \n   – reaction_added  \n\n4️⃣ Slash Command  \n Command name: `/trans`  \n Request URL →  \n   https://<your-n8n-domain>/webhook/slack/trans  \n Short desc: “Translate text JA⇄EN with Gemini 2.5 Flash”\n\n5️⃣ Install or Reinstall to Workspace  \n Copy the new Bot User OAuth Token (xoxb-…)  \n and paste it into the HTTP Request headers in n8n  \n (`Authorization: Bearer YOUR_TOKEN_HERE`)\n\n6️⃣ Invite the bot to your channels:  \n `/invite @TransBot`"
      },
      "typeVersion": 1
    },
    {
      "id": "3e9045e2-e73b-4a23-a30a-9ecc27a16ed8",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3824,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 368,
        "content": "🔁 Workflow Architecture\n\n• Webhooks:\n  – /slack/trans     → Slash Command  \n  – /slack/mention  → app_mention & reaction_added events  \n\n• Language Model: Google Gemini 2.5 Flash  \n• Logic:\n  – Detect source language (JA/EN)  \n  – Translate to the opposite language  \n  – Format Slack message per mode  \n\n• Outputs:\n  – /trans → Posts bilingual message to channel (via response_url)  \n  – @trans → Replies in thread with translation only  \n  – Reaction → Replies in thread with translation only (for reader)\n\nAll three paths share the same Gemini core."
      },
      "typeVersion": 1
    },
    {
      "id": "11a71607-a154-4a2a-8903-c896f4462551",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        1200
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 272,
        "content": "🚨 Common Errors & Fixes\n\n❌ invalid_auth  \n → Using an old token or bot not invited to channel  \n  Fix: Reinstall app / use latest xoxb token / `/invite @TransBot`\n\n❌ missing_scope  \n → A required scope is missing  \n  Fix: Add scope in OAuth & Permissions → Save → Reinstall\n\n❌ no message found  \n → Reaction event can’t fetch original text  \n  Fix: Add `groups:history` scope for private channels"
      },
      "typeVersion": 1
    },
    {
      "id": "a6cce3e2-180b-45ee-ba6d-b81e1bcdb5b5",
      "name": "Nota adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4336,
        1328
      ],
      "parameters": {
        "color": 4,
        "width": 528,
        "height": 144,
        "content": "✅ Workflow is Active in n8n  \n✅ Slack Event Subscription Request URL shows “Verified ✅”  \n✅ Bot Token includes chat:write, channels:history, reactions:read  \n✅ /trans Slash Command responds with “Translating...” then Gemini output  \n✅ @trans mention replies in thread with translation only  \n✅ 🇯🇵/🇺🇸 reaction adds translation reply in thread"
      },
      "typeVersion": 1
    },
    {
      "id": "88bac316-9994-466b-8f75-b7d2f8cf1467",
      "name": "Enrutar por tipo de evento",
      "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": "Omitir reacción si no se encuentra mensaje",
      "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": "Filtrar tipo de reacción",
      "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": "Detectar tipo de evento 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": {
    "59f4988f-274d-4f5c-b304-7f253d507306": {
      "main": [
        [
          {
            "node": "ecbacf69-4903-4643-9398-89ab3d903609",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "021bfa0c-46a6-45ca-89a2-bee8f1a28270": {
      "main": [
        [
          {
            "node": "be154439-e6f6-4eed-9715-2fbd5d3cd9b1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "88bac316-9994-466b-8f75-b7d2f8cf1467": {
      "main": [
        [
          {
            "node": "9229c1c8-99a3-47e9-9e51-9fdf611f3d6f",
            "type": "main",
            "index": 0
          },
          {
            "node": "59f4988f-274d-4f5c-b304-7f253d507306",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "313833d3-b896-42e3-8c85-37a5f8140e4f",
            "type": "main",
            "index": 0
          },
          {
            "node": "19651cc6-1157-4baf-a330-b1d999212c32",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1eb61e22-6993-4fd0-ac72-0f9b0fbb976d": {
      "main": [
        [
          {
            "node": "cc79dec9-6da6-4abb-bc92-47b01b6d1e48",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "19651cc6-1157-4baf-a330-b1d999212c32": {
      "main": [
        [
          {
            "node": "1eb61e22-6993-4fd0-ac72-0f9b0fbb976d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cc79dec9-6da6-4abb-bc92-47b01b6d1e48": {
      "main": [
        [
          {
            "node": "fc114495-2e73-4a78-ab32-43291dd7b326",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "613a274c-124d-42cb-bcea-7769e8050eb1": {
      "main": [
        [
          {
            "node": "1f1ec470-c751-4de8-b2a8-4f9c2841139f",
            "type": "main",
            "index": 0
          },
          {
            "node": "021bfa0c-46a6-45ca-89a2-bee8f1a28270",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e3aa1071-f785-4338-a8f4-ae20384ae621": {
      "main": [
        [
          {
            "node": "88bac316-9994-466b-8f75-b7d2f8cf1467",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "be154439-e6f6-4eed-9715-2fbd5d3cd9b1": {
      "main": [
        [
          {
            "node": "c443fefb-b54e-4b7a-b97f-60f115daa471",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ecbacf69-4903-4643-9398-89ab3d903609": {
      "main": [
        [
          {
            "node": "c939414e-b72e-4a70-a60c-809294ba8d58",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b00abedc-8dd1-4193-b825-4b51b79694a5": {
      "ai_languageModel": [
        [
          {
            "node": "adeaa1b3-fbcb-4a11-a1cc-84dc75602478",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "ecbacf69-4903-4643-9398-89ab3d903609",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "be154439-e6f6-4eed-9715-2fbd5d3cd9b1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "adeaa1b3-fbcb-4a11-a1cc-84dc75602478": {
      "main": [
        [
          {
            "node": "05b95459-5234-479d-8455-74504d4fbfa6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c443fefb-b54e-4b7a-b97f-60f115daa471": {
      "main": [
        [
          {
            "node": "3a592c03-37b3-4d68-a22c-1b7bff70c5f1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c939414e-b72e-4a70-a60c-809294ba8d58": {
      "main": [
        [
          {
            "node": "07a8ba81-4fee-4073-b8fa-48de1e829bc9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "05b95459-5234-479d-8455-74504d4fbfa6": {
      "main": [
        [
          {
            "node": "4a426e04-11a0-4e99-b37a-0aa2580ea043",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fc114495-2e73-4a78-ab32-43291dd7b326": {
      "main": [
        [
          {
            "node": "1a9163a3-bcab-475d-8372-de95de586e4f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c5f820f6-5027-49d4-89de-a1781aa354e9": {
      "main": [
        [
          {
            "node": "e3aa1071-f785-4338-a8f4-ae20384ae621",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1a9163a3-bcab-475d-8372-de95de586e4f": {
      "main": [
        [
          {
            "node": "adeaa1b3-fbcb-4a11-a1cc-84dc75602478",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Varios, IA Multimodal

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos29
Categoría2
Tipos de nodos9
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor
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.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34