A Couple of basic questions

Hello, I am pretty new to nodered. however i found these points to be unclear and wanted to ask them here.

  1. Can we programatically trigger the addition of flows to the pallette? Let me explain a little, If i have a json like this for example, stored on a remote location, Is it possible to add this flow to the workspace programatically, upon an event lets say, without editing the main flows file?
[{"id":"9261b687.403138","type":"debug","z":"3e2accbd.7e7cb4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":940,"wires":[]},{"id":"7fccbc37.33dff4","type":"inject","z":"3e2accbd.7e7cb4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":920,"wires":[["197a3a53.6db906"]]},{"id":"197a3a53.6db906","type":"delay","z":"3e2accbd.7e7cb4","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":330,"y":960,"wires":[["9261b687.403138"]]}]
  1. Can i be linked to a page or an article which describes how the "id" is generated and used to refer a particular node ? (If they exist already, couldnt find them myself :cry: )
  1. well you can use the admin API to add things to the flow - but you will in effect be editing the flow file as you have to deploy it to make it active. (Which then writes it to storage). Or if it is running on the remote location by opening a browser to it - then that is a different session anyway - so wont change anything locally.

  2. the id is a random number that is auto allocated when you add or import a node - it is unique across the flow, and just used as an internal reference.

1 Like

Thank you for repliying. This solves my issue. :slight_smile:

You can add and remove entire flows (i.e. tabs) with the Admin API, but I have not seen where you can add or remove individual nodes, or a group of nodes to an existing flow via the Admin API... only via the editor?

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