Automate Object-Based Image Search with n8n and Cloudflare AI

Discover how this n8n workflow uses Cloudflare’s Detr-Resnet-50 AI model to classify objects in images, crop them automatically, and index them in Elasticsearch for powerful image search. Save hours by automating detailed image processing and indexing workflows.
httpRequest
elasticsearch
manualTrigger
+5
Workflow Identifier: 2069
NODES in Use: Manual Trigger, HTTP Request, Split Out, Filter, Edit Image, Set, Elasticsearch, Sticky Note
Automate object search with n8n and Cloudflare AI

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

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow processes images by detecting objects inside them automatically. It takes an image URL as input, finds objects in the image with high confidence, cuts out each object into a new image, uploads those images to Cloudinary, and saves detailed records in Elasticsearch. The main goal is to save time and reduce errors when managing and searching large collections of product photos.

The workflow uses Cloudflare’s Detr-Resnet-50 AI model to recognize objects and crops them using bounding box data. Only objects with confidence above 90% are kept for better accuracy. This makes searching for specific products easy by their appearance later in the Elasticsearch index.


Tools and Services Used

  • Cloudflare AI API: For object detection using the Detr-Resnet-50 model.
  • Cloudinary: Hosting cropped images securely in the cloud.
  • Elasticsearch: Indexing and searching cropped image metadata and URLs.
  • n8n Automation Platform: Runs the workflow and connects all steps.

Inputs, Processing Steps, and Output

Inputs

  • Image URL to be processed.
  • Cloudflare API credentials.
  • Cloudinary credentials and upload preset.
  • Elasticsearch credentials and index name.

Processing Steps

  • Download the given image from the URL.
  • Send the image to Cloudflare’s AI for object detection.
  • Split detected objects into individual items.
  • Filter objects to only those with confidence of 90% or higher.
  • Fetch the original image again to have fresh binary data.
  • Crop each object out of the image using the bounding box coordinates.
  • Upload each cropped image to Cloudinary.
  • Create searchable documents in Elasticsearch with the cropped image link, original image URL, object label, and metadata.

Output

Indexed image records in Elasticsearch with cropped object images hosted on Cloudinary, making fast object-based image searches possible.


Who Should Use This Workflow

This is good for people managing large sets of images, like e-commerce managers or catalog curators, who need to find and organize photos by what’s inside them. No need for coding skills, but some basic understanding of API keys and cloud accounts helps.


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

Step 1: Download the Workflow File

  1. Use the Download button on this page to get the workflow file.
  2. Save it locally where it can be found easily.

Step 2: Import Workflow into n8n Editor

  1. Open your n8n editor, either cloud or self-host n8n instance.
  2. Click on the calendar menu and choose Import from File.
  3. Select the downloaded workflow file and import it.

Step 3: Configure Credentials and Variables

  1. Open the Set Variables node and enter your Cloudflare account ID.
  2. Ensure the Cloudflare API credential is set in the Use Detr-Resnet-50 Object Classification node.
  3. Enter your Cloudinary API keys and upload preset under the Upload to Cloudinary node.
  4. Set Elasticsearch credentials and index name in the Create Docs In Elasticsearch node.
  5. Replace or confirm the source_image URL in the Set Variables node for the image you want to process.

Step 4: Test the Workflow

  1. In n8n editor, trigger the workflow manually by clicking the When clicking “Test workflow” node.
  2. Check each node’s output to confirm images and object data pass correctly.

Step 5: Activate Workflow for Production

  1. Toggle the workflow from draft to active mode.
  2. Optionally connect triggers like webhooks, schedules, or file uploads to automate processing.
  3. Regularly monitor executions and errors within the n8n dashboard.

Edge Cases and Troubleshooting

  • If the Cloudflare API shows authentication failure, check and update the API Key in credentials.
  • If HTTP 404 error happens when fetching images, verify that the image URL is accessible and correct.
  • No objects pass the confidence filter? Lower the confidence threshold temporarily and confirm the correct field name is used in the filter.
  • Uploads to Cloudinary fail? Ensure the correct upload preset name and API keys are set.
  • Elasticsearch document creation errors can come from wrong index names or missing required fields.

Customization Ideas

  • Change the confidence threshold in the Filter Score >= 0.9 node to meet quality needs.
  • Use a different AI model in the Set Variables node by changing the model variable.
  • Switch out the source image input for webhooks or storage trigger nodes to automate image processing.
  • Replace the Cloudinary upload step with AWS S3 or Google Drive nodes if preferred.
  • Add extra metadata fields like timestamps or user tags in the Elasticsearch document creation to improve search features.

Summary of Results

✓ Automatic image analysis reveals objects without manual tagging or cropping.

✓ Cropped object images stored safely with Cloudinary for easy access and display.

✓ Fast, object-based image search in Elasticsearch helps find products quickly.

→ Saves hours of work and reduces mistakes when managing many product images.

→ Enables scalable and accurate image organization for marketing or catalogs.


Automate object search with n8n and Cloudflare AI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The Cloudflare AI API node requires a valid Cloudflare account ID and an API Key with permission to use the Detr-Resnet-50 model.
Check that the image URL is correct and publicly accessible by opening it in a browser before running the workflow.
Lower the confidence threshold in the Filter node temporarily and verify the correct field name for ‘score’ in the data is used.
Yes, the Cloudinary upload node can be replaced with AWS S3, Google Drive, or other cloud storage nodes based on preference.

Promoted by BULDRR AI

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.