juststeveking/workflow-engine
A lightweight workflow engine for Laravel applications. Define workflows with states, transitions, guards, and actions to model approval or business processes, then move records through each step using a clean, expressive PHP API.
Architecture fit. JustSteveKing/workflow-engine is a Laravel package that models workflows/state transitions as Eloquent-backed entities. The v1.1.2 change—letting a subclassed model declare its own factory via a newFactory() override—confirms the package is designed around Eloquent models that consumers are expected to extend. That is a good architectural sign for a workflow engine: teams routinely need to add domain fields, relationships, or casting to workflow/transition models, and an extensible model layer is a prerequisite for that. Fit is strong if your domain maps to explicit states and guarded transitions; weaker if you need a general-purpose BPMN/orchestration engine.
Integration feasibility. Delivery is via Composer with Laravel package auto-discovery, so adoption is a composer require plus optional config/migration publishing. The footprint appears small and non-invasive. The main unknown is whether the package ships its own migrations and how it handles the workflows/transitions schema against an existing database—that determines whether integration is a 30-minute task or a migration project.
Technical risk. Low-to-moderate. This is a patch-level release (semver patch), the change is additive and backwards-compatible, and it does not alter runtime workflow semantics. The larger risks are structural, not version-specific: single-maintainer project (bus factor), a young 1.x API surface, and limited public signal about production usage at scale. The factory change itself is a normal Laravel extensibility pattern and should not affect existing consumers who have not subclassed models.
Key questions.
Stack fit. Targets a conventional Laravel stack—PHP 8.x, Eloquent, service container, and likely events/listeners for transition side effects. It slots in alongside existing domain models rather than replacing an application layer. Verify framework version constraints in composer.json before committing; the release notes do not state them.
Migration path. There is no prior assessment, so treat this as a greenfield evaluation. Recommended path: (1) install in a sandbox branch, (2) publish and inspect config and migrations, (3) model one real, low-risk business workflow (e.g. an approval or onboarding flow) end-to-end, (4) confirm audit history and failure/rollback behavior, (5) only then expand to critical paths. Avoid retrofitting an existing state machine in the same step as adopting the package.
Compatibility. v1.1.2 is a patch release with a single additive change and no deprecations or breaking changes noted. Existing integrations that rely on default factories are unaffected; the change only matters if you subclass the package's models, in which case you can now point the subclass at your own factory. Pin to ^1.1 and review the v1.1.1 → v1.1.2 diff, which is small enough to audit in full.
Sequencing. Do the compatibility/version check first, then schema review, then a pilot workflow, then observability (logging transitions, alerting on stuck states), and finally broader rollout. Budget explicit time for the factory-subclass pattern if you plan to extend models—this release makes that cleaner, but you should decide your extension convention once rather than per model.
Maintenance. Low ongoing code footprint, but the update cadence is driven by a single maintainer. Plan to track releases and be prepared to fork or vendor the package if it goes quiet. The patch release is small and auditable, which reduces the cost of staying current.
Support. Community/GitHub-issues support rather than commercial. For anything on a revenue-critical path, assume you own first-line support and designate an internal owner for the package. Document your subclassed models and factories so the extension surface is understood by more than one engineer.
Scaling. Workflow engines of this shape typically scale with the database: transition writes are row-level operations, so throughput is bounded by DB capacity and index design on the workflow/state tables. Watch for contention on hot workflows and for N+1 patterns when loading transition history. Queue long-running side effects rather than executing them inline inside transition handling.
Failure modes. The ones to instrument for: workflows stuck in a state with no valid outgoing transition; transitions partially applied with side effects that did not complete (no transactional boundary around listeners); concurrent transitions on the same entity (needs optimistic locking or a guard); and schema drift if published migrations are edited locally. Add a periodic sweep for aged in-flight workflows and assert transition validity at the boundary.
Ramp-up. Modest for a Laravel-fluent team—one engineer can pilot a workflow in a day or two if the docs cover config, migrations, and transition definition. The non-obvious learning is the extension model (subclassing models and, as of v1.1.2, supplying your own factories), so codify a short internal example early. Budget a half-day for the first engineer to read the source, which is likely small enough to do so.
How can I help you explore Laravel packages today?