API: Install Flows and Modules automated via API Requests

Hey Node-Red Admins,

I try some Node-Red automation on installing flows and modules via Admin API where I need your help.

Actually I can load a preset of flows via post /flows api method. The the flows are installed but missing some nodes from additional modules original installed via palette. I can install the missing node modules via post /nodes API method manually but where can I get the module name from the missing nodes when I try to automate it?

Using api method get /flows will list all flows and node types. The node Json blob does not include the node module name! With the types list in the json I can parse against the get /nodes result. But when it is missing i am out off the module name to install it via post /nodes module name

Thank you for any ideas or tipps.

Welcome to the forum @hinrich

You can get the required nodes from the package.json of the source system.

@colin0031
Thank you for your reply.
When I import a new flow with an node that is not yet installed, the packag.json does not contain the node_module name. The node module name will be written to the package.json after installation via npm or palette module manager. This is exactly the step I try to automate. But it looks like i have to declare the module names separately.

Most probably you have to. There's no data referencing the (e.g. npm) package name of a node in the flows json. If you try to guess the package name, you may even fall over ambiguities - as there's no mechanism to ensure that a node name may only be used once in the Node-RED universe...

1 Like

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