n8n workflow template · 24 nodes · OpenAI
Customer Insights with Qdrant, Python and Information Extractor is a free n8n workflow template that runs when another workflow calls it and works with OpenAI, Google Sheets and Qdrant. It has 24 nodes, 6 of them AI nodes (Default Data Loader, Recursive Character Text Splitter, OpenAI Embeddings and OpenAI Chat Model). The notes inside the workflow say: “Join the Discord or ask in the Forum!” To run it, you add your own credentials for Google Sheets OAuth2, OpenAI API and Qdrant API.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
Check out the reference google sheet here
Join the Discord or ask in the Forum!
If for any reason you need to run more than once, be sure to clear the existing data first.
For this demo, we'll clear any existing records in our Qdrant vector store for the selected company. We do this using the Qdrant's delete points API.
Learn more about Workflow Triggers
This subworkflow takes the companyId to find the relevant records in our Qdrant vector store. It also takes a "from" and "to" date to scope the insights to a particular range - doing this we can say something like "we only want insights for the past month of reviews".
Trustpilot must recognise it as part of the url.
Read more about using Python in n8n
We'll retrieve our vectors embeddings for the desired company reviews and perform an advanced clustering algorithm on them. This powerful echnique allows us to quickly group similar embeddings into clusters which we can then use to discover popular feedback, opinions and pain-points!
There is a slight delay on first run because the code node has to download the required packages.
Read more about HTTP Request Node
We'll scrape at the most recent 3 pages of reviews for illustrative purposes but we could easily scrape them all if required. The HTML node offers a convenient way to extract data from the returned html pages and using it, we'll retrieve all the reviews data.
Learn more about using the Code Node
With the Qdrant point IDs grouped and returned by our code node, all that's left is to fetch the payload of each. Note that the clustering algorithm isn't perfect and may require some tweaking depending on your data.
Learn more about the Qdrant Vector Store
Vector databases are a great way to store data if you're interested in perform similiarity searches which applies here as we want to group similar reviews to find patterns. Qdrant is a powerful vector database and tool of choice because of its robust API implementation and advanced filtering capabilities.
Read more about using Information Extractor Node
Next, we'll use our state-of-the-art LLM to generate insights on our reviews. Doing it this way, we'll able to pull more granular results addressing many key topics within the reviews.
Learn more about Workflow Triggers
A subworkflow is used to trigger the analysis for the survey. This separation is optional but used here to better demonstrate the two part process.
Finally, our completed insights to appended to the Insights Sheet we created earlier in the workflow.
You can find a sample sheet here
The 24 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
Do you need somewhere to run it? Read our guide to self-hosted n8n.
We can adapt this workflow to your apps, data and process, then deploy and support it.
Contact Us