Skip to content

πŸ” 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.

License

Notifications You must be signed in to change notification settings

Grazulex/laravel-flowpipe

Laravel Flowpipe

Laravel Flowpipe

Composable, traceable and declarative Flow Pipelines for Laravel

A modern alternative to Laravel's Pipeline with advanced features for complex workflow management

Latest Version Total Downloads License PHP Version Laravel Version Tests Code Style


πŸš€ 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:

The wiki includes:


🀝 Contributing

Please see CONTRIBUTING.md for details.

πŸ”’ Security

If you discover any security-related issues, please email [email protected] 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 Pipeline
with enhanced features for complex workflow management.

About

πŸ” 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.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 2

  •  
  •  

Languages