DRAGOPS
DRAGOPS
DocumentationNode libraryFlow Control

Flow Control

Branching, loops, error handling, delays, and execution routing nodes.

Flow Control nodes determine how execution moves through your pattern. They handle branching, iteration, error handling, timing, and parallel execution. Most Flow Control nodes have an orange header (flow category), though Call Pattern has a green header (action category).

All Flow Control nodes are impure — they have execution pins that control sequencing.


Branch

If/else branching based on a boolean condition.

PinDirectionTypeDescription
ExecInputExecTriggers the branch
ConditionInputBooleanThe condition to evaluate
TrueOutputExecFires when condition is true
FalseOutputExecFires when condition is false

Impure. Use Branch to route execution based on any boolean value — API response status, string comparison, null check.


Switch

Multi-way branch that matches a value against multiple cases.

PinDirectionTypeDescription
ExecInputExecTriggers the switch
ValueInputAnyThe value to match against
Case 0OutputExecFires when value matches Case 0
Case 1OutputExecFires when value matches Case 1
Case 2OutputExecFires when value matches Case 2
DefaultOutputExecFires when no case matches

Cases are configurable — you can add or remove them in the Inspector Panel. Each case has an associated value to match against.

Impure. Use Switch to route execution based on string or numeric values, like HTTP status codes or event types.


For Each

Iterate over a collection, executing the body once per element.

PinDirectionTypeDescription
ExecInputExecStarts the loop
CollectionInputArrayThe array to iterate over
BodyOutputExecFires once per element
CompletedOutputExecFires after all elements are processed
ItemOutputAnyThe current element
IndexOutputIntegerThe current index (zero-based)

Impure. Use For Each to process arrays of alerts, IP addresses, user records, or any collection.


For Range

Loop through a numeric range with configurable start, end, and step.

PinDirectionTypeDescription
ExecInputExecStarts the loop
StartInputIntegerStarting value (default: 0)
EndInputIntegerEnding value (default: 10)
StepInputIntegerIncrement per iteration (default: 1)
BodyOutputExecFires once per step
CompletedOutputExecFires after the range is exhausted
IndexOutputIntegerThe current counter value

Impure. Use For Range for counted loops — paginating through API results, processing numbered batches.


While

Loop while a condition remains true.

PinDirectionTypeDescription
ExecInputExecStarts the loop
ConditionInputBooleanContinue while true
BodyOutputExecFires each iteration
CompletedOutputExecFires when condition becomes false

Impure. Use While for loops where the iteration count is unknown — polling until a resource is ready.


Do While

Execute the body first, then check the condition. Guarantees at least one iteration.

PinDirectionTypeDescription
ExecInputExecStarts the loop
ConditionInputBooleanContinue while true
BodyOutputExecFires each iteration
CompletedOutputExecFires when condition becomes false

Impure. Use Do While when you need the loop body to run at least once before checking the exit condition.


Sequence

Fire multiple execution outputs in order. Each output runs to completion before the next begins.

PinDirectionTypeDescription
ExecInputExecTriggers the sequence
Then 0OutputExecFirst branch
Then 1OutputExecSecond branch
Then 2OutputExecThird branch
Then 3OutputExecFourth branch

Impure. Use Sequence to run independent tasks in order from a single entry point — fetch data, then process, then send notification.


Try / Catch

Structured error handling with try, catch, and finally blocks.

PinDirectionTypeDescription
ExecInputExecEnters the try block
TryOutputExecThe guarded execution path
CatchOutputExecFires if an error occurs in Try
FinallyOutputExecAlways fires after Try or Catch
ErrorOutputObjectError details (message, type, status)

Impure. Use Try / Catch around HTTP requests or other operations that may fail, so you can handle errors gracefully.


Retry

Retry a block with exponential backoff on failure.

PinDirectionTypeDescription
ExecInputExecStarts the retry loop
Max AttemptsInputIntegerMaximum number of attempts (default: 3)
Delay (s)InputFloatInitial delay between attempts (default: 1)
Backoff MultiplierInputFloatMultiply delay after each attempt (default: 2)
BodyOutputExecThe block to retry
SuccessOutputExecFires if the body completes without error
FailureOutputExecFires after all attempts are exhausted
AttemptOutputIntegerCurrent attempt number

Impure. Use Retry to wrap flaky API calls or transient operations that may succeed on a subsequent attempt.


Timeout

Execute a block with a time limit. Routes to Completed or Timed Out based on whether the body finishes in time.

PinDirectionTypeDescription
ExecInputExecStarts the timed block
SecondsInputFloatMaximum time allowed (default: 30)
BodyOutputExecThe guarded block
CompletedOutputExecFires if the body finishes in time
Timed OutOutputExecFires if the deadline is exceeded

Impure. Use Timeout to prevent long-running operations from blocking your pattern indefinitely.


Delay

Pause execution for a specified number of seconds.

PinDirectionTypeDescription
ExecInputExecTriggers the delay
SecondsInputFloatDuration to pause (default: 1)
ExecOutputExecFires after the delay

Impure. Use Delay for rate limiting, waiting for external systems to process, or spacing out API calls.


Gate

Stateful gate that only passes execution when open. Use the Open, Close, and Toggle pins to control its state.

PinDirectionTypeDescription
OpenInputExecOpens the gate
CloseInputExecCloses the gate
ToggleInputExecToggles the gate state
EnterInputExecAttempts to pass through
ExitOutputExecFires if the gate is open when Enter fires
Is OpenOutputBooleanCurrent gate state

Impure. Use Gate to conditionally block or allow execution paths based on runtime state.


Do Once

Execute the downstream path only the first time. Subsequent calls route to Already Done.

PinDirectionTypeDescription
ExecInputExecTriggers the node
ExecOutputExecFires the first time only
Already DoneOutputExecFires on subsequent calls

Impure. Use Do Once for one-time initialization inside loops or repeated event handlers.


Merge

Join two execution branches into a single output.

PinDirectionTypeDescription
AInputExecFirst branch
BInputExecSecond branch
ExecOutputExecFires when either branch completes

Impure. Use Merge to reconverge after a Branch or Switch before continuing to shared logic.


Filter Guard

Continue execution only if a condition is true. Otherwise route to the Reject path.

PinDirectionTypeDescription
ExecInputExecTriggers the guard
ConditionInputBooleanThe condition to check
PassOutputExecFires when condition is true
RejectOutputExecFires when condition is false

Impure. Use Filter Guard for early-exit patterns — stop processing if a prerequisite is not met.


Break

Exit the current loop immediately.

PinDirectionTypeDescription
ExecInputExecTriggers the break

Impure. Use Break inside a For Each, For Range, or While loop to stop iteration early.


Continue

Skip the rest of the current loop iteration and advance to the next one.

PinDirectionTypeDescription
ExecInputExecTriggers the skip

Impure. Use Continue inside a loop to skip elements that do not meet a condition.


Return

Exit the current function and optionally return a value.

PinDirectionTypeDescription
ExecInputExecTriggers the return
ValueInputAnyThe value to return

Impure. Use Return to end a function early or to pass a result back to the calling pattern.


Throw Error

Raise an error with a custom message. This interrupts normal execution and can be caught by Try / Catch or On Error.

PinDirectionTypeDescription
ExecInputExecTriggers the error
MessageInputStringError message text

Impure. Use Throw Error to signal failure conditions that upstream handlers should deal with.


Batch Process

Process an array in fixed-size chunks with an optional delay between batches.

PinDirectionTypeDescription
ExecInputExecStarts processing
ItemsInputArrayThe full array to process
Batch SizeInputIntegerElements per batch (default: 10)
Delay Between (s)InputFloatPause between batches (default: 0)
BatchOutputExecFires once per batch
CompletedOutputExecFires after all batches are processed
Current BatchOutputArrayThe current chunk of items

Impure. Use Batch Process to send bulk API requests in manageable chunks without overwhelming rate limits.


For Each Parallel

Iterate over a collection concurrently. Each element runs in parallel, up to a configurable concurrency limit.

PinDirectionTypeDescription
ExecInputExecStarts the parallel loop
CollectionInputArrayThe array to iterate over
Throttle LimitInputIntegerMax concurrent iterations (default: 5)
BodyOutputExecFires once per element (concurrently)
CompletedOutputExecFires after all elements finish
ItemOutputAnyThe current element

Impure. Use For Each Parallel to speed up independent operations like enriching a list of IP addresses or checking multiple endpoints simultaneously.


Throttle

Iterate over a collection with a controlled delay between each item.

PinDirectionTypeDescription
ExecInputExecStarts the throttled loop
CollectionInputArrayThe array to iterate over
Interval (s)InputFloatDelay between each item (default: 1)
BodyOutputExecFires once per element
CompletedOutputExecFires after all elements are processed
ItemOutputAnyThe current element
IndexOutputIntegerThe current index (zero-based)

Impure. Use Throttle to respect API rate limits by spacing out requests at a fixed interval.


Call Pattern

Execute another deployed pattern and return its result.

PinDirectionTypeDescription
ExecInputExecTriggers the call
Pattern IDInputStringThe deployment ID of the pattern to call
InputInputObjectData to pass to the called pattern
ExecOutputExecFires when the called pattern completes
ResultOutputAnyThe return value from the called pattern

Impure. Use Call Pattern to break large automations into reusable sub-patterns — an enrichment pattern, a notification pattern, or a shared validation step.


  • Events — triggers that start execution before flow control takes over
  • Comparison — produce boolean values for Branch and Filter Guard conditions
  • Logical — combine conditions with AND, OR, NOT before branching

On this page