# 🎉 Node-RED 4.0.0-beta.1 released

**URL:** <https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433>\
**Category:** News\
**Created:** [14 March 2024 17:26 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433 "2024-03-14T17:26:17Z")\
**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:** [14 March 2024 17:26 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/1 "2024-03-14T17:26:17Z")

</div>

🎉 The first **beta** release of Node-RED 4.0 is now available!

**Node-RED 4.x requires at least Node 18.x. We recommend using Node 20**

Here are the highlights for this release. We'll be doing regular beta releases over  
the next few weeks as there's still plenty to come before 4.0 is fully released  
by the end of April.

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

**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 yet!

### Updated JSONata

I'm putting this first as it is a _potentially_ breaking change.

The JSONata library is used to provide the `expression` types in Node-RED - a really powerful way of working with JSON objects. With this release we've updated to the new major release of JSONata that comes with a bunch of performance improvements.

But it also comes with a breaking change with how it gets invoked under the covers. We prepared for this in 3.1 by adding a large warning to the log if we ever spotted a node accessing it incorrectly. With this release, that warning becomes an error.

Given we didn't hear a lot of complaints in the 3.1 release about this, either the warning went unnoticed, or it isn't a wide-spread issue. We'll see...

### Auto-complete for `flow`/`global` and `env` inputs

Node-RED already has simple auto-complete on `msg` fields in the editor. We've now extended that to also work with `flow`/`global` context inputs as well as the `env` type for accessing environment variables.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/41fc40c64f7ceead44f6f5b06c0e362f731cd691.png)

This makes it so much easier to work with these types of properties - being sure you're using something that exists rather than having to switch between different views in the editor to get the names right.

In the case of env vars, it also shows you where the value was set - useful when you have nested groups and subflows which might be overriding a particular value.

The `msg` auto-complete is still based on a built-in list of common message properties used by the core nodes. There is interest in enabling this to pull completions from 'live' messages seen by the node in question - but that's not currently in the plan for 4.0.

### Timestamp formatting

The Inject node has provided the ability to inject a timestamp since the very early days of Node-RED. The value it actually sets is the number of milliseconds since epoch (aka January 1st, 1970). If you're used to working with JavaScript, then this is a perfectly normal way to pass times around. However, it isn't always what is needed and flows end up using a Function node to reformat it in some way.

With 4.0 we've added options to pick what format the timestamp is generated in at the start. Now, formatting times and dates can be a big can of worms of options. So, for this initial release, we've kept it simple by offering three options:

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

- _milliseconds since epoch_ - the existing option, just more explicitly labelled for what it is
- _YYYY-MM-DDTHH:mm:ss.sssZ_ - also known as ISO 8601
- _JavaScript Date Object_ - the standard Date object

There is scope to allow custom format strings to be set in the node - but we'll see what the feedback is on these new options first.

### A better CSV node

The CSV node has had a big overhaul to make it more standards compliant. It turns out CSV has a whole bunch of tricky edge cases that most users don't hit - but if you did hit them you would be stuck.

The new node follows the [RFC4180](https://www.ietf.org/rfc/rfc4180.txt) standard and is also faster - wins all around.

Existing flows using the CSV node will stay in 'legacy' mode until they are modified to use the new parser.

### Customising config nodes in Subflows

This one needs a bit of explaining. Subflows are a way Node-RED lets you create a flow and add multiple reusable instances of it within your flows. For example, a subflow may connect to an MQTT broker and do some standard processing on the messages it received before sending them on. The Subflow can then expose a set of properties that can be customised for each instance. In our example, that could be the topic the MQTT node subscribes to.

However, in that example, the MQTT node's broker configuration would be locked to the same broker config node in every instance - and that's something we're solving in Node-RED 4.0.

We're making it possible to expose the choice of a configuration node in the Subflow properties - so each instance can be customised even further.

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

Another common use for this will be with Node-RED Dashboard - which uses config nodes to set the location of a widget. With Node-RED today, you cannot really use dashboard nodes inside subflows as you end up with multiple copies of the widgets all packed into the same group. With this update, you'll be able to configure the subflow instance with exactly what dashboard group to place its contents into.

This will probably make more sense once we get the docs updated with some more concrete examples.

### Node Updates

Here's a list of the various updates made to the individual core nodes.

- TCP node - when resetting, if no payload, stay disconnected @dceejay
- HTML node: add option for collecting attributes and content (#4513) @gorenje
- let split node specify property to split on, and join auto join correctly (#4386) @dceejay
- Add RFC4180 compliant mode to CSV node (#4540) @Steve-Mcl
- Fix change node to return boolean if asked (#4525) @dceejay
- Let msg.reset reset Tcp request node connection when in stay connected mode (#4406) @dceejay
- Let debug node status msg length be settable via settings (#4402) @dceejay
- Feat: Add ability to set headers for WebSocket client (#4436) @marcus-j-davies

Check the full changelog to see what else has been happening.

* * *

Be sure to read through the [Change Log](https://github.com/node-red/node-red/blob/f041a21f2251e00906438bf015d09c244306aad0/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.x

So on a Pi you'd do:

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

```

## Docker images

The beta images are building as I write this, but will soon be available under `nodered/node-red-dev:v4.0.0-beta.1` - with the default image being based on node 20.

## 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

This is the first beta release to get the ball rolling towards the full 4.0 at the end of April.

There are still plenty of changes still being worked on and more to come in the next few weeks.

---

<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:** [14 March 2024 21:50 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/2 "2024-03-14T21:50:16Z")

</div>

Working well for me so far, great work!

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [15 March 2024 00:00 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/3 "2024-03-15T00:00:20Z")

</div>

Just installed docker version and copied my dev environment onto it ... works OK so far

well done

---

<div class="post-metadata">

**Author:** ![jodelkoenig](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jodelkoenig/32/44645_2.png) [@jodelkoenig](https://discourse.nodered.org/u/jodelkoenig)\
**Post date:** [15 March 2024 07:35 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/4 "2024-03-15T07:35:24Z")

</div>

> [@knolleary](#):
>
> `nodered/node-red-dev:4.0.0-beta.1`

Thanks @knolleary. Works just fine here so far.

A minor error in your info post ... docker should be "nodered/node-red-dev:v4.0.0-beta.1" ... the v is missing in front of 4.0.0 🙂

---

<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:** [15 March 2024 09:05 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/5 "2024-03-15T09:05:10Z")

</div>

2 posts were split to a new topic: [Node-RED 4.0 beta + Dashboard 2](https://discourse.nodered.org/t/node-red-4-0-beta-dashboard-2/86452)

---

<div class="post-metadata">

**Author:** ![RvG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rvg/32/96613_2.png) [@RvG](https://discourse.nodered.org/u/RvG)\
**Post date:** [19 March 2024 15:54 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/6 "2024-03-19T15:54:12Z")

</div>

Hi, not sure if it counts as a bug, but the Split node is now shown with a capitalized name 'Split' instead of 'split'.

#splittinghears

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [20 March 2024 11:13 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/7 "2024-03-20T11:13:01Z")

</div>

> [@RvG](#):
>
> Split node is now shown with a capitalized name 'Split' instead of 'split'.

The type didn't change, it's just the labelling. Which does beg the question, did any of the core types change? I.e. did the types change or just their labels?

---

<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:** [20 March 2024 11:17 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/8 "2024-03-20T11:17:52Z")

</div>

No types have changed - that would be a major breaking change and not something we'd ever do without a very good reason and a lot of highlighting in the change log.

Looks like the label got changed in this PR [let split node specify property to split on, and join auto join correctly by dceejay · Pull Request #4386 · node-red/node-red · GitHub](https://github.com/node-red/node-red/pull/4386) as it wanted to reuse the `Split` text inside the edit dialog where it wanted to be capitalised... so an unintentional side-effect that didn't get spotted.

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [20 March 2024 11:27 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/9 "2024-03-20T11:27:10Z")

</div>

> [@knolleary](#):
>
> so an unintentional side-effect that didn't get spotted.

Is there a convention to use lower case for palette labelling and types? I've been using CamelCase for a lot my types because of my OOP background where classes are capitalised.

---

<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:** [20 March 2024 11:35 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/10 "2024-03-20T11:35:10Z")

</div>

> Is there a convention to use lower case for palette labelling and types

It is the convention we use in the core nodes. I don't think we've ever explicitly documented a requirement in this area.

---

<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 March 2024 17:07 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/11 "2024-03-23T17:07:16Z")

</div>

There was a previous request to make URL's case sensitive for v4 given that [Socket.IO](http://Socket.IO) (used for Dashboards 1 & 2 and UIBUILDER) is case sensitive by default which could lead to hard to track down bugs.

Also, the W3C recommendations are to use case sensitive URL's.

Could this be included?

---

<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:** [23 March 2024 17:16 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/12 "2024-03-23T17:16:45Z")

</div>

> [@TotallyInformation](#):
>
> Could this be included?

Is there a PR (or issue) Julian. Please link to there is & I'll take a look & consider implications over the weekend.

---

<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 March 2024 17:17 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/13 "2024-03-23T17:17:41Z")

</div>

~~Sorry Steve, I raised it ages ago, so not sure. If not, I'll raise an issue - let me check.~~

Yes, there is:

> <https://github.com/node-red/node-red/issues/4373>
>
> \### Current Behavior
> 
> From: https://discourse.nodered.org/t/fix-node-red-url-cas…e-sensitivity-for-http-in-out/81688
> 
> \---
> 
> Hi devs.
> 
> Following this discussion: \[Uibuilder and URL case sensitivity - General - Node-RED Forum (nodered.org)\](https://discourse.nodered.org/t/uibuilder-and-url-case-sensitivity/81019/5), \[@annuello\](https://discourse.nodered.org/u/annuello) spotted that Node-RED does not follow the W3C guidelines on the use of case sensitivity in URL's.
> 
> This is because the default in ExpressJS also does not use case sensitivity.
> 
> Really, this isn't quite in alignment with the standards which say that it SHOULD (not MUST).
> 
> More critically, the \[Socket.IO\](http://socket.io/) library IS case sensitive and as can be seen from the thread, this can cause at least confusion.
> 
> So this is an initial request to see if the default could be changed. However, I recognise that this could only happen in a Major version change as it would be potentially breaking.
> 
> Thoughts?
> 
> Many thanks, J.
> 
> \### Expected Behavior
> 
> Would be better for URL case sensitivity for both ExpressJS and Socket.IO to match. It would be best to align them with W3C recommendations.
> 
> \### Steps To Reproduce
> 
> See https://discourse.nodered.org/t/uibuilder-and-url-case-sensitivity/81019
> 
> \### Example flow
> 
> \_No response\_
> 
> \### Environment
> 
> \- Node-RED version: Any
> \- Node.js version: Any
> \- npm version: Any
> \- Platform/OS: Any
> \- Browser: Any

---

<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 March 2024 17:32 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/14 "2024-03-23T17:32:52Z")

</div>

My main reluctance here is that we've had one issue reported in 10 years on this subject that I'm aware of. Whereas we have no idea how many existing instances rely on the case insensitivity behaviour. That doesn't immediately give me warm feelings over the need to make a breaking change of this nature.

---

<div class="post-metadata">

**Author:** ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)\
**Post date:** [29 March 2024 04:33 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/15 "2024-03-29T04:33:55Z")

</div>

I was very surprised that the pi install script accepted `--nodered-version="next"` to let me get the beta verson.

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node20 --nodered-version="next"

```

Works good so far. Testing on a pi5 8gb. At the very least, my published nodes seemed to work just fine.

---

<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:** [29 March 2024 17:34 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/16 "2024-03-29T17:34:13Z")

</div>

> [@kevinGodell](#):
>
> Testing on a pi5 8gb

Show off 😉

---

<div class="post-metadata">

**Author:** ![DiverRich](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diverrich/32/64523_2.png) [@DiverRich](https://discourse.nodered.org/u/DiverRich)\
**Post date:** [30 March 2024 03:14 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/17 "2024-03-30T03:14:43Z")

</div>

lol, I waited forever to get my Rpi4 and had it about a month when they announced the 5. I suppose there's no reason not to get another one; they don't take up much space. 🙂

---

<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:** [30 March 2024 10:25 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/18 "2024-03-30T10:25:35Z")

</div>

Subflow packaging as a module appears to be broken if the subflow includes a D2 ui-group config node as a subflow property.

Having packaged it up and installed it, on placing it on the flow, Deploying, and opening up the node to set the config all is well, but if I then select a ui-group node, deploy, and then re-open the node I see

```auto
oneditprepare b7fa46dd25e31c0d sf:617c00e61edb38f6 TypeError: Cannot read properties of undefined (reading 'sort')
red.min.js?v=3ee9a1d92ab2:18 TypeError: Cannot read properties of undefined (reading 'sort')
    at T (red.min.js?v=3ee9a1d92ab2:18:426526)
    at Object.y [as prepareConfigNodeSelect] (red.min.js?v=3ee9a1d92ab2:18:419769)
    at red.min.js?v=3ee9a1d92ab2:19:133222
    at u (red.min.js?v=3ee9a1d92ab2:19:133291)
    at Object.buildEditForm (red.min.js?v=3ee9a1d92ab2:19:138723)
    at Proxy.oneditprepare (<anonymous>:19:25)
    at t (red.min.js?v=3ee9a1d92ab2:18:422357)
    at n (red.min.js?v=3ee9a1d92ab2:18:423285)
    at Object.success (red.min.js?v=3ee9a1d92ab2:18:423576)
    at c (vendor.js?v=3ee9a1d92ab2:2:28294)
    at Object.fireWith [as resolveWith] (vendor.js?v=3ee9a1d92ab2:2:29039)
    at l (vendor.js?v=3ee9a1d92ab2:2:79800)
    at XMLHttpRequest.<anonymous> (vendor.js?v=3ee9a1d92ab2:2:82254)

```

The node does appear to correctly picking up the group, but it is not possible to get in to edit it any more.  
I can put an example up on github for testing if it is not obvious what the problem is.

---

<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:** [30 March 2024 12:09 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/19 "2024-03-30T12:09:43Z")

</div>

I have uploaded an example. It can be installed using  
`npm install colinl/node-red-dropdown-cdl`  
It appears as Dropdown CDL in the Functions category. I need to work out how to change the category.

There is also a presumably unrelated issue [A subflow containing a ui node, packaged as a subflow, does not appear in dashboard config panel · Issue #722 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/722)

---

<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:** [30 March 2024 14:43 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/20 "2024-03-30T14:43:23Z")

</div>

There seems to be a problem with the command `node-red -u` under some circumstances. If I run

```auto
cd ~
node-red -u ~/.node-red-1884 -p 1884

```

Then I see this which is as it should be

```auto
30 Mar 14:40:26 - [info] Node-RED version: v4.0.0-beta.1
30 Mar 14:40:26 - [info] Node.js version: v20.5.1
30 Mar 14:40:26 - [info] Linux 5.15.0-101-generic x64 LE
30 Mar 14:40:26 - [info] Loading palette nodes
30 Mar 14:40:26 - [info] Settings file : /home/colinl/.node-red-1884/settings.js
30 Mar 14:40:26 - [info] Context store : 'default' [module=memory]
30 Mar 14:40:26 - [info] User directory : /home/colinl/.node-red-1884
30 Mar 14:40:26 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Mar 14:40:26 - [info] Flows file : /home/colinl/.node-red-1884/flows.json
30 Mar 14:40:26 - [info] Server now running at http://127.0.0.1:1884/

```

However if I go into the usual user dir and run it

```auto
cd ~/.node-red
node-red -u ~/.node-red-1884 -p 1884

```

then I see

```auto
30 Mar 14:35:15 - [info] Node-RED version: v4.0.0-beta.1
30 Mar 14:35:15 - [info] Node.js version: v20.5.1
30 Mar 14:35:15 - [info] Linux 5.15.0-101-generic x64 LE
30 Mar 14:35:15 - [info] Loading palette nodes
30 Mar 14:35:15 - [info] Settings file : /home/colinl/.node-red-1884/settings.js
30 Mar 14:35:15 - [info] Context store : 'default' [module=memory]
30 Mar 14:35:15 - [info] User directory : /home/colinl/.node-red-1884
30 Mar 14:35:15 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Mar 14:35:15 - [info] Flows file : /home/colinl/.node-red/flows.json
30 Mar 14:35:15 - [info] Server now running at http://127.0.0.1:1884/

```

Note that it is picking up the wrong flows file.  
I have checked with NR 3.1.6 and it does not show the problem.

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