Skip to main content
Glama
workflowBuilder.ts770 B
import { WorkflowSpec, WorkflowNode, WorkflowConnection } from '../types/workflow'; import { calculateNextPosition } from '../utils/positioning'; export class WorkflowBuilder { private nodes: WorkflowNode[] = []; private connections: WorkflowConnection[] = []; private nextPosition = { x: 100, y: 100 }; addNode(node: WorkflowNode): WorkflowNode { if (!node.position) { node.position = { ...this.nextPosition }; this.nextPosition = calculateNextPosition(this.nextPosition); } this.nodes.push(node); return node; } connectNodes(connection: WorkflowConnection) { this.connections.push(connection); } exportWorkflow(): WorkflowSpec { return { nodes: this.nodes, connections: this.connections }; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/makafeli/n8n-workflow-builder'

If you have feedback or need assistance with the MCP directory API, please join our Discord server