The Flow Builder is a visual programming interface for creating, testing, and managing complex backend workflows. Instead of writing code or complex JSON, you can build a process by dragging and dropping nodes onto a canvas and connecting them with edges to define the sequence and data flow. It's an intuitive UI for orchestrating operations like calling Python functions, making AI requests, and manipulating data.
The Flow Builder UI consists of four main sections:
{steps.node_api_name.output}.{inputs.variable_name}.Creating a new node for the Flow Builder is a standardized process involving four files and a final registration step.
First, navigate to the .../Flow/nodes/ directory and create a new, capitalized, and descriptive folder for your node, for example:
.../Flow/nodes/MyNewNode/
MyNewNode.props.js)This file defines the node's core metadata for the UI and the default data structure that the backend will use.
export const MyNewNodeProps = { // --- Metadata for the UI and Registry --- api_name: "my_new_node", // A unique, lowercase, snake_case key name: "My New Node", // The human-friendly name description: "This node performs a specific awesome action.", category: "Custom", // The category for the left panel // --- Data for the Backend Workflow --- step_type: "function_call", // Must be a type the backend recognizes payload: { function_name: "my_python_function", kwargs: { "parameter_one": "default value", } }, inputs: null };
MyNewNode.schema.js)This file uses a JSON Schema to define the configuration fields that will appear in the right-side Settings Panel when the node is selected.
export const MyNewNodeSchema = { title: "My New Node", description: "Configuration for My New Node.", properties: { "api_name": { "type": "string", "title": "API Name (Unique)", "description": "A unique, human-readable name for this step." }, // The key here, "parameter_one", must match a key in your props.js payload "parameter_one": { "type": "string", "title": "Parameter One", "description": "The first parameter for this node's function." } }, required: ["api_name"] };
MyNewNode.node.jsx)This React component renders the visual representation of your node on the canvas. It receives a data prop containing all its properties.
import React, { memo } from 'react'; import { Handle, Position } from '@xyflow/react'; export const MyNewNode = memo(({ data }) => { return ( <div style={{ border: '1px solid #1E90FF', borderRadius: '5px', padding: '10px', background: 'white', width: 180, }}> {/* Input handle (dot on the left) */} <Handle type="target" position={Position.Left} /> <div> <strong>{data.name}</strong> <p style={{ fontSize: '12px', margin: 0, color: '#555' }}> {data.description} </p> </div> {/* Output handle (dot on the right) */} <Handle type="source" position={Position.Right} /> </div> ); });
index.js)This file bundles all the node's components into a single object for the registry.
import { MyNewNode } from './MyNewNode.node'; import { MyNewNodeProps } from './MyNewNode.props'; import { MyNewNodeSchema } from './MyNewNode.schema'; export const MyNewNodeComponent = { component: MyNewNode, props: MyNewNodeProps, schema: MyNewNodeSchema, // If you have a custom settings UI, you would export it here };
Finally, open the central registry file and import your new node component, then add it to the allNodeDefinitions array.
// ... other imports import { MyNewNodeComponent } from './nodes/MyNewNode'; // ... const allNodeDefinitions = [ TriggerComponent, SayComponent, MyNewNodeComponent, // 2. Add your node to this list // ... ]; // ... rest of the file
Once these steps are completed, your new node will appear in the left panel and be fully functional within the Flow Builder.