Opening Problem Statement
Meet Marco, the owner of a renowned pizzeria in Verona, “Pizzeria da Michele.” Marco wants to provide his customers with a voice-based assistant that can answer queries about his pizzeria’s menu, opening hours, and special offers without needing him or his staff to manually respond every time. But every day, Marco wastes over 3 hours answering repetitive questions by phone, leading to frustrated staff and lost time that could be spent improving the restaurant.
He’s looked into chatbots but found text-only solutions too limiting and impersonal, especially since many customers prefer asking questions on the phone. Marco needs a modern voice-enabled assistant that understands natural language, retrieves accurate information from his document database, and responds vocally with a human-like voice. Achieving this can be technically complex and time-consuming if done manually.
This is where this n8n workflow, “Voice RAG Chatbot with ElevenLabs and OpenAI,” comes into action, enabling Marco to deploy a sophisticated voice AI assistant integrated with live document retrieval and text-to-speech capabilities efficiently and effortlessly.
What This Automation Does
When this workflow runs, here’s what happens:
- ✅ Listens for voice questions posed by customers through an ElevenLabs voice agent integrated with a webhook.
- ✅ Uses OpenAI’s language models combined with a Retrieval-Augmented Generation (RAG) approach to access the most relevant information stored in a Qdrant vector database.
- ✅ Converts Google Drive documents into vectorized chunks, enriching the vector store with up-to-date data to answer customer queries precisely.
- ✅ Sends the AI-generated answers back to ElevenLabs, which converts the text response into natural-sounding speech for voice replies.
- ✅ Supports continuous memory with LangChain’s window buffer memory for contextual, coherent dialogues during long conversations.
- ✅ Externalizes a widget that can be embedded into a website to enable visitors to interact via voice with the AI assistant.
This workflow saves Marco roughly 3+ hours daily by automating Q&A interactions with customers, improving response quality and freeing staff for other tasks.
Prerequisites ⚙️
- n8n automation platform account (cloud or self-hosted) 🔌
- ElevenLabs account for creating voice agents with webhook capabilities 🔐
- OpenAI API account with access to GPT-4 or similar models 🔑
- Qdrant vector database API access for storing and retrieving document embeddings 🔑
- Google Drive account with documents to index 📁
- Basic familiarity with webhooks, HTTP requests, and LangChain concepts ⏱️
Step-by-Step Guide ✏️
Step 1: Create an Agent on ElevenLabs
Navigate to ElevenLabs portal and create a new voice agent (e.g., “test_n8n”). Under its configuration:
- Add a “First message” like “Hi, Can I help you?”
- Configure the “System Prompt” with a message tailored to your use case, e.g., “You are the waiter of ‘Pizzeria da Michele’ in Verona. If asked a question, use the tool ‘test_chatbot_elevenlabs’ to answer precisely.”
- Add a tool—specifically a Webhook called “test_chatbot_elevenlabs.” Provide a description stating: “You are the waiter. Answer questions and store them in the question field.”
- Enter your n8n webhook URL that will accept POST requests.
- Enable “Body Parameters,” add a data parameter named “question” of type “LLM Prompt,” and describe it as “user question.”
This setup configures the voice agent to send spoken queries as structured data to the n8n workflow.
Step 2: Create and Configure Qdrant Collection
Within n8n, use the HTTP Request node titled “Create collection” to create your vector collection in Qdrant:
- Set the HTTP method to POST
- Use a URL like “https://QDRANTURL/collections/COLLECTION” (replace QDRANTURL and COLLECTION accordingly)
- Set the Headers with “Content-Type: application/json”
- Set the body to an empty JSON filter:
{ "filter": {} } - Use your Qdrant API credentials for authorization
Run “Create collection” followed by the “Refresh collection” HTTP node which deletes all existing points in the collection to prepare for fresh data.
Step 3: Fetch and Download Documents from Google Drive
Configure the “Get folder” Google Drive node:
- Set the drive ID to “My Drive” or the targeted drive
- Set folder ID to the specific folder containing your documents, e.g., “test-whatsapp”
Connect to the “Download Files” node to download each document using the file IDs. Enable Google Docs to plain text conversion.
This ensures your documents are ready for text vectorization.
Step 4: Vectorize Documents using LangChain and Qdrant
Pass your downloaded documents through a series of LangChain nodes:
- “Default Data Loader” node to load the document binaries.
- “Token Splitter” node that breaks documents into 300-token chunks with a 30-token overlap for better context retention.
- “Embeddings OpenAI1” generates embedding vectors for document chunks.
- “Qdrant Vector Store1” inserts these embeddings into your Qdrant collection.
This process ensures that your documents are segmented and represented in vector form for efficient retrieval.
Step 5: Configure the AI Agent for Query Handling
The “AI Agent” node receives the question field from the Listen webhook triggered by ElevenLabs. Here’s what happens:
- Extracts the question text for processing.
- Uses the “Vector Store Tool” to access relevant information from Qdrant.
- Utilizes the OpenAI Chat Model for generating accurate, conversational answers.
- Stores conversation context in the “Window Buffer Memory” node to maintain dialogue coherence.
Connect the “AI Agent” node output to the “Respond to ElevenLabs” node to send the generated answer back as a voice response.
Step 6: Testing the Workflow
Start by clicking “Test workflow” in n8n.
Speak a question to the ElevenLabs agent. Monitor the webhook triggering in n8n, ensuring the question payload arrives.
Confirm that the AI Agent processes the question, fetches relevant data, generates an answer, and responds vocally via ElevenLabs.
Step 7: Embed the Voice Widget on Your Website
Add the widget snippet to your business website HTML:
Replace AGENT_ID with your ElevenLabs agent ID.
Visitors can now ask questions by voice directly on your website, making the experience seamless.
Customizations ✏️
- Change the Vector Store Collection Name: Update the COLLECTION variable in the “Create collection,” “Refresh collection,” “Qdrant Vector Store,” and “Qdrant Vector Store1” nodes to point to a different Qdrant collection for other datasets.
- Adjust Token Size for Text Splitting: In the “Token Splitter” node, modify
chunkSizeandchunkOverlapto control document chunking granularity for different document types. - Modify System Prompt for Custom Responses: Change the prompt in ElevenLabs agent setup to reflect a different persona or tone, tailoring responses to specific businesses beyond the pizzeria example.
- Add More Memory Context: Tune the “Window Buffer Memory” node to expand conversation context window size to handle longer dialogs.
- Integrate Additional Data Sources: Incorporate other document repositories by adding Google Drive nodes or other connectors to enrich the knowledge base.
Troubleshooting 🔧
- Problem: “Webhook doesn’t trigger when speaking to agent.”
Cause: Incorrect ElevenLabs webhook URL or webhook not enabled.
Solution: Double-check ElevenLabs tool webhook URL matches your n8n Listen webhook URL and is set to POST with Body Parameters enabled. - Problem: “Qdrant API returns collection not found.”
Cause: Collection name mismatch or collection not created.
Solution: Verify the collection name in “Create collection” node matches the “COLLECTION” variable and run creation before inserting points. - Problem: “Embeddings or insertion fails.”
Cause: API key issues or wrong data types.
Solution: Confirm OpenAI API credentials in “Embeddings OpenAI” nodes are correct. Ensure data passed is text format and chunked properly. - Problem: “Voice response is delayed or missing.”
Cause: Response node not connected or ElevenLabs integration misconfigured.
Solution: Check the “Respond to ElevenLabs” node is connected and receiving output from the AI Agent node. Verify ElevenLabs agent settings for response acceptance. - Problem: “Google Drive file download fails.”
Cause: Incorrect folder or file IDs.
Solution: Validate folder ID in the “Get folder” node and confirm file exists in Google Drive with permission access.
Pre-Production Checklist ✅
- Ensure Qdrant collection exists and is refreshed with no residual points.
- Confirm Google Drive folder contains relevant documents and is accessible with OAuth credentials.
- Test ElevenLabs webhook triggers with a test voice question.
- Verify OpenAI API keys are active and have sufficient quota.
- Run the entire vectorization flow and validate embeddings are stored correctly.
- Perform end-to-end voice query and response tests before going live.
Deployment Guide
Activate the workflow in n8n and ensure it is running in triggered mode (not manual). Keep monitoring webhook activity logs within n8n to identify any failed requests.
Embed the ElevenLabs voice widget on your website as instructed in Step 7, enabling customers to interact directly.
For production, consider self-hosting n8n for better performance and security — Hostinger offers easy n8n self-hosting solutions at https://buldrr.com/hostinger.
FAQs
- Can I use another vector database besides Qdrant? Yes, but you would need to adjust the vector store nodes accordingly and ensure API compatibility.
- Does this workflow consume OpenAI API credits? Yes, text embedding and chat completions use OpenAI APIs and may incur costs depending on your usage.
- Is my conversation data secure? The workflow uses secure APIs but make sure your credentials and webhook URLs are protected and access-controlled.
- Can the system handle multiple simultaneous users? Yes, but depending on n8n hosting resources and API rate limits, scale accordingly.
Conclusion
You’ve now built a full voice-enabled Retrieval-Augmented Generation (RAG) chatbot integrated seamlessly with your document store and voice synthesis service using n8n, ElevenLabs, and OpenAI.
This setup not only frees up hours per day by automating customer Q&A but also creates a professional, human-like interaction channel that strengthens your business presence.
To extend this, consider adding multilingual support, integrating SMS or WhatsApp messaging for omni-channel engagement, or connecting analytics dashboards to track user queries and responses over time.
Keep experimenting with n8n and LangChain nodes to refine and expand your AI-powered automation journey!