Skip to content

Using nodes

Introduction

Nodes are configurable pieces of functionality that processes input data and produce output data. Examples include data processing, complex functions and online services.

The Visual Flow Creator node palette contains a set of node categories for creating flows in the working area. You can view the detailed information of each node in the info window. The info window displays the node type, node ID and other properties which provides the information about the exact use of the node and shows the possible applications using examples. For more information on node categories, refer to Nodes in Visual Flow Creator.

To view the information of a node, select the node in the node palette and click Help. You can view the detailed information of the node in the "Help" window.

Editing nodes

To edit a node, you can drag and drop the node from the node palette to the working area. You can edit the node properties by double-clicking the node in the working area to configure the flow execution. Each node has its specific properties window with different setting options.

The following table describes the states of node:

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

The following graphic shows the flow of nodes in working area:

inject node

To change the properties of the "inject" node in the above example, follow these steps:

  1. From the node palette, drag and drop the "inject" node from the input palette to the working area.
  2. Double click on "inject" node to open the properties window.

    • Enter the "Name".
    • In the "Payload" section, you can select any one of the following options from the dropdown menu and enter the details.
    • Enter the "Topic".
    • In the "Repeat" section, you can select any one of the following options from the dropdown menu.

      edit inject node

      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 the specified 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.
    • Check the box of "Inject once at start?" and "Power Mode" based on your requirement.

      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.

    • To add new property, click property.

    • Click "Done".

Processing input and output data

The "input" and "output" nodes exchange data through messages, which are JSON objects. These messages typically include the "payload" parameter for storing user data. A "msg object" can contain different properties specific to the node. Different nodes may support different properties of the JSON object. For example, the "write timeseries" node utilizes the "Topic" property to access time series data by specifying the asset or aspect or variable combination.

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 format for timeseries. For example, { "_time": "2017-12-27T07:35:45", "pos_X": 112.2 }.

Note

  • The maximum interval that can be specified is approximately 596 hours or 24 days.
  • More than 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" and so on.

Execution duration of the flow

You can get the duration of the complete execution time of the flow displayed under every node which starts or triggers the flow. The 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 then the second flow output will be generated as per the specified delayed time in the delay node.

execution-duration-flow

Basic nodes

The Visual Flow Creator component has the following basic nodes:

Input nodes

Input nodes trigger data flow, each having one output. Use input nodes to supply data from other services, as they generate messages for downstream nodes.

Input nodes Description
catch node This node catches errors while handling a message in a typical flow and handles them with a dedicated flow.
input nodes This node injects a message into a flow either manually or at regular intervals. The message payload can be of various types, including strings, JavaScript objects, or the current time.
http-in node This node creates an HTTP endpoint for web services.

http-in node

You can create an http endpoint for the web services. You can use this node to create an http endpoint for the web services with specified access. You can manage the access key by the "Key Management" in http edit node properties.

Note

  • Endpoint should start with '/'.
  • You cannot send any response without the flow to complete the request.
  • You cannot create the flow in other user flow tab to generate the output.

To create an endpoint and display the timeseries data in the web services, follow these steps:

  1. From the node palette, drag and drop the nodes from the respective palette to the working area.

    • Http-in node
    • Generate node
    • Debug node
  2. Connect the nodes in a flow as shown below:

    access http node

  3. Double click on "http-in" node to edit the properties.

    • Enter the "Name".
    • In the "Method" section, you can select any one of the following options from the dropdown menu.
    • Enter the "Endpoint".
    • In the "Access" section, you can select any one of the following options from the dropdown menu.
    • Click "Done".

      edit http in node

  4. Click menu and select "Key Management" to generate the key.

  5. Enter the endpoint with expiry date and click "Generate key".

    Key management

  6. To generate new key, click generate key.

Note

You can create multiple keys for an endpoint.

You can click the URL link to display the output data in the web services.

Web service

Output nodes

Output nodes send data from the flow to other services or to the debug tab. Each output node has one input. They consume messages and trigger actions, such as sending an HTTP response.

Output Nodes Description
image output This node is used for previewing the results of face detection, object recognition and similar processes.
http response This node sends responses back to requests received from an HTTP input node
debug This node displays the selected message properties in the debug sidebar tab.
flow switch This node allows you to activate or deactivate a Visual Flow Creator tab.

Usage of flow switch node

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

  1. From the node palette, drag and drop the nodes from the respective palette to the working area.

    • Inject node
    • Ui control node
    • Http request node
    • Function node
    • Switch node
    • Flow switch node
  2. Connect the nodes in a flow as shown below:

    design-flow-window

  3. Double click on "http request" node to edit the properties.

    • Enter the "Name".
    • Select the "Method" as "GET".
    • Use Industrial IoT service: Check the option
    • Industrial IoT 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.

  4. Double click on "function" node to edit the properties.

    • Code: msg.payload = !msg.payload.disabled; return msg;
  5. Double click on "switch" node to edit the properties.

    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.

  6. Double click on "flow switch" node to edit the properties.

    edit-flow-switch-node

  7. Save and execute the flow.

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

Activated "Pump" tab

activate-pump-tab

Once the "Pump" flow tab is deactivated, the flows in this tab are disabled from executing.

Deactivated "Pump" tab

deactivate-pump-tab

Usage of image output node

The simple image output node allows you to preview the results of face detection, object recognition and so on. Click image-output-button button of the image output node can be used to enable or disable the image preview. It is recommended (for performance) to disable or remove any Image-Output nodes that are not being used.

You can edit the Image output node properties with the following parameters:

Parameters Description
Property This node expects the selected msg.property (default msg.payload) to contain one of the following formats:
- A base64 encoded string
- A buffer
- A URL to an image
Sending a blank or null payload will remove/hide the preview panel.
Width (1px - 800px) The width (in pixels) of the image needs to be specified to display in the flow.
Resize images on server side When too much data is sent to the browser, the flow editor can become unresponsive.
- When it is activated, the images will be resized (to the specified width) on the server side and then those small thumbnail images will be send to the browser, to reduce the bandwidth.
- When it is de-activated, the (original) large images will be send to the browser. Once the image is arrived to the browser, it will resize the image to the specified width.

To preview the image output using image output node, follow these steps:

  1. From the node palette, drag and drop the nodes from the respective palette to the working area.

    • Two inject nodes
    • Http request node
    • Image output node
  2. Connect the nodes in a flow as shown below:

    image-output-flow

  3. Double click on first "inject" node to edit the properties and enter the URL as a string value.

    • Payload(string) example URL: https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Siemens-logo.svg/250px-Siemens-logo.svg.png
  4. Double click on the second "inject" node to edit the properties and set the payload value as timestamp.

  5. Double click on the second "http request" node to edit the properties.

    • Enter the example URL: https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Siemens-logo.svg/250px-Siemens-logo.svg.png
    • Return: Select "a binary buffer" from the drop-down.
  6. Double click on the second "image output" node to edit the properties.

    • Enter the "Name".
    • Enter the "Property" as msg.payload.
    • Enter the "Width (1px - 800px)" as 250.
    • Resize images on server side - Uncheck for "first" flow and check for "second" flow to reduce the bandwidth.
    • Click "Done".
  7. Save and execute the flow.

    edit-image-output-node

When you execute the "first" flow for multiple times, it will preview the same image as the result if the URL consists of multiple images.

image-output-first-preview

When you execute the "second" flow for multiple times, it will preview the different image as the result if the URL consists of multiple images.

image-output-second-preview

For both the flows "first" and "second", when you click on the image preview then it will be disappeared.

Junction nodes

Junction node allows you to combine the multiple wires which are connected to multiple nodes. To insert the junction, "Right-click" on the work area and click "Insert junction".

junction-node-right-click

Junction node is displayed as shown below:

junction-node

The following example displays the usage of the junction node:

junction-node-flow


Last update: December 13, 2024