← All docs
05 · DOCUMENTATION

Logic & code

Branching, loops, Try/Catch, and the JavaScript sandbox — the real engine.

OpFlow ships a genuine engine, not a linear step-runner. The logic and code nodes are where that shows.

Branching

If routes down a true/false path; Switch routes down as many named paths as the flow needs. Filter halts items that don't match a condition.

Loops

Iterate over an array — the whole array at once (Batch) or one item at a time (Bundle). Configure the items source, the loop variable, and a max. This is where OpFlow's dual execution model lives: set Batch or Bundle per workflow, and override it per node.

Loop fan-out currently runs downstream edges sequentially in edge order. True parallel concurrency is on the roadmap — don't rely on parallel execution yet.

Try / Catch

Guard a whole branch. Try/Catch retries before the catch runs (retry_count, retry_delay_ms), so transient failures self-heal and only real failures fall through to your error handling.

Code

  • Code node — run sandboxed JavaScript against the live input and return a value downstream.
  • AI-written code — describe the step in plain English and the JavaScript is written fresh on each run, shaped to the actual data.
  • Set / Edit fields, Delay, and Log round out the utility nodes.

AI node

Claude-backed by default (Anthropic API). Ask for plain text (generate_text) or forced-JSON (generate_json) that drops straight into the flow as structured data.