grazulex / laravel-flowpipe
Composable, traceable and declarative Flow Pipelines for Laravel. A modern alternative to Laravel's Pipeline, with support for conditional steps, nested flows, tracing, validation, and more.
Fund package maintenance!
Grazulex
Buy Me A Coffee
paypal.me/strauven
Requires
- php: ^8.3
- illuminate/contracts: ^12.0
- illuminate/support: ^12.19
- nesbot/carbon: ^3.10
- symfony/yaml: ^7.3
Requires (Dev)
- doctrine/dbal: ^4.2
- larastan/larastan: ^3.4
- laravel/pint: ^1.22
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.8
- pestphp/pest-plugin-laravel: ^3.2
- rector/rector: ^2.0
README

Composable, traceable and declarative Flow Pipelines for Laravel
A modern alternative to Laravel's Pipeline with advanced features for complex workflow management
🚀 Overview
Laravel Flowpipe is a powerful, modern alternative to Laravel's built-in Pipeline package that provides composable, traceable, and declarative flow pipelines. Perfect for building complex business workflows, data processing pipelines, user registration flows, API integrations, and any scenario where you need reliable, maintainable, and testable step-by-step processing.
✨ Key Features
- 🚀 Fluent API - Chainable, expressive syntax
- 🔄 Flexible Steps - Support for closures, classes, and custom steps
- 🎯 Conditional Logic - Built-in conditional step execution
- 📊 Tracing & Debugging - Track execution flow and performance
- 🛡️ Advanced Error Handling - Retry, fallback, and compensation strategies
- 🔗 Step Groups - Reusable, named collections of steps
- 🎯 Nested Flows - Create isolated sub-workflows for complex logic
- 📋 YAML Support - Define flows in YAML for easy configuration
- 🧪 Test-Friendly - Built-in test tracer for easy testing
- 🎨 Artisan Commands - Full CLI support for flow management
- ✅ Flow Validation - Validate flow definitions with comprehensive error reporting
- 📈 Export & Documentation - Export to JSON, Mermaid, and Markdown
📦 Installation
Install the package via Composer:
composer require grazulex/laravel-flowpipe
💡 Auto-Discovery: The service provider will be automatically registered thanks to Laravel's package auto-discovery.
⚡ Quick Start
🚀 Programmatic API
use Grazulex\LaravelFlowpipe\Flowpipe; $result = Flowpipe::make() ->send('Hello World') ->through([ fn($data, $next) => $next(strtoupper($data)), fn($data, $next) => $next(str_replace(' ', '-', $data)), fn($data, $next) => $next($data . '!'), ]) ->thenReturn(); // Result: "HELLO-WORLD!"
📋 YAML Configuration (Recommended)
Laravel Flowpipe supports declarative flow definitions using YAML files, making your workflows easy to manage, version, and maintain:
Create a flow definition (flow_definitions/user_registration.yaml
):
name: user_registration description: Complete user registration workflow steps: - type: validation rules: email: required|email password: required|min:8 - type: closure action: App\Actions\CreateUserAccount - type: conditional condition: field: email_verification_required operator: equals value: true then: - type: closure action: App\Actions\SendVerificationEmail - type: group name: notifications metadata: version: "1.0" author: "Your Team"
Execute the flow:
use Grazulex\LaravelFlowpipe\Flowpipe; $result = Flowpipe::fromDefinition('user_registration') ->send($userData) ->thenReturn();
📁 Organize with step groups (flow_definitions/groups/notifications.yaml
):
name: notifications steps: - type: closure action: App\Actions\SendWelcomeEmail - type: closure action: App\Actions\CreateNotificationPreferences
💡 Avantages des fichiers YAML :
- ✅ Configuration déclarative - Définissez vos workflows sans code
- ✅ Réutilisabilité - Partagez des groupes d'étapes entre différents flux
- ✅ Versioning facile - Trackez les changements dans votre système de contrôle de version
- ✅ Collaboration - Les non-développeurs peuvent modifier les workflows
- ✅ Validation - Validation automatique des définitions avec
php artisan flowpipe:validate
🔧 Requirements
- PHP 8.3+
- Laravel 12.0+
📚 Complete Documentation
For comprehensive documentation, examples, and advanced usage guides, visit our Wiki:
📖 👉 Laravel Flowpipe Wiki
The wiki includes:
- 🚀 Installation & Setup
- ⚙️ Configuration
- 🎯 Your First Flow
- 📋 Understanding YAML Flows
- 🏗️ YAML Flow Structure
- 🔧 PHP Steps
- 🔗 Step Groups
- 🎯 Conditions & Branching
- 🛡️ Error Handling
- 🎨 Artisan Commands
- 🚀 Queue Integration
- 📝 Example: User Registration
🤝 Contributing
Please see CONTRIBUTING.md for details.
🔒 Security
If you discover any security-related issues, please email jms@grazulex.be instead of using the issue tracker.
📝 Changelog
Please see RELEASES.md for more information on what has changed recently.
📄 License
The MIT License (MIT). Please see License File for more information.
👥 Credits
💬 Support
Laravel Flowpipe - A modern, powerful alternative to Laravel's built-in Pipelinewith enhanced features for complex workflow management.