
Composable, traceable and declarative Flow Pipelines for Laravel
A modern alternative to Laravel's Pipeline with advanced features for complex workflow management
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.
- π 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
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.
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!"
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
- PHP 8.3+
- Laravel 12.0+
For comprehensive documentation, examples, and advanced usage guides, visit our 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
Please see CONTRIBUTING.md for details.
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Please see RELEASES.md for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.
- π Report Issues
- οΏ½ Discussions
- οΏ½ Documentation
with enhanced features for complex workflow management.