phpmentors/workflower
Workflower is an open-source BPMN 2.0 workflow engine for PHP. Import BPMN process definitions and run process instances with tasks, events, gateways, lanes, and sequence flows, plus interfaces for persistence via serialization/deserialization.
ExpressionLanguage → Laravel’s Illuminate\Contracts\ExpressionLanguage or a custom solution)..bpmn files in a defined directory. Laravel could:
storage/app/workflows/ or a config-defined path.| Risk Area | Mitigation Strategy |
|---|---|
| Outdated Maintenance | Last release: 2019. Risk of compatibility issues with modern PHP/Laravel. |
| Symfony Dependencies | Abstract Symfony-specific components (e.g., ExpressionLanguage) via interfaces. |
| Persistence Layer | Implement custom WorkflowSerializerInterface for Eloquent (e.g., JSON/Blob storage). |
| Expression Language | Replace Symfony’s ExpressionLanguage with a lightweight alternative (e.g., php-expr). |
| Task Allocation | Laravel’s auth system can replace Symfony’s security integration for role-based task assignment. |
ExpressionLanguage, ProcessAware, etc.workflow_state column (Eloquent)..bpmn files only use supported constructs.ProcessContextInterface and WorkflowSerializer for unit tests.| Laravel Component | Workflower Integration Strategy |
|---|---|
| Service Container | Register Workflower services manually (e.g., WorkflowEngine, ProcessDefinitionRepository). |
| Eloquent ORM | Implement WorkflowSerializableInterface for Eloquent models (store workflow state in DB). |
| Expression Language | Replace Symfony’s ExpressionLanguage with spatie/laravel-expression-language or a custom evaluator. |
| Authentication | Use Laravel’s gates/policies for task assignment instead of Symfony’s security system. |
| Filesystem | Store .bpmn files in storage/app/workflows/ and load via Storage::disk('local')->files(). |
| Queues/Jobs | Offload long-running workflow steps to Laravel Queues (e.g., completeWorkItem). |
| Events | Dispatch Laravel events (e.g., WorkflowStarted, TaskAssigned) for reactivity. |
Phase 1: Proof of Concept (2-4 weeks)
storage/app/workflows/approval.bpmn).ApprovalProcess implementing ProcessContextInterface).WorkflowSerializer for Eloquent.Phase 2: Core Integration (4-6 weeks)
ExpressionLanguage with a Laravel-compatible alternative.process_aware (Laravel’s bindings or tags).Phase 3: Production Readiness (2-4 weeks)
| Component | Compatibility Notes |
|---|---|
| PHP 8.x | Workflower may need backported compatibility (e.g., TypedProperty support). |
| Laravel 9/10 | No major conflicts, but Symfony dependencies must be abstracted. |
| Doctrine ORM | Replace with Eloquent via custom WorkflowSerializer. |
| Symfony ExpressionLanguage | Use spatie/laravel-expression-language or a minimal parser (e.g., php-expr). |
| BPMN 2.0 Tools | Use Camunda Modeler or bpmn.io to design .bpmn files (compatible with Workflower). |
phpmentors/workflower:^1.4).WorkflowSerializer for Eloquent.LoanRequestProcess).ProcessContextInterface and WorkflowSerializableInterface.ProcessAwareInterface services (e.g., LoanApprovalService).bind() or tags()).php artisan workflow:complete).| Task | Effort Level | Notes |
|---|---|---|
| BPMN File Updates | Low | Version-control .bpmn files; deploy with app. |
| Workflow State Migrations | Medium | Schema changes may require data migration scripts. |
| Dependency Updates | High | Workflower is abandoned; monitor for PHP/Laravel compatibility breaks. |
| Expression Language | Medium | Custom evaluator may need updates if syntax changes. |
| Task Assignment Logic | Low | Laravel Auth policies can be updated independently. |
| Issue Type | Resolution Strategy |
|---|---|
| Workflow Stuck | Implement timeout handlers (e.g., retry failed tasks via Laravel Queues). |
| Permission Errors | Use Laravel’s gates/policies for fine-grained task access control. |
| Performance Bottlenecks | Optimize DB queries (e.g., index workflow_state column). Add caching for frequent workflow lookups. |
| BPMN Design Errors | Validate .bpmn files with Camunda Modeler before deployment. |
| Expression Errors | Log failed expressions; provide admin UI to debug context data. |
| Concern | Solution |
|---|
How can I help you explore Laravel packages today?