🙋♀️What's the difference?
Configured with Agent, Chat Trigger, Compression, Document Default Data Loader, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- AI & models
- Files / media
- Transform
- Web / API
- Routing
- Data store
- Wait
- Subworkflow
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 |
|---|---|---|---|
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| Embeddings Mistral Cloud | AI & models | Embeddings Mistral Cloud | 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 |
| Get Tax Code Zip File | Web / API | HTTP Request | See node parameters |
| Extract Zip Files | Transform | Compression | See node parameters |
| Files as Items | Transform | Split Out | See node parameters |
| Extract PDF Contents | Transform | Extract From File | |
| Extract From Chapter | Transform | Edit Fields | See node parameters |
| Map To Sections | Transform | Edit Fields | See node parameters |
| Execute Workflow Trigger | Trigger | Execute Workflow Trigger | See node parameters |
| Get Mistral Embeddings | Web / API | HTTP Request | POST |
| Content Chunking @ 50k Chars | Transform | Edit Fields | See node parameters |
| Split Out Chunks | Transform | Split Out | See node parameters |
| For Each Section... | Routing | Loop Over Items | See node parameters |
| Sections To List | Transform | Split Out | See node parameters |
| Only Valid Sections | Routing | Filter | See node parameters |
| Use Qdrant Search API1 | Web / API | HTTP Request | POST |
| Use Qdrant Scroll API | Web / API | HTTP Request | POST |
| Get Search Response | Transform | Edit Fields | See node parameters |
| Qdrant Vector Store | Data store | Vector Store Qdrant | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Window Buffer Memory | Data store | Memory Buffer Window | See node parameters |
| When chat message received | Trigger | Chat Trigger | See node parameters |
| Window Buffer Memory1 | Data store | Memory Buffer Window | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| 1sec | Wait | Wait | See node parameters |
| Ask Tool | Subworkflow | Tool Workflow | See node parameters |
| Search Tool | Subworkflow | Tool Workflow | See node parameters |
| Switch | Routing | Switch | See node parameters |
| Get Ask Response | Transform | Edit Fields | 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
mistralCloudApiopenAiApiqdrantApi
Workflow notes
Step 1. Download the Tax Code PDF
Step 1. Download the Tax Code PDF
Read more about handling Zip Files
Let's begin by pulling a zip file containing all the tax codes as separate PDF files. We can unzip on the fly with n8n's compression node.
Step 2. Extract and Partition Into Chapters & Sections
Step 2. Extract and Partition Into Chapters & Sections
Learn more about reading PDF Files
Rather than ingest the raw text of the PDF, we'll be a little more strategic and extract the tax code sections separately instead. Not only will this provide cleaner results, we'll also be able to fetch sections in isolation if required.
Step 3. Save into Qdrant VectorStore
Step 3. Save into Qdrant VectorStore
Read more about using the Qdrant Vectorstore
We'll save our data into a Qdrant collection being mindful to use metadata to take full advantage of Qdrant's filtering capabilities later. Though not always required, since the tax code documents can be quite large we'll implement a loop here to throttle the number of tokens being processed as to not trip the Mistral.ai rate limits for embeddings.
Step 4. Build a Tax Code Assistant ChatBot
Step 4. Build a Tax Code Assistant ChatBot
Learn more about using AI Agents in n8n
For our chatbot, we'll use an AI agent node because we want to achieve more than one functionality. The first will be querying to relevant texts to answer a user's question and secondly, a direct search feature to pull full section text when requested.
Step 5. Use Qdrant API as Tools
Step 5. Use Qdrant API as Tools
Learn more about using AI Agents in n8n
Our Ask Tool will generate embeddings using Mistral.ai and query our Qdrant collection using the Qdrant Search API. Our Search Tool will use filter our Qdrant collection using the Qdrant Scroll API, matching on each doc's section metadata key.
Try Me Out!
Try Me Out!
This workflow builds an AI powered Legal assistant who answers questions about tax codes.
- Download publically available tax code PDFs from the relevant government website.
- Strategically exact tax code sections and store these in our Qdrant Vectorstore using Mistral.ai embeddings.
- Use an AI Agent to answer user's tax questions by attaching tools which query our Qdrant vectorstore.
Need Help?
Join the Discord or ask in the Forum!
Happy Hacking!
🙋♀️What's the difference?
🙋♀️What's the difference?
With raw PDF data, we may blur the boundaries between chapters and sections making later results hard to find, incoherent or misleading. Depending on your use-case, store your data in a way you intend to retrieve it!
🙋♀️What's the difference?
🙋♀️What's the difference?
Purpose and structure
This folder contains the 🙋♀️What's the difference? workflow. Its executable nodes use agent, chatTrigger, compression, documentDefaultDataLoader, embeddingsMistralCloud, executeWorkflowTrigger, extractFromFile, filter, httpRequest, lmChatOpenAi, manualTrigger, memoryBufferWindow, set, splitInBatches, splitOut, switch, textSplitterRecursiveCharacterTextSplitter, toolWorkflow, vectorStoreQdrant, wait. 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
When clicking ‘Test workflow’, Execute Workflow Trigger, When chat message received
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/Wait/0538_Wait_Splitout_Send_Webhook.json MIT; preserve source notices.