Headers aren't passed to error after helper.requestWithAuthentication

Describe the problem/error/question

I’m building a custom node and I use this.helpers.requestWithAuthentication to make http requests. One of my actions (“create”) have 3 requests inside of it (create, update related records and get back the resulted entity). There is a chance of rate-limits being hit and in case I turn on “Retry on Fail” there is a chance of data duplication. I.e. if error happens during update/get then retry calls “create” again.

The API responds with “Retry-After” header, so naively I wanted to just add some retries to requests however I noticed that NodeApiError doesn’t expose Headers at all.

Is it expected? if yes then what is the preferred n8n way of dealing with rate-limit errors in the middle of action? Thanks in advance for any tips

What is the error message (if any)?

The service is receiving too many requests from you

Please share your workflow

Information on your n8n setup

  • n8n version: 1.111.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): all
  • Operating system: Tahoe 26.0.1

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