Skip to content

Commit 1dbbb28

Browse files
authored
Merge branch 'master' into master
2 parents 1dd5bf8 + 90f7268 commit 1dbbb28

File tree

3 files changed

+62
-23
lines changed

3 files changed

+62
-23
lines changed

about/releases/index.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,27 @@ title: Release Plan
44
slug: releases
55
---
66

7-
_Updated: 2021-10-21_
7+
_Updated: 2022-08-04_
88

99
This plan is a guide for how the project plans to schedule upcoming releases, taking
1010
into account the release schedule of the underlying Node.js runtime.
1111

1212
![](release-plan.png)
1313

1414

15-
The active Node-RED stream (2.x) will get a new minor version release (for example, 2.1 -> 2.2)
16-
every three months. Maintenance releases (for example 2.1.0 -> 2.1.1) will continue
15+
The active Node-RED stream (3.x) will get a new minor version release (for example, 3.1 -> 3.2)
16+
every three months. Maintenance releases (for example 3.1.0 -> 3.1.1) will continue
1717
to happen as and when they are needed.
1818

19-
At the end of April 2022, when Node 12.x reaches its end-of-life, we will publish
20-
Node-RED 3.x that will *drop* support for Node 12.
19+
At the end of April 2023, when Node 14.x reaches its end-of-life, we will publish
20+
Node-RED 4.x that will *drop* support for Node 14.
2121

22-
The 2.x stream will then enter maintenance mode. It will only receive bug fixes
23-
and security updates. New features could get back-ported from 3.x if there was
22+
The 3.x stream will then enter maintenance mode. It will only receive bug fixes
23+
and security updates. New features could get back-ported from 4.x if there was
2424
a very good reason to do so as well as people available to do the work.
2525

26-
The 3.x stream will continue in active development with a minor release every
27-
three months or so until April 2023 when Node 14.x reaches its end-of-life. We
28-
then publish Node-RED 4.x and the cycle continues. The 2.x stream will reach its
29-
end-of-life soon after the 4.x release. The exact timing of that will be something
30-
we will need to discuss further.
26+
The 4.x stream will continue in active development with a minor release every
27+
three months or so for a year, when the next major release is made.
3128

3229
This proposal means:
3330

@@ -37,13 +34,14 @@ This proposal means:
3734
- We have a plan that enables us to make potentially breaking changes once a year.
3835

3936

40-
Release | Initial | Maintenance Start | End-of-life
41-
--------|-------------|----------------------|-----------------
42-
1.x | 2019-09-30 | 2021-04-30 | 2022-06-30
43-
2.x | 2021-04-30 | 2022-04-30 | 2023-06-30
44-
3.x | 2022-04-30 | 2023-04-30 | 2024-06-30
37+
Release | Initial | Maintenance Start | End-of-life
38+
--------|-----------------|----------------------|-----------------
39+
1.x | 2019-09-30 | 2021-04-30 | 2022-06-30
40+
2.x | 2021-07-22 | 2022-07-14 | 2023-06-30
41+
3.x | 2022-07-14 | *2023-04-30* * | 2024-06-30
42+
4.x | *2023-04-30* * | *2024-04-30* * | 2025-06-30
4543

46-
_Dates are subject to change_
44+
_* Dates are subject to change_
4745

4846
References:
4947
- [Blog post: Going beyond Node-RED 1.x](https://nodered.org/blog/2020/07/01/release-plans)

about/releases/release-plan.png

-3.35 KB
Loading

docs/user-guide/environment-variables.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ function:
5959
```javascript
6060
let foo = env.get("FOO");
6161
```
62+
6263
### Template node
64+
6365
*Since [Node-RED 3.0](https://nodered.org/blog/2022/07/14/version-3-0-released#environment-variables-in-the-template-node)*
6466

6567
The `template` node can access environment variables using the syntax:
@@ -78,22 +80,61 @@ a subflow could be created to access the API and handle the response, using an
7880
environment variable to identify which type of record should be accessed. Individual
7981
instances of the Subflow can then be customised for those particular types.
8082

83+
84+
8185
### Flow/Group level environment variables
8286

8387
*Since [Node-RED 2.1](https://nodered.org/blog/2021/10/21/version-2-1-released#flowgroup-level-environment-variables)*
8488

8589
Environment variables can be set at the flow or group level. This is done in the appropriate tab in the edit dialog for the flow or group.
8690

91+
### Accessing nested environment variables
92+
93+
When accessing an environment variable in a subflow, Node-RED will search the
94+
subflow properties, then the flow containing the subflow (which could be a subflow
95+
itself).
96+
97+
In some cases it is useful to access the 'parent' levels environment variables
98+
without reference the 'local' value. This can be achieved by prefixing the
99+
variable name with `$parent.`.
100+
101+
87102
### Running as a service
103+
88104
When Node-RED is running as a service having been installed using the provided [script](https://nodered.org/docs/getting-started/raspberrypi), it will not have access to environment variables that are defined only in the calling process. In this instance, environment variables can be defined in the settings file by adding:
89-
````
90-
process.env.FOO= 'World';
91-
````
105+
106+
```
107+
process.env.FOO='World';
108+
```
109+
92110
placed outside the `module.exports` section. Alternatively, variables can be defined as part of the `systemd` service by placing statements of the form
111+
93112
```
94113
ENV_VAR='foobar'
95-
````
96-
in a file named `environment` in the Node-RED user directory, `~/.node-red`.
114+
```
115+
in a file named `environment` within the Node-RED user directory, `~/.node-red`.
116+
117+
118+
### Built-In Environment Variables
119+
120+
*Since Node-RED 2.2*
121+
122+
Node-RED defines a set of environment variables for exposing information about the nodes, flows and groups.
123+
124+
This information helps "locate" the node in your [workspace](/docs/user-guide/editor/workspace/index.md). Nodes in your workspace exist as part of a [flow](/docs/user-guide/editor/workspace/flows.md). Likewise, a node may (or may not) be part of a [group](/docs/user-guide/editor/workspace/groups.md). Nodes, flows and groups are each given unique IDs that are generated by Node-RED.
125+
126+
Nodes, flows and groups all support the `name` property, which you can change when [editing properties](/docs/user-guide/editor/workspace/nodes.md#editing-node-properties).
127+
128+
The following environment variables can be used to access this information for a given node:
129+
130+
- `NR_NODE_ID` - the ID of the node
131+
- `NR_NODE_NAME` - the Name of the node
132+
- `NR_NODE_NAME` - the Path of the node. This represents a node's position in a flow. It is `/` delimited IDs of the flow, enclosing subflows, and the node.
133+
- `NR_GROUP_ID` - the ID of the containing group
134+
- `NR_GROUP_NAME` - the Name of the containing group
135+
- `NR_FLOW_ID` - the ID of the flow the node is on
136+
- `NR_FLOW_NAME` - the Name of the flow the node is on
97137

138+
Note that while the IDs generated by Node-RED are guaranteed to be unique, the names are not. If a node, flow or group does not have a given name, the corresponding environment variable will be an empty string. If a node is not part of a group, its group id environment variable will also return an empty string.
98139

99140

0 commit comments

Comments
 (0)