feat: node creation and serialization logic in workflow editor

This commit is contained in:
alam00000
2026-02-26 20:28:16 +05:30
parent 88260c26ab
commit 85d90c3382
5 changed files with 230 additions and 174 deletions

View File

@@ -9,6 +9,7 @@ export abstract class BaseWorkflowNode extends ClassicPreset.Node {
width = 280;
height = 140;
execStatus: 'idle' | 'running' | 'completed' | 'error' = 'idle';
nodeType: string = '';
constructor(label: string) {
super(label);

View File

@@ -593,7 +593,9 @@ export const nodeRegistry: Record<string, NodeRegistryEntry> = {
export function createNodeByType(type: string): BaseWorkflowNode | null {
const entry = nodeRegistry[type];
if (!entry) return null;
return entry.factory();
const node = entry.factory();
node.nodeType = type;
return node;
}
export function getNodesByCategory(): Record<