Skip to content

Using nodes

Introduction to nodes

Definition

Nodes are configurable pieces of functionality that can process input data and produce output data. Examples range from data processing to complex functions and online services.

Categories

Visual Flow Creator palette contains set of node categories to create the flows in the working area.

It provides the following node categories:

  • Basic nodes
    • Input
    • Output
  • Mindsphere nodes
  • Function nodes
  • Analytics nodes
  • Storage nodes
  • Array nodes
  • Simple anomaly nodes
  • MDSP Dashboard nodes
  • Dashboard nodes
  • Custom nodes

Note

Region deviation

Support for "Simple Anomaly nodes", "MDSP Dashboard nodes", "Dashboard nodes" and "Custom nodes" are in progress for Region Europe 2.

Node information

Within the program user interface, you receive detailed information for each node in the info window. The info window displays the node type and the node ID for each node and other properties. The info window provides information about the exact use of the node and shows the possible applications using examples.

To view the information for a node, click the node in the "Node palette" and open the "info" tab in the info window.

Edit nodes

You can edit or change the properties of the nodes as per the configuration to execute the flow in the Visual Flow Creator.

In order to use a node, you must move it from the node palette to the working area using dragand-drop.

The following table shows the various node states:

Range - The blue circle identifies nodes that have not yet been saved.
- The red triangle indicates missing inputs or errors in the node properties.
- The text below the node shows status and error messages.

You can edit the node in the properties window, e.g. in order to change the name of the node. Each node has its specific properties window with different setting options. To open the properties window of a node, double-click a node placed on the working area.

The following graphic shows the properties window of the "inject" node:

Properties of inject node

inject node

Warning

Power Mode

In this mode, the flow runs up to 120 seconds for the heavy execution and the compute hours is calculated 2.5 times more than the normal execution. This mode is available for every node which is used to trigger and msg._powerMode.

Repeat Description
None In this mode, the node gets triggered only by clicking on its button.
It will not be triggered automatically
Interval In this mode, the node can be configured to trigger and repeat until the specified end time. The node will be automatically terminated after reaching end time. The interval time units can be specified in seconds, minutes, hours or infinite. If required, choose "Start next execution time" parameter to display the next execution time for every execution. For example, the node can be configured to trigger at every 10 seconds with the specified end time to terminate the execution automatically.
Interval between times In this mode, the node can be configured to trigger and repeat automatically in between thespecified time on the specified days of the week. The interval time units can be specified in seconds, minutes or hours. For example, the node can be configured to trigger at every 1 minute in between the time 11am to 12pm of the weekday.
At a specific time In this mode, the node can be configured to trigger and repeat automatically at a specified time on the specified days of the week. For example, the node can be configured to trigger once at 12pm of the weekday.

Processing input and output data

"input" and "output" nodes exchange data through messages. The messages themselves are JSON objects. They generally contain the "payload" parameter, which can be used for storing user data. A "msg object" can contain different properties of the "node properties". Different nodes may support different properties of the JSON object. For example, the "write timeseries" node uses the "Topic" property in order to retrieve the asset/ aspect/ variable-combination which it uses to access time series data.

The most often referred property is the "payload" property. Data can be of different types such as String, Array of structure mapping JavaScript objects and others.

For processing time series data, Visual Flow Creator uses the default MindSphere format for timeseries. E.g.: { "_time": "2017-12-27T07:35:45", "pos_X": 112.2 }.

You can inject the input node at different intervals by using the "Repeat" element. The following options are available:

  • interval: You can trigger to repeat every time as per the specified time interval.
  • interval between time: You can trigger to repeat in between the specified time interval.
  • at a specfic time: You can trigger to repeat at a specific time interval.

Note

  • The maximum interval that can be specified is about 596 hours / 24 days.
  • <10 seconds time interval triggers can lead to high consumption of available compute hours.

Dynamic message properties

In Visual Flow Creator function nodes, the user has full control over the message including its message properties like "Topic" etc.

Execution duration of the flow

With this information, you get the duration of the complete execution time of the flow displayed under every node which starts/triggers the flow. Maximum execution time limit for a flow is 30 seconds, except the flow with power mode execution time limit is up to 120 seconds. In the below example, the execution time for the first flow output will be generated and thereafter the second flow output will be generated as per the specified delayed time in the delay node.

Execution duration of the flow

Uses of basic nodes

The Visual Flow Creator component has the following basic nodes:

  • Input nodes
  • Output nodes

Input nodes

Input nodes trigger data to the flow. Each input node has one output. Use input nodes to supply data from other services. They generate messages for downstream nodes.

Input nodes - Shows an input node
- The blue button on the left triggers the input node

Output nodes

Output nodes send the data from the flow to other services or to the debug tab. Output nodes have one input. They consume the messages and trigger an action (for example sending an http response).

Debug - Shows an output node
- The green button on the right deactivates or activates the output node

Uses of function-nodes

Function-nodes

Function nodes process the incoming data within a flow. You can modify and convert data with function nodes. You can also use your own JavaScript code within a function node.

Function node - Shows a function node
- Each function node can have multiple outputs.
- You can change the number of inputs and outputs in the node properties

You define the specific mode of operation and the parameter processing in the properties window of a function node. The processing of the functions is set using parameters. The function node provides a text box for entering the JavaScript code. You can also import saved JavaScript code using your own library. Asynchronous code is not supported (e.g. Promises).

You can use function node in between the input and output node to run JavaScript code with a return message. You can add your JavaScript code to the funtion nodes to execute the flow.

Note

If you don’t return a message then the flow will be stopped.

In Node-RED the information from one node to another is passed as an object called "msg". You can connect a debug node to the output of a function node and use "msg.payload" as the "Output" value in order to display the message contents of the payload to the debug tab.

You can find more information in section writing functions in the Node-RED documentation.

Note

Unsupported functions

Visual Flow Creator does not support the following functions:

  • setTimeout
  • clearTimeout
  • setInterval
  • clearInterval
  • setImmediate

Uses of flow switch node

The Flow Switch node allows you to activate or deactivate a Visual Flow Creator flow tab.

Example

To activate or deactivate a Visual Flow Creator flow tab, follow these steps:

  1. Design the flow as shown below:

    Design the flow

  2. Edit http request node properties:

    • Method: GET
    • Use MindSphere service: Check the option
    • MindSphere path: /api/vfc/v3/flows/projects/0/tabs/8888a447.745cc8?user=steve@email.com

    Note

    "8888a447.745cc8" is a flow tab unique ID for the selected tab. This unique ID of the selected tab is available in Visual Flow Creator URL.

  3. Edit function node properties:
    • Code: msg.payload = !msg.payload.disabled; return msg;
  4. Edit switch node properties:

    Edit switch node

  5. Edit flow switch node properties:

    Edit flow switch node

  6. Save and execute the flow.

Result

To view the output, activate and deactivate Visual Flow Creator flow tab by using toggle button in the dashboard. After activating or deactivating the toggle button in the dashboard, refresh Visual Flow Creator editor page to view the output.

Activated "Pump" tab

Activate pump tab

Deactivated "Pump" tab

Deactivated pump tab

After "Pump" flow tab is deactivated, the flows are disabled to execute under this tab.

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.


Last update: April 29, 2022