Installation
Requirements
Workflow requires the following to run:
- PHP 8.1 or later
- Laravel 9 or later
Workflow can be used with any queue driver that Laravel supports (except the sync driver), including:
- Amazon SQS
- Beanstalkd
- Database
- Redis
Each queue driver has its own prerequisites.
Workflow also requires a cache driver that supports locks.
✨ SQS Support:
timer()andawaitWithTimeout()work with any duration, even when using the SQS queue driver. Workflow automatically handles SQS's delay limitation transparently.
Installing the Workflow package
The Workflow package is installable via Composer. To install it, run the following command in your Laravel project:
composer require laravel-workflow/laravel-workflow
After installing the Workflow package, you must also publish the migrations. To publish the migrations, run the following command:
php artisan vendor:publish --provider="Workflow\Providers\WorkflowServiceProvider" --tag="migrations"
Once the migrations are published, you can run the migrate command to create the workflow tables in your database:
php artisan migrate
Running Workers
The Workflow package uses queues to run workflows and activities in the background. You will need to either run the queue:work command or use Horizon to run your queue workers. Without a queue worker, workflows and activities will not be processed. You cannot use the sync driver with queue workers.