qanna-rsa / workflow-engine
The headless workflow execution engine for Laravel
Requires
- php: ^8.1
- illuminate/bus: ^11.0|^12.0|^13.0
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/queue: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- laravel/prompts: ^0.1.24|^0.3
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^10.5|^11.0|^12.0
This package is not auto-updated.
Last update: 2026-08-08 14:54:18 UTC
README
Workflow Engine
A headless workflow automation engine for Laravel. Define a trigger and a graph of nodes, store the definition as data, and run it synchronously, asynchronously, or from the command line — no bundled UI required.
Workflow::run( workflowId: 'send-welcome-email', payload: ['email' => 'ada@example.com'] );
View live docs: Workflow Engine Documentation
Features
- Trigger-driven execution — Manual, Webhook, Schedule (cron), and Eloquent Model event triggers included.
- A large built-in node library — logic (condition, switch, loop), variables, HTTP, files, Eloquent model CRUD, math, text, date/time, and collection operations.
- An expression language —
{{ trigger.email }},{{ nodes.query.result.first().name }}, with a rich set of chainable helper methods. - Suspend and resume — nodes like Wait and Call Workflow can pause an execution and resume it later without re-running earlier steps.
- Pluggable storage — file-based (git-friendly) or database-backed, configured independently for workflows and executions.
- An interactive builder —
php artisan workflow:buildwalks you through constructing a workflow from the terminal, including a full interactive JSON builder. - A fluent schema API for custom nodes — declare a node's config form with
Schema::text(),Schema::select(),Schema::group(), and more, including fields that resolve dynamically based on earlier answers. - First-class testing support —
Workflow::fake()plus a full set of assertions.
Installation
composer require qanna-rsa/workflow-engine php artisan vendor:publish --tag=workflowengine::config
See the live documentation for the full guide, including the optional database storage migrations.
Quick Start
use Qanna\WorkflowEngine\Engine\Nodes\Action\LogNode; use Qanna\WorkflowEngine\Engine\Triggers\ManualTrigger; use Qanna\WorkflowEngine\Models\Workflow; use Qanna\WorkflowEngine\Storage\Contracts\WorkflowRepositoryContract; $workflow = Workflow::fromArray([ 'id' => 'send-welcome-email', 'name' => 'Send Welcome Email', 'trigger' => ['type' => ManualTrigger::type(), 'config' => []], 'nodes' => [[ 'id' => 'log', 'type' => LogNode::type(), 'config' => ['level' => 'info', 'message' => 'Welcome {{trigger.email}}'], ]], 'edges' => [['from' => 'trigger', 'to' => 'log', 'branch' => 'main']], ]); app(WorkflowRepositoryContract::class)->create($workflow);
use Qanna\WorkflowEngine\Facades\Workflow; Workflow::run('send-welcome-email', ['email' => 'ada@example.com']);
Or skip the code and build it interactively:
php artisan workflow:build
See the live documentation for a walkthrough of both paths.
Documentation
Full documentation — installation, configuration, concepts, the built-in node reference, triggers, the interactive builder, testing, and extension points — lives at:
qanna-rsa.github.io/workflow-engine.github.io
License
Released under the MIT License.