Workflow Engine SDK
The Workflow Engine SDK (@allternit/workflow-engine) is a TypeScript library for defining and running directed acyclic graph (DAG) workflows. It provides a lightweight engine, a parallel task scheduler, and visualizers that export workflows to SVG, Mermaid, or Graphviz.
Overview
Use this SDK when you want to:- Build deterministic, multi-step automation pipelines in TypeScript.
- Orchestrate HTTP requests, transforms, conditional branches, delays, and loops from a single workflow graph.
- Execute workflows locally with built-in concurrency controls and lifecycle hooks.
- Render workflow definitions as diagrams for documentation or a visual editor.
Installation
Quick start
Core concepts
Workflow
A workflow is a declarative DAG made of nodes and connections. It is registered by ID and version, then executed by callingengine.execute(workflowId, inputs). Each execution receives its own execution ID and isolated context.
Nodes and connections
Nodes are the units of work. Connections describe the directed edges between them. The engine starts with nodes that have no incoming connections, then walks the graph as each node completes.Execution context
Every workflow execution maintains a context that carries workflow variables, node results, and the execution path. Node executors receive this context plus resolved inputs, and return a result object that downstream nodes can consume.Scheduler
The scheduler manages parallel task submission, concurrency limits, and cancellation. You can use it directly for advanced scenarios or let the engine manage execution for you.Visualizer
The visualizer computes layered layouts and exports them to SVG, Mermaid, or Graphviz DOT format for embedding in documentation or a UI canvas.Built-in node types
Triggers
Transforms
Logic
Actions
Engine configuration
Execution lifecycle
Conditional branching
Add acondition property to a connection to route execution dynamically:
Input and output mappings
Map workflow variables into node inputs using expressions:output:result node at the end of execution.
Custom node types
Register your own node types to extend the engine:Scheduler
Use the scheduler directly when you need fine-grained control over task concurrency:Visualization
Engine methods
Types
All workflow types are exported for TypeScript users:Error handling
Errors are captured per node and surfaced on the execution object:Global instances
For convenience, the package exports pre-created singletons:createWorkflowEngine() and createScheduler() so instances remain isolated.
Related pages
- Workflows API — cloud workflow definitions and executions
- Orchestration — platform orchestration services
- TypeScript SDK — general Allternit TypeScript client
- Computer Use SDK — browser and desktop automation SDK