← Docs Hub

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

  1. Open the Editor — Go to Flows and click "Open Editor". The Node-RED editor opens in a full-screen view.
  2. Add Nodes — Drag nodes from the left palette onto the canvas. Look for the "OpenShopFloor" category for custom OSF nodes.
  3. Connect Nodes — Draw wires between node outputs and inputs to define the execution order.
  4. Configure — Double-click a node to set its parameters (which tool to call, template text, LLM settings, etc.).
  5. Save — Click the Save button in the top bar. Give your flow a name and description.
  6. 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

  1. The flow engine builds a directed acyclic graph (DAG) from your nodes and wires.
  2. Entry nodes (no incoming connections) execute first.
  3. Each node receives the output of its predecessor as context. Multi-input nodes receive all upstream outputs.
  4. Execution proceeds in topological order — all dependencies must complete before a node runs.
  5. Multi-output nodes route data to specific downstream paths based on port index.
  6. If a human-input node is reached, the flow pauses until the user responds.
  7. 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:

// Flow: OEE Analysis with Context + LLM
[osf-mcp-fertigung] Get OEE data ————\
[osf-mcp-erp] Get production orders —\
|
[osf-context] Merge all data
|
[osf-llm] Analyze OEE ← [osf-prompt-tpl]
|
[osf-output-parser] Validate JSON schema

Example: Quality Alert Flow

A flow that monitors defects and escalates to a human when quality drops:

// Flow: Quality Alert Pipeline
[osf-mcp-qms] Get defect summary
|
[osf-prompt] "Analyze defects: {{input}}"
|
[osf-decision] Has critical defects?
|--- Yes ---
[osf-human-input] "Critical defects found. Approve shutdown?"
|--- No ---
[osf-agent] Run Quality Guard agent

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.
Tip
For a complete reference of all node types, see the Node Reference.

Keyboard Shortcuts

ShortcutAction
Ctrl + ASelect all nodes
Ctrl + C / VCopy / paste nodes
DeleteDelete selected nodes
Ctrl + ZUndo
Double-clickEdit node properties
Ctrl + SpaceQuick-add node

This site uses a cookie to remember your preferences. Analytics are anonymous and cookie-free. Privacy Policy