# 🎉 Node-RED 3.1.0-beta.4 released

**URL:** <https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091>\
**Category:** News\
**Created:** [26 July 2023 16:33 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091 "2023-07-26T16:33:51Z")\
**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:** [26 July 2023 16:33 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/1 "2023-07-26T16:33:51Z")

</div>

🎉 Whilst it isn't the excitement of the final 3.1 release, this is the next best thing - a new beta for the release.

**Node-RED 3.x requires at least Node 14.x, but that has already reached its end-of-life. These days you should really be using Node 18 as even Node 16 only has a short time before it reaches its end-of-life.**

The [Change Log](https://github.com/node-red/node-red/blob/4d3e3a73fd225d9116b5255a096413842fe3b0c1/CHANGELOG.md) has the full list of changes.

If you haven't tried the previous beta releases, please check their release posts for details on what's included:

- [3.1.0-beta.1 release post](https://discourse.nodered.org/t/node-red-3-1-0-beta-1-released/74644)
- [3.1.0-beta.2 release post](https://discourse.nodered.org/t/node-red-3-1-0-beta-2-released/76192)
- [3.1.0-beta.3 release post](https://discourse.nodered.org/t/node-red-3-1-0-beta-3-released/78716)

**Note** : if any issues are reported against the beta, we'll update this post to list them here. If you hit a problem, please do check back here before adding a comment.

## Known Issues

- none

### Improved wiring for horizontally aligned nodes

Following [this](https://discourse.nodered.org/t/feature-request-little-tweak-on-wires/79336) discussion on the forum, we've made some modifications to the wiring layout logic to improve cases where wires loop back on horizontally laid out nodes.

Here is a before/after pair of screenshots.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a298bddef3be2e9d8175cd7703b375e92df09e1e.png) ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/1342ec8a5a25cbf3a1c20f8aea43bdcc1e142736.png)

### New subflow env vars

Within a subflow, you can now use `NR_SUBFLOW_NAME` `NR_SUBFLOW_ID` and `NR_SUBFLOW_PATH` to access those properties of the subflow instance node.

These join the existing `NR_NODE_*`/`NR_FLOW_*` and `NR_GROUP_*` equivalents.

### Individual http middleware for httpStatic routes

It is now possible to configure separate middleware functions for different `httpStatic` configured routes.

See [#4229](https://github.com/node-red/node-red/pull/4229) for the details.

### Changes to how Environment Variables are evaluated

Environment variables are statically defined values that cannot be changed whilst the flow is running. There were some edge cases to this, such as using a JSONata expression of `$now()` that would get re-evaluated every time it was referenced.

Because of the need to make JSONata fully asynchronous in the future, we've changed how the env var evaluation is done - their values are now all generated when the flows start and not re-evaluated again.

This should not cause any changes in behaviour, unless you were relying on the `$now()` trick that was not an intentional behaviour.

As nodes can depend on env var values, we've also updated the logic around the 'modified nodes' and 'modified flows' types of deploys. Changing an env var at the flow level will now cause all of the nodes on that flow to be considered modified. This is a bit of a blunt solution and it may be able to refine it to be more selective to only the nodes that reference the changed env var - but that's beyond the scope of getting 3.1 released any time soon.

* * *

Be sure to read through the [Change Log](https://github.com/node-red/node-red/blob/4d3e3a73fd225d9116b5255a096413842fe3b0c1/CHANGELOG.md) to see what else is in there.

## Installing the beta

If you want to try out the beta, you will need specify node-red@next when you use npm to update. Without the `@next` you'll still get 3.0.x

So on a Pi you'd do:

```auto
sudo npm install -g --unsafe-perm node-red@next

```

## Reporting problems

If you hit any problems, please report them either as a reply on this topic, or in the #core-dev slack channel. Please do not post new topics to the forum regarding the beta as that could confuse users who are not using the beta.

## Outstanding work

The main task is now to get the 3.1 release done. There really is nothing else we want to get into it. Anything else at this point, unless critical, will be considered bug fixes for 3.1.1.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [26 July 2023 17:09 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/2 "2023-07-26T17:09:50Z")

</div>

> [@knolleary](#):
>
> Improved wiring for horizontally aligned nodes

Excellent!!! Looking forward to hours of tweaking my layouts 😂 😂 😂 😂

---

<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:** [26 July 2023 17:31 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/3 "2023-07-26T17:31:13Z")

</div>

That should be "untweaking" surely? 😉

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [27 July 2023 08:44 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/4 "2023-07-27T08:44:09Z")

</div>

Docker containers for the 3.1.0-beta.4 release available as tags on nodered/node-red-dev as usual

---

<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:** [29 July 2023 00:01 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/5 "2023-07-29T00:01:12Z")

</div>

Just a slight issue at times with the line going blank near where a status symbol could appear

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d391d73071c9fca7a39a895de414272911038e28.png)

---

<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:** [29 July 2023 07:05 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/6 "2023-07-29T07:05:02Z")

</div>

Oh.

How is that particular debug node set up?

Also, what browser please?

Lastly, if you could, what do you see in the html if you inspect that area?

I think it is the status text background element overlapping the wire but would like to see the html/SVG

Thanks

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [29 July 2023 09:48 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/7 "2023-07-29T09:48:31Z")

</div>

Giving node status a semi-opaque background (when it is non-null) is a big improvement from 3.0.2.

There does seem to be a z-index issue remaining though:

 ![3.0.2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3a15583017e596a2b70018c1d0e99d08955bb48c.jpeg)  
3.0.2

 ![3.1.4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/6/e6dc0d20022577749bff67eb7258319de7a7ae11.jpeg)  
3.1.0 beta4

Edit - sorry, my wires are customised. Don't think it affects this observation.

```auto
.red-ui-flow-link-line {
        stroke: #0722fc;
        stroke-width: 1;
}

```

---

<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:** [29 July 2023 10:23 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/8 "2023-07-29T10:23:13Z")

</div>

Simon, what browser, platform and node.js do you see this on? On my Mac with Safari, FireFox and Chrome (Node.js v18.12.1) I can't recreate this. Also I can not get the inject node to show the blue dot and have the button not be faded.  
 ![Screenshot 2023-07-29 at 6.21.21 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f903e08c86cfcd8f01382afa2247fd9e61cd57c5.jpeg)

---

<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:** [29 July 2023 10:29 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/9 "2023-07-29T10:29:27Z")

</div>

What if you set the debug to show status & deploy?

Also, try sending an empty string or a single space

---

<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:** [29 July 2023 10:33 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/10 "2023-07-29T10:33:29Z")

</div>

Ahh setting it to display node status causes the blank space to show up.

---

<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:** [29 July 2023 10:38 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/11 "2023-07-29T10:38:25Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0feb3587e807be31edc376f88f80e1ef83328a01.png)

Vivaldi browser - same effect in Edge  
Sending empty string give same effect

> [@Steve-Mcl](#):
>
> Lastly, if you could, what do you see in the html if you inspect that area?

Can't work out how to do that I'm afraid

---

<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:** [29 July 2023 11:05 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/12 "2023-07-29T11:05:28Z")

</div>

Steve, here is what the HTML shows when selecting that spot:

```auto
<g class="red-ui-flow-node-status-group" transform="translate(-14,33)" style="display: inline;">
	<rect class="red-ui-flow-node-status-background" x="17" y="-1" width="6" height="13" rx="1" ry="1"></rect>
	<rect class="red-ui-flow-node-status red-ui-flow-node-status-ring-grey" x="6" y="1" width="9" height="9" rx="2" ry="2" stroke-width="3" style="display: none;"></rect>
	<text class="red-ui-flow-node-status-label" x="20" y="10"></text></g>

```

---

<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:** [29 July 2023 11:43 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/13 "2023-07-29T11:43:30Z")

</div>

Another example  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a0011fb198a805ee3dab6004e1ff8b2ed35b9c61.png)

---

<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:** [30 July 2023 18:05 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/14 "2023-07-30T18:05:06Z")

</div>

> [@knolleary](#):
>
> This should not cause any changes in behaviour, unless you were relying on the `$now()` trick that was not an intentional behaviour.

Sorry, I'm confused. I thought that `$now()` was meant to return the CURRENT timestamp? Are you saying that it now does not do that?

> Generates a timestamp in ISO 8601 compatible format and returns it as a string.

Does that mean that you can no longer to current time calculations using JSONata?

---

<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:** [30 July 2023 18:29 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/15 "2023-07-30T18:29:49Z")

</div>

> [@TotallyInformation](#):
>
> Sorry, I'm confused. I thought that `$now()` was meant to return the CURRENT timestamp? Are you saying that it now does not do that?

I'm only talking about when an Env Var is set via a JSONata expression. It is evaluated at deploy and not again.

All other uses of JSONata (such as in the Change node) continues as it always has.

---

<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:** [30 July 2023 18:32 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/16 "2023-07-30T18:32:11Z")

</div>

Ah! Well, that's what happens when you've been trying the alcoholic & food specialities of 3 different countries for a week! 🤣 Thanks for the clarification.

---

<div class="post-metadata">

**Author:** ![DmitrySidorow](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dmitrysidorow/32/62008_2.png) [@DmitrySidorow](https://discourse.nodered.org/u/DmitrySidorow)\
**Post date:** [1 August 2023 06:07 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/17 "2023-08-01T06:07:14Z")

</div>

Is it normal, that every opened function node became changed even if not? It's not changed if I closing edit window with 'Cancel' button

---

<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:** [1 August 2023 07:06 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/18 "2023-08-01T07:06:02Z")

</div>

> [@DmitrySidorow](#):
>
> Is it normal, that every opened function node became changed even if not

It depends when those function nodes were written and if any new properties have been added to the src function node since. Could you select one function node that exhibits this behaviour and export it? I will import it and have a try.

---

<div class="post-metadata">

**Author:** ![DmitrySidorow](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dmitrysidorow/32/62008_2.png) [@DmitrySidorow](https://discourse.nodered.org/u/DmitrySidorow)\
**Post date:** [1 August 2023 07:43 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/19 "2023-08-01T07:43:25Z")

</div>

I found problem. This is because of the new timeout feature, it is added to the node after closing. Property changes from undefined to ""

---

<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:** [1 August 2023 08:57 UTC](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091/20 "2023-08-01T08:57:28Z")

</div>

Should there be a reference to the timeout feature in the help pane? It isn't mentioned in the [writing functions](https://nodered.org/docs/user-guide/writing-functions) docs either.

[Next page](https://discourse.nodered.org/t/node-red-3-1-0-beta-4-released/80091.md?page=2)
