How prodev717/awfex works
Project type and purpose
• AWFEX is an open-source, full-stack automation workflow engine.
• Frontend: A React + React Flow drag-and-drop UI for designing workflows.
• Backend: An Express.js server that orchestrates workflows by executing individual function modules via HTTP.
File structure
Top-level:
• index.js / awfex.js – entry points for the backend service.
• functions/ – directory of custom “node” functions (add.js, sub.js, etc.).
• frontend/ – standalone React app using Vite + React Flow.
• public/ – static files served by the server (public/index.html).
Backend specifics:
• Express.js routes invoked by HTTP triggers, reading workflow JSON, loading functions, chaining execution.
• No database—state passes through JSON payloads.
Frontend specifics:
• src/components – UI panels, toolbars.
• src/nodes – definitions of available node types (FunctionNode, InputNode).
• FlowCanvas.jsx – the core canvas where workflows are drawn.
• Generates JSON representing nodes + edges.
Key architectural insights from README
• HTTP-only triggers—makes the engine serverless-friendly.
• Function-first, plugin-style: any JS file dropped into functions/ is automatically available.
• UI feeds JSON to backend; backend returns execution results.
Main components & relationships (to represent
A. User / Client
• Web browser interacting with the React UI.
B. Frontend (React + React Flow)
• UI Layer: FlowCanvas, LeftPanel, Toolbar.
• Generates workflow JSON.
• Sends HTTP POST to Backend /execute endpoint.
C. Backend (Express.js)
• HTTP API layer.
• Workflow controller: parses JSON, resolves node graph order.
• Function registry loader: dynamically imports modules from functions/.
• Executor: invokes each function in sequence, passing data payload.
• Returns execution status / output.
D. Functions Library
• Individual JS modules (add, sub, mul, div, print).
• Plugin-style—dropping a file auto-registers it.
E. External Systems (optional)
• Any HTTP endpoint or serverless platform hosting backend.
• Third-party APIs invoked by custom functions if needed.
Architectural patterns & design principles
• Plugin architecture: loose coupling between engine and functions.
• Event-driven chaining: each node emits data to the next.
• Separation of concerns: UI purely for design, backend purely for execution.
• JSON-based workflow as an explicit intermediate representation (IR).
• Serverless-friendly: HTTP triggers only, stateless execution.
Essential details not to omit
• Dynamic function resolution—make the Function Registry explicit.
• HTTP trigger endpoint as the entry point.
• Separation between design-time (UI) and run-time (execution engine).
• Identifies all key components and their responsibilities.
• Shows data/control flow between User, Frontend, Backend, and Functions.
• Reflects AWFEX’s plugin-first, HTTP-driven architecture.