-
-
Notifications
You must be signed in to change notification settings - Fork 0
Artisan Commands
Jean-Marc Strauven edited this page Aug 6, 2025
·
2 revisions
β Queue Integration | Home | Configuration β
Laravel Flowpipe provides powerful Artisan commands for managing, debugging, and executing workflows from the command line.
# List all available flows
php artisan flowpipe:list
# Run a specific flow
php artisan flowpipe:run flow-name
# Validate flow definitions
php artisan flowpipe:validate
# Show detailed flow information
php artisan flowpipe:show flow-name
# Generate step class
php artisan flowpipe:make:step StepName
# Generate flow YAML template
php artisan flowpipe:make:flow flow-name
# Run with default data from YAML
php artisan flowpipe:run user-registration
# Run with custom data (JSON)
php artisan flowpipe:run user-registration '{"name":"John","email":"[email protected]"}'
# Run with data from file
php artisan flowpipe:run user-registration --data=/path/to/data.json
# Run with verbose output
php artisan flowpipe:run user-registration --verbose
# Run with tracing enabled
php artisan flowpipe:run user-registration --trace
# Run specific steps only
php artisan flowpipe:run user-registration --steps=validate-input,create-user
# Skip specific steps
php artisan flowpipe:run user-registration --skip=send-welcome-email
# Run with timeout
php artisan flowpipe:run user-registration --timeout=300
# Run asynchronously (queue)
php artisan flowpipe:run user-registration --async
# Run with custom configuration
php artisan flowpipe:run user-registration --config='{"retry_attempts":5}'
# List all flows
php artisan flowpipe:list
# List flows with details
php artisan flowpipe:list --detailed
# Filter flows by tag
php artisan flowpipe:list --tag=user
# Show flows in specific directory
php artisan flowpipe:list --path=flows/user
# Export flow list to JSON
php artisan flowpipe:list --format=json > flows.json
Output example:
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββ
β Flow Name β Description β Version β Tags β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββ€
β user-registration β Complete user registration β 2.1 β user, auth β
β order-processing β E-commerce order processing β 1.5 β ecommerce, order β
β content-moderation β Automated content review β 1.0 β content, ai β
β newsletter-campaign β Email campaign with segments β 1.2 β email, marketing β
βββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββ
# Show detailed flow information
php artisan flowpipe:show user-registration
# Show flow steps only
php artisan flowpipe:show user-registration --steps
# Show flow dependencies
php artisan flowpipe:show user-registration --dependencies
# Export flow definition
php artisan flowpipe:show user-registration --export=json > user-registration.json
# Validate all flows
php artisan flowpipe:validate
# Validate specific flow
php artisan flowpipe:validate user-registration
# Validate with strict mode (warnings as errors)
php artisan flowpipe:validate --strict
# Validate and show detailed errors
php artisan flowpipe:validate --verbose
# Validate flows in specific directory
php artisan flowpipe:validate --path=flows/production
# Dry run without executing steps
php artisan flowpipe:run user-registration --dry-run
# Test with mock data
php artisan flowpipe:test user-registration
# Test all flows
php artisan flowpipe:test:all
# Generate test report
php artisan flowpipe:test user-registration --report=/tmp/test-report.html
# Basic step class
php artisan flowpipe:make:step ValidateUserStep
# Step with namespace
php artisan flowpipe:make:step User/ValidateUserStep
# Step with template
php artisan flowpipe:make:step ProcessPaymentStep --template=payment
# Step with full setup
php artisan flowpipe:make:step CreateUserStep --with-test --with-contract
Generated step example:
<?php
namespace App\Flowpipe\Steps;
use Closure;
use Grazulex\LaravelFlowpipe\Contracts\FlowStep;
class ValidateUserStep implements FlowStep
{
public function handle(mixed $payload, Closure $next): mixed
{
// TODO: Implement step logic
return $next($payload);
}
}
# Basic flow template
php artisan flowpipe:make:flow user-onboarding
# Flow with steps
php artisan flowpipe:make:flow order-processing --steps=validate,process,fulfill
# Flow from template
php artisan flowpipe:make:flow newsletter --template=email-campaign
# Interactive flow builder
php artisan flowpipe:make:flow --interactive
# Run with detailed tracing
php artisan flowpipe:run user-registration --trace
# Export trace to file
php artisan flowpipe:run user-registration --trace --trace-file=/tmp/trace.json
# Trace specific steps
php artisan flowpipe:run user-registration --trace --trace-steps=validate-input,create-user
# Live trace monitoring
php artisan flowpipe:trace user-registration --follow
# Analyze flow performance
php artisan flowpipe:analyze user-registration
# Performance report for all flows
php artisan flowpipe:analyze --all
# Compare flow performance
php artisan flowpipe:compare user-registration-v1 user-registration-v2
# Generate performance report
php artisan flowpipe:performance-report --format=html > performance.html
# Show queued flows
php artisan flowpipe:queue:status
# Retry failed flows
php artisan flowpipe:queue:retry
# Clear failed flows
php artisan flowpipe:queue:clear-failed
# Monitor queue in real-time
php artisan flowpipe:queue:monitor
# Show current configuration
php artisan flowpipe:config
# Validate configuration
php artisan flowpipe:config:validate
# Export configuration
php artisan flowpipe:config:export > flowpipe-config.json
# Reset configuration to defaults
php artisan flowpipe:config:reset
# Set environment-specific flows
php artisan flowpipe:env:set production
# List environment configurations
php artisan flowpipe:env:list
# Sync flows between environments
php artisan flowpipe:env:sync staging production
# 1. Create a new flow
php artisan flowpipe:make:flow user-verification --interactive
# 2. Generate required steps
php artisan flowpipe:make:step SendVerificationEmailStep
php artisan flowpipe:make:step VerifyEmailTokenStep
# 3. Validate the flow
php artisan flowpipe:validate user-verification
# 4. Test with sample data
php artisan flowpipe:run user-verification --dry-run
# 5. Run with real data
php artisan flowpipe:run user-verification '{"user_id":123,"email":"[email protected]"}'
# 1. Validate all flows before deployment
php artisan flowpipe:validate --strict
# 2. Run health checks
php artisan flowpipe:health-check
# 3. Test critical flows
php artisan flowpipe:test:critical
# 4. Monitor deployment
php artisan flowpipe:monitor --env=production
# 1. Identify the failing flow
php artisan flowpipe:queue:status
# 2. Run with detailed tracing
php artisan flowpipe:run problematic-flow --trace --verbose
# 3. Analyze the trace
php artisan flowpipe:trace:analyze /tmp/trace.json
# 4. Test fix with dry run
php artisan flowpipe:run problematic-flow --dry-run
# Run multiple flows
php artisan flowpipe:batch:run user-registration,order-processing,content-moderation
# Run flows matching pattern
php artisan flowpipe:batch:run "user-*"
# Run flows by tag
php artisan flowpipe:batch:run --tag=critical
# Parallel execution
php artisan flowpipe:batch:run --parallel --workers=4 user-registration order-processing
# With custom data for each flow
php artisan flowpipe:batch:run --data-file=batch-data.json
# Process CSV data through flow
php artisan flowpipe:process:csv user-registration users.csv
# Process JSON file
php artisan flowpipe:process:json order-processing orders.json
# Process with custom mapping
php artisan flowpipe:process:csv user-registration users.csv --mapping=mapping.json
# Chunked processing for large files
php artisan flowpipe:process:csv user-registration large-users.csv --chunk=1000
# Run flow test suite
php artisan flowpipe:test:suite
# Run specific test categories
php artisan flowpipe:test:suite --category=critical
# Generate test coverage report
php artisan flowpipe:test:coverage
# Run performance benchmarks
php artisan flowpipe:benchmark
# Simulate load on specific flow
php artisan flowpipe:load:test user-registration --concurrent=10 --duration=60
# Stress test with increasing load
php artisan flowpipe:load:stress user-registration --start=1 --end=50 --step=5
# Generate load test report
php artisan flowpipe:load:report > load-test-results.html
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Grazulex\LaravelFlowpipe\Flowpipe;
class ProcessDailyReportsCommand extends Command
{
protected $signature = 'flowpipe:daily-reports {date?}';
protected $description = 'Process daily reports using Flowpipe';
public function handle()
{
$date = $this->argument('date') ?? now()->subDay()->toDateString();
$this->info("Processing daily reports for {$date}");
$result = Flowpipe::fromYaml('daily-analytics-report')
->send(['date' => $date])
->execute();
if ($result->isSuccessful()) {
$this->info('Daily reports processed successfully');
} else {
$this->error('Failed to process daily reports: ' . $result->error->getMessage());
}
}
}
// In app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
// Daily reports
$schedule->command('flowpipe:daily-reports')
->daily()
->at('01:00');
// Weekly cleanup
$schedule->command('flowpipe:run weekly-cleanup')
->weekly()
->sundays()
->at('02:00');
// Health checks
$schedule->command('flowpipe:health-check')
->everyFifteenMinutes();
}
Command | Description | Options |
---|---|---|
flowpipe:list |
List all available flows |
--detailed , --tag , --format
|
flowpipe:run |
Execute a flow |
--data , --trace , --async , --timeout
|
flowpipe:show |
Show flow details |
--steps , --dependencies , --export
|
flowpipe:validate |
Validate flow definitions |
--strict , --path
|
flowpipe:make:step |
Generate step class |
--template , --with-test
|
flowpipe:make:flow |
Generate flow template |
--steps , --template , --interactive
|
flowpipe:trace |
Trace flow execution |
--follow , --steps
|
flowpipe:queue:status |
Show queue status |
--queue , --connection
|
flowpipe:test |
Test flow execution |
--dry-run , --report
|
flowpipe:analyze |
Analyze flow performance |
--all , --format
|
- Configuration - Detailed configuration options
- Error Handling - Advanced error handling strategies
- Queue Integration - Asynchronous workflow processing
- Example User Registration - See commands in practice
Laravel Flowpipe - YAML-driven workflow engine for Laravel
GitHub: Laravel Flowpipe Repository | Support: GitHub Issues
Quick Navigation: Home β’ Installation β’ Configuration β’ Commands β’ Examples
π§ Developed by Grazulex