Skip to content

Execution safety net

A misbuilt sub-workflow or iteration can loop forever. In Floogos that no longer freezes the platform: six layered defenses detect recursion, set a hard limit and abort the run in seconds — with no process restarts and no impact on anyone else.
6
layered defenses against loops and recursion
0
process restarts needed to recover the queue
seconds
to abort a recursion — not minutes, not “never”
10
max nesting levels (configurable)

The problem it solves. You’re building a flow and, while testing it, a Sub Workflow that calls itself (or a badly built iteration) enters an infinite loop. With no defenses, that execution never yields: it holds a worker slot forever and, with a few loops, the queue freezes. The safety net makes sure you never reach that point.

The six defenses

They act in layers: if one doesn’t reach, the next one cuts

1 · Anti-recursion

If a workflow ends up calling itself (A → B → A), Floogos detects it at runtime and aborts with a clear message showing the chain that caused the cycle. No infinite descent.

2 · Depth cap

Sub-workflow nesting is bounded (10 levels by default). Past that limit the execution stops with an explicit error instead of growing without control.

3 · Tree-wide cancellation

The Stop button now halts the children too. Cancelling the execution you see in the editor cuts the whole sub-workflow tree, not just the top level.

4 · Node budget

A count of executed nodes catches cyclic chains (a node pointing backwards) even when the clock hasn’t run out. Past the budget, the execution is marked failed.

5 · Execution deadline

Every execution has an effective time limit. On expiry the engine cuts cleanly between nodes and records the error for diagnosis.

6 · Worker watchdog

The final backstop: if a node never yields, the worker releases its slot on timeout. The queue keeps flowing even if one execution gets stuck — with no process restarts.

How to stop a runaway execution

Three ways, from the simplest to the last-resort backstop

The «Stop» button

In the editor, during a run, the stop control cancels the whole tree. The engine cuts at the next safe point between nodes and marks the instance as cancelled.

It stops itself

Recursion, depth cap, node budget or deadline: any of the four aborts the run on its own, with no intervention, and leaves the reason in the trace.

Automatic watchdog

If none of the above reaches (a node that won’t yield), the worker releases its slot on timeout. No need to touch the infrastructure: the queue never freezes.

Available settings

All with a safe default; tuned via environment variables

SettingDefaultWhat it controls
SUBWORKFLOW_MAX_DEPTH10Maximum sub-workflow nesting levels.
WORKFLOW_MAX_NODE_EXECUTIONS10000Node-execution budget per run (catches cycles).
WORKFLOW_MAX_EXECUTION_SEC—Maximum execution time for all flows. 0 = no limit.
WORKFLOW_DEFAULT_EXECUTION_SEC3600Default maximum time (1 hour) when nothing else is defined.
WORKER_JOB_TIMEOUT_MS600000Hard worker timeout (releases the slot).
DLQ_SKIP_MANUALfalseWhen on, manual runs don’t retry on failure.

Design without fear of loops

The safety net is the backstop, not the plan. The best execution is the one that never runs away: learn to chain sub-workflows without creating cycles.

Sub Workflow best practices →