You only have to run this part once!
Configured with Agent, Document Default Data Loader, Embeddings Open Ai, Extract From File, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- AI & models
- Data store
- Files / media
- Transform
- Web / API
- Messaging
- Routing
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| WhatsApp Trigger | Trigger | Whats App Trigger | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Window Buffer Memory | Data store | Memory Buffer Window | See node parameters |
| Vector Store Tool | AI & models | Tool Vector Store | See node parameters |
| Embeddings OpenAI | AI & models | Embeddings Open Ai | See node parameters |
| OpenAI Chat Model1 | AI & models | OpenAI Chat Model | See node parameters |
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| Embeddings OpenAI1 | AI & models | Embeddings Open Ai | See node parameters |
| Default Data Loader | Files / media | Document Default Data Loader | See node parameters |
| Recursive Character Text Splitter | Transform | Text Splitter Recursive Character Text Splitter | See node parameters |
| Extract from File | Transform | Extract From File | |
| get Product Brochure | Web / API | HTTP Request | See node parameters |
| Reply To User | Messaging | Whats App | send |
| Reply To User1 | Messaging | Whats App | send |
| Product Catalogue | Data store | Vector Store In Memory | See node parameters |
| Create Product Catalogue | Data store | Vector Store In Memory | See node parameters |
| Handle Message Types | Routing | Switch | See node parameters |
| AI Sales Agent | AI & models | Agent | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApiwhatsAppApiwhatsAppTriggerApi
Workflow notes
1. Download Product Brochure PDF
1. Download Product Brochure PDF
Read more about the HTTP Request Tool
Import your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.
For this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure (Source) and an Extract from File node to extract the text contents.
2. Create Product Brochure Vector Store
2. Create Product Brochure Vector Store
Read more about the In-Memory Vector Store
Vector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.
To keep things simple, we'll use the In-memory Vector Store which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either Qdrant or Pinecone.
3. Use the WhatsApp Trigger
3. Use the WhatsApp Trigger
Learn more about the WhatsApp Trigger
The WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.
Note that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages.
Want to handle all message types?
Want to handle all message types?
Check out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/
3a. Handle Unsupported Message Types
3a. Handle Unsupported Message Types
For non-text messages, we'll just reply with a simple message to inform the sender.
4. Sales AI Agent Responds To Customers
4. Sales AI Agent Responds To Customers
Learn more about using AI Agents
n8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.
In this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier.
5. Repond to WhatsApp User
5. Repond to WhatsApp User
Learn more about the WhatsApp Node
The WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.
Here, we'll keep it simple by replying with a text message which is the output of the AI agent.
Try It Out!
Try It Out!
This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.
- This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.
- A product brochure is imported via HTTP request node and its text contents extracted.
- The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.
- A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.
- The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.
- The Agent's response is sent back to the user via the WhatsApp node.
Need Help?
You only have to run this part once!
You only have to run this part once!
Run this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version.
Activate your workflow to use!
Activate your workflow to use!
To start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server.
You only have to run this part once!
You only have to run this part once!
Purpose and structure
This folder contains the You only have to run this part once! workflow. Its executable nodes use agent, documentDefaultDataLoader, embeddingsOpenAi, extractFromFile, httpRequest, lmChatOpenAi, manualTrigger, memoryBufferWindow, switch, textSplitterRecursiveCharacterTextSplitter, toolVectorStore, vectorStoreInMemory, whatsApp, whatsAppTrigger. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
WhatsApp Trigger, When clicking ‘Test workflow’
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Extractfromfile/1365_Extractfromfile_Manual_Create_Webhook.json MIT; preserve source notices.