🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fib-flow

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fib-flow

A robust workflow management system for fibjs with task orchestration, state management, and distributed execution capabilities

3.4.3
latest
Source
npm
Version published
Weekly downloads
23
-45.24%
Maintainers
1
Weekly downloads
 
Created
Source

fib-flow

A powerful workflow management system built on fibjs for orchestrating complex task dependencies and distributed task execution.

Key Features

  • Workflow Management: Parent-child task relationships, automatic state propagation
  • Task Types: Async tasks and cron jobs with priorities and delays
  • State Management: Comprehensive task lifecycle and state transitions
  • Reliability: Automatic retries, timeout protection, transaction safety
  • Database Support: SQLite/MySQL/PostgreSQL with flexible connection options
  • Resource Management: Load balancing and specialized worker support

Installation

fibjs --install fib-flow

Quick Start

const { TaskManager } = require('fib-flow');

// Initialize task manager (uses in-memory SQLite by default)
const taskManager = new TaskManager();
taskManager.db.setup();

// Basic task handler
taskManager.use('sendEmail', async (task) => {
    const { to, subject, body } = task.payload;
    await sendEmail(to, subject, body);
    return { sent: true };
});

// Handler with configuration
taskManager.use('processImage', {
    handler: async (task) => {
        const { path } = task.payload;
        await processImage(path);
        return { processed: true };
    },
    timeout: 120,      // 2 minutes timeout
    max_retries: 2,    // Maximum 2 retries
    retry_interval: 30 // 30 seconds retry interval
});

// Start processing
taskManager.start();

// Add a task
taskManager.async('sendEmail', {
    to: 'user@example.com',
    subject: 'Hello',
    body: 'World'
});

Documentation

Core Concepts

  • Task States and Transitions
  • Task Types
  • Error Handling
  • Workflow Support

Configuration & Setup

Reference

Example Use Cases

  • Background Processing: File processing, report generation
  • Scheduled Tasks: Data synchronization, backups
  • Complex Workflows: Multi-step data pipelines
  • Distributed Systems: Task coordination across services

For detailed examples and implementation guides, see Usage Examples.

License

MIT License

Keywords

fibjs

FAQs

Package last updated on 09 May 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