Skip to content

@memberjunction/ng-flow-editor

A generic, entity-agnostic visual flow editor component powered by Foblex Flow, with an agent-specific Flow Agent Editor for building AI agent workflows.

Terminal window
npm install @memberjunction/ng-flow-editor

The Flow Editor provides a canvas-based visual editor for building node-and-connection graphs. It wraps Foblex Flow with a clean MemberJunction-style API and includes automatic layout via the Dagre graph algorithm. A specialized Agent Editor component is also included for visually designing AI agent step flows.

flowchart TD
    subgraph Generic["Generic Flow Editor"]
        A["FlowEditorComponent"] --> B["FlowNodeComponent"]
        A --> C["FlowPaletteComponent"]
        A --> D["FlowToolbarComponent"]
        A --> E["FlowStatusBarComponent"]
    end
    subgraph Agent["Agent Editor"]
        F["FlowAgentEditorComponent"] --> G["AgentPropertiesPanelComponent"]
        F --> H["AgentStepListComponent"]
        F --> I["AgentFlowTransformerService"]
        I --> A
    end
    subgraph Services["Services"]
        J["FlowStateService"]
        K["FlowLayoutService (Dagre)"]
    end

    A --> J
    A --> K

    style Generic fill:#2d6a9f,stroke:#1a4971,color:#fff
    style Agent fill:#7c5295,stroke:#563a6b,color:#fff
    style Services fill:#2d8659,stroke:#1a5c3a,color:#fff
import { FlowEditorModule } from '@memberjunction/ng-flow-editor';
@NgModule({
imports: [FlowEditorModule]
})
export class YourModule {}
<mj-flow-editor
[Nodes]="myNodes"
[Connections]="myConnections"
[NodeTypes]="myNodeTypes"
[ShowMinimap]="true"
[ShowPalette]="true"
[ShowGrid]="true"
(NodeSelected)="onNodeSelected($event)"
(ConnectionCreated)="onConnectionCreated($event)"
(NodesChanged)="onNodesChanged($event)">
</mj-flow-editor>
<mj-flow-agent-editor
[AgentId]="selectedAgentId"
[ReadOnly]="false"
(StepSelected)="onStepSelected($event)"
(FlowChanged)="onFlowChanged($event)">
</mj-flow-agent-editor>
ComponentSelectorPurpose
FlowEditorComponentmj-flow-editorGeneric canvas-based flow editor
FlowNodeComponentinternalRenders individual nodes on the canvas
FlowPaletteComponentinternalDraggable palette of node types
FlowToolbarComponentinternalToolbar with zoom, layout, grid controls
FlowStatusBarComponentinternalDisplays node/connection counts
FlowAgentEditorComponentmj-flow-agent-editorAgent-specific flow editor wrapper
AgentPropertiesPanelComponentinternalAgent property editing panel
AgentStepListComponentinternalList of agent steps
PropertyTypeDefaultDescription
NodesFlowNode[][]Array of flow nodes
ConnectionsFlowConnection[][]Array of connections between nodes
NodeTypesFlowNodeTypeConfig[][]Available node type definitions
ReadOnlybooleanfalseDisable editing
ShowMinimapbooleantrueShow minimap overlay
ShowPalettebooleantrueShow the node palette
ShowGridbooleantrueShow background grid
ShowStatusBarbooleantrueShow the status bar
ShowToolbarbooleantrueShow the toolbar
ShowLegendbooleantrueShow the node type legend
GridSizenumber20Grid snap size in pixels
AutoLayoutDirectionFlowLayoutDirection'vertical'Dagre auto-layout direction
EventTypeDescription
NodeSelectedEventEmitter<FlowNode | null>A node was selected or deselected
NodeAddedEventEmitter<FlowNodeAddedEvent>A node was added to the canvas
NodeRemovedEventEmitter<FlowNode>A node was removed
NodeMovedEventEmitter<FlowNodeMovedEvent>A node was repositioned
ConnectionCreatedEventEmitter<FlowConnectionCreatedEvent>A connection was created
ConnectionRemovedEventEmitter<FlowConnection>A connection was removed
ConnectionReassignedEventEmitter<FlowConnectionReassignedEvent>A connection endpoint was moved
SelectionChangedEventEmitter<FlowSelectionChangedEvent>Selection state changed
NodesChangedEventEmitter<FlowNode[]>The nodes array was modified
ConnectionsChangedEventEmitter<FlowConnection[]>The connections array was modified
NodeEditRequestedEventEmitter<FlowNode>Double-click to edit a node
  • FlowNode — A node on the canvas with id, type, label, position, size, ports, badges
  • FlowConnection — A connection between two node ports with optional label
  • FlowNodeTypeConfig — Configuration for a node type (icon, color, ports, palette info)
  • FlowNodePort — Input/output port definition
  • FlowPosition / FlowSize — Position and size types
  • FlowSnapshot — Serializable snapshot of the entire flow state
  • FlowLayoutDirection'vertical' | 'horizontal'
ServicePurpose
FlowStateServiceManages undo/redo, snapshots, dirty state
FlowLayoutServiceDagre-based auto-layout for flow graphs
AgentFlowTransformerServiceTransforms MJ Agent entities into flow graph data