A powerful workflow management system built on fibjs for orchestrating complex task dependencies and distributed task execution.
- 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
fibjs --install fib-flow
const { TaskManager } = require('fib-flow');
// Initialize task manager (uses in-memory SQLite by default)
const taskManager = new TaskManager();
taskManager.db.setup();
// Register task handler
taskManager.use('sendEmail', async (task) => {
const { to, subject, body } = task.payload;
await sendEmail(to, subject, body);
return { sent: true };
});
// Start processing
taskManager.start();
// Add a task
taskManager.async('sendEmail', {
to: '[email protected]',
subject: 'Hello',
body: 'World'
});
- 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.
MIT License