# How can I set the error indicator (little red triangle) of a node in the editor?

**URL:** <https://discourse.nodered.org/t/how-can-i-set-the-error-indicator-little-red-triangle-of-a-node-in-the-editor/51481>\
**Category:** Developing Nodes\
**Created:** [24 September 2021 15:57 UTC](https://discourse.nodered.org/t/how-can-i-set-the-error-indicator-little-red-triangle-of-a-node-in-the-editor/51481 "2021-09-24T15:57:07Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [25 September 2021 10:08 UTC](https://discourse.nodered.org/t/how-can-i-set-the-error-indicator-little-red-triangle-of-a-node-in-the-editor/51481/7 "2021-09-25T10:08:47Z")

</div>

> [@rozek](#):
>
> The set of questions I planned to ask therefore looks as follows:
> 
> - (how can I set the error indicator of a node in the editor)
> - how do I find a tab by name (in the editor and in the runtime)
> - how do I find a node by name (in all tabs or within a given tab, in the editor and in the runtime)
> - how do I iterate over all nodes (in the editor and in the runtime)
> - how can I find all (transitively) connected nodes of a given node (in the editor)

It is true to say the runtime apis for these types of actions are far more limited - simply because Nodes generally do not have a need to do these things. And none of the nodes that have 'hacked' around the available APIs have ever discussed any possible API changes or improvements.

The editor provides better APIs because it is more generally useful to be able to do these things when editing the flow.

**Everything that follows only applies in the editor. This is no equivalent in the runtime.**

### Finding by name

There's no direct way to find anything by its 'name' - names are optional fields and can be left blank. They are also not unique. Under the covers you should be using the `id` field to reference other nodes.

```auto
let node = RED.nodes.node(id);

```

To get any nodes whose name property is set to a particular value:

```auto
let results = [];
RED.nodes.eachNode(function(node) {
   if (node.name === "HELLO") {
      results.push(node);
   }
});

```

(If you dig around the code, you'll see `RED.nodes.filterNodes` exists - that currently only filters on `z` and `type` rather than any other property... but it would be simply enough to update to handle any property... we have never needed it)

The above works for regular flow nodes. To do the same for Config nodes or Flows, you'd do the same but with `eachConfig()` and `eachWorkspace()` respectively.

### Find connected nodes of a given node

```auto
let node = RED.nodes.node(nodeId);
let allConnectedNodes = RED.nodes.getAllFlowNodes(node)

```

If you just want the nodes that come 'before' or 'after' this one, you can do:

```auto
let allUpstreamNodes = RED.nodes.getAllUpstreamNodes(node);
let getAllDownstreamNodes = RED.nodes.getAllDownstreamNodes(node)

```

---

_[View the full topic](https://discourse.nodered.org/t/how-can-i-set-the-error-indicator-little-red-triangle-of-a-node-in-the-editor/51481)._
