Skip to content

Nodes & Edges

What Is a Node?

A node is a single processing unit in a workflow. Each node has:

  • A type (e.g. schedule_node, http_request, if_node)
  • A configuration — a JSON object specific to the node type
  • One or more input handles (where data flows in)
  • One or more output handles (where data flows out)
  • A position on the canvas

Nodes are stored in the voodflow_nodes table.

What Is an Edge?

An edge is a directed connection between two nodes. It specifies:

  • source — the source node UUID
  • source_handle — which output handle to use (e.g. output, true, false, case_1)
  • target — the target node UUID
  • target_handle — which input handle on the target (typically input)

Edges are stored in the voodflow_edges table.

Node Anatomy

php
class MyNode extends AbstractNode
{
    // Unique string identifier — used in DB and exports
    public static function type(): string { return 'my_node'; }

    // Human-readable name — shown in the node selector
    public static function name(): string { return 'My Node'; }

    // UI metadata: icon, color, group, description
    public static function metadata(): array { ... }

    // Default values for the config JSON
    public static function defaultConfig(): array { ... }

    // Filament form definition for the node's config panel
    public static function definition(): array { ... }

    // The actual execution logic
    public function execute(ExecutionContext $context): ExecutionResult { ... }
}

Handle Types

Handle TypeDescription
inputStandard single input (most nodes)
outputStandard single output (most nodes)
true / falseIf node conditional outputs
case_{n}Switch node dynamic case outputs
defaultSwitch node fallback output
success / errorCatch node outputs
itemFor Each node per-iteration output

Data Flow Between Nodes

When node A completes and produces ExecutionResult::success(['key' => 'value']), the engine:

  1. Saves the output to voodflow_execution_nodes.output
  2. Finds all edges where source = A.id
  3. For each edge, calls NodeB::execute($context) where $context->input = ['key' => 'value']

The data flows sequentially — each node receives the complete output of its predecessor as its input.

Multiple Outputs

Some nodes have multiple output handles (If, Switch, ForEach). The engine follows all paths that should be activated based on the node's execution result. For If/Switch, only the branch matching the condition is followed.

Terminal Nodes

Terminal nodes have no output handles. They end the execution path. Examples:

  • HTTP Response — sends an HTTP response and terminates the webhook handler path
  • Any node without outgoing edges

The AbstractNode Base Class

AbstractNode implements NodeInterface and provides helpers:

php
// Read a config value with a default
$value = $this->getConfig($context, 'field_name', 'default');

// Get the node's full configuration array
$config = $context->config;

// Access previous node's output
$input = $context->input;

// Set a workflow-level variable
$context->setVar('my_key', 'my_value');

// Read a workflow-level variable
$value = $context->getVar('my_key');

Proprietary software — source-available. All rights reserved.