n8n

How to Automate Cloudflare Elasticsearch Image Search?

Build a smart image library that finds pictures by the objects inside them. Ideal for marketing teams that manage large photo sets and need quick discovery across product shots and creative assets.

The flow runs on demand. A source image URL is set first, the image is downloaded, then an AI vision model on Cloudflare detects objects. Results are split so each object is handled on its own, and only high confidence hits remain using a 0.9 score filter. The source image is fetched again and each object is cropped from the original using the bounding box. Crops are saved as JPEG files with clean names that include the label. Files are uploaded to Cloudinary to get secure links. Those links and the original image link are stored as documents in Elasticsearch so teams can search by object.

Setup needs accounts for Cloudflare, Cloudinary, and Elasticsearch. Add your Cloudflare account ID and model name in the variables node, set the upload preset in Cloudinary, and choose the Elasticsearch index. Expect to replace manual tagging with an automated step and cut review time from hours to minutes. Great for digital asset teams, online marketplaces, and content studios that want object level search.

What are the key features?

  • On demand run with a manual trigger and a variables step to set IDs, model, index, and source image URL
  • Downloads the image from a URL before analysis
  • Calls a Cloudflare AI vision model to detect objects and return labels, boxes, and scores
  • Splits results so each object is processed separately and removes low confidence hits
  • Crops each object from the original image using bounding box values and saves as JPEG
  • Creates clean file names that include the object label and item index
  • Uploads crops to Cloudinary and returns secure image links
  • Creates documents in Elasticsearch with optimized image URLs and the original source link

What are the benefits?

  • Reduce manual tagging from hours to minutes
  • Improve search precision by filtering to 0.9 confidence
  • Connect AI detection, media storage, and search in one flow
  • Handle thousands of images by indexing each object separately
  • Speed content reuse with object level links for every crop

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 Cloudflare, Cloudinary and Elasticsearch. See the Tools Required section above for links to create accounts with these services.
  3. Open the Set Variables node. Enter your Cloudflare account ID, the Cloudflare model name for object detection, the Elasticsearch index name, and a source image URL for testing.
  4. Set up Cloudflare credentials: double click the object detection HTTP Request node, open the credential field, click Create new credential, then follow the on screen instructions to connect your Cloudflare account with an API token.
  5. Configure Cloudinary: double click the Upload to Cloudinary node, open the credential field, click Create new credential, then follow the on screen steps. Ensure the upload_preset value matches a preset in your Cloudinary account or update the query parameter.
  6. Connect Elasticsearch: double click the Elasticsearch node, choose Create new credential, and follow the on screen steps. Provide your host, username, and password or API key as your cluster requires.
  7. Review the classification request: in the Cloudflare HTTP node, confirm the URL includes your Cloudflare account ID and model from the Set Variables node, and that content type is binary data with input field name set to data.
  8. Check the Split Out Results Only node and confirm it splits the result field. This ensures each object is handled as a separate item.
  9. Open the Filter Score node and verify the threshold is set to 0.9. Adjust this value if you want more or fewer objects to pass.
  10. Verify the image crop: the Edit Image node should use the bounding box values for width, height, and position. Confirm the file format is JPEG and that the file name uses the label and item index.
  11. Run a test with the manual trigger. Confirm Cloudinary returns a secure_url and that documents are created in the chosen Elasticsearch index.
  12. Troubleshoot common issues: 401 from Cloudflare means check the API token and account ID, Cloudinary errors often come from a missing upload preset, and Elasticsearch 404 suggests the index name is wrong or not created yet.

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.

Cloudflare

Sign up

Workers Free plan: $0 / mo; includes Workers KV 100,000 reads/day, 1,000 writes/day, 1,000 deletes/day, 1,000 list requests/day, 1 GB storage

Cloudinary

Sign up

Free plan: $0 / mo, includes API access (Upload widget, API, search) with 25 monthly credits

Elasticsearch

Sign up

Self-managed Basic: Free ($0)

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.