Skip to content

Cyclic flows

A cyclic flow in a Visual Flow Creator refers to a loop within the flow structure where a process, decision or action redirects back to a previous step instead of terminating. This results in a closed-loop system that repeats until a defined exit condition is met.

The "Allow cyclic flows" can be enabled or disabled by using the toggle button at the edit flow tab properties.

Example

To execute a cyclic flows using delay node, follow these steps:

  1. From the node palette, drag and drop the nodes with the respective palette to the working area. Connect the nodes in a flow as shown below:

    Design the flow

  2. Double click on "inject" node to edit the properties. For more information, refer to Editing nodes.

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

    • Enter the "Name" as "Increment".
    • Select the "Language" as "javascript".
    • Enter the "Code" as:

          msg.payload++;
           return msg;
      
    • Click "Done".

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

    • Select the "Action" as "Delay each message".
    • Select the "Fixed delay".
    • Enter the "For" as "2 seconds".

    Note

    If you proceed to save and deploy the flow, a notification will be displayed with the message "Deploy failed: cycles are detected. This can lead to high compute hours consumption!"

  5. Edit the flow tab properties.
    Allow cyclic flows should be enabled.

    Edit flow

  6. Save and execute the flow.

The output will be displayed in the debug tab.

Debug tab


Last update: February 19, 2025