Flow

Overview

Flows enable you to coordinate the execution of multiple steps across several elements. A step can be:

Schedule

You can configure a specific schedule for your flow. When scheduled, the flow executes automatically on the specified days at the specified time.

Execution Mode

Serial

In Serial mode, the flow executes all steps for a single element before moving to the next element. This ensures that each element completes its entire workflow sequentially.

Parallel

In Parallel mode, the flow executes one step across all elements before proceeding to the next step. This allows for simultaneous execution across multiple elements.

Processing Script

The Processing Script allows you to sort and filter the elements that will be used in the flow execution as you wish.

Example

sort_function = lambda x: 1 if x['context']['patroni_leader'] == 'master' else 0
order_flow_elements(elements, sort_function, reverse=False)

This code sorts elements from DESC to ASC based on whether they are "master" or not.

Available Variables and Functions

  1. elements: Contains all elements that match the profile, groups, and filters
  2. order_flow_elements: Sorts elements based on specified criteria (you can use element context)
  3. filter_flow_elements: Filters elements based on specified criteria (you can use element context)

Execution Script

The Execution Script defines which steps will be executed when the flow runs. See Visual Script Editing to learn how to use the visual view.

Special Variables

Custom Steps

Execution Examples

You can combine multiple flows of different execution modes (Serial and Parallel) to achieve more complex logic. When defining a flow execution script, you can pass specific elements to each child flow execution.

Example Scenario

Given 2 elements (E1, E2), 2 flows (F1 & F2), and 5 tasks (A, B, C, D, F):

image.png

Parent Serial - Child Serial

What happens when F1 is Serial and F2 is Serial?

image.png

Parent Serial - Child Parallel

What happens when F1 is Serial and F2 is Parallel?

image.png

Parent Parallel - Child Serial

What happens when F1 is Parallel and F2 is Serial?

image.png

Parent Parallel - Child Parallel

What happens when F1 is Parallel and F2 is Parallel?

image.png


Revision #4
Created 2026-02-13 23:11:12 UTC by ipena@zequenze.com
Updated 2026-04-09 03:28:39 UTC by mauro@zequenze.com