New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tsflow-engine

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsflow-engine

Enterprise TypeScript workflow engine with state machines, parallel execution, saga patterns, and YAML DSL

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

@tsflow/flow-engine

Enterprise TypeScript workflow engine with state machines, parallel execution, saga patterns, and YAML DSL.

Installation

npm install @tsflow/flow-engine

Quick Start

import { FlowEngine, StateMachineConfig } from '@tsflow/flow-engine';

const config: StateMachineConfig = {
  id: 'order-flow',
  initialState: 'pending',
  states: {
    pending: {
      name: 'pending',
      transitions: [
        { event: 'APPROVE', to: 'approved' },
        { event: 'REJECT', to: 'rejected' }
      ]
    },
    approved: { name: 'approved', type: 'final' },
    rejected: { name: 'rejected', type: 'final' }
  }
};

const engine = new FlowEngine(config);
const flow = await engine.start({ context: { orderId: '12345' } });

await engine.execute(flow.flowId, { event: 'APPROVE' });
console.log('Order approved!');

Features

  • 🎯 State Machine Core - Robust state machine with transitions, guards, and actions
  • Parallel States - Execute multiple regions concurrently
  • 🏗️ Hierarchical States - Nested state machines for complex workflows
  • 🎭 Saga Pattern - Built-in compensation/rollback for distributed transactions
  • 🔁 Sub-Flows - Compose workflows from reusable components
  • 🔌 Middleware - Hooks for logging, metrics, observability
  • ♻️ Retry Logic - Automatic retry with exponential backoff
  • 🔐 Idempotency - Prevent duplicate executions
  • Validation - Schema-based context validation
  • 📝 YAML DSL - Define workflows declaratively
  • 🏷️ Type-Safe - Full TypeScript support
  • 🧪 Well Tested - 162+ comprehensive tests

Documentation

Complete documentation available at:

  • Getting Started
  • Advanced Patterns
  • YAML Workflows
  • Examples
  • API Reference

Use Cases

  • E-Commerce (order processing, payments, fulfillment)
  • User Management (registration, verification, onboarding)
  • Content Management (approval workflows, publishing)
  • DevOps (CI/CD, infrastructure provisioning)
  • Finance (loan applications, KYC, transactions)
  • Customer Support (ticket management, escalation)
  • IoT (device provisioning, commissioning)

License

MIT

Repository

https://github.com/sjefvanleeuwen/tsFlow

Keywords

workflow

FAQs

Package last updated on 15 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts