WhatsApp AI Chatbot: Text, Image, PDF Automation

Automate WhatsApp with this n8n workflow! AI-powered automation responds to texts, images, audio, & PDFs. Build your smart assistant today!

INTERMEDIATE
AI & ML
WHATSAPP
WORKFLOW VISUALIZATION
React Flow mini map
WORKFLOW PREVIEW
35 nodes • 32 connections
USE CASES
  • Automate customer support with n8n: Instantly respond to WhatsApp inquiries, route complex issues to human agents, and improve customer satisfaction using our **WhatsApp chatbot automation** workflow template.
  • Audio Transcription and Response: A journalist can record interviews and send the audio files to the bot for transcription, then receive AI-generated responses or summaries based on the transcribed text.
  • Personal Assistant: An individual can use this workflow as a personal assistant, sending reminders, asking for information via SerpAPI, scheduling events in Google Calendar, or sending emails via Gmail, all through WhatsApp.
SETUP STEPS
  1. 1Create a WhatsApp Business account and retrieve your API Key and Phone Number ID from the Meta Developer Platform.
  2. 2Create accounts and obtain API keys for OpenAI, SerpAPI, and set up OAuth2 credentials for Gmail, Google Drive, and Google Calendar.
  3. 3Configure the 'WhatsApp Trigger' node with your WhatsApp Business account credentials and subscribe to the 'messages' update.
  4. 4Configure the HTTP Request nodes ('Download Image', 'Download Audio', 'Download File') with your Perplexity API credentials.
  5. 5Configure the OpenAI nodes ('Analyze Image', 'Transcribe Audio', 'OpenAI Chat Model', 'Generate Audio Response') with your OpenAI API credentials.
  6. 6Configure the Langchain nodes ('AI Agent1', 'Simple Memory') by providing your OpenAI API key and adjusting the parameters to fine-tune agent behavior and memory retention.
  7. 7Configure the Google tools (Gmail, Google Drive, Google Calendar) with respective credentials.
  8. 8Test the workflow by sending different types of messages (text, image, audio, PDF) to your WhatsApp bot and verify the responses.
WORKFLOW JSON
{
  "id": "VYpljlOfa9VQui9h",
  "meta": {
    "instanceId": "eae46237f0b03e1e21495b9d127d17ad71e5e7504c7d7b1084f9a3d34657c561",
    "templateCredsSetupCompleted": true
  },
  "name": "Whatsapp AI-Powered Chatbot",
  "tags": [],
  "nodes": [
    {
      "id": "a349c382-f158-416c-b6ab-dfb9f173adc4",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        1220,
        1220
      ],
      "webhookId": "d3978cae-2aca-4553-8ac7-ab89068deabc",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "IFYxVujKFTHCzxKp",
          "name": "WhatsApp OAuth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fa52641a-a626-4f51-8a11-28a7bd397d8c",
      "name": "Download Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2300,
        1260
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "24YsN3SGg6TIrz1i",
          "name": "Perlexity API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "72377330-25eb-486f-99a3-32b7405712df",
      "name": "Analyze Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2540,
        1260
      ],
      "parameters": {
        "text": "=You are an advanced image description AI assistant . Your primary function is to provide detailed, accurate descriptions of images submitted through WhatsApp.\n\nCORE FUNCTIONALITY:\n- When presented with an image, you will analyze it thoroughly and provide a comprehensive description in English.\n- Your descriptions should capture both the obvious and subtle elements within the image.\n\nIMAGE DESCRIPTION GUIDELINES:\n- Begin with a broad overview of what the image contains\n- Describe key subjects, people, objects, and their relationships\n- Note significant visual elements such as colors, lighting, composition, and perspective\n- Identify any text visible in the image\n- Describe the setting or environment\n- Mention any notable actions or events taking place\n- Comment on mood, tone, or atmosphere when relevant\n- If applicable, identify landmarks, famous people, or cultural references\n\nRESPONSE FORMAT:\n- Start with \"Image Description:\" followed by your analysis\n- Structure your description in a logical manner (general to specific)\n- Use clear, precise language appropriate for visual description\n- Format longer descriptions with paragraphs to enhance readability\n- End with any notable observations that might require special attention\n\nLIMITATIONS:\n- If the image is blurry, low resolution, or difficult to interpret, acknowledge these limitations\n- If an image contains potentially sensitive content, provide a factual description without judgment\n- Do not make assumptions about elements that cannot be clearly determined\n\nYour descriptions should be informative, objective, and thorough, enabling someone who cannot see the image to form an accurate mental picture of its contents.",
        "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": "9WpWmiE8A7Gl3BYM",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "d90a0f24-337d-4e80-a509-6e6de98902fa",
      "name": "Download Audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2300,
        960
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "24YsN3SGg6TIrz1i",
          "name": "Perlexity API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "50fddcb3-be0b-4853-88ac-5c6eebe66598",
      "name": "Transcribe Audio",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2540,
        960
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "9WpWmiE8A7Gl3BYM",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "5ac66a13-99ed-41a0-ba90-5a03c12badfb",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1740,
        2480
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "9WpWmiE8A7Gl3BYM",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0c38a598-7142-4749-a8d1-85eb985d8959",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1740,
        2260
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "You are an intelligent assistant. Your purpose is to analyze various types of input and provide helpful, accurate responses.\n\nCAPABILITIES:\n- Process and respond to text messages\n- Analyze uploaded files\n- Interpret and describe images\n- Transcribe and understand voice messages\n\nINPUT HANDLING:\n1. For text messages: Analyze the content, understand the intent, and provide a relevant response.\n2. For file analysis: Examine the file content, extract key information, and summarize important points also based on the questions asked.\n3. For image analysis: Describe what you see in the image, identify key elements, and respond to any questions about the image.\n4. For voice messages: Transcribe the audio, understand the message, and respond appropriately.\n\nRESPONSE GUIDELINES:\n- Be concise but thorough\n- Prioritize accuracy over speculation\n- Maintain a professional and helpful tone\n- When uncertain, acknowledge limitations\n- Format responses for easy reading on mobile devices\n- Include actionable information when appropriate\n\nLIMITATIONS:\n- Mention if you're unable to process certain file formats\n- Indicate if an image is unclear or if details are difficult to discern\n- Note if audio quality impacts transcription accuracy\n\nSECURITY & PRIVACY:\n- Do not store or remember sensitive information shared in files, images, or voice notes\n- Do not share personal information across different user interactions\n- Inform users about data privacy limitations when relevant\n\nAnalyze all inputs carefully before responding. Your goal is to provide value through accurate information and helpful assistance."
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "9bf1fdd7-fb77-40ad-9931-6870ed079694",
      "name": "Download File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2300,
        1600
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "24YsN3SGg6TIrz1i",
          "name": "Perlexity API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4adacaa1-e6f6-4a74-8c9b-13228c67b432",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2560,
        1600
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "a9660359-3b20-42ab-b970-8608bd79bedb",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1880,
        2480
      ],
      "parameters": {
        "sessionKey": "=memory_{{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "35921a8a-f6a4-4eda-8a11-c03094352685",
      "name": "Get File Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2080,
        1600
      ],
      "webhookId": "280bd5de-32d7-4d8f-93d2-e91e3b0bc161",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].document.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bd38aae7-73fc-433d-9a7d-2128b06cae76",
      "name": "Only PDF File",
      "type": "n8n-nodes-base.if",
      "position": [
        1800,
        1620
      ],
      "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": "823a5532-cf27-48fc-aa34-72a8d50c539f",
      "name": "Fix mimeType for Audio",
      "type": "n8n-nodes-base.code",
      "position": [
        2620,
        2120
      ],
      "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": "bbe4ad89-8907-4463-9a03-be8a6bf21981",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2420,
        2300
      ],
      "webhookId": "23834751-5066-48ba-8e19-549680df2b27",
      "parameters": {
        "textBody": "={{ $json.output }}",
        "operation": "send",
        "phoneNumberId": "470271332838881",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cd50d8ad-4eee-4a03-8956-59e992b2a63f",
      "name": "Send audio",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2840,
        2120
      ],
      "webhookId": "d18b2c98-84e4-43cf-a532-0c47d5161684",
      "parameters": {
        "mediaPath": "useMedian8n",
        "operation": "send",
        "messageType": "audio",
        "phoneNumberId": "470271332838881",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('Input type').item.json.contacts[0].wa_id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0661d629-c4bd-4e00-89c3-70958956e9e3",
      "name": "Incorrect format",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2080,
        1840
      ],
      "webhookId": "23834751-5066-48ba-8e19-549680df2b27",
      "parameters": {
        "textBody": "=Sorry but you can only send PDF files",
        "operation": "send",
        "phoneNumberId": "470271332838881",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ada203f4-2a6e-48ef-8b60-75a8549a248e",
      "name": "Text",
      "type": "n8n-nodes-base.set",
      "position": [
        2040,
        620
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c53cd9f9-77c1-4331-98ff-bfc9bdf95a3c",
              "name": "text",
              "type": "string",
              "value": "={{ $('WhatsApp Trigger').item.json.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5f0a2638-6446-4aff-b2d5-5eb6a58b60d3",
      "name": "Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        2820,
        960
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "219577d5-b028-48fc-90be-980f4171ab68",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "de97ea55-d79d-49b0-a01b-b6315f6509bd",
      "name": "Image",
      "type": "n8n-nodes-base.set",
      "position": [
        2800,
        1260
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "67552183-de2e-494a-878e-c2948e8cb6bb",
              "name": "text",
              "type": "string",
              "value": "=User request on the image:\n{{ \"Describe the following image\" || $('WhatsApp Trigger').item.json.messages[0].image.caption }}\n\nImage description:\n{{ $json.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2a6cbdcd-fa46-46c0-95d1-96bf1309bc0e",
      "name": "File",
      "type": "n8n-nodes-base.set",
      "position": [
        2820,
        1600
      ],
      "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": "2810b70f-3f6b-4570-b080-bf0d9b1d086f",
      "name": "Not supported",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1560,
        1500
      ],
      "webhookId": "23834751-5066-48ba-8e19-549680df2b27",
      "parameters": {
        "textBody": "=You can only send text messages, images, audio files and PDF documents.",
        "operation": "send",
        "phoneNumberId": "470271332838881",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2760825e-6cc5-46c0-af5a-27a6bcdfd0c1",
      "name": "Get Image Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2060,
        1260
      ],
      "webhookId": "280bd5de-32d7-4d8f-93d2-e91e3b0bc161",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "15daa0a9-e393-443e-bd64-00ef7cb662b7",
      "name": "Get Audio Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2040,
        960
      ],
      "webhookId": "87caa300-7204-47b5-959a-94f4a8fbf8cf",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "ey0kKkekrRjShcGh",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c760842c-a130-4a86-8807-22257110cd6e",
      "name": "Generate Audio Response",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2420,
        2120
      ],
      "parameters": {
        "input": "={{ $('AI Agent1').item.json.output }}",
        "voice": "onyx",
        "options": {},
        "resource": "audio"
      },
      "credentials": {
        "openAiApi": {
          "id": "9WpWmiE8A7Gl3BYM",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "bb93ec35-c684-4bbd-a7dd-8eeccfca7f63",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        580
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Text"
      },
      "typeVersion": 1
    },
    {
      "id": "0c3e5a67-ca0c-42c5-a8b3-3a8f6530b22f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        900
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Voice"
      },
      "typeVersion": 1
    },
    {
      "id": "0780bd78-3bce-4ad0-b11a-215e3fcff4a3",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        1220
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Image"
      },
      "typeVersion": 1
    },
    {
      "id": "81083d22-c40b-4380-b238-8606f5840319",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        1560
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Document"
      },
      "typeVersion": 1
    },
    {
      "id": "28a36db8-79ce-4373-871f-0728fc8c23da",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        2000
      ],
      "parameters": {
        "color": 5,
        "width": 1340,
        "height": 620,
        "content": "## Response"
      },
      "typeVersion": 1
    },
    {
      "id": "b2d7740d-33ee-4adf-890e-ac866da47212",
      "name": "From audio to audio?",
      "type": "n8n-nodes-base.if",
      "position": [
        2160,
        2260
      ],
      "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": "74321d0c-54ed-427d-9449-3065cfc90d96",
      "name": "Input type",
      "type": "n8n-nodes-base.switch",
      "position": [
        1400,
        1180
      ],
      "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": "de389814-4bfd-4f37-8ad9-e23a4d1654b1",
      "name": "SerpAPI",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        2000,
        2480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "serpApi": {
          "id": "5FdJeW5TaRtQIw6s",
          "name": "SerpAPI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c667e686-b7c9-4fee-b907-ea3f3b5720a3",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        2120,
        2480
      ],
      "webhookId": "8f041ab7-39ea-4f2d-bcdb-cb22cf8a56aa",
      "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') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "gC5tBV1b2itKkIZb",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ba0224d5-52b8-4149-92e4-a08f3e474e65",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDriveTool",
      "position": [
        2240,
        2480
      ],
      "parameters": {
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "nOHaczbgB6WGs3gg",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "27fcb644-f096-43d4-8681-06f9c87b61e1",
      "name": "Google Calendar",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        2380,
        2480
      ],
      "parameters": {
        "calendar": {
          "__rl": true,
          "mode": "id",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Calendar', ``, 'string') }}",
          "__regex": "(^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)"
        },
        "additionalFields": {}
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "xIto6HRt0QO6pcfs",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e6d68978-8269-4dc8-8873-b610dcdba47f",
  "connections": {
    "File": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Image": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "From audio to audio?",
            "type": "main",
            "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
          }
        ],
        [
          {
            "node": "Not supported",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File Url": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "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
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Download Audio": {
      "main": [
        [
          {
            "node": "Transcribe Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "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
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "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
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    }
  }
}
STATISTICS
Views
2
Downloads
0
Nodes28
CREDENTIALS
  • WhatsApp OAuth account
  • Perplexity API
  • OpenAi account
  • WhatsApp account
  • SerpAPI account
  • Gmail OAuth2
  • Google Drive OAuth2 Api
  • Google Calendar OAuth2 Api
TAGS
automation
whatsapp
customer-service
ai
pdf extraction
chatbot
image analysis
langchain
openai
audio transcription