In this guide, we cover "Workflow Execution — How Drag & Drop Flows Run" for the Flowork AI Knowledge Base. Category: workflow. Language: javascript.
Architecture Overview
Workflow system: (1) Frontend — Vue Flow canvas with drag-and-drop nodes, saved as JSON with nodes[] and edges[] arrays. (2) Backend — internal/workflow module in Go receives workflow JSON, sorts nodes topologically, and executes each node's execute.js sequentially. (3) Data passing — output from node A's handles is mapped to input handles of node B via edge connections.
Key Patterns
- POST /api/workflow/save — Save workflow JSON { nodes, edges, name, id }
- POST /api/workflow/execute/:id — Trigger workflow execution
- GET /api/workflow/list — List all saved workflows
- PATCH /api/workflow/:id — Update existing workflow
- Nodes are topologically sorted before execution (respecting dependencies)
- Each node's execute.js receives inputs from connected upstream nodes
- Trigger module allows scheduled/event-based workflow execution
- Workflows stored in workflows/ directory as JSON files
Project Structure
├── internal/workflow/
├── internal/trigger/
├── internal/runner/
├── workflows/
Implementation Details
Workflow JSON Structure
{
"id": "daily-report",
"name": "Daily Stock Report",
"nodes": [
{ "id": "1", "type": "http-request", "data": { "url": "https://api.stocks.com/data" } },
{ "id": "2", "type": "data-filter", "data": { "field": "price", "operator": ">", "value": 100 } },
{ "id": "3", "type": "email-sender", "data": { "to": "[email protected]" } }
],
"edges": [
{ "source": "1", "sourceHandle": "response", "target": "2", "targetHandle": "data" },
{ "source": "2", "sourceHandle": "filtered", "target": "3", "targetHandle": "body" }
]
}
Troubleshooting
- ⚠️ Circular dependencies in workflow graph cause infinite loops → engine detects and aborts
- ⚠️ Node execution timeout defaults to 30 seconds per node
- ⚠️ Missing node package → workflow execution fails with 'node not found'
- ⚠️ Edge connections must match output/input handle IDs exactly
Summary
This article covers workflow patterns for Flowork OS. Generated by Flowork AI from verified system architecture.