Error 502 with HTTP node

Hello everyone. I’ve been running a workflow where an HTTP Request node sends data to external API. Sometimes I see error logs with status code 502 even though the data actually gets created successfully on the API side.

I already enabled Retry on Fail, so the node tries again, but the confusing part is:

  • The first attempt logs on error 502
  • The retry seems to work, since I can confirm the data is there
  • In n8n execution log, it still marks the node as error because of the first failure

Is this expected behaviour in n8n, or am I misconfiguring the error handling?

Thanks!

1 Like

Hello Eloise_Gabriel, welcome to n8n Community! I’ll try my best to help yaa.

yes, this is normal. The HTTP node reports the initial error 502, and even if the retry succeeds, n8n will still log that first failure in the execution history.

There are several that i suggest you can do:

  1. Use an Error workflow or Error trigger, so you can handle these cases gracefully and avoid unnecessary failed executions.
  2. Wrap the HTTP call in Try/Catch pattern with the Function node to manually check the response and decide what to log as success/failure
  3. If the target system is flaky,. its fine to rely on retry on fail, but expect that the logs will always shows the first error.

So overall, nothings wrong with your setup. Its just how n8n logs retries, it doesnt overwrite the initial error, even if later attempts succeed.

I think thats all i share to you, hope this will works yaa! :blush::raising_hands:

2 Likes

Oo wow, you are so fast mann. Thank you for your suggest, and I’ll try it later

It is expected like that, just so you know that there is an error in the workflow and you might want to do anything with that, or at least note it

hope that answer your question @Eloise_Gabriel

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.