Referencing the current node name inside the node itself

Describe the problem/error/question

I’m currently working on a customised version of n8n’s Wait node, and was looking to create a unique webhook suffix, based on the name of the node itself, e.g Wait1, Wait2.

When looking at the available metadata, there does not seem to be an option to reference the node name. I was therefore wondering if someone could confirm whether this was possible and if so, show me the correct variable to use.

Alternatively, is there a way to set this during the execution phase of the node (via the source code?)

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

n8n version - 1.41.1
Database - Postgres
Running n8n via Docker
OS - MacOs

Hey @kc_360dialog,

We don’t have an option in n8n to get the current node name but… If you are making your own node you should be able to use this.getNode().name to get the name of the current node and other parameters if needed.

2 Likes

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