Visual Flows Guide
Build multi-step AI workflows with the Node-RED editor
What are Flows?
Flows let you chain multiple AI operations together in a visual graph editor powered by Node-RED. Each node in your flow performs one action — calling an MCP tool, running TypeScript code, prompting an LLM, making a decision, or waiting for human input. Data flows from one node to the next automatically.
OpenShopFloor uses a hybrid execution model: custom OSF nodes run through the optimized OSF engine with SSE streaming, while all native Node-RED nodes (switch, change, function, http-request, etc.) are fully supported.
Getting Started
- Open the Editor — Go to Flows and click "Open Editor". The Node-RED editor opens in a full-screen view.
- Add Nodes — Drag nodes from the left palette onto the canvas. Look for the "OpenShopFloor" category for custom OSF nodes.
- Connect Nodes — Draw wires between node outputs and inputs to define the execution order.
- Configure — Double-click a node to set its parameters (which tool to call, template text, LLM settings, etc.).
- Save — Click the Save button in the top bar. Give your flow a name and description.
- Run — Go back to the Flows listing and click Run on your saved flow. Results stream in real time.
Multi-Output Nodes
Some nodes support multiple output ports, letting you route data to different downstream paths:
- osf-ts — Configure 1-5 outputs. Return an array where each element goes to the corresponding port.
- osf-decision — Each condition maps to a separate output port.
- switch — Each rule creates an output port for conditional routing.
- function — Return an array of messages for multiple outputs.
Multi-Input Nodes
Nodes like osf-context and osf-llm accept multiple inputs. The engine waits for all upstream nodes to complete before executing a multi-input node.
- osf-context — Merges all upstream outputs into a single JSON object, keyed by source node label.
- osf-llm — Expects two inputs: context (system message from osf-context) and prompt (user message from osf-prompt-tpl).
- join — Collects multiple messages and combines them into an array or object.
Execution Model
- The flow engine builds a directed acyclic graph (DAG) from your nodes and wires.
- Entry nodes (no incoming connections) execute first.
- Each node receives the output of its predecessor as context. Multi-input nodes receive all upstream outputs.
- Execution proceeds in topological order — all dependencies must complete before a node runs.
- Multi-output nodes route data to specific downstream paths based on port index.
- If a
human-inputnode is reached, the flow pauses until the user responds. - Results are streamed in real time via SSE (Server-Sent Events).
Example: OEE Analysis Pipeline
A modular flow that collects data from multiple sources, builds context, and generates an analysis:
Example: Quality Alert Flow
A flow that monitors defects and escalates to a human when quality drops:
Tips & Best Practices
- Start simple — begin with 2-3 nodes and add complexity gradually.
- Use osf-context for multi-source data — collect data from multiple MCP/TS nodes before sending to the LLM.
- Use osf-prompt-tpl for structured prompts — separate your prompt template from data collection.
- Add human checkpoints — use human-input nodes before destructive or high-impact actions.
- Validate LLM output — use osf-output-parser after osf-llm to ensure structured JSON responses.
- Use debug nodes — attach debug nodes to inspect data at any point in the flow.
- Name your nodes — double-click and set a descriptive name. osf-context uses these names as JSON keys.
- One tab per flow — each Node-RED tab becomes a separate saveable flow.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl + A | Select all nodes |
| Ctrl + C / V | Copy / paste nodes |
| Delete | Delete selected nodes |
| Ctrl + Z | Undo |
| Double-click | Edit node properties |
| Ctrl + Space | Quick-add node |