Skip to content

Statements

Statements control execution and side effects within blocks.

Quick patterns

  • Use LET for new bindings and SET for mutation.
  • Guard code with IF and TRY/CATCH.
  • FOR EACH iterates collections; comprehensions provide shorthand for arrays.
  • OUTPUT { ... } shapes final payloads.

Output

OUTPUT specifies how results are emitted from the pipeline.

OUTPUT { id: input.id, total: input.total };

Using

USING references adapters and external modules.

Transform

TRANSFORM defines transformation steps. Use OPTIONS { ... } after the signature to declare per-transform settings.

For loops

FOR and FOR EACH iterate over collections.

FOR EACH item IN input.items WHERE item.qty > 0 {
    OUTPUT { name: item.name, qty: item.qty };
}

If statements

IF provides conditional branching.

IF input.enabled {
    OUTPUT { status: "enabled" };
} ELSE {
    OUTPUT { status: "disabled" };
}

Enumerations

ENUM defines enumerated types inside TYPE declarations.

For each shorthand

FOREACH is a shorthand loop form.

Input

INPUT references the pipeline input data.

Abort

ABORT terminates execution immediately.

Throw

THROW raises an error.

Try/Catch

TRY handles errors and exceptions.

TRY {
    OUTPUT { value: input.value };
} CATCH {
    OUTPUT { value: null };
}

Call

CALL invokes host-provided functions.

CALL inventoryService(input) -> payload;

Shared

SHARED declares shared memory resources.

SHARED session MANY;

Functions

FUNC declares reusable functions.

Types

TYPE declares custom types.

Return

RETURN exits from functions.

Modify

MODIFY changes existing values.

Where

WHERE filters loop iterations and comprehensions.

Set/Append/Init

SET, APPEND, TO, and INIT are assignment operations used in loops and shared writes.

Init

INIT provides an initial value when appending to a missing target.