👉 n8n No Limits Access :

https://www.hostg.xyz/SHHAd

Hébergement VPS n8n | Automatisation sécurisée et évolutive

coupon -15% : DRFIRAS15

👉 Formation n8n en Français

Formation n8n en Français : Automatisation & Agents IA

coupon -20% : LANCEMENT : HERE


What you will build

A multimodal AI assistant that lives inside WhatsApp. It understands text, voice notes, images and PDF documents, keeps a short memory per contact, and — the new part — can generate an AI image on demand and send it straight back in the chat when the user writes a message starting with /image.

<aside> 🎯

Goal of this document: let you rebuild the whole workflow manually, node by node, live on camera. Every value, prompt and expression below is copy-paste ready.

</aside>

Flow overview

flowchart TD
  A["WhatsApp Trigger"] --> B["Configuration"]
  B --> C{"Input type"}
  C -->|Text| D{"Is image request?"}
  D -->|Yes| E["Generate image"] --> F["Send image"]
  D -->|No| G["Text"] --> Z["AI Assistant"]
  C -->|Voice| H["Get Audio Url"] --> I["Download Audio"] --> J["Transcribe Audio"] --> K["Audio"] --> Z
  C -->|Image| L["Get Image Url"] --> M["Download Image"] --> N["Analyze Image"] --> O["Image"] --> Z
  C -->|Document| P{"Only PDF File"}
  P -->|Yes| Q["Get File Url"] --> R["Download File"] --> S["Extract from File"] --> T["File"] --> Z
  P -->|No| U["Incorrect format"]
  C -->|Unsupported| V["Not supported"]
  Z --> W{"From audio to audio?"}
  W -->|Yes| X["Generate Audio Response"] --> Y["Fix mimeType"] --> AA["Send audio"]
  W -->|No| AB["Send message"]

Prerequisites & credentials

<aside> 🔑

You need three services: an n8n instance, a WhatsApp Business Cloud app (Meta), and an OpenAI API key. Create the four credentials below before building.

</aside>

Credential (n8n type) Used by How to get it
OpenAi accountopenAiApi Generate image, Transcribe Audio, Analyze Image, Generate Audio Response, OpenAI Chat Model platform.openai.com → API keys → create a secret key → paste it in n8n
WhatsApp accountwhatsAppApi All WhatsApp send + media nodes Meta app → WhatsApp → System user permanent token + Phone number ID
WhatsApp OAuth accountwhatsAppTriggerApi WhatsApp Trigger Meta app → App ID + App Secret (Client ID / Client Secret)
WhatsApp Media TokenhttpHeaderAuth Download Audio, Download Image, Download File Header Auth: Name = Authorization, Value = Bearer YOUR_META_TOKEN

<aside> ⚠️

WhatsApp media URLs returned by the API are protected. The 3 Download (HTTP Request) nodes must send the Meta token, which is why the WhatsApp Media Token Header Auth credential exists. n8n cannot auto-assign it — you select it by hand on each of the 3 nodes.

</aside>


1. WhatsApp Trigger