# Node registration order

**URL:** <https://discourse.nodered.org/t/node-registration-order/6779>\
**Category:** General\
**Created:** [14 January 2019 08:51 UTC](https://discourse.nodered.org/t/node-registration-order/6779 "2019-01-14T08:51:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lionel](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@Lionel](https://discourse.nodered.org/u/Lionel)\
**Post date:** [14 January 2019 08:51 UTC](https://discourse.nodered.org/t/node-registration-order/6779/1 "2019-01-14T08:51:54Z")

</div>

Hi,

I have a specialized singleton node which needs to do a stuff, at the node registration , and then put the result in the flow. This result is expected by some other nodes, also at the node registration.  
So, the question is, can I force the registration node order ?

Thx

---

<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:** [14 January 2019 08:57 UTC](https://discourse.nodered.org/t/node-registration-order/6779/2 "2019-01-14T08:57:39Z")

</div>

> [@Lionel](#):
>
> So, the question is, can I force the registration node order ?

When the runtime starts your flows, it first looks for all configuration nodes and starts them. It tries to identify any dependencies between the config nodes and will start them in the right order to satisfy those dependencies. It then starts the regular flow nodes, one tab at a time, in the order they were added to the tab.

If you have a node that other nodes depend on, I would assume its a config node - as regular flow nodes don't, in general, have dependencies on each other like that.

If your node is a config node, and other nodes declare a dependency on it, then it will get started first.

---

<div class="post-metadata">

**Author:** ![Lionel](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@Lionel](https://discourse.nodered.org/u/Lionel)\
**Post date:** [14 January 2019 09:05 UTC](https://discourse.nodered.org/t/node-registration-order/6779/3 "2019-01-14T09:05:04Z")

</div>

The node, I need to start first, is a node responsible for the translation of prompt. This node has a config part where all the prompts are declared.  
At the node creation, it requests the translation to the distant HUB (synchronous call) and then puts the information in the flow context.  
And I would like some other nodes to use these prompts info in their init.

---

<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:** [16 January 2019 09:23 UTC](https://discourse.nodered.org/t/node-registration-order/6779/4 "2019-01-16T09:23:00Z")

</div>

@knolleary - Nick, If I add TAB1 then TAB2 then TAB3 (all regular flows) from what you say, it will start them in that order.

But what if I move TAB3 before TAB1 so you have TAB3, TAB1, TAB2 - is TAB3 or TAB1 started first? i.e. is it the order they occur in the tabs or the order they were added?

---

<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:** [16 January 2019 09:25 UTC](https://discourse.nodered.org/t/node-registration-order/6779/5 "2019-01-16T09:25:46Z")

</div>

It is the order they appear in the editor.

---

<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:** [16 January 2019 09:41 UTC](https://discourse.nodered.org/t/node-registration-order/6779/6 "2019-01-16T09:41:03Z")

</div>

I would also suggest that you should make your flows resilient to data not being available as expected, either waiting for data to become available or falling back to some default or other appropriate action. Then when the data does become available normal operation should be resumed.

---

<div class="post-metadata">

**Author:** ![Lionel](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@Lionel](https://discourse.nodered.org/u/Lionel)\
**Post date:** [16 January 2019 09:46 UTC](https://discourse.nodered.org/t/node-registration-order/6779/7 "2019-01-16T09:46:26Z")

</div>

For the moment, we process the data on the first received msg, and only once.  
Is there a mean to suspend the creation of a node waiting for the data ready ?

---

<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:** [16 January 2019 09:58 UTC](https://discourse.nodered.org/t/node-registration-order/6779/8 "2019-01-16T09:58:06Z")

</div>

> [@Lionel](#):
>
> Is there a mean to suspend the creation of a node waiting for the data ready ?

No, there isn't.

---

<div class="post-metadata">

**Author:** ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)\
**Post date:** [28 January 2019 12:03 UTC](https://discourse.nodered.org/t/node-registration-order/6779/9 "2019-01-28T12:03:22Z")

</div>

I used [node-red-contrib-config] and set the variable to 0 in the beginning, the startup routine will change this value and in the rest of flow I check this variable again before sending anything. So only when hardware is initialized I can use it.
