Node Engine Lifecycle
A complete walkthrough of how BizFirst executes a workflow — from the moment a process is triggered to the final output of each node. Four nested layers, each with a single responsibility, each explained from the outside in.
The Four-Layer Hierarchy
Every workflow execution in BizFirst flows through four nested layers. Understanding what each layer owns makes the entire engine predictable and debuggable.
1 · Process
The top-level container. Coordinates one or more threads. Manages top-level state and represents a complete business workflow from trigger to completion.
Read more →2 · Thread
A sequential execution path within a process. Contains an ordered graph of nodes. Owns the ExecutionMemory that flows between nodes.
Read more →3 · Element
A single node instance in the thread. Responsible for config resolution, expression evaluation (Tier 1 & 2), validation, and dispatching to the executor.
Read more →4 · Node Executor
The business logic. Runs through a structured 8-stage lifecycle: Entry → Validate → Guard → PreProcess → Process → PostProcess → Guard → Exit.
Read more →Key Concepts Before You Start
Execution Context Objects
Every layer carries a typed execution context object that accumulates state as execution progresses.
| Layer | Context Type | What It Carries |
|---|---|---|
| Process | ProcessExecutionContext | ExecutorID, state, timing, accumulated thread outputs |
| Thread | ProcessThreadExecutionContext | ExecutionMemory, node counts, stack state |
| Element | ProcessElementExecutionContext | ElementDefinition, ResolvedConfig, InputData, OutputData, ConnectorData |
| Node | NodeExecutionContext | ElementExecutionContext (reference), RuntimeInfo, result |
The Execution Stack
The thread execution loop is stack-based, not recursive. When a node completes, its downstream nodes (determined by the output port key) are pushed onto the stack. The loop pops and executes until the stack is empty. This design enables:
- Parallel lanes — multiple nodes executing conceptually in parallel within a single thread
- Pause/resume — the stack is serialized to the database and restored on resume
- Loops — loop nodes push themselves back onto the stack
- Try-catch-finally — exception routing pushes catch/finally nodes
Execution Memory
The thread's ExecutionMemory is the shared data store that all nodes in a thread
read from and write to. It contains:
- InputData — the immutable trigger/initial input to the thread
- Variables — mutable key-value pairs, scoped by the variable scope stack
- NodeOutputs — dictionary of outputs keyed by ProcessElementKey
- Cache — transient execution-scoped cache, not serialized on pause
- LoopStack, ExceptionContextStack — control flow tracking