How to retrieve node.description.requestDefaults in the execute method?

Describe the problem/error/question

I’m building a Custom Node that includes the key requestDefaults, as detailed here in the official docs containing an object with a baseURL, header, and other properties.

I want to then retrieve this key value inside the execute function, so that I can use this data when making a HTTP request. What is the doing this?

The this.getNode() method exists, but doesn’t allow me to access this key value.

Currently, I am creating a new instance of the node inside the execute function, and then extracting the description.requestDefaults object, but this doesn’t seem like a logical solution. Surely there is a direct way of accessing this value?

Information on your n8n setup

  • **n8n version:**1.31.0
  • **Database (default: SQLite):**NA
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):**default
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**desktop app
  • **Operating system:**macOS

Welcome to the community @kc_360dialog!

That is currently not possible. The data is meant for nodes that use the declarative-style and is then used automatically.

1 Like

Thanks for clarifying jan