symfony/workflow
Symfony Workflow component helps model and run workflows or finite state machines. Define places and transitions, guard rules, events, and marking stores to track state changes and integrate processes cleanly into your application.
if-else checks for order statuses) with a declarative workflow system in Laravel. Ideal for domains like e-commerce, SaaS feature rollouts, or HR pipelines where transitions are multi-step and conditional. Example: Replace 200+ lines of order-processing logic with a YAML-defined workflow (e.g., draft → review → approved → shipped).workflow:trace) and monitoring (e.g., Sentry for failed transitions).user.subscription_tier >= 'enterprise'). Eliminates manual flag checks and reduces misconfiguration risks in production.OrderShipped) for notifications, analytics, or async tasks (via Laravel Queues). Example: Automatically dispatch SlackNotification or SendEmail when an order transitions to shipped.tenantA to require 2 approvals while tenantB uses 1 approval.Adopt when:
verified AND budget > $X" or "reject if fraud_score > 0.9").order.shipped, log to audit table, or trigger a webhook to Stripe).workflow:dump CLI).Avoid when:
is_active toggle → use Eloquent accessors or spatie/laravel-state-machine).spatie/laravel-state-machine for 2-state processes).Executives: *"Symfony Workflow is a proven, enterprise-grade solution to eliminate manual errors and compliance risks in critical business processes—like order fulfillment, content moderation, or user onboarding. Here’s the impact:
if-else logic with declarative workflows, cutting bugs and maintenance costs. Used by Sentry, Shopware, and Blackfire to streamline high-stakes processes.Engineering Teams: *"Symfony Workflow gives you superpowers for managing complex state transitions in Laravel:
if-else hell with YAML: Define workflows like this:
# config/workflows/order_workflow.yaml
support:
marking_store:
method: getStatus
type: method
initial_marking: draft
transitions:
submit:
from: draft
to: submitted
approve:
from: submitted
to: approved
guard: isAdmin
OrderShipped, InvoicePaid, etc., to dispatch notifications, queues, or webhooks without tight coupling.php artisan workflow:dump to generate Mermaid diagrams or inspect traces with workflow:trace.config('workflows.tenant_1').How can I help you explore Laravel packages today?