durable-workflow/workflow

Embedded durable workflow runtime and orchestration engine for Laravel applications.
254,032 1,244
Install
composer require durable-workflow/workflow
Latest Version:2.0.14
PHP:^8.1
License:MIT
Last Updated:Sep 12, 2026
Links: GitHub  ·  Packagist
Maintainer: rmcdaniel

Durable Workflow for Laravel

Durable Workflow is the embedded Laravel runtime for durable execution. Write long-running workflows as ordinary PHP, keep completed work recorded through worker restarts and application deploys, and use Laravel's queues, cache, and database as the runtime.

This package also provides the orchestration engine hosted by Durable Workflow Server. Use the PHP SDK with Server or Durable Workflow Cloud when workers need to run outside the Laravel application or across PHP, Python, and Rust.

Install

composer require durable-workflow/workflow:^2.0
php artisan migrate

Run a Laravel queue worker or Horizon to execute workflows and activities:

php artisan queue:work

Your First Workflow

<?php

use Workflow\V2\Activity;
use Workflow\V2\Workflow;
use Workflow\V2\WorkflowStub;
use function Workflow\V2\activity;

final class GreetActivity extends Activity
{
    public function handle(string $name): string
    {
        return "Hello, {$name}!";
    }
}

final class GreetWorkflow extends Workflow
{
    public function handle(string $name): string
    {
        return activity(GreetActivity::class, $name);
    }
}

$workflow = WorkflowStub::make(GreetWorkflow::class);
$workflow->start('world');

echo $workflow->output(); // Hello, world!

Workflow code can coordinate activities, timers, signals, queries, updates, child workflows, sagas, cancellation, retries, parallel work, side effects, continue-as-new, search attributes, memo, and message streams. The runtime persists execution history so replay can resume after process or host failure without repeating completed activities.

Choose a Deployment

Deployment Use it when Runtime owner
Embedded Laravel Workflows and activities live inside one Laravel application. Your application owns persistence and queue execution.
Self-hosted Server Workers run independently or in multiple languages. Your team operates Server, MySQL, Redis, and optional Waterline.
Durable Workflow Cloud You want a managed runtime for PHP, Python, and Rust workers. Durable Workflow operates the runtime and persistence.

Embedded runs remain owned by the Laravel application. Moving new work to Server or Cloud does not reinterpret existing embedded history.

Learn More

Questions and design discussions are welcome in GitHub Discussions and Discord.

Sponsors

Durable Workflow is sustained by contributors and sponsors:

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444