Can a node modify the workflow

Is it possible for an n8n node (custom node or otherwise) to modify the workflow it is in ?
For example, can the node create new nodes dynamically based on its input data?
Maybe I can access the json representation of the workflow and modify it ?

Something similar was asked but that seemed to be about accessing other nodes data. I am more interested in “this.getWorkflow()” but couldn’t find much information about it.

With the execute workflow node in parameter mode you can specify a workflow as arbitrary JSON. So you could construct your workflow/nodes dynamically and execute them like this?

I don’t think a live workflow can be edited however, it’s already committed in the DB at runtime.


You could use the n8n node / api to modify a workflow but you can’t modify the workflow that is currently running.


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