← All N8N workflows
AI & researchAgentChat TriggerCompressionDocument Default Data LoaderEmbeddings Mistral Cloud

🙋‍♀️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.

Workflow preview
TriggerWhen clicking ‘Testworkflow’Manual TriggerAI & modelsEmbeddings MistralCloudEmbeddings Mistral CloudFiles / mediaDefault Data LoaderDocument Default Data Lo…TransformRecursive CharacterText SplitterText Splitter Recursive …Web / APIGet Tax Code Zip FileHTTP RequestTransformExtract Zip FilesCompressionTransformFiles as ItemsSplit OutTransformExtract PDF ContentsExtract From FileTransformExtract From ChapterEdit FieldsTransformMap To SectionsEdit FieldsTriggerExecute WorkflowTriggerExecute Workflow TriggerWeb / APIGet Mistral EmbeddingsHTTP RequestTransformContent Chunking @ 50kCharsEdit FieldsTransformSplit Out ChunksSplit OutRoutingFor Each Section...Loop Over ItemsTransformSections To ListSplit OutRoutingOnly Valid SectionsFilterWeb / APIUse Qdrant Search API1HTTP RequestWeb / APIUse Qdrant Scroll APIHTTP RequestTransformGet Search ResponseEdit FieldsData storeQdrant Vector StoreVector Store QdrantAI & modelsAI AgentAgentData storeWindow Buffer MemoryMemory Buffer WindowTriggerWhen chat messagereceivedChat TriggerData storeWindow Buffer Memory1Memory Buffer WindowAI & modelsOpenAI Chat ModelOpenAI Chat ModelWait1secWaitSubworkflowAsk ToolTool WorkflowSubworkflowSearch ToolTool WorkflowRoutingSwitchSwitchTransformGet Ask ResponseEdit Fields

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.

Workflow node names, types, and operations
NodeCategoryTypeOperation
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
Embeddings Mistral CloudAI & modelsEmbeddings Mistral CloudSee node parameters
Default Data LoaderFiles / mediaDocument Default Data LoaderSee node parameters
Recursive Character Text SplitterTransformText Splitter Recursive Character Text SplitterSee node parameters
Get Tax Code Zip FileWeb / APIHTTP RequestSee node parameters
Extract Zip FilesTransformCompressionSee node parameters
Files as ItemsTransformSplit OutSee node parameters
Extract PDF ContentsTransformExtract From Filepdf
Extract From ChapterTransformEdit FieldsSee node parameters
Map To SectionsTransformEdit FieldsSee node parameters
Execute Workflow TriggerTriggerExecute Workflow TriggerSee node parameters
Get Mistral EmbeddingsWeb / APIHTTP RequestPOST
Content Chunking @ 50k CharsTransformEdit FieldsSee node parameters
Split Out ChunksTransformSplit OutSee node parameters
For Each Section...RoutingLoop Over ItemsSee node parameters
Sections To ListTransformSplit OutSee node parameters
Only Valid SectionsRoutingFilterSee node parameters
Use Qdrant Search API1Web / APIHTTP RequestPOST
Use Qdrant Scroll APIWeb / APIHTTP RequestPOST
Get Search ResponseTransformEdit FieldsSee node parameters
Qdrant Vector StoreData storeVector Store QdrantSee node parameters
AI AgentAI & modelsAgentSee node parameters
Window Buffer MemoryData storeMemory Buffer WindowSee node parameters
When chat message receivedTriggerChat TriggerSee node parameters
Window Buffer Memory1Data storeMemory Buffer WindowSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
1secWaitWaitSee node parameters
Ask ToolSubworkflowTool WorkflowSee node parameters
Search ToolSubworkflowTool WorkflowSee node parameters
SwitchRoutingSwitchSee node parameters
Get Ask ResponseTransformEdit FieldsSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. 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

  • mistralCloudApi
  • openAiApi
  • qdrantApi

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.

More in AI & research