{
  "id": "hw9syNocoZX8OOzj",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Build a multimodal AI assistant on WhatsApp with GPT-5 and Gemini",
  "tags": [],
  "nodes": [
    {
      "id": "04177b1c-7f29-44f5-9e74-5020f281708f",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        0,
        400
      ],
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2cebb084-0a9e-43b5-8a09-afbcc337f3f2",
      "name": "Split out messages",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        208,
        400
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "messages"
      },
      "typeVersion": 1
    },
    {
      "id": "923f35a2-c447-4797-9898-11f5d01c1837",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-01",
              "name": "sender_phone",
              "type": "string",
              "value": "={{ $json.from }}"
            },
            {
              "id": "cfg-02",
              "name": "message_type",
              "type": "string",
              "value": "={{ $json.type }}"
            },
            {
              "id": "cfg-03",
              "name": "openai_chat_model",
              "type": "string",
              "value": "gpt-5.4"
            },
            {
              "id": "cfg-04",
              "name": "gemini_video_model",
              "type": "string",
              "value": "gemini-2.5-flash"
            },
            {
              "id": "cfg-05",
              "name": "memory_context_window",
              "type": "number",
              "value": 10
            },
            {
              "id": "cfg-06",
              "name": "reply_max_chars",
              "type": "number",
              "value": 4000
            },
            {
              "id": "cfg-07",
              "name": "system_prompt",
              "type": "string",
              "value": "You are a friendly and helpful AI assistant available on WhatsApp. Answer the user succinctly and factually, in the same language the user writes in. You may receive plain text, or an AI-generated transcription/description when the user sends a voice note, an image or a video. Use the Wikipedia tool for factual or encyclopedic questions. Keep answers short and mobile-friendly: no Markdown headers, no tables, use *asterisks* only for light emphasis."
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "02abbc7b-ae85-4956-a4fa-09f6910db9b4",
      "name": "Route by message type",
      "type": "n8n-nodes-base.switch",
      "position": [
        704,
        368
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Audio message",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.message_type }}",
                    "rightValue": "audio"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Video message",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.message_type }}",
                    "rightValue": "video"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image message",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.message_type }}",
                    "rightValue": "image"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Text message"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7ca1984c-a0c4-4fe6-b6e0-a7b6fe051989",
      "name": "Get audio URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1136,
        -144
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "ce9661d2-a5bc-4844-8a94-c40286f18f34",
      "name": "Download audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1344,
        -144
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "5e8972bc-aedb-4e64-ac61-c41331fc4953",
      "name": "Transcribe audio with OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1552,
        -144
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "e0f6cbf1-4164-4392-839c-98bbee8c96db",
      "name": "Normalize user message",
      "type": "n8n-nodes-base.set",
      "position": [
        1920,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "norm-01",
              "name": "message_type",
              "type": "string",
              "value": "={{ $('Configuration').item.json.message_type }}"
            },
            {
              "id": "norm-02",
              "name": "message_text",
              "type": "string",
              "value": "={{ $json.text }}"
            },
            {
              "id": "norm-03",
              "name": "message_caption",
              "type": "string",
              "value": "={{ $('Configuration').item.json.image?.caption || $('Configuration').item.json.video?.caption || $('Configuration').item.json.audio?.caption || '' }}"
            },
            {
              "id": "norm-04",
              "name": "sender_phone",
              "type": "string",
              "value": "={{ $('Configuration').item.json.sender_phone }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "49bbe634-968a-452f-aff0-a9b8f7fc18ff",
      "name": "Get video URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        896,
        192
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.video.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "470643ad-409a-4518-9f26-8cc2b41a1b55",
      "name": "Download video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1120,
        192
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "1a50bd1a-8155-4289-ba03-27febc2acf09",
      "name": "Describe video with Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1344,
        192
      ],
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/models/{{ $('Configuration').item.json.gemini_video_model }}:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={{\n{\n  \"contents\": [{\n    \"parts\": [\n      { \"text\": \"Describe this video in detail and transcribe any speech you hear.\" },\n      { \"inlineData\": {\n          \"mimeType\": $binary.data.mimeType || (\"video/\" + $binary.data.fileExtension),\n          \"data\": $input.item.binary.data.data\n      } }\n    ]\n  }]\n}\n}}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "1ba5612c-87ad-4317-9e38-0b3ea7a2481b",
      "name": "Extract video description",
      "type": "n8n-nodes-base.set",
      "position": [
        1632,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "vid-01",
              "name": "text",
              "type": "string",
              "value": "={{ $json.candidates[0].content.parts[0].text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2ed472bb-5511-4f9f-b6a3-9f8f26be37b2",
      "name": "Get image URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1104,
        560
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "f26ac4fa-d6a2-4c7e-aa06-d8717d50582b",
      "name": "Download image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1328,
        560
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "750b5a6b-00e2-42a4-8669-1211db2ed11c",
      "name": "Analyze image with GPT",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1600,
        544
      ],
      "parameters": {
        "text": "Here is an image sent by the user on WhatsApp. Describe the image precisely and transcribe any text visible in it.",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "messageType": "imageBinary"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "a79c07d1-f5c5-4717-9c88-6e8de63b212b",
      "name": "OpenAI Vision Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1616,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.openai_chat_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6c05ec49-ed0e-4096-82a3-e451980b0165",
      "name": "Get text message",
      "type": "n8n-nodes-base.set",
      "position": [
        976,
        944
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "txt-01",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text?.body || \"\" }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6e5a9d74-3216-47f9-bd97-9bb17f310e61",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2208,
        336
      ],
      "parameters": {
        "text": "=The user sent a WhatsApp message.\nMessage type: {{ $json.message_type }}\nMessage text or media description:\n\"\"\"{{ $json.message_text }}\"\"\"\n{{ $json.message_caption ? \"Media caption: \" + $json.message_caption : \"\" }}",
        "options": {
          "systemMessage": "={{ $('Configuration').item.json.system_prompt }}",
          "passthroughBinaryImages": false
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "4e3403d0-6d66-4785-8b99-f1fe2969f09f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2112,
        560
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.openai_chat_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "1fbde36c-c154-4f4d-9142-b550325055da",
      "name": "Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2272,
        560
      ],
      "parameters": {
        "sessionKey": "=whatsapp-assistant-{{ $('Configuration').item.json.sender_phone }}",
        "sessionIdType": "customKey",
        "contextWindowLength": "={{ $('Configuration').item.json.memory_context_window }}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "cc0110b2-b0b8-4a18-aff5-efd0e5c361c4",
      "name": "Wikipedia",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        2400,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "77581328-43d5-45d3-8979-29d86e514ceb",
      "name": "Format reply for WhatsApp",
      "type": "n8n-nodes-base.set",
      "position": [
        2608,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fmt-01",
              "name": "reply_text",
              "type": "string",
              "value": "={{ ($json.output || '').replaceAll('**', '*').replaceAll('### ', '').replaceAll('## ', '').replaceAll('# ', '').trim().slice(0, $('Configuration').item.json.reply_max_chars) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "22217850-6469-46ca-98a2-e7b5f7ad56af",
      "name": "Send WhatsApp reply",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2832,
        336
      ],
      "parameters": {
        "textBody": "={{ $json.reply_text }}",
        "operation": "send",
        "phoneNumberId": "<__PLACEHOLDER_VALUE__Select your WhatsApp Business phone number ID__>",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('Configuration').item.json.sender_phone }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "f8bf2e5e-cbba-4ace-b9e2-35feaacdc693",
      "name": "Sticky Note 24e15e73",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -576
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 1800,
        "content": "# Build a multimodal AI assistant on WhatsApp with GPT-5 and Gemini\n# \ud83d\udce5  [Open full documentation on Notion](https://automatisation.notion.site/Course-Build-a-multimodal-AI-assistant-on-WhatsApp-with-GPT-5-and-Gemini-39e3d6550fd981468128d322b0d5bf71)\n\n## How it works\n- The **WhatsApp Trigger** receives every incoming message on your WhatsApp Business number.\n- Each message is routed by type: **text**, **voice note**, **image** or **video**.\n- Voice notes are transcribed with **OpenAI (Whisper)**, images are described by **GPT-5 vision**, and videos are analyzed by **Google Gemini** (the only model that accepts video natively).\n- Everything is normalized into plain text, then an **AI Agent** (GPT-5) answers with per-user **conversation memory** and a **Wikipedia** tool for factual questions.\n- The reply is cleaned for WhatsApp formatting and sent back to the sender.\n\n## Setup\n1. Select your **WhatsApp Trigger** credential (Meta app Client ID + Secret) and your **WhatsApp Business Cloud** credential on the WhatsApp nodes.\n2. Select your **OpenAI** credential on the two OpenAI Chat Model nodes and the transcription node.\n3. Select your **Google Gemini (PaLM)** credential on the \"Describe video with Gemini\" node \u2014 get a free API key at Google AI Studio (aistudio.google.com).\n4. Open **Send WhatsApp reply** and pick your **Phone number ID** from the dropdown.\n5. Open the **Configuration** node to adjust the models, memory size and system prompt.\n6. Activate the workflow to start receiving messages.\n\n## Requirements\n- A WhatsApp Business Cloud account (Meta for Developers)\n- An OpenAI API key (chat, vision and audio transcription)\n- A Google Gemini API key (video analysis only \u2014 free tier available)\n\n## Customization\n- Change `openai_chat_model` in **Configuration** to any GPT-5 family model (use a `-mini` variant to lower costs).\n- Edit `system_prompt` to give your assistant a persona: support agent, booking assistant, tutor...\n- Add more tools to the AI Agent (calculator, HTTP request, your own sub-workflows) for richer answers.\n- Reply with images or audio instead of text using the WhatsApp node media message types.\n\nNeed help customizing?\nContact me for consulting and support : [Linkedin](https://www.linkedin.com/in/doctor-firass/)\n\n# MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new YouTube channel](https://www.youtube.com/@DrFiras_AI). Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.\n\n[![The AI Doctor](https://www.dr-firas.com/the-ai-doctor.png)](https://www.youtube.com/@DrFiras_AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "48cfce01-d1f9-468b-8226-7866317d14b3",
      "name": "Sticky Note 306433b7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 450,
        "height": 544,
        "content": "## 1. Receive WhatsApp messages\nThe trigger listens to incoming messages on your WhatsApp Business number, then each message is split out and routed by type (text, audio, image, video)."
      },
      "typeVersion": 1
    },
    {
      "id": "3f070911-b613-4f4b-bc5b-73f120e14170",
      "name": "Sticky Note 64928341",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 250,
        "height": 540,
        "content": "## 2. Configuration \u2014 edit your variables here\nOne single place to set the OpenAI model, the Gemini video model, the memory window, the max reply length and the system prompt. No need to open any other node."
      },
      "typeVersion": 1
    },
    {
      "id": "0ec5c187-994f-4f32-843d-bd512aee805b",
      "name": "Sticky Note 2fb6e08f",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -304
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 280,
        "content": "## 3a. Voice notes \u2192 text (OpenAI Whisper)\nThe audio file is fetched from WhatsApp and transcribed with your OpenAI credential."
      },
      "typeVersion": 1
    },
    {
      "id": "054937a9-a1e4-4e00-94a0-8936e23600a3",
      "name": "Sticky Note 374f1f42",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 1010,
        "height": 346,
        "content": "## 3b. Videos \u2192 description (Google Gemini)\nGemini is used here because it accepts video input natively. Swap the model in Configuration if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "81635778-9328-435f-9a84-a092df38f364",
      "name": "Sticky Note 9b3ba847",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        400
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 364,
        "content": "## 3c. Images \u2192 description (GPT-5 vision)\nThe image is analyzed and any visible text is transcribed so the agent can answer about it."
      },
      "typeVersion": 1
    },
    {
      "id": "8808ea92-8ff9-457f-be45-6c112e459b09",
      "name": "Sticky Note c79e4e29",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        768
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 332,
        "content": "## 3d. Text messages\nPlain text is passed through as-is \u2014 no extra AI call, no wasted tokens."
      },
      "typeVersion": 1
    },
    {
      "id": "2ae2ccb9-19a3-49c9-8bdd-2400a207356f",
      "name": "Sticky Note f1cceaff",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 1180,
        "height": 570,
        "content": "## 4. AI Agent reply\nThe agent answers with GPT-5, remembers the last exchanges per phone number, and can search Wikipedia. The reply is cleaned for WhatsApp formatting before being sent back."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "c79a4b9d-0da2-49ba-a43f-33f190b5c7a5",
  "nodeGroups": [],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Format reply for WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Configuration": {
      "main": [
        [
          {
            "node": "Route by message type",
            "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
          }
        ]
      ]
    },
    "Get video URL": {
      "main": [
        [
          {
            "node": "Download video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download audio": {
      "main": [
        [
          {
            "node": "Transcribe audio with OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download image": {
      "main": [
        [
          {
            "node": "Analyze image with GPT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download video": {
      "main": [
        [
          {
            "node": "Describe video with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get text message": {
      "main": [
        [
          {
            "node": "Normalize user message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Split out messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Split out messages": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Vision Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze image with GPT",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Route by message type": {
      "main": [
        [
          {
            "node": "Get audio URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get video URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get image URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image with GPT": {
      "main": [
        [
          {
            "node": "Normalize user message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize user message": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract video description": {
      "main": [
        [
          {
            "node": "Normalize user message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format reply for WhatsApp": {
      "main": [
        [
          {
            "node": "Send WhatsApp reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Describe video with Gemini": {
      "main": [
        [
          {
            "node": "Extract video description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe audio with OpenAI": {
      "main": [
        [
          {
            "node": "Normalize user message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}