Skip to main content

AI-powered WhatsApp chatbot πŸ€–πŸ“² for text, voice, images & PDFs with memory 🧠

Workflow preview

Workflow preview
100%
AI-powered WhatsApp chatbot πŸ€–πŸ“² for text, voice, images & PDFs with memory 🧠 preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow is a highly advanced multimodal AI assistant designed to operate through WhatsApp . It can understand and respond to text, images, voice messages, and PDF documents by combining OpenA...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.whatsapptrigger, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.openai, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.whatsapp

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.

Original n8n.io source

1.1 Workflow description

Title
AI-powered WhatsApp chatbot πŸ€–πŸ“² for text, voice, images & PDFs with memory 🧠
Workflow name
AI-powered WhatsApp chatbot πŸ€–πŸ“² for text, voice, images & PDFs with memory 🧠

This workflow is a highly advanced multimodal AI assistant designed to operate through WhatsApp. It can understand and respond to text, images, voice messages, and PDF documents by combining OpenAI models with smart logic to adapt to the content received.


🎯 Core Features

πŸ“₯ 1. Automatic Message Type Detection

Using the Input type node, the bot detects whether the user has sent:

  • Text
  • Voice messages
  • Images
  • Files (PDF)
  • Other unsupported content
πŸ’¬ 2. Smart Text Message Handling
  • Text messages are processed by an OpenAI GPT-4o-mini agent with a customized system prompt.
  • Replies are concise, accurate, and formatted for mobile readability.
πŸ–ΌοΈ 3. Image Analysis & Description
  • Images are downloaded, converted to base64, and analyzed by an image-aware AI model.
  • The output is a rich, structured description, designed for visually impaired users or visual content interpretation.
πŸŽ™οΈ 4. Voice Message Transcription & Reply
  • Audio messages are downloaded and transcribed using OpenAI Whisper.
  • The transcribed text is analyzed and answered by the AI.
  • Optionally, the AI reply can be converted back to voice using OpenAI's text-to-speech, and sent as an audio message.
πŸ“„ 5. PDF Document Extraction & Summary
  • Only PDFs are allowed (filtered via MIME type).
  • The document’s content is extracted and combined with the user's message.
  • The AI then provides a relevant summary or answer.
🧠 6. Contextual Memory
  • Each user has a personalized session ID with a memory window of 10 interactions.
  • This ensures a more natural and contextual conversation flow.

How It Works

Thisworkflow is designed to handle incoming WhatsApp messages and process different types of inputs (text, audio, images, and PDF documents) using AI-powered analysis. Here’s how it functions:

  • Trigger: The workflow starts with the WhatsApp Trigger node, which listens for incoming messages (text, audio, images, or documents).
  • Input Routing: The Input type (Switch node) checks the message type and routes it to the appropriate processing branch:
    • Text: Directly forwards the message to the AI agent for response generation.
    • Audio: Downloads the audio file, transcribes it using OpenAI, and sends the transcription to the AI agent.
    • Image: Downloads the image, analyzes it with OpenAI’s GPT-4 model, and generates a detailed description.
    • PDF Document: Downloads the file, extracts text, and processes it with the AI agent.
    • Unsupported Formats: Sends an error message if the input is not supported.
  • AI Processing: The AI Agent1 node, powered by OpenAI, processes the input (text, transcribed audio, image description, or PDF content) and generates a response.
  • Response Handling:
    • For audio inputs, the AI’s response is converted back into speech (using OpenAI’s TTS) and sent as a voice message.
    • For other inputs, the response is sent as a text message via WhatsApp.
  • Memory: The Simple Memory node maintains conversation context for follow-up interactions.

Setup Steps

To deploy this workflow in n8n, follow these steps:

  1. Configure WhatsApp API Credentials:
    • Set up WhatsApp Business API credentials (Meta Developer Account).
    • Add the credentials in the WhatsApp Trigger, Get Image/Audio/File URL, and Send Message nodes.

Set Up OpenAI Integration:

  • Provide an OpenAI API key in the Analyze Image, Transcribe Audio, Generate Audio Response, and AI Agent1 nodes.

Adjust Input Handling (Optional):

  • Modify the Switch node ("Input type") to handle additional message types if needed.
  • Update the "Only PDF File" IF node to support other document formats.

Test & Deploy:

  • Activate the workflow and test with different message types (text, audio, image, PDF).
  • Ensure responses are correctly generated and sent back via WhatsApp.

Need help customizing?

Contact me for consulting and support or add me on Linkedin.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - WhatsApp Trigger

Type / Role
n8n-nodes-base.whatsAppTrigger - whatsAppTrigger
Config choices
Version 1

Block 2 - Download Image

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Analyze Image

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 4 - Download Audio

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Transcribe Audio

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 6 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 8 - Download File

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Extract from File

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 10 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 11 - Get File Url

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 12 - Only PDF File

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 13 - Fix mimeType for Audio

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Send message

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 15 - Send audio

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 16 - Incorrect format

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 17 - Text

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Audio

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 19 - Image

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - File

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Not supported

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 22 - Get Image Url

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 23 - Get Audio Url

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 24 - Generate Audio Response

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Showing the first 24 of 32 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow AI-powered WhatsApp chatbot πŸ€–πŸ“² for text, voice, images & PDFs with memory 🧠
Complexity advanced
Nodes 32
Categories Support Chatbot, AI Chatbot
Author Davide
Published 17 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3586/3586.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI-powered WhatsApp chatbot πŸ€–πŸ“² for text, voice, images & PDFs with memory 🧠 do?

This workflow is a highly advanced multimodal AI assistant designed to operate through WhatsApp . It can understand and respond to text, images, voice messages, and PDF documents by combining OpenA...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.