Error handler for a specific node

Describe the problem/error/question

I am using a HTTP Request Node to connect to Discourse API (cloud hosted). I cannot use the built-in node as I need to make requests to different endpoints than the ones available in the n8n UI.

The issue is that, Discourse API is heavily rate-limited at least in my use-case and my workflow is running into several HTTP 429s. I contacted them and they told me that when they send a 429, they respond with a retry-after header which indicates the number of seconds to wait before trying again.

I’ve created the following solution:

I think this would probably work (I cannot be sure as I’d have to somehow trigger a rate-limit manually, but by pinning data, it seems to work). The above example runs in an endless loop if the data is pinned in the HTTP Request Node to reproduce a 429. The problem is that, I have multiple Discourse API calls in a single workflow and multiple such workflows in the project. Is there a way I could configure this for all nodes in one go without having to manually add an If and Wait Node for each?

This could have been solved with a custom node, but since I’m using n8n Cloud, that’s not an option.

What other options do I have?

Information on your n8n setup

  • n8n version: 1.112.4
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud

http has built in retry on error:


you can try this option

1 Like

I did check it out, but as you can see, the wait time field does not support expression, so I cannot set the wait time dynamically.

you are right it does not support dynamic values.
but 429 error usually gives same time to retry after for.

That’s a good point actually. Okay let me check with Discourse on what’s the default limit.

1 Like

do not forget to mark it as solution if it was helpful :slight_smile:

Discourse told me that I can safely wait for 60 seconds, so I have set 60000 in the value above. It’s still not the most ideal solution because I want to retry only for 429s and not for other errors, but I don’t see any other solution for now, so I’ll take it.

1 Like

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