Automate Crop Anomaly Detection with n8n and Voyage AI

Discover how this unique n8n workflow detects anomalies in agricultural crop images using the Voyage AI embedding service and Qdrant vector search database. It automates identifying unusual crops from a comprehensive dataset, saving time while improving dataset accuracy.
httpRequest
code
set
+2
Workflow Identifier: 1931
NODES in Use: Sticky Note, HTTP Request, Set, Code, Execute Workflow Trigger
Automate crop anomaly detection with n8n and Voyage AI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow checks if an agricultural crop image is normal or strange, using n8n automation.
It takes an image URL, changes the image into numbers called embeddings, then looks in a Qdrant database for similar crop groups.
If the image matches a known crop group well enough, it says which crop it is.
If not, it alerts that this might be a new or unknown crop.
The final result is a simple message telling if the crop looks normal or is an anomaly.
This stops long manual checks and lowers mistakes, helping manage crop images fast and right.


Tools and Services Used

  • n8n: Automates the workflow steps with nodes.
  • Voyage AI API: Converts crop images into vector embeddings.
  • Qdrant Cloud: Stores crop cluster data and finds similar embeddings.
  • HTTP Headers Authentication: Secures API access in n8n.
  • Predefined n8n Credentials: Saves Qdrant API keys for use in requests.


Inputs, Processing Steps, and Output

Inputs

  • Crop image URL in JSON, example:
    { "query": { "imageURL": "https://storage.googleapis.com/n8n-qdrant-demo/agricultural-crops/cotton/image%20(36).jpg" }}

Processing Steps

  • Extract the imageURL from input JSON using the Set node.
  • Define variables including Qdrant URL, collection name, and cluster info in a Set node.
  • Fetch total points and crop counts from Qdrant with HTTP Request nodes.
  • Calculate the number of crop clusters to query.
  • Send image URL to Voyage AI API in an HTTP Request node to get image embedding vector.
  • Query Qdrant for similarity scores between image embedding and stored crop cluster medoids.
  • Use a Code node with Python code to compare similarity scores with thresholds.
  • Decide if the image belongs to known crops or is an anomaly.

Output

The final output is a clear text message such as “Looks similar to cotton” or “ALERT, we might have a new undefined crop!” as anomaly detection feedback.


Beginner Step-by-Step: How to Use This Workflow in n8n

Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where you want to run the automation.
  3. Use the Import from File option to upload the downloaded workflow.

Configure credentials and settings

  1. Add the Voyage AI API Key to the HTTP Header Authentication credentials in n8n.
  2. Add Qdrant Cloud API credentials in the predefined n8n credential for Qdrant.
  3. Check and update the qdrantCloudURL variable in the Variables for medoids node if needed.
  4. Verify the collectionName matches your Qdrant collection holding crop embeddings.
  5. If using dynamic image URLs, replace the hardcoded URL in the Set node called Image URL hardcode or use a Webhook node to receive URLs.

Test and activate

  1. Run the workflow manually once with a test payload to confirm it works.
  2. Check the output message for correct anomaly detection result.
  3. Activate the workflow in n8n to start production monitoring.

If self hosting n8n is preferred, consider self-host n8n for control and customization.


Common Edge Cases or Failures

  • Incorrect image URL format or missing input leads to empty or failed processing.
  • Missing or wrong API Key for Voyage AI causes 401 Unauthorized errors.
  • Mismatched Qdrant collection name or wrong filter breaks data retrieval.
  • Errors in Python code node may happen if JSON keys change or data is null.
  • Qdrant returns no points when collection is empty or filter is too strict.


Customization Ideas

  • Switch cluster center type between is_medoid and is_text_anchor_medoid in variables node to change anomaly detection style.
  • Change the image URL input to use a Webhook node for live ingestion.
  • Add logging or forward output messages to external apps for monitoring.
  • Adjust similarity thresholds in the Qdrant collection metadata to tune sensitivity.


Pre-Production Checklist

  • Confirm Qdrant collection exists and has crop data.
  • Test the Voyage AI API with sample images outside n8n.
  • Verify all API Keys and credentials are correct and active.
  • Run test workflow executions to validate outputs.
  • Backup collection data and credentials before production use.


Summary of Workflow Benefits and Outcome

✓ Saves hours by replacing manual crop image checks.
✓ Finds unknown or mislabeled crops automatically.
✓ Gives easy-to-understand text alerts for anomalies.
✓ Works with n8n, Voyage AI API, and Qdrant Cloud.
✓ Helps keep agricultural image datasets clean and reliable.
→ Enables faster, more accurate agricultural data management.
→ Supports improved research and decision-making.


Automate crop anomaly detection with n8n and Voyage AI

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

This workflow detects if a crop image matches known crop types or is an anomaly using image embeddings and vector search.
Add the Voyage AI API Key in n8n under HTTP Header Authentication credentials used in the Embed image HTTP Request node.
Check if the collection name matches and that the collection has uploaded crop image vectors.
Yes, replace the hardcoded URL in the Image URL hardcode Set node or use a Webhook node to receive image URLs live.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.