~4 min2 / 12

Flow Control Activities

Flow Control activities define the execution path of a workflow — branching on conditions, iterating over collections, handling errors, and composing sub-workflows. These are the backbone of every automation: Sequence, If, Else If, Switch, For Each, While, Do While, Break, Continue, Parallel, Try Catch, Retry, Delay, Invoke Workflow, Throw, Rethrow, Comment.

Sequence

A grouping container with no execution logic of its own. Use it to visually organise related activities and create named sections inside a workflow. Sequences can be collapsed in the designer canvas to reduce visual clutter.

ParameterTypeDescription
DisplayNameStringLabel shown on the canvas card
BodyActivity sequenceChild activities to execute in order

If / Else If

If evaluates a boolean condition and executes the Then or Else branch accordingly. Chain Else If activities inside the Else branch for multi-condition trees.

ParameterTypeRequiredDescription
ConditionBoolean ExpressionYesExpression that evaluates to true or false. Use ${variable} syntax to reference variables.
ThenActivity sequenceYesActivities executed when condition is true
ElseActivity sequenceNoActivities executed when condition is false
workflow
1// Check if a file exists before reading it
2If Condition="${fileExists}"
3 Then:
4 Excel Read Range ...
5 Else:
6 Log Message: "File not found, skipping"

Switch

Multi-branch selector — evaluates an expression and matches it against case labels. Each case has its own activity sequence. A Default case handles unmatched values.

ParameterTypeRequiredDescription
ExpressionAnyYesValue to match against case labels (supports ${variable})
CasesList of (value → sequence)YesOne or more labelled case branches
DefaultActivity sequenceNoRuns if no case matches
workflow
1Switch: {orderStatus{"}"}
2 Case "Pending": Send SMTP Email ...
3 Case "Shipped": Excel Set Cell Value ...
4 Case "Cancelled": Log Message: "Order cancelled"
5 Default: Log Message: "Unknown status"

For Each

Iterates over each item in a collection — StringArray, Int32Array, List, or DataTable. Use For Each Row (in the Data category) when iterating a DataTable row-by-row.

ParameterTypeRequiredDescription
CollectionIEnumerable / variable nameYesVariable holding the collection to iterate
ItemVariableStringYesVariable name that holds the current item in each iteration
BodyActivity sequenceYesActivities to execute for each item
workflow
1For Each: itemVar="row" Collection="${invoiceTable}"
2 Body:
3 Type Into: Selector=... Text="${row["InvoiceNo"]}"
4 Click: Selector=...

While / Do While

While checks the condition before each iteration (may run 0 times). Do While checks the condition after each iteration (always runs at least once).

ParameterTypeRequiredDescription
ConditionBoolean ExpressionYesLoop continues while this evaluates to true
BodyActivity sequenceYesActivities executed each iteration

Break / Continue

Use inside For Each, While, or Do While loops. Break exits the loop immediately. Continue skips to the next iteration. Neither activity has parameters.

Parallel

Runs two or more activity sequences concurrently. The workflow waits until all branches complete before continuing.

ParameterTypeRequiredDescription
BranchesList of sequencesYes2 or more concurrent branches (added in the designer)
Parallel and UIDo not run parallel branches that both interact with the same UI window — they will interfere with each other. Parallel is best for independent I/O tasks (file reads, HTTP calls, Excel operations on separate files, etc.).

Try Catch

Wraps a sequence in error-handling logic. If any activity in the Try block throws, execution jumps to the Catch block. The Finally block always runs regardless of success or failure.

BranchRequiredDescription
TryYesMain sequence — activities that may fail
CatchNoError-handling sequence — runs when an exception is thrown
FinallyNoCleanup sequence — always runs after Try/Catch
Exception variableIn the Catch branch, the special variable ${exception} holds the error message from the caught exception. Use it in a Log or Message Box to surface the error details.

Retry

Wraps a sequence and automatically re-executes it on failure, up to a configurable number of times with an optional delay between attempts.

ParameterTypeDefaultDescription
RetryCountInt323Maximum number of retry attempts
RetryIntervalInt32 (ms)1000Milliseconds to wait between attempts
BodyActivity sequenceActivities to retry on failure

Delay

Pauses workflow execution for a fixed duration in milliseconds.

ParameterTypeRequiredDescription
MillisecondsInt32YesDuration to pause (e.g., 2000 = 2 seconds)

Invoke Workflow

Calls another saved .gbw workflow file as a sub-workflow. The called workflow runs synchronously inside the current execution. Use this to build reusable workflow components.

ParameterTypeRequiredDescription
WorkflowPathStringYesPath to the .gbw file (absolute or relative to the main workflow)
ArgumentsDictionaryNoInput arguments to pass to the sub-workflow's Arguments (In/InOut)

Throw

Manually raises an exception to halt execution or trigger a surrounding Try Catch.

ParameterTypeRequiredDescription
MessageStringYesError message to include in the exception

Rethrow

Use inside a Catch block to re-raise the caught exception to the next outer error handler. No parameters.

Comment

A non-executing annotation block. Use it to add notes, documentation, or temporary disable-markers inside a workflow. Has a single Text parameter (String).

Was this helpful?