Skip to main content
Durable Workflow requires PHP 8.1 or higher and Laravel 9.0 or higher.

Requirements

PHP

PHP 8.1 or higher

Laravel

Laravel 9.0, 10.0, 11.0, 12.0, or 13.0

Queue

A configured Laravel queue driver (database, Redis, etc.)

Database

MySQL, PostgreSQL, SQLite, or SQL Server

Install via Composer

1

Install the package

Install Durable Workflow using Composer:
composer require laravel-workflow/laravel-workflow
The package will be automatically discovered by Laravel.
2

Run migrations

Publish and run the migrations to create the required database tables:
php artisan migrate
This creates the following tables:
  • workflows - Stores workflow instances and their state
  • workflow_logs - Records each activity execution for replay
  • workflow_signals - Stores signals sent to workflows
  • workflow_timers - Manages scheduled timers
  • workflow_exceptions - Tracks exceptions that occur during execution
  • workflow_relationships - Manages parent-child workflow relationships
All tables use the default database connection unless you configure a different connection in the package configuration.
3

Configure your queue

Durable Workflow uses Laravel’s queue system. Ensure you have a queue driver configured in config/queue.php.For development, you can use the database driver:
config/queue.php
'default' => env('QUEUE_CONNECTION', 'database'),
For production, Redis is recommended:
config/queue.php
'default' => env('QUEUE_CONNECTION', 'redis'),
The sync driver is not recommended for workflows as it executes jobs synchronously and doesn’t provide the durability guarantees needed for workflow execution.
4

Start your queue worker

Start a queue worker to process workflows:
php artisan queue:work
For development with hot reloading:
php artisan queue:work --tries=3
Use a process manager like Supervisor in production to keep your queue workers running. See the Laravel queue documentation for details.

Optional configuration

You can publish the configuration file if you need to customize the package settings:
php artisan vendor:publish --provider="Workflow\Providers\WorkflowServiceProvider"
This creates a config/workflows.php file where you can configure:
  • Database connection
  • Queue connection and queue name
  • Serialization settings
  • Webhook authentication

Verify installation

Create a test workflow to verify everything is working:
php artisan make:workflow TestWorkflow
php artisan make:activity TestActivity
These commands generate:
  • app/Workflows/TestWorkflow.php - Your workflow class
  • app/Activities/TestActivity.php - Your activity class
If the make:workflow and make:activity commands are not available, ensure you’ve run composer dump-autoload after installing the package.

Next steps

Quick start guide

Learn how to create and run your first workflow

Build docs developers (and LLMs) love