Skip to content

Commit 53cc501

Browse files
committed
Add core nodes page to user guide
1 parent bdd109d commit 53cc501

9 files changed

Lines changed: 134 additions & 7 deletions

File tree

_includes/user-guide-toc.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@
44
<li class="tocheader">
55
<ul>
66
<li class="toctitle active"><a href="/docs/user-guide/">User Guide</a></li>
7+
<li {% if page.url contains "/docs/user-guide/projects/" %}class="active"{% endif %}><a href="/docs/user-guide/projects/">Working with projects</a></li>
8+
<li {% if page.url == "/docs/user-guide/nodes" %}class="active"{% endif %}><a href="/docs/user-guide/nodes">The core nodes</a></li>
9+
<li {% if page.url == "/docs/writing-functions" %}class="active"{% endif %}><a href="/docs/writing-functions">Writing Functions</a></li>
10+
<li {% if page.url == "/docs/user-guide/messages" %}class="active"{% endif %}><a href="/docs/user-guide/messages">Working with messages</a></li>
11+
</ul>
12+
</li>
13+
<li class="tocheader">
14+
<ul>
15+
<li class="toctitle"><span>Running Node-RED</span></li>
716
<li {% if page.url == "/docs/configuration" %}class="active"{% endif %}><a href="/docs/configuration">Configuration</a></li>
817
<li {% if page.url == "/docs/security" %}class="active"{% endif %}><a href="/docs/security">Security</a></li>
918
<li {% if page.url == "/docs/user-guide/logging" %}class="active"{% endif %}><a href="/docs/user-guide/logging">Logging</a></li>
10-
<li {% if page.url contains "/docs/user-guide/projects/" %}class="active"{% endif %}><a href="/docs/user-guide/projects/">Working with projects</a></li>
1119
<li {% if page.url == "/docs/node-red-admin" %}class="active"{% endif %}><a href="/docs/node-red-admin">Command-line Admin</a></li>
12-
<li {% if page.url == "/docs/writing-functions" %}class="active"{% endif %}><a href="/docs/writing-functions">Writing Functions</a></li>
13-
<li {% if page.url == "/docs/user-guide/messages" %}class="active"{% endif %}><a href="/docs/user-guide/messages">Working with messages</a></li>
20+
</ul>
21+
</li>
22+
<li class="tocheader">
23+
<ul>
24+
<li class="toctitle"><span>Advanced</span></li>
1425
<li {% if page.url == "/docs/embedding" %}class="active"{% endif %}><a href="/docs/embedding">Embedding into an existing app</a></li>
1526
</ul>
1627
</li>
6.81 KB
Loading
4.73 KB
Loading
5.38 KB
Loading
5.42 KB
Loading
6.04 KB
Loading

docs/user-guide/index.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,25 @@ title: User Guide
66

77
There's lots more to write in this guide, we're just getting started.
88

9+
#### Using Node-RED
10+
11+
- [Working with projects](/docs/user-guide/projects)
12+
- [The core nodes](/docs/user-guide/nodes)
13+
- [Writing Functions](/docs/writing-functions)
14+
- [Working with messages](/docs/user-guide/messages)
15+
16+
#### Running Node-RED
17+
918
- [Configuring Node-RED](/docs/configuration)
1019
- [Security](/docs/security)
1120
- [Logging](/docs/user-guide/logging)
12-
- [Working with projects](/docs/user-guide/projects)
1321
- [Command-line Admin](/docs/node-red-admin)
14-
- [Using the Function node](/docs/writing-functions)
15-
- [Working with messages](/docs/user-guide/messages)
22+
23+
#### Advanced
24+
1625
- [Embedding into an existing app](/docs/embedding)
1726

27+
1828
<div class="doc-callout">
1929
<em>Note</em>: Parts of the user guide assume the reader is somewhat familiar with
2030
<strong>JavaScript</strong> (not Java). There are many online resources to get up

docs/user-guide/nodes.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
layout: docs
3+
toc: user-guide-toc.html
4+
title: The Core Nodes
5+
---
6+
7+
The Node-RED palette includes a default set of nodes that are the basic building
8+
blocks for creating flows. This page highlights the core set you should know about.
9+
10+
All nodes include documentation you can see in the Info sidebar tab when you select a node.
11+
12+
- [Inject](#inject)
13+
- [Debug](#debug)
14+
- [Function](#function)
15+
- [Change](#change)
16+
- [Switch](#switch)
17+
18+
***
19+
20+
<h3 id="inject"><img alt="Inject node" style="vertical-align: middle" src="/docs/user-guide/images/node_inject.png" width="169px"></h3>
21+
22+
The Inject node can be used to manual trigger a flow by clicking the node's button
23+
within the editor. It can also be used to automatically trigger flows at regular
24+
intervals.
25+
26+
The message sent by the Inject node can have its `payload` and `topic` properties
27+
set.
28+
29+
The `payload` can be set to a variety of different types:
30+
31+
- a flow or global context property value
32+
- a String, number, boolean, Buffer or Object
33+
- a Timestamp in milliseconds since January 1st, 1970
34+
35+
***
36+
37+
<h3 id="debug"><img alt="Debug node" style="vertical-align: middle" src="/docs/user-guide/images/node_debug.png" width="169px"></h3>
38+
39+
The Debug node can be used to display messages in the Debug sidebar within the editor.
40+
41+
The sidebar provides a structured view of the messages it is sent, making it easier
42+
to explore the message.
43+
44+
Alongside each message, the debug sidebar includes information about the time the message
45+
was received and which Debug node sent it. Clicking on the source node id will reveal
46+
that node within the workspace.
47+
48+
The button on the node can be used to enable or disable its output. It is recommended
49+
to disable or remove any Debug nodes that are not being used.
50+
51+
The node can also be configured to send all messages to the runtime log, or to
52+
send short (32 characters) to the status text under the debug node.
53+
54+
The page on [Working with messages](/docs/user-guide/messages) gives more
55+
information about using the Debug sidebar.
56+
57+
***
58+
59+
<h3 id="function"><img alt="Function node" style="vertical-align: middle" src="/docs/user-guide/images/node_function.png" width="169px"></h3>
60+
61+
The Function node allows JavaScript code to be run against the messages that are
62+
passed through it.
63+
64+
A complete guide for using the Function node is available [here](/docs/writing-functions).
65+
66+
***
67+
68+
<h3 id="change"><img alt="Change node" style="vertical-align: middle" src="/docs/user-guide/images/node_change.png" width="169px"></h3>
69+
70+
The Change node can be used to modify a message's properties and set context properties
71+
without having to resort to a Function node.
72+
73+
Each node can be configured with multiple operations that are applied in order. The
74+
available operations are:
75+
76+
- **Set** - set a property. The value can be a variety of different types, or
77+
can be taken from an existing message or context property.
78+
- **Change** - search and replace parts of a message property.
79+
- **Move** - move or rename a property.
80+
- **Delete** - delete a property.
81+
82+
When setting a property, the value can also be the result of a [JSONata expression](https://jsonata.org).
83+
JSONata is a declarative query and transformation language for JSON data.
84+
85+
***
86+
87+
<h3 id="switch"><img alt="Switch node" style="vertical-align: middle" src="/docs/user-guide/images/node_switch.png" width="169px"></h3>
88+
89+
The Switch node allows messages to be routed to different branches of a flow by
90+
evaluating a set of rules against each message.
91+
92+
The node is configured with the property to test - which can be either a message
93+
property or a context property.
94+
95+
There are four types of rule:
96+
97+
- **Value** rules are evaluated against the configured property
98+
- **Sequence** rules can be used on message sequences, such as those generated
99+
by the Split node
100+
- A JSONata **Expression** can be provided that will be evaluated against the
101+
whole message and will match if the expression returns a `true` value.
102+
- An **Otherwise** rule can be used to match if none of the preceding rules have
103+
matched.
104+
105+
The node will route a message to all outputs corresponding to matching rules. But
106+
it can also be configured to stop evaluating rules when it finds one that matches.

docs/writing-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Writing Functions
55
---
66

77
The Function node allows JavaScript code to be run against the messages that are
8-
passed in and then return zero or more messages to continue the flow.
8+
passed through it.
99

1010
The message is passed in as an object called `msg`. By convention it will
1111
have a `msg.payload` property containing the body of the message.

0 commit comments

Comments
 (0)