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.
| Parameter | Type | Description |
|---|---|---|
| DisplayName | String | Label shown on the canvas card |
| Body | Activity sequence | Child 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Condition | Boolean Expression | Yes | Expression that evaluates to true or false. Use ${variable} syntax to reference variables. |
| Then | Activity sequence | Yes | Activities executed when condition is true |
| Else | Activity sequence | No | Activities executed when condition is false |
| 1 | // Check if a file exists before reading it |
| 2 | If 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Expression | Any | Yes | Value to match against case labels (supports ${variable}) |
| Cases | List of (value → sequence) | Yes | One or more labelled case branches |
| Default | Activity sequence | No | Runs if no case matches |
| 1 | Switch: {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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Collection | IEnumerable / variable name | Yes | Variable holding the collection to iterate |
| ItemVariable | String | Yes | Variable name that holds the current item in each iteration |
| Body | Activity sequence | Yes | Activities to execute for each item |
| 1 | For 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).
| Parameter | Type | Required | Description |
|---|---|---|---|
| Condition | Boolean Expression | Yes | Loop continues while this evaluates to true |
| Body | Activity sequence | Yes | Activities 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Branches | List of sequences | Yes | 2 or more concurrent branches (added in the designer) |
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.
| Branch | Required | Description |
|---|---|---|
| Try | Yes | Main sequence — activities that may fail |
| Catch | No | Error-handling sequence — runs when an exception is thrown |
| Finally | No | Cleanup sequence — always runs after Try/Catch |
${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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| RetryCount | Int32 | 3 | Maximum number of retry attempts |
| RetryInterval | Int32 (ms) | 1000 | Milliseconds to wait between attempts |
| Body | Activity sequence | — | Activities to retry on failure |
Delay
Pauses workflow execution for a fixed duration in milliseconds.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Milliseconds | Int32 | Yes | Duration 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| WorkflowPath | String | Yes | Path to the .gbw file (absolute or relative to the main workflow) |
| Arguments | Dictionary | No | Input 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Message | String | Yes | Error 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).