Flow
Native left-to-right workflow canvas — pan, zoom, multi-output nodes, drag-to-connect edges, snap grid, toolbar and minimap. Zero third-party graph libraries.
Basic Usage
Pass
nodes
and edges
. Positions are optional — missing ones are auto-laid out left to right.
Hover a node to light its pipeline — everything it is fed by and feeds — and dim the rest (:trace="false"
turns it off).
Empty flow
Add nodes to start building your workflow.
Drag nodes · scroll to zoom · drag background to pan · drag a + / right port onto another node to connect · Delete to remove
<neura::flow :nodes="$nodes" :edges="$edges" height="380px" />
Branching workflow
Multiple outputs via
data.outputs
. Edges use sourceHandle
to pick a port.
Empty flow
Add nodes to start building your workflow.
$nodes = [
['id' => 'w2', 'data' => [
'label' => 'Review',
'outputs' => [
['id' => 'ok', 'label' => 'Approve'],
['id' => 'ko', 'label' => 'Reject'],
],
]],
];
$edges = [
['source' => 'w2', 'target' => 'w3', 'sourceHandle' => 'ok', 'animated' => true],
['source' => 'w2', 'target' => 'w4', 'sourceHandle' => 'ko'],
];
<neura::flow :nodes="$nodes" :edges="$edges" height="420px" />
Node shapes
Steps are horizontal cards by default.
shape="node"
turns them into n8n-style square tiles with their name below; then a trigger
is rounded on its left and has no input,
an agent
is a wide tile with sub-connectors underneath, a sub
node plugs into one from below,
and a note
is a sticky note on the canvas. Set a node's own shape with its type or data.shape
.
Among cards, a trigger stays a card, marked with a bolt. Icons are kit icon names, glyphs, or an image
URL for a logo.
Empty flow
Add nodes to start building your workflow.
Hover a node for its actions · drag a sub-node’s top diamond onto the agent · hover a connection to insert a step or delete it · double-click a node to open it
<neura::flow shape="node" :nodes="$nodes" :edges="$edges" />
Card styles
variant
sets the style of every node — elevated
, outline
,
soft
(tinted with the node’s colour) or solid
— and data.variant
one node’s.
Colours are design-system names (violet
, success-600
) or any CSS colour.
Empty flow
Add nodes to start building your workflow.
<neura::flow :nodes="$nodes" :edges="$edges" variant="soft" />
// One node
['id' => 'mail', 'data' => ['label' => 'Send email', 'icon' => 'envelope', 'color' => 'violet', 'variant' => 'solid']]
// config/neura-kit.php
'flow' => Config::flow([
'default' => ['shape' => 'node', 'variant' => 'soft'],
]),
Execution states
data.status
marks a run: success
, error
,
running
or waiting
; data.disabled
greys a step out.
A connection takes a status
too, and a label
such as the number of items it carried.
Empty flow
Add nodes to start building your workflow.
['id' => 'http', 'data' => ['label' => 'HTTP Request', 'icon' => 'globe-alt', 'status' => 'success']]
['id' => 'slack', 'data' => ['label' => 'Notify Slack', 'status' => 'error']]
['id' => 'archive', 'data' => ['label' => 'Archive', 'disabled' => true]]
['source' => 'http', 'target' => 'if', 'status' => 'success', 'label' => '12 items']
Themes
theme
sets the look of the whole flow. classic
draws square tiles with their name below and curved connections.
signal
draws capsules with a status light, circuit-like traces, and data dots moving along the connections that run
(animated
or status: running
). The same nodes and edges work in both.
Empty flow
Add nodes to start building your workflow.
<neura::flow theme="signal" :nodes="$nodes" :edges="$edges" />
// An agent's steps, as chips
['id' => 'agent', 'type' => 'agent', 'data' => ['label' => 'AI Agent', 'status' => 'running', 'steps' => ['plan', 'calendar', 'reply']]]
// Data dots on a running connection
['source' => 'orders', 'target' => 'agent', 'animated' => true, 'label' => '12']
// config/neura-kit.php
'flow' => Config::flow([
'default' => ['theme' => 'signal'],
]),
Pipelines and relations
A
table
node lists its rows — columns, fields — and every row has its own connectors, so a pipeline links row to row:
a foreign key to its primary key, a column to the column it feeds. Edges name rows in sourceHandle
and targetHandle
.
Hover a row to light its lineage through the whole pipeline, upstream and downstream; the rest dims.
Empty flow
Add nodes to start building your workflow.
Empty flow
Add nodes to start building your workflow.
Hover revenue in revenue_by_country to see where it comes from · drag a row’s right connector onto another row to link them
<neura::flow :nodes="$nodes" :edges="$edges" />
<neura::flow theme="signal" :nodes="$nodes" :edges="$edges" />
Empty canvas
Empty flow
Add nodes to start building your workflow.
<neura::flow :nodes="[]" :edges="[]" height="280px" :showMinimap="false" />
Snap, minimap & edges
Tune interaction and chrome with props:
<neura::flow
:nodes="$nodes"
:edges="$edges"
height="500px"
:snapToGrid="true"
:gridSize="16"
:showMinimap="true"
:showToolbar="true"
edgeType="smoothstep"
:defaultEdgeAnimated="false"
backgroundClasses="grid"
toolbarClasses="bottom left"
:minZoom="0.2"
:maxZoom="2.5"
:zoomOnWheelScroll="true"
:panOnDrag="true"
:nodesConnectable="true"
:fitViewOnInit="true"
/>
Data structure
// Node
[
'id' => 'unique-id',
'type' => 'step',
'position' => ['x' => 120, 'y' => 80], // optional
'data' => [
'label' => 'Title',
'description' => 'Subtitle',
'icon' => 'envelope', // kit icon name, or a glyph such as ▶
'image' => null, // logo URL, instead of the icon
'color' => 'violet', // design-system name or any CSS colour
'shape' => 'card', // card | node | trigger | agent | sub | note | table (default: from the type, else the flow's)
'variant' => 'soft', // elevated | outline | soft | solid
'status' => 'running', // success | error | running | waiting
'disabled' => false, // greyed out, name struck through
'text' => null, // a note's body
'inputs' => null, // an agent's sub-connectors (default: model, memory, tool)
'steps' => null, // an agent's steps, shown as chips: ['plan', 'reply']
'rows' => null, // a table's rows: names, or ['id' => 'total', 'type' => 'numeric', 'key' => 'pk|fk']
'outputs' => [ // multi-output ports (right)
['id' => 'success', 'label' => 'Success'],
['id' => 'error', 'label' => 'Error'],
],
],
]
// Edge
[
'id' => 'e1', // optional
'source' => 'node-a',
'target' => 'node-b',
'sourceHandle' => 'success', // default: out
'targetHandle' => 'in', // default: in
'type' => 'bezier', // or smoothstep
'animated' => true,
'label' => '3 items', // pill in the middle
'status' => 'success', // success | error | running
'sourceOffset' => -12, // shift attachment up/down (px)
'targetOffset' => 18,
]
// Self-loop (same node)
['source' => 'node-a', 'target' => 'node-a']
Select an edge → drag an endpoint up/down along the node to reposition (live). Drag onto another node to reconnect.
Or call
flow.updateEdge(id, { target: '3', targetOffset: 20 })
.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| nodes | array | [] | Initial nodes |
| edges | array | [] | Connections |
| height | string | 500px | Canvas height |
| direction | string | lr | Flow direction (left → right) |
| edgeType | string | theme's | bezier | smoothstep; by default bezier in classic, smoothstep in signal (loops always use an orthogonal U-turn) |
| defaultEdgeAnimated | boolean | false | Animate edges created by drag-connect / addEdge |
| snapToGrid | boolean | true | Snap node drag to grid |
| gridSize | number | 16 | Snap grid size |
| showMinimap | boolean | true | Overview map |
| showToolbar | boolean | true | Zoom / fit / delete controls |
| backgroundClasses | string | dots | dots | grid | none |
| minZoom / maxZoom | number | 0.25 / 2.5 | Zoom limits |
| zoomOnWheelScroll | boolean | true | Wheel zooms toward cursor |
| panOnDrag | boolean | true | Drag empty canvas to pan |
| nodesDraggable | boolean | true | Allow moving nodes |
| nodesConnectable | boolean | true | Allow drawing edges |
| theme | string | config: classic | Look of the flow: classic | signal (pack: Flow\Theme) |
| shape | string | config: card | Shape of nodes that name none: card | node | trigger | agent | sub | note | table (pack: Flow\Shape); signal draws capsules (node) unless set |
| variant | string | config: elevated | Card style: elevated | outline | soft | solid (pack: Flow\Variant) |
| icons | array | [] | Extra icon names, for nodes added later |
| trace | boolean | true | Hovering a node (or a table row) lights its pipeline and dims the rest |
| nodeActions | boolean | true | Run, deactivate and delete buttons over a hovered node |
| fitViewOnInit | boolean | true | Fit graph on load (alias: autoCenter) |
Events
Events bubble from the flow root. Listen with Alpine / Livewire:
| Event | Detail |
|---|---|
| flow-init | nodes, edges, viewport |
| flow-change | Full toObject()
snapshot |
| flow-connect | New edge |
| flow-edge-update | Edge reconnected / repositioned |
| flow-node-select | Selected node ids |
| flow-nodes-deleted | Deleted ids |
| flow-node-run | node — the run button of a hovered node |
| flow-node-toggle | node, disabled — the node was deactivated or activated |
| flow-node-open | node — a double-click, to open its settings |
| flow-edge-insert | edge, position — the + of a hovered connection, to insert a step |
<div @flow-change="console.log($event.detail)">
<neura::flow :nodes="$nodes" :edges="$edges" />
</div>
API
Alpine component:
neuraFlow
(alias flowEditor
).
<div x-data="{ flow: null }">
<div
x-data="neuraFlow({ nodes: [], edges: [] })"
x-init="flow = $data"
style="height: 420px"
class="flow"
></div>
<button @click="flow.addNode({ data: { label: 'New step' } })">Add</button>
<button @click="flow.addEdge({ source: '1', target: '2', animated: true })">Connect (animated)</button>
<button @click="flow.fitView()">Fit</button>
<button @click="console.log(flow.toObject())">Export</button>
</div>
Methods:
addNode
, removeNodes
, addEdge
, updateEdge
, removeEdges
, fitView
, setViewport
, zoomIn
, zoomOut
, toObject
, getNode
, selectNodes
, deleteSelection
.