HTTP Request returns 400 when downloading Cloudinary transformed image in workflow

Hello,
I’m building an image processing workflow in n8n and I’m running into a 400 Bad Request error in the HTTP Request node when trying to download a transformed Cloudinary image.
Workflow structure:
Manual Trigger
Google Drive – Search files and folders
Google Drive – Download file
Cloudinary – Upload an asset from file data
HTTP Request – Download transformed image
Google Drive – Upload file
The Cloudinary node uploads images correctly and returns the secure_url.
Then in the HTTP Request node I generate the transformation URL with this expression:
{{$json.secure_url.replace(‘/upload/’,‘/upload/e_enhance,e_improve:outdoor,e_brightness:5/’)}}
Configuration of HTTP Request:
Method: GET
Response Format: File
Put Output in Field: data
Sometimes it works, but after re-running the workflow (for example after deleting and re-uploading the source images in Drive), the HTTP Request node returns:
Bad request - please check your parameters
Error code: 400
Example request URL generated:
https://res.cloudinary.com/[cloud-name]/image/upload/e_enhance,e_improve:outdoor,e_brightness:5/v1773112055/filename.jpg
Questions:
Could this be caused by stale execution data between nodes?
Is there a better way to reference the Cloudinary secure_url between nodes when processing multiple items?
Is using replace() on the URL considered a safe approach for transformations in n8n?

Hi @Lengerich , welcome to the n8n community :tada: !

From what you described, this is unlikely to be caused by stale execution data between nodes. Each execution processes the items independently, so n8n shouldn’t reuse old data in that way. A couple of things I would check:

  1. Log the exact URL generated for each item (using a Set or Code node) to confirm it’s always valid.
  2. Verify that the secure_url always contains /upload/ exactly once.
  3. Make sure the asset is fully available in Cloudinary before requesting the transformed version (a short delay sometimes helps right after upload).
1 Like