Image Search Indexing using AI Object Detection and Elasticsearch - n8n Workflow

Use this powerful n8n workflow to automatically analyze images using AI object detection, crop individual objects, and index them into Elasticsearch for building a sophisticated image search tool.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

E-commerce platforms needing automated product image tagging.
Data scientists building large-scale image metadata knowledge bases.
Developers looking for advanced n8n templates integrating AI vision models with NoSQL databases.
Anyone needing an automated n8n node sequence for computer vision tasks and indexing.

Overview

Building a robust image search feature traditionally requires extensive backend engineering. This specialized n8n workflow template solves this by providing a complete, low-code automation solution. It leverages modern AI (Cloudflare Workers AI's DETR model) to perform precise object detection. Once objects are identified, the n8n workflow crops them out of the source image and uploads them to a reliable CDN (Cloudinary). Finally, the resulting image URLs and metadata (like the object label and bounding box) are indexed into Elasticsearch. This entire process, orchestrated by the n8n node operations, creates a highly granular, object-associated index, moving beyond simple keyword tagging to enable powerful image search capabilities using this powerful n8n workflow.

How it Works

This powerful n8n workflow begins with a manual n8n trigger for testing, although it can easily be adapted to a webhook or scheduled n8n node.


  1. Initialization: The Set Variables n8n node defines crucial configuration, including the source image URL and credentials for the AI model and Elasticsearch index.

  2. Image Fetch & AI Analysis: The original image is fetched via an HTTP Request n8n node. It is then passed to the Use Detr-Resnet-50 Object Classification HTTP Request n8n node, which sends the binary data to Cloudflare Workers AI for object detection, relying on the configured AI model.

  3. Filtering Results: The raw AI results are processed by the Split Out Results Only n8n node, and then meticulously filtered by the Filter Score >= 0.9 n8n node to ensure only high-confidence detections are carried forward, guaranteeing data integrity in this n8n workflow.

  4. Cropping Objects: For each filtered object, the source image is fetched again. The Crop Object From Image Edit Image n8n node uses the precise bounding box coordinates returned by the AI to cut the object out, generating a new, smaller image file for each item detected.

  5. Storage & Indexing: Each cropped image is uploaded to Cloudinary via an HTTP Request n8n node. The successful upload URL and related object metadata are then fed into the Elasticsearch n8n node, which uses the create operation to index the data, finalizing the automated indexing process of this n8n workflow.

Installation Guide


  1. Import: Download the provided n8n workflow JSON and import it directly into your n8n instance using the Import from JSON option.

  2. Cloudflare Credentials: Configure a Cloudflare API credential. This is required for the Use Detr-Resnet-50 Object Classification n8n node to access the Workers AI service.

  3. Cloudinary Credentials: Configure an HTTP Query Auth credential named "Cloudinary API" for the Upload to Cloudinary n8n node, providing necessary API keys and ensuring the uploadpreset is correctly set in the node parameters.

  4. Elasticsearch Credentials: Set up an Elasticsearch API credential for the Create Docs In Elasticsearch n8n node, ensuring connectivity to your desired index.

  5. Configuration: Open the Set Variables n8n node and update the CLOUDFLAREACCOUNTID and the sourceimage URL. Ensure the elasticsearch_index value aligns with your Elasticsearch setup.

  6. Testing: Execute the n8n workflow using the manual n8n trigger to verify successful classification, cropping, and indexing.

Node Details

When clicking "Test workflow" (Manual Trigger): The initiating n8n trigger for this automation, used for immediate execution and testing purposes.
Set Variables (Set n8n node): Crucial setup n8n node. Defines global parameters such as Cloudflare account details, the specific AI model (@cf/facebook/detr-resnet-50), the target sourceimage URL, and the elasticsearchindex name, essential for the rest of the n8n workflow.
Use Detr-Resnet-50 Object Classification (HTTP Request n8n node): Sends the binary image data to the Cloudflare AI endpoint for high-precision object detection, relying on the Cloudflare API credential configured in the n8n workflow.
Filter Score >= 0.9 (Filter n8n node): A core logic n8n node that ensures only AI detections with a high confidence score (0.9 or greater) are processed, maintaining data quality for the generated index.
Crop Object From Image (Edit Image n8n node): An essential image processing n8n node. It dynamically calculates the necessary crop dimensions and position based on the AI's returned bounding box data for each object detected.
Upload to Cloudinary (HTTP Request n8n node): Handles external storage by uploading the cropped binary image data to the Cloudinary CDN.


  • Create Docs In Elasticsearch (Elasticsearch n8n node): The final indexing n8n node in this n8n workflow. It uses the create operation to store the image URL, label, and full metadata into the specified Elasticsearch index, completing the process defined by this powerful n8n template.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Jimleuk
Jimleuk

Freelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at [email protected] LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk

Featured*