Skip to main content

Installation

Require the package​

composer require qanna-rsa/workflow-engine

The service provider and the Workflow facade alias are registered automatically via package discovery.

Publish the config​

php artisan vendor:publish --tag=workflowengine::config

This writes config/workflowengine.php. See Configuration for every key.

Run the migrations​

Workflows and execution records are stored in your database. Publish and run the migration:

php artisan vendor:publish --tag=workflowengine::migrations
php artisan migrate

This creates four tables: workflows, workflow_versions, workflow_executions, and workflow_execution_logs. See Storage.

To keep workflows in git, export them to JSON files — see Exporting and importing.

Queue worker (for async execution)​

Running a workflow with Workflow::dispatch(...), or resuming after a long Wait, uses Laravel's queue. If you use those, run a worker:

php artisan queue:work

Synchronous execution (Workflow::run(...)) needs no worker.

Scheduler (for the Schedule trigger)​

The Schedule trigger registers cron entries on Laravel's scheduler at boot. For those to fire, Laravel's scheduler must be running (php artisan schedule:work locally, or the usual single cron entry calling schedule:run in production).

Webhook routes (for the Webhook trigger)​

The Webhook trigger registers a POST route per workflow at boot under the webhooks/ prefix. No extra setup is required, but note that webhook/schedule/model-event workflows only wire themselves up for their published version on the next application boot — restart your app and queue workers after publishing one.