Workflow Engine
A headless workflow automation engine for Laravel. You describe a trigger and a graph of nodes as plain data, store that definition, and run it — synchronously, on a queue, or from the command line. There is no bundled UI: the package is the engine, the node library, an expression language, and an interactive terminal builder.
use Qanna\WorkflowEngine\Facades\Workflow;
Workflow::run('send-welcome-email', ['email' => 'ada@example.com']);
What you get
- Trigger-driven execution — Manual, Webhook, Schedule (cron), and Eloquent model-event triggers are built in. See Triggers.
- A large built-in node library — branching logic, variables, HTTP, Eloquent CRUD, files, and math / text / date / collection / data helpers. See the Node reference.
- An expression language —
{{ trigger.email }},{{ nodes.list-orders.result.first().total }}, with a set of chainable helper methods. See Context & expressions. - Suspend and resume — a workflow can pause on a Wait or a child workflow and continue later without re-running earlier steps. See Suspend & resume.
- Pluggable storage — file-based (git-friendly) or database-backed, configured independently for workflow definitions and execution records. See Storage.
- An interactive builder —
php artisan workflow:buildwalks you through constructing a workflow from the terminal. See Building workflows. - A fluent schema API for custom nodes, including fields that resolve dynamically from earlier answers. See Extending.
- First-class testing support —
Workflow::fake()plus a full set of assertions that still run the real engine. See Testing.
How a workflow is put together
A workflow definition has four parts:
| Part | What it is |
|---|---|
id | A stable string you choose, e.g. send-welcome-email. |
trigger | { type, config } — what starts the workflow and with what payload. |
nodes | A list of { id, type, config } — the steps. |
edges | A list of { from, to, branch } — how steps connect, including branch names like true / false. |
The engine fires the trigger, and if it decides to proceed, walks the node graph
starting from the edge from: 'trigger'. Each node returns a result that becomes
available to later nodes as {{ nodes.<id>.* }}.
Start with Installation and the Quickstart.
Requirements
- PHP 8.1+
- Laravel 11, 12, or 13 (
illuminate/*^11 | ^12 | ^13) laravel/prompts(pulled in automatically; used by the interactive builder)
The test suite runs against a PHP 8.2–8.4 × Laravel 11–13 matrix.