{
  "name": "AI-powered WhatsApp chatbot 🤖📲 for text, voice, images & PDFs with memory 🧠",
  "nodes": [
    {
      "id": "38246f5d-0cf4-49ed-957e-0189243d0dec",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -700,
        80
      ]
    },
    {
      "id": "4cc0b70b-3ecc-4415-af2f-e50d4f302786",
      "name": "Download Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        120
      ]
    },
    {
      "id": "528984be-b9ad-41c7-8b2e-ccbf275f7805",
      "name": "Analyze Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        960,
        120
      ]
    },
    {
      "id": "b8898138-f987-4ef7-a5c1-d6d6b9c815f0",
      "name": "Download Audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        -180
      ]
    },
    {
      "id": "e68bea55-f43a-4143-afca-1348b35e5879",
      "name": "Transcribe Audio",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        960,
        -180
      ]
    },
    {
      "id": "1c0aa0c3-cee4-40f1-9e13-9365cc06443a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        1440
      ]
    },
    {
      "id": "d2215cf8-49e1-433b-b9c3-a219e6432cba",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        160,
        1220
      ]
    },
    {
      "id": "103825d0-8521-43c7-8246-9cc1faca42e1",
      "name": "Download File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        460
      ]
    },
    {
      "id": "98077f98-6dcf-4932-9363-19bf1fdc299e",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        980,
        460
      ]
    },
    {
      "id": "fefc8b87-d64e-4ff9-9f62-1ac3af2bf17e",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        300,
        1440
      ]
    },
    {
      "id": "83ac997d-6ba0-4eb7-bd6c-80671f03c56c",
      "name": "Get File Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        500,
        460
      ]
    },
    {
      "id": "56b23f60-57c3-4ea7-a4e8-64029a2e44c1",
      "name": "Only PDF File",
      "type": "n8n-nodes-base.if",
      "position": [
        220,
        480
      ]
    },
    {
      "id": "fa733b7b-16a7-4a9b-86b3-88395535ecd5",
      "name": "Fix mimeType for Audio",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        1080
      ]
    },
    {
      "id": "0d99c2fa-945b-487a-b929-742e8b1b6859",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        840,
        1360
      ]
    },
    {
      "id": "046328e9-e948-479c-ac42-567877350f1e",
      "name": "Send audio",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        1080
      ]
    },
    {
      "id": "aa20a408-42ab-4011-9cea-331e23cda4ce",
      "name": "Incorrect format",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        500,
        700
      ]
    },
    {
      "id": "23b3750d-3638-4fd0-bab8-6082f53f19f9",
      "name": "Text",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        -520
      ]
    },
    {
      "id": "435c020b-826b-4946-b19e-f9663f4f9f23",
      "name": "Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        -180
      ]
    },
    {
      "id": "0139bb33-651e-4f37-901d-ccc705c9833a",
      "name": "Image",
      "type": "n8n-nodes-base.set",
      "position": [
        1220,
        120
      ]
    },
    {
      "id": "d66b7190-f83b-483e-b3f3-8c220e2c815f",
      "name": "File",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        460
      ]
    },
    {
      "id": "20239933-418c-436f-b15b-c293043a0328",
      "name": "Not supported",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -260,
        360
      ]
    },
    {
      "id": "117fd705-1f64-4bcc-88db-357df679fa3d",
      "name": "Get Image Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        480,
        120
      ]
    },
    {
      "id": "3bf7364c-6263-4825-aec5-693adaed7d03",
      "name": "Get Audio Url",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        460,
        -180
      ]
    },
    {
      "id": "b23f8467-480a-45c1-a7df-e512290a8e13",
      "name": "Generate Audio Response",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        840,
        1080
      ]
    },
    {
      "id": "0b139e60-fbf3-43ae-ae3f-40588f135443",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        -560
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Text"
      }
    },
    {
      "id": "3622ad4c-79c7-479f-a050-ff21d3077c77",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        -240
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Voice"
      }
    },
    {
      "id": "1f35e179-22d1-4019-a807-21803df51a46",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        80
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Image"
      }
    },
    {
      "id": "314b8ae2-e518-44a3-80a5-dc8482ab1fa9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        420
      ],
      "parameters": {
        "width": 1340,
        "height": 240,
        "content": "## Document"
      }
    },
    {
      "id": "a55cc899-3490-4b7c-b793-4f20605fc711",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        960
      ],
      "parameters": {
        "width": 1340,
        "height": 600,
        "content": "## Response"
      }
    },
    {
      "id": "f37e975b-c112-4af8-badd-1fdbdb90d2f5",
      "name": "From audio to audio?",
      "type": "n8n-nodes-base.if",
      "position": [
        580,
        1220
      ]
    },
    {
      "id": "864be43a-e280-4c6d-bab4-878b88304807",
      "name": "Input type",
      "type": "n8n-nodes-base.switch",
      "position": [
        -420,
        40
      ]
    },
    {
      "id": "cf327372-d2cc-40db-a057-9bfb10d6a520",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1580,
        -1140
      ],
      "parameters": {
        "width": 780,
        "height": 2680,
        "content": "How to obtain Whatsapp API?\n\n\n### ✅ Prerequisites\nBefore you begin, make sure you have:\n- A **Meta Business Account**\n- A **Facebook Developer Account**\n- A **Verified Business**\n- A **Phone Number** "
      }
    }
  ],
  "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
          }
        ]
      ]
    },
    "Image": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "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
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    }
  }
}