Determining list of nodes used in a flow

Imagine a colleague creates a flow and ships me the flow.json. If my colleague has added a new contributed node to his palette and used it in the flow my understanding is that I must do the same in order to be able to run his flow. Is there a way to determine what nodes are used by a given flow?

Maybe there is a tool that takes a flow JSON file as input and can return such a list and, ideally, identify the exact names of the nodes from npm that I should install?

As a test to see what is in a flow.json, I added a node and used it. The node I added was:

node-red-contrib-function-npm

and what I found in the JSON was:

"id": "45a62d42.162224",
"type": "function-npm",
"z": "43d626f8.84bc48",

This suggests that given a node of type XXX that the package might be node-red-contrib-XXX but that might be far too easy.

Given the maturity of Node-RED, I'm thinking that this puzzle may have been solved many times in the past and I'm looking forward to any links or thoughts.

Neil

If you check out the flows site, you will find at least one example flow that tells you what nodes are installed and how many nodes you have. :slight_smile:

As it does it by examining a flow.json file, you could adapt it to look at any flow.json file.

@kolban the flow file does not uniquely identify the npm module that provides any particular node.

Being able to identify the right module to install given the type of a node can be a challenge as the same type could be provided by more than one module.

It's a known problem and is sat on the backlog with everything else.

1 Like

Of course, analysing the package.json file would give you the list of installed packages. But that still doesn't link it to the nodes in the flow.

However, that is "just" an analysis job. All the data is available - but not easily.