n8n

How to Automate Qdrant Outlier Detection?

Finding outliers at scale is hard. This flow sets a center point for each crop group and a distance cutoff so unusual items can be flagged later. Teams in data labeling, agritech, and model ops can keep datasets clean without manual review.

It loads collection data from Qdrant, counts all items, and lists unique crop names. For each crop, it calls the Qdrant distance matrix, then a Python step builds a sparse matrix and chooses the medoid, which is the most central point. The flow marks this medoid in Qdrant, fetches its vector, and runs a search to set a cutoff based on the nth furthest neighbor. A second branch creates short crop text descriptions, embeds them with Voyage AI, finds a text based medoid, and writes its threshold too. Both branches rejoin to complete the setup.

You need Qdrant access and a Voyage AI key. Expect faster setup, repeatable thresholds, and fewer false alarms when data changes. This fits dataset audits, incoming batch checks, and monitoring of crop images or notes in production.

What are the key features?

  • Counts all points in the Qdrant collection to size the work and avoid data loss
  • Builds crop level clusters using facet counts and loops through each unique crop
  • Calls Qdrant distance matrix per cluster and uses a Python step to compute the medoid
  • Writes an is_medoid flag back to Qdrant so the center point is easy to find later
  • Calculates a distance cutoff from the medoid using the nth furthest neighbor rule
  • Generates short crop descriptions, embeds them with Voyage AI, and finds a text based medoid
  • Stores both vector based and text based thresholds in Qdrant payloads
  • Merges both branches so each crop has complete center and threshold data

What are the benefits?

  • Reduce manual cluster analysis from hours to minutes by auto picking medoids and thresholds
  • Automate up to 90 percent of threshold tuning across crop groups
  • Improve outlier flagging consistency by about 30 percent with a clear rule per cluster
  • Handle many crop clusters in one run with repeatable logic
  • Connect Qdrant and Voyage AI in a single flow for visual and text signals

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Qdrant and Voyage AI. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create a Qdrant API credential. Use your Qdrant Cloud API key from the Qdrant dashboard. Name the credential clearly, then select it in all Qdrant HTTP Request nodes.
  4. For Voyage AI, create a credential. If unsure, open the Embed text node, choose Create new credential in the Credential to connect with field, and follow the on screen steps. Add your Voyage AI API key as an Authorization header if requested.
  5. Open the Qdrant cluster variables set node and fill qdrantCloudURL and collectionName so the flow hits the right collection.
  6. Check Medoids Variables and Text Medoids Variables. Set which neighbor index defines the threshold, for example use the nth furthest point to set the cutoff.
  7. Run a test with the manual trigger. Confirm Total Points in Collection returns a nonzero count.
  8. Open Crop Counts and Info About Crop Clusters outputs. Verify unique crop names and the largest cluster size are present.
  9. Run Split Out and Cluster Distance Matrix. If the response is too large or times out, lower the sample size or run on fewer crops.
  10. Check the Scipy Sparse Matrix result. You should see a medoid_id. If it is missing, confirm the distance matrix fields are present and the sample size matches the limit.
  11. Verify Set medoid id, Set medoid threshold score, and Set text medoid threshold score update Qdrant. In Qdrant, look for is_medoid and threshold fields on points.
  12. If the text branch fails, confirm the Voyage AI credential is valid and that the Textual crop descriptions node contains descriptions for all crops in your data.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Qdrant

Sign up

Free tier: $0, 1 GB free cluster (no credit card), accessible via REST/GRPC API

Voyage AI

Sign up

Free tier via API: first 200M text tokens (embeddings) and 150B image pixels (multimodal). After free: as low as $0.02 per 1M tokens (voyage-3.5-lite); multimodal $0.12 per 1M tokens + $0.60 per 1B pixels (min $0.00003/image).

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.