Hi, I have a question. Currently, I have a node that performs a number increment. I am setting this node with an initial value of 0 and want to increment a number in it.
My node component:
Example of my code:
Previously, I used the following, and it worked perfectly:
$item(0).$node["Set counter"].json["counter"]
I’ve tried other ways, such as:
$('Set counter').first().json.counter += 1 // Increment counter
But it didn’t work.
The value is changed, but the state is not maintained. Instead of being altered, it remains at only the value of 1
For the workflow I am working on, this seems to be the only solution. I tried a few others, but they didn’t work. I need to change the value of the node directly using custom node scripts
Information on your n8n setup
- **n8n version: 0.224.2
- **Database (default: SQLite): postgres
- **n8n EXECUTIONS_PROCESS setting (default: own, main): default
- **Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- **Operating system: Ubuntu Server / docker container
