# New thing: Flow Inspector

**URL:** <https://discourse.nodered.org/t/new-thing-flow-inspector/20573>\
**Category:** General\
**Created:** [19 January 2020 14:08 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573 "2020-01-19T14:08:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [19 January 2020 14:08 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/1 "2020-01-19T14:08:56Z")

</div>

We are all familiar with the issue of a flow being shared in the forum without any information about what it contains. It isn't easy to stare at the JSON to figure these things out. In particular, the question over what contrib nodes it depends on.

I've put together an experimental page in the flow library to try to help. You paste in the flow and it gives back a report about what the flow contains. It looks up each node type to say which module it comes from.

[https://flows.nodered.org/inspect](https://flows.nodered.org/inspect)

For example, pasting in [this](https://flows.nodered.org/flow/f24cb20846f57eec19ed617b25cb61ae) flow (picked at random), you get:

```auto
Flows: 1
Subflows: 1
Nodes: 35

 Type | Count | Module
-------------------------|-------|-------------------
 comment | 2 | @node-red/nodes
 debug | 1 | @node-red/nodes
 function | 12 | @node-red/nodes
 inject | 3 | @node-red/nodes
 schedex | 1 | node-red-contrib-schedex
 ui_group | 1 | node-red-dashboard
 ui_button | 3 | node-red-dashboard
 ui_switch | 7 | node-red-dashboard
 ui_tab | 1 | node-red-dashboard
 ui_text_input | 2 | node-red-dashboard
 ui_toast | 1 | node-red-dashboard
 subflow:3abe8c84.455934 | 1 | 

Modules:
 - node-red-contrib-schedex
 - node-red-dashboard

```

When a node type is provided by multiple modules it does try to infer the right one. For example, above you can see node-red-dashboard is listed. Some of those `ui_xyz` nodes are provided by multiple modules that have cloned dashboard. However only `ui_group` is provided by `node-red-dashboard`, so the code infers it must be the module providing the others.

This is a quickly hacked together idea, I'm sure there's more it could do. Ideas/contributions etc are welcome.

Here's the code for the page: [https://github.com/node-red/flow-library/blob/master/template/flowInspector.html](https://github.com/node-red/flow-library/blob/master/template/flowInspector.html)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [19 January 2020 14:18 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/2 "2020-01-19T14:18:30Z")

</div>

Excellent Nick!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 January 2020 16:13 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/3 "2020-01-19T16:13:57Z")

</div>

I like it.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 January 2020 16:14 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/4 "2020-01-19T16:14:21Z")

</div>

> [@knolleary](#):
>
> When a node type is provided by multiple modules it does try to infer the right one.

Nick, could a potential workaround to inference be in a future version of node-red add a property that explicitly identifies the original node (in the JSON export)? I'm not certain about the possibility or impact or where this would need to be implemented (in each node or the core) but if it is something that could be added easily, it might open other possibilities (like option download and install missing nodes for example?)

Just a thought.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [19 January 2020 16:20 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/5 "2020-01-19T16:20:02Z")

</div>

> [@Steve-Mcl](#):
>
> Just a thought.

Yup, one that has been discussed many times to no ultimate conclusion. Hence why, 5 years later, we still don't do it.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 January 2020 16:34 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/6 "2020-01-19T16:34:54Z")

</div>

Yeah I know it was an obvious one but thought it worth mentioning

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [19 January 2020 16:34 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/7 "2020-01-19T16:34:56Z")

</div>

Great facility 🙂

[edit]

Maybe add it to main menu or prominent link of [https://flows.nodered.org/](https://flows.nodered.org/)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/867fa562e394ebeb4f33979cbc92be05e46d7bea.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [22 January 2020 16:08 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/8 "2020-01-22T16:08:58Z")

</div>

Just used it in anger for first time to find out what a missing contrib node was in a flow that someone wants help with 🙂  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b85b1db38b546de45ea68274bcbfb1f97cc366f8.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 January 2020 16:28 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/9 "2020-01-22T16:28:06Z")

</div>

I used it earlier. Extremely useful.  
Now if you could just right click a flow in the forum and have that popup then that would be the icing on the cake 🙂  
I guess that would rely on discourse providing a hook to connect to so maybe it isn't even possible.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [22 January 2020 16:28 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/10 "2020-01-22T16:28:48Z")

</div>

> [@Colin](#):
>
> I guess that would rely on discourse providing a hook to connect to so maybe it isn't even possible.

I'm waiting for a suitably wet evening before I go read up on writing discourse plugins....

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [22 January 2020 19:53 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/11 "2020-01-22T19:53:56Z")

</div>

It's perfect coding weather up here at the moment ☹

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 January 2020 12:02 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/12 "2020-01-23T12:02:36Z")

</div>

Love it!

Of course, inevitably I'll ask for more ☹

A nice, small enhancement would be to add a link to the appropriate place in the flows library for the identified nodes. Might need to be a search link though as I note that some nodes use npm scopes which are included in the URL - a search URL would therefore likely be simpler to implement.

Looks like it would just need a small change on line 129. Happy to do a PR for you if you agree it worthwhile.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2020 12:23 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/13 "2020-01-23T12:23:11Z")

</div>

@TotallyInformation its trivial to add a link to the modules - scopes are no issue. I held back initially because I was trying to keep the output valid markdown so it could be copy/pasted into the forum. Once you start adding markdown links, it because less readable in the raw markdown format. No real need to keep it as markdown for now - so go ahead with a PR

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 January 2020 12:53 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/14 "2020-01-23T12:53:52Z")

</div>

Done.

> <https://github.com/node-red/flow-library/pull/33>

However, apologies but I can't actually test this change at the moment as I don't have a docker environment available.

In particular, it would be good to find a flow that contains a scoped node.

The link is only added to the modules summary at the end and is set to open the appropriate entry in the flows library in a new tab.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2020 13:37 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/15 "2020-01-23T13:37:31Z")

</div>

Thanks Julian - although it isn't _quite_ that simple. The report being generated at that point is treated as plain text, so any HTML in it will be displayed raw.

I'll stick something in later for it.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 January 2020 13:44 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/16 "2020-01-23T13:44:10Z")

</div>

Ah, OK. Such is life! 😀

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 January 2020 17:25 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/17 "2020-01-23T17:25:50Z")

</div>

Nice, I see you've already updated it Nick!

Now all you need to do is add a diagramming library so you can draw out the flow without needing Node-RED 🤣

Just kidding - well, unless you are really bored ...

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 March 2020 23:05 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/18 "2020-03-01T23:05:52Z")

</div>

@knolleary One small nit with this, it sometimes will report a node that is not in the flow. Take this flow;

```auto
[{"id":"f07be5c0.6e40b","type":"tab","label":"Flow 17","disabled":false,"info":""},{"id":"66e2a3fb.68a234","type":"inject","z":"f07be5c0.6e40b","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":120,"wires":[["aaa9daf4.424fa8"]]},{"id":"9660353a.d1e858","type":"debug","z":"f07be5c0.6e40b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":560,"y":120,"wires":[]},{"id":"aaa9daf4.424fa8","type":"random","z":"f07be5c0.6e40b","name":"","low":"1","high":"10","inte":"true","property":"payload","x":400,"y":140,"wires":[["9660353a.d1e858"]]}]

```

it's a simple `inject` -\> `random` -\> `debug` but when you run it thru the inspector it shows:

```auto
Flows: 1
Nodes: 3

 Type | Count | Module
----------|-------|-------------------
 debug | 1 | @node-red/nodes
 inject | 1 | @node-red/nodes
 random | 1 | node-red-node-random, node-red-contrib-viseo-random

Modules:
 - node-red-node-random, node-red-contrib-viseo-random

```

but node-red-contrib-viseo-random is not installed at all.

And if there is a flow using the moment node you get back: node-red-contrib-moment, node-red-contrib-moment-bug\_locale, node-red-contrib-moment2

Just thought I'd point this out.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 March 2020 23:29 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/19 "2020-03-01T23:29:31Z")

</div>

They are all node modules that could provide a node of that name.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 March 2020 23:33 UTC](https://discourse.nodered.org/t/new-thing-flow-inspector/20573/20 "2020-03-01T23:33:46Z")

</div>

True...but you wouldn't know which one the user used nd they could do different things or be missing an option or have an option that is not set.

[Next page](https://discourse.nodered.org/t/new-thing-flow-inspector/20573.md?page=2)
