c1x-workflow-builder-flowforge
v1.0.0
Published
Core Workflow Engine
Readme
C1X Workflow Builder UI Library
Standalone, framework-agnostic workflow builder built with pure TypeScript core logic and a Web Component wrapper.
What This Provides
- Pure TypeScript workflow engine for DAG state, validation, history, and JSON serialization.
- Drag-and-drop node builder UI rendered with LiteGraph (HTML5 canvas).
- Embeddable Web Component: c1x-workflow-builder.
- Public API methods for host apps: getWorkflow, loadWorkflow, validateWorkflow, undo, redo, clearWorkflow, fitToScreen.
- Custom DOM events for host synchronization.
Build The Library
From project root:
- npm install
- npm run build
Artifacts are generated in dist.
Embed In React (Fresh Project)
- In this library project root:
- npm run build
- npm link
- In your React app:
- npm install c1x-workflow-builder
- npm link c1x-workflow-builder
- Import once at app startup so custom element is registered:
import "c1x-workflow-builder/dist/index.js";- Use the element:
<c1x-workflow-builder workflow-id="react-flow-001" />- Optional API usage:
const builder = document.querySelector("c1x-workflow-builder") as any;
const json = builder.getWorkflow();
const ok = builder.loadWorkflow(json);
const result = builder.validateWorkflow();Embed In Angular (Fresh Project)
- In this library project root:
- npm run build
- npm link
- In your Angular app:
- npm install c1x-workflow-builder
- npm link c1x-workflow-builder
- In src/main.ts (or another bootstrap import):
import "c1x-workflow-builder/dist/index.js";- In app.module.ts, allow custom elements:
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}- In template:
<c1x-workflow-builder workflow-id="ng-flow-001"></c1x-workflow-builder>Demo Page (Preloaded JSON)
A standalone demo is available in demo/index.html.
It loads demo/sample-workflow.json on startup and calls loadWorkflow, then fitToScreen.
Run:
- npm run build
- Open demo/index.html
Event Contract
Common DOM events emitted by the component:
- workflow-ready
- workflow-change
- workflow-validation-failed
- workflow-history-changed
- workflow-destroyed
Framework Examples In This Repo
- React example: examples/react-demo
- Angular example: examples/angular-demo
