WhatsApp AI助手(使用Claude和GPT4O):多格式处理与生产力套件

高级

这是一个Content Creation、Multimodal AI领域的自动化工作流,包含 51 个节点。主要使用 If、Set、Code、Switch、WhatsApp 等节点。 WhatsApp AI助手(使用Claude和GPT4O):多格式处理与生产力套件

前置要求
  • Google 账号和 Gmail API 凭证
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
  • Airtable API Key
  • Google Drive API 凭证
  • OpenAI API Key
  • Anthropic API Key
  • PostgreSQL 数据库连接信息
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "393ca9e36a1f81b0f643c72792946a5fe5e49eb4864181ba4032e5a408278263",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "70d356b8-7257-4457-95fc-593a5ae107c6",
      "name": "Download Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        384
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "M1itATRZlkkQI3mk",
          "name": "WhatsApp Growth Ai Agent IA"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4f254607-5d6f-4828-a122-acefc8f98c7f",
      "name": "分析图像",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        560,
        384
      ],
      "parameters": {
        "text": "=Tu es une intelligence artificielle avancée spécialisée dans la description d’images. Ta fonction principale est de fournir des descriptions détaillées et précises d’images envoyées via WhatsApp.\n\n#Fonctionnalité principale :\nLorsque tu reçois une image, tu dois l’analyser en profondeur et fournir une description complète en français.\nTes descriptions doivent capturer à la fois les éléments évidents et les détails plus subtils présents dans l’image.\n\n#Directives pour la description d’image :\nCommence par une vue d’ensemble de ce que contient l’image.\nDécris les sujets principaux, les personnes, les objets et les relations entre eux.\nNote les éléments visuels importants tels que les couleurs, l’éclairage, la composition et la perspective.\nSignale tout texte visible dans l’image.\nDécris le décor ou l’environnement représenté.\nMentionne toute action ou événement notable en cours.\nCommente l’ambiance, le ton ou l’atmosphère si cela est pertinent.\nLorsque c’est applicable, identifie les monuments, personnes célèbres ou références culturelles.\n\n#Format de réponse :\nCommence toujours par « Image Description: » suivi de ton analyse.\nStructure la description de manière logique (du général au spécifique).\nUtilise un langage clair, précis et adapté à la description visuelle.\nPour les descriptions longues, organise le texte en paragraphes pour une meilleure lisibilité.\nTermine avec toute observation importante nécessitant une attention particulière.\n\n#Limitations :\nSi l’image est floue, de faible résolution ou difficile à interpréter, mentionne ces limites clairement.\nSi l’image contient du contenu potentiellement sensible, décris-la de manière factuelle, sans porter de jugement.\nNe fais aucune supposition sur des éléments que tu ne peux pas clairement identifier.\nTes descriptions doivent être informatives, objectives et approfondies, permettant à une personne qui ne voit pas l’image de se faire une représentation mentale fidèle de son contenu.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {
          "detail": "auto"
        },
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "Wk5dyBYFy6HDwml2",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "60f194a0-3749-4f69-834e-597015c351be",
      "name": "下载音频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        368,
        -304
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "M1itATRZlkkQI3mk",
          "name": "WhatsApp Growth Ai Agent IA"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f34b223e-42f0-4c23-8d84-71c945f87b3d",
      "name": "转录音频",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        544,
        -304
      ],
      "parameters": {
        "options": {
          "language": "en"
        },
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "Wk5dyBYFy6HDwml2",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "5529202d-2b0c-4879-92fa-ea861f6c478c",
      "name": "下载文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        1072
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "M1itATRZlkkQI3mk",
          "name": "WhatsApp Growth Ai Agent IA"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1dbd7c31-6ea5-4045-83f6-b46762400808",
      "name": "从文件提取",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        624,
        1072
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "50781d73-3968-4c6f-b070-62f743e90686",
      "name": "Get File Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        256,
        1072
      ],
      "webhookId": "280bd5de-32d7-4d8f-93d2-e91e3b0bc161",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].document.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "jcnpyvSgT2JMrgFR",
          "name": "WhatsApp Growth Ai"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d7ceba5c-7b0a-438f-b90c-9d998030ad31",
      "name": "Only PDF File",
      "type": "n8n-nodes-base.if",
      "position": [
        64,
        1072
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f52d2aaa-e0b2-45e5-8c4b-ceef42182a0d",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.messages[0].document.mime_type }}",
              "rightValue": "application/pdf"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ee3e8387-8637-4367-b9a8-526aeb007d3a",
      "name": "Fix mimeType for Audio",
      "type": "n8n-nodes-base.code",
      "position": [
        3296,
        -96
      ],
      "parameters": {
        "jsCode": "for (const item of $input.all()) {\n  if (item.binary) {\n    const binaryPropertyNames = Object.keys(item.binary);\n    for (const propName of binaryPropertyNames) {\n      if (item.binary[propName].mimeType === 'audio/mp3') {\n        item.binary[propName].mimeType = 'audio/mpeg';\n      }\n    }\n  }\n}\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "55e9b3eb-100c-4058-b2d2-1223a3fbf2f1",
      "name": "Send audio",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        3472,
        -96
      ],
      "webhookId": "d18b2c98-84e4-43cf-a532-0c47d5161684",
      "parameters": {
        "mediaPath": "useMedian8n",
        "operation": "send",
        "messageType": "audio",
        "phoneNumberId": "752773604591912",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('Input type').item.json.contacts[0].wa_id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "jcnpyvSgT2JMrgFR",
          "name": "WhatsApp Growth Ai"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "de508f77-3f60-4808-9726-0cc0da2842c7",
      "name": "Incorrect format",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        384,
        1216
      ],
      "webhookId": "23834751-5066-48ba-8e19-549680df2b27",
      "parameters": {
        "textBody": "=Sorry but you can only send PDF files",
        "operation": "send",
        "phoneNumberId": "633014906568769",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "jcnpyvSgT2JMrgFR",
          "name": "WhatsApp Growth Ai"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c5aa0040-6b27-428f-8302-bb18a12bfe87",
      "name": "文本",
      "type": "n8n-nodes-base.set",
      "position": [
        80,
        -624
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c53cd9f9-77c1-4331-98ff-bfc9bdf95a3c",
              "name": "text",
              "type": "string",
              "value": "={{ $json.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "59211922-ef3c-4c1a-85b0-a328d7257202",
      "name": "Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        -304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "219577d5-b028-48fc-90be-980f4171ab68",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1fabd368-fe0e-4dbc-b027-7a2e16c82668",
      "name": "Image",
      "type": "n8n-nodes-base.set",
      "position": [
        752,
        384
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "67552183-de2e-494a-878e-c2948e8cb6bb",
              "name": "text",
              "type": "string",
              "value": "=Demande de l'utilisateur sur l'image :\n{{ \"Describe the following image\" || $('WhatsApp Trigger').item.json.messages[0].image.caption }}\n\nImage description:\n{{ $json.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9e279946-eaae-48da-bf7d-7bbd6617ad6b",
      "name": "File",
      "type": "n8n-nodes-base.set",
      "position": [
        816,
        1072
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "67552183-de2e-494a-878e-c2948e8cb6bb",
              "name": "text",
              "type": "string",
              "value": "=User request on the file:\n{{ \"Describe this file\" || $('Only PDF File').item.json.messages[0].document.caption }}\n\nFile content:\n{{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2a81eaad-8eb3-4297-8b93-fa979d42274d",
      "name": "Get Image Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        192,
        384
      ],
      "webhookId": "280bd5de-32d7-4d8f-93d2-e91e3b0bc161",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "jcnpyvSgT2JMrgFR",
          "name": "WhatsApp Growth Ai"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f8373aa3-e8fd-4cc1-912c-ced3bc6bdfce",
      "name": "Get Audio Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        176,
        -304
      ],
      "webhookId": "87caa300-7204-47b5-959a-94f4a8fbf8cf",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "jcnpyvSgT2JMrgFR",
          "name": "WhatsApp Growth Ai"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1742fb29-d6b2-4528-9080-553ea4b7579e",
      "name": "Generate Audio Response",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3104,
        -96
      ],
      "parameters": {
        "input": "={{ $('Agent personnel').item.json.output }}",
        "voice": "fable",
        "options": {},
        "resource": "audio"
      },
      "credentials": {
        "openAiApi": {
          "id": "Wk5dyBYFy6HDwml2",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "bc97b264-1d90-4b45-89de-53152c188da1",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        320
      ],
      "parameters": {
        "color": 6,
        "width": 1028,
        "height": 240,
        "content": "## Images"
      },
      "typeVersion": 1
    },
    {
      "id": "f26f9d45-64e8-4e5a-b3c0-1456c119d73e",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        1008
      ],
      "parameters": {
        "color": 7,
        "width": 1028,
        "height": 352,
        "content": "## PDF Documents"
      },
      "typeVersion": 1
    },
    {
      "id": "8b5245a2-6017-47f6-b3de-fd433f5256f8",
      "name": "From audio to audio?",
      "type": "n8n-nodes-base.if",
      "position": [
        2816,
        -96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b9d1d759-f585-4791-a743-b9d72951e77c",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('WhatsApp Trigger').item.json.messages[0].audio }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b1fc3072-4a21-4bad-ba13-f5d7e13a610e",
      "name": "Input type",
      "type": "n8n-nodes-base.switch",
      "position": [
        -704,
        80
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "08fd0c80-307e-4f45-b1de-35192ee4ec5e",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].text.body }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b7b64446-f1ea-4622-990c-22f3999a8269",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].audio }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "202af928-a324-411a-bf15-68a349e7bf9e",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].image }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Document",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c63299e9-6069-4bc6-afb9-7beebf6e3d69",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].document }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "a3491a70-94c5-40a9-b1fc-c85d9df0cc0d",
      "name": "Postgres 聊天记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        1392,
        176
      ],
      "parameters": {
        "tableName": "Growth_Ai_bot_whatsapp",
        "sessionKey": "={{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "credentials": {
        "postgres": {
          "id": "AHpJedehHyZdI0MX",
          "name": "Postgres account - IDR"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "43108f3a-f132-4cb5-b4fe-edd995d6a239",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -368
      ],
      "parameters": {
        "color": 5,
        "width": 1028,
        "height": 240,
        "content": "## Audio Messages"
      },
      "typeVersion": 1
    },
    {
      "id": "a72662d8-972c-4fb5-915b-d78a30e5d49e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -704
      ],
      "parameters": {
        "color": 3,
        "width": 260,
        "height": 304,
        "content": "## Text\n"
      },
      "typeVersion": 1
    },
    {
      "id": "504908de-7751-4374-ad1d-6f47c45cf358",
      "name": "SerpAPI",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        1248,
        176
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "serpApi": {
          "id": "w1oDmQzMKE4Wcj2P",
          "name": "SerpAPI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a22a2384-74a8-4a95-8123-fab7040b4ccc",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        2336,
        -96
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude Sonnet 4"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "id": "WXQf5QsxCs3AyxlW",
          "name": "Anthropic account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d3703f11-b9d6-42dc-b96c-a66fe3942ac7",
      "name": "BDD mails",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        2192,
        176
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appFh92e1OfEzpsx4",
          "cachedResultUrl": "https://airtable.com/appFh92e1OfEzpsx4",
          "cachedResultName": "Base mail"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbl0rtoKTWhCeilvL",
          "cachedResultUrl": "https://airtable.com/appFh92e1OfEzpsx4/tbl0rtoKTWhCeilvL",
          "cachedResultName": "Mails"
        },
        "options": {},
        "operation": "search",
        "descriptionType": "manual",
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}",
        "toolDescription": "Outil de recherche de contact : Base de données mails, tu trouvera la colonne Nom avec le nom prénom de la personne et la colonne mail avec le mail qui lui est associé."
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "9mTR7mhD0VA7GbZP",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b90ab2e8-a7f1-436a-9f55-bdfae30dab6a",
      "name": "Ajouter un mail",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        2304,
        176
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appFh92e1OfEzpsx4",
          "cachedResultUrl": "https://airtable.com/appFh92e1OfEzpsx4",
          "cachedResultName": "Base mail"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbl0rtoKTWhCeilvL",
          "cachedResultUrl": "https://airtable.com/appFh92e1OfEzpsx4/tbl0rtoKTWhCeilvL",
          "cachedResultName": "Mails"
        },
        "columns": {
          "value": {
            "Nom": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Nom', ``, 'string') }}",
            "Mails": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Mails', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Nom",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Nom",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Mails",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Mails",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create",
        "descriptionType": "manual",
        "toolDescription": "Outil d'ajout de contact : Base de données mails, tu trouvera la colonne Nom avec le nom prénom de la personne et la colonne mail avec le mail qui lui est associé."
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "9mTR7mhD0VA7GbZP",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b16ea121-07fa-41d1-8bbf-395392cad42b",
      "name": "Search drive",
      "type": "n8n-nodes-base.googleDriveTool",
      "position": [
        2048,
        176
      ],
      "parameters": {
        "limit": 50,
        "filter": {},
        "options": {},
        "resource": "fileFolder",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "queryString": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search_Query', ``, 'string') }}",
        "descriptionType": "manual",
        "toolDescription": "Chercher un document dans le drive"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "V7Z0Wpv41ApVPTfs",
          "name": "Allan"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ed4ae529-8cc9-4b23-b4e2-4568d540cb09",
      "name": "Create event Google Calendar",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        1536,
        176
      ],
      "parameters": {
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "allan@institut-du-referencement.com",
          "cachedResultName": "allan@institut-du-referencement.com"
        },
        "descriptionType": "manual",
        "toolDescription": "Créer un évènement dans le Google Calendar d'Allan",
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}"
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "TAZfq18u79yBpNa9",
          "name": "Allan"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "1da44657-4554-4c65-bdb3-c62ee3fb36e1",
      "name": "Send a mail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1920,
        176
      ],
      "webhookId": "246b45ea-faa1-4748-8be5-49d1cdc8dec3",
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "emailType": "text",
        "descriptionType": "manual",
        "toolDescription": "Envoyer un email"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "snxR9AHoajR5X1Ev",
          "name": "Allan"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "43d4212e-9997-41a3-8713-b3e9067b977c",
      "name": "MP Discord",
      "type": "n8n-nodes-base.discordTool",
      "position": [
        2448,
        176
      ],
      "webhookId": "d675b1fa-f5bf-4eed-9c76-bac2b931ddc3",
      "parameters": {
        "sendTo": "user",
        "userId": {
          "__rl": true,
          "mode": "list",
          "value": "161535791783215104",
          "cachedResultName": "cyclonewar"
        },
        "content": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1377297267014504520",
          "cachedResultUrl": "https://discord.com/channels/1377297267014504520",
          "cachedResultName": "Growth AI"
        },
        "options": {},
        "resource": "message",
        "descriptionType": "manual",
        "toolDescription": "Enovyer un message MP(message privée) à Allan"
      },
      "credentials": {
        "discordBotApi": {
          "id": "pnY6XafKnApsBts5",
          "name": "Bender Growth AI"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e38819b9-6a51-48c0-a9b4-a6a2fdfd9fb3",
      "name": "Search mails",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1808,
        176
      ],
      "webhookId": "2b4ab66c-5a9b-400d-8d66-59c41d1ef0e1",
      "parameters": {
        "simple": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Simplify', ``, 'boolean') }}",
        "filters": {
          "q": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search', ``, 'string') }}",
          "sender": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Sender', ``, 'string') }}",
          "receivedAfter": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Received_After', ``, 'string') }}",
          "receivedBefore": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Received_Before', ``, 'string') }}"
        },
        "options": {},
        "operation": "getAll",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "descriptionType": "manual",
        "toolDescription": "Chercher un email dans les mails reçu"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "snxR9AHoajR5X1Ev",
          "name": "Allan"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ec844b72-7a9f-4658-879b-828403bb3dcb",
      "name": "在 Google Calendar 中获取多个事件",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        1680,
        176
      ],
      "parameters": {
        "options": {},
        "timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}",
        "timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "allan@institut-du-referencement.com",
          "cachedResultName": "allan@institut-du-referencement.com"
        },
        "operation": "getAll",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "descriptionType": "manual",
        "toolDescription": "Chercher un évènement dans le Google Calendar d'Allan"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "TAZfq18u79yBpNa9",
          "name": "Allan"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "fa720ea4-d191-4399-b953-50940f4fa4dd",
      "name": "计算器",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        1600,
        80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a0d80835-f4a4-4b7c-99f4-f6ed653064fa",
      "name": "WhatsApp 触发器",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -912,
        128
      ],
      "webhookId": "df8e6c0f-f0f6-4206-8391-57f9f8d088a0",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "w1JvZIMpbzbQY8BQ",
          "name": "WhatsApp OAuth Harry"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "97e59f79-6389-4d6b-801f-4eb9df25a5e8",
      "name": "Agent personnel",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1760,
        -96
      ],
      "parameters": {
        "text": "=Message : {{ $json.text }}\nDate : {{ $now }}",
        "options": {
          "systemMessage": "Tu es un assistant personnel WhatsApp. Tu peux effectuer les tâches suivantes quand Allan te le demande :\n\nAirtable : Ajouter/Récupérer des adresses email\nGmail : Envoyer/Chercher des emails\nGoogle Calendar : Créer/Chercher des événements\nGoogle Drive : Chercher des documents\nDiscord : Envoyer des message\nSerpAPI : Faire des recherches sur internet\n\nSi tu dois envoyer un mail consulte systématiquement la base de données Airtable pour récupérer les adresses mails. \n\nRéponds de manière concise et amicale. Exécute directement les demandes d'Allan en utilisant les outils appropriés. Si une demande n'est pas claire, pose une question courte pour clarifier."
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "49fa5649-9461-4af7-8441-3cffcfdbc7c9",
      "name": "## 试试看!",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        -848
      ],
      "parameters": {
        "width": 816,
        "height": 336,
        "content": "## 需要更高级的自动化解决方案?联系我们获取定制企业工作流!"
      },
      "typeVersion": 1
    },
    {
      "id": "b39e2e3f-67b9-4e41-aa9d-3ce896c3ad18",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -48
      ],
      "parameters": {
        "color": 4,
        "width": 512,
        "height": 384,
        "content": "# Phase 1: Message Reception and Classification"
      },
      "typeVersion": 1
    },
    {
      "id": "4976ec6b-24cc-4bc9-bab5-ad831d4f2f14",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -832
      ],
      "parameters": {
        "width": 1088,
        "height": 2640,
        "content": "# Phase 2: Content Processing by Format"
      },
      "typeVersion": 1
    },
    {
      "id": "dd42dc89-5763-43c7-837a-1ff19fbb6648",
      "name": "### 替换 Airtable 连接",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -224
      ],
      "parameters": {
        "color": 6,
        "width": 1520,
        "height": 592,
        "content": "# Phase 3: AI Assistant Processing"
      },
      "typeVersion": 1
    },
    {
      "id": "9ffd3c6f-bf44-4934-a4bb-36b4c1957843",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        -224
      ],
      "parameters": {
        "color": 2,
        "width": 1088,
        "height": 496,
        "content": "# Phase 4: Response Delivery"
      },
      "typeVersion": 1
    },
    {
      "id": "640f3e41-888d-4b05-ad49-b9bdc312ff2f",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        384
      ],
      "parameters": {
        "color": 4,
        "width": 512,
        "height": 448,
        "content": "### What you do:\n\nSend a message to WhatsApp in any format (text, audio, image, or PDF document)\n\n### What the system does:\n\nReceives the incoming message via WhatsApp Trigger\nAnalyzes the message type using a switch node to detect format\nRoutes the message to the appropriate processing pathway based on content type\nValidates document formats (only PDF files are accepted for document processing)\n\n### Result:\n\n✅ Message automatically captured and classified by type\n✅ Invalid document formats blocked with error notification\n✅ Proper routing ensures optimal processing for each format"
      },
      "typeVersion": 1
    },
    {
      "id": "deb5fe39-4bbb-4be2-a66f-39cf34c446ec",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -704
      ],
      "parameters": {
        "color": 3,
        "width": 740,
        "height": 304,
        "content": "### What you do:\nSend a regular text message through WhatsApp\n\n### What the system does:\n\nExtracts text content directly from the message body\nFormats the text for AI agent processing\nPasses clean text to the personal assistant agent\n\n### Result:\n✅ Text ready for immediate AI processing\n✅ No additional conversion required\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c6248ea8-8a2b-4d3b-8c74-15d9520c6615",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -112
      ],
      "parameters": {
        "color": 5,
        "width": 1028,
        "height": 384,
        "content": "## What you do:\n\nSend a voice message through WhatsApp\n\n### What the system does:\n\nRetrieves audio file URL from WhatsApp API\nDownloads the audio file using authenticated HTTP request\nTranscribes speech to text using OpenAI's Whisper model\nFormats transcribed content for AI agent processing\n\n### Result:\n\n✅ Voice messages automatically converted to text\n✅ Multi language transcription\n✅ Audio content accessible to AI assistant"
      },
      "typeVersion": 1
    },
    {
      "id": "87b49ebe-c8ef-4fa1-9333-5d804f963fd9",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        576
      ],
      "parameters": {
        "color": 6,
        "width": 1028,
        "height": 384,
        "content": "### What you do:\n\nSend an image through WhatsApp (with optional caption for specific requests)\n\n### What the system does:\n\nRetrieves image URL from WhatsApp API\nDownloads the image file using authenticated HTTP request\nAnalyzes image content using GPT-4O-mini vision capabilities\nGenerates detailed description in French covering composition, objects, people, text, and atmosphere\nCombines user request with AI analysis for comprehensive understanding\n\n### Result:\n\n✅ Images automatically analyzed and described in detail\n✅ User requests incorporated into analysis\n✅ Visual content made accessible to text-based AI assistant\n"
      },
      "typeVersion": 1
    },
    {
      "id": "dedf0c2d-c1d3-46a7-8d26-f572e10a0f5a",
      "name": "便签 14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        1376
      ],
      "parameters": {
        "color": 7,
        "width": 1028,
        "height": 400,
        "content": "### What you do:\n\nSend a PDF file through WhatsApp (with optional caption for specific requests)\n\n### What the system does:\n\nValidates file format (rejects non-PDF files with error message)\nRetrieves document URL from WhatsApp API\nDownloads the PDF file using authenticated HTTP request\nExtracts text content from PDF using built-in extraction tools\nFormats extracted content with user request context\n\n### Result:\n\n✅ PDF content automatically extracted and processed\n✅ Document text made available for AI analysis\n✅ Invalid formats blocked to prevent errors\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cbc5b30d-042a-46fe-b164-460daa4bc25d",
      "name": "便签15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        416
      ],
      "parameters": {
        "color": 6,
        "width": 1520,
        "height": 592,
        "content": "### What you do:\n\nWait for the AI agent to process your request using available tools\n\n### What the system does:\n\nProcesses request using Claude Sonnet 4 language model\nAccesses conversation history via PostgreSQL chat memory\nUtilizes specialized tools including:\n\nSerpAPI for internet searches\nAirtable database for email contact management\nGmail integration for email operations\nGoogle Calendar for event management\nGoogle Drive for document searches\nDiscord messaging for notifications\nCalculator for mathematical operations\n\n\nExecutes requested actions automatically using appropriate tools\nGenerates comprehensive response based on processed information\n\n### Result:\n\n✅ Intelligent responses with access to multiple data sources\n✅ Automatic execution of complex tasks\n✅ Persistent conversation memory across sessions\n✅ Integration with productivity and communication tools"
      },
      "typeVersion": 1
    },
    {
      "id": "9d45c05b-b16c-4ea8-9804-2914c54257ee",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        3168,
        96
      ],
      "webhookId": "6a2a5af1-f065-4261-8bc3-d6a381ae4bc6",
      "parameters": {
        "textBody": "={{ $('Agent personnel').item.json.output }}",
        "operation": "send",
        "phoneNumberId": "752773604591912",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('Input type').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "jcnpyvSgT2JMrgFR",
          "name": "WhatsApp Growth Ai"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c9bc1bc8-9637-4399-b519-ad45ba40ee2f",
      "name": "便签 16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        320
      ],
      "parameters": {
        "color": 2,
        "width": 1088,
        "height": 416,
        "content": "### What you do:\n\nReceive the AI-generated response through WhatsApp\n\n### What the system does:\n\nDetermines response format based on original message type\nFor audio inputs: Converts text response to speech using OpenAI TTS\nFor other inputs: Sends text response directly\nHandles audio conversion: Fixes MIME type compatibility for WhatsApp\nDelivers response via WhatsApp to the original sender\n\n### Result:\n\n✅ Responses delivered in appropriate format (text or audio)\n✅ Audio responses maintain conversational flow for voice interactions\n✅ Seamless user experience across different input methods\n✅ Reliable delivery through WhatsApp platform"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "File": {
      "main": [
        [
          {
            "node": "Agent personnel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text": {
      "main": [
        [
          {
            "node": "Agent personnel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio": {
      "main": [
        [
          {
            "node": "Agent personnel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image": {
      "main": [
        [
          {
            "node": "Agent personnel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "BDD mails": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Input type": {
      "main": [
        [
          {
            "node": "Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Audio Url",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Image Url",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Only PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MP Discord": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send a mail": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get File Url": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search drive": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search mails": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image": {
      "main": [
        [
          {
            "node": "Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio Url": {
      "main": [
        [
          {
            "node": "Download Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image Url": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only PDF File": {
      "main": [
        [
          {
            "node": "Get File Url",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Incorrect format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Audio": {
      "main": [
        [
          {
            "node": "Transcribe Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent personnel": {
      "main": [
        [
          {
            "node": "From audio to audio?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ajouter un mail": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Audio": {
      "main": [
        [
          {
            "node": "Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Input type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "From audio to audio?": {
      "main": [
        [
          {
            "node": "Generate Audio Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Fix mimeType for Audio": {
      "main": [
        [
          {
            "node": "Send audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Audio Response": {
      "main": [
        [
          {
            "node": "Fix mimeType for Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create event Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get many events in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "Agent personnel",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个高级难度的工作流,适用于Content Creation、Multimodal AI等场景。适合高级用户,包含 16+ 个节点的复杂工作流

需要付费吗?

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

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

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

外部链接
在 n8n.io 上查看 →

分享此工作流