Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Workflow Laravel Package

durable-workflow/workflow

Durable Workflow for Laravel lets you define workflows and activities as simple PHP classes, with queuing, parallel execution, retries, and error handling. Ideal for sagas, pipelines, AI agent flows, and complex business processes.

View on GitHub
Deep Wiki
Context7

Durable Workflow (formerly Laravel Workflow) is a package for the Laravel web framework that provides tools for defining and managing workflows and activities. A workflow is a series of interconnected activities that are executed in a specific order to achieve a desired result. Activities are individual tasks or pieces of logic that are executed as part of a workflow.

Durable Workflow can be used to automate and manage complex processes, such as agentic workflows (AI-driven), financial transactions, data analysis, data pipelines, microservices, job tracking, user signup flows, sagas and other business processes. By using Durable Workflow, developers can break down large, complex processes into smaller, modular units that can be easily maintained and updated.

Some key features and benefits of Durable Workflow include:

  • Support for defining workflows and activities using simple, declarative PHP classes.
  • Tools for starting, monitoring, and managing workflows, including support for queuing and parallel execution.
  • Built-in support for handling errors and retries, ensuring that workflows are executed reliably and consistently.
  • Integration with Laravel's queue and event systems, allowing workflows to be executed asynchronously on worker servers.
  • Extensive documentation and a growing community of developers who use and contribute to Durable Workflow.

Documentation

Documentation for Durable Workflow can be found on the website.

Community

You can find us in the GitHub discussions and also on our Discord channel.

Sample App

There's also a sample application that you can run directly from GitHub in your browser.

Usage

Install the embedded Laravel runtime:

curl -fsSL https://durable-workflow.com/install-sdk.sh | sh -s -- workflow

This package owns Laravel service-provider integration, migrations, Eloquent models, queue jobs, replay persistence, and in-process workflow and activity authoring. It does not include a client or remote-worker runtime for the standalone server.

1. Create a workflow

use function Workflow\V2\activity;
use Workflow\V2\Workflow;

class MyWorkflow extends Workflow
{
    public function handle(string $name): string
    {
        $result = activity(MyActivity::class, $name);

        return $result;
    }
}

2. Create an activity

use Workflow\V2\Activity;

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

3. Run the workflow

use Workflow\V2\WorkflowStub;

$workflow = WorkflowStub::make(MyWorkflow::class);
$workflow->start('world');
$workflow->output();
=> 'Hello, world!'

Using a dedicated storage connection

By default all workflow persistence (every Eloquent model and every migration shipped by this package) lives on your application's default database connection. To isolate workflow state on its own database — for separate backup/retention/scaling, a different driver, or tenant isolation — point the package at a dedicated connection:

// config/workflows.php
'storage' => [
    // null => the application's default connection (the default, unchanged behavior).
    'connection' => Env::dw('DW_STORAGE_CONNECTION', 'WORKFLOW_STORAGE_CONNECTION', null),
],
# .env — must match a key under config('database.connections')
DW_STORAGE_CONNECTION=durable_workflow

When set, both the models and the migrations are routed to that connection, so php artisan migrate creates the workflow tables there and all reads/writes target it. Leaving it null preserves today's behavior exactly.

The schema/database is governed by the connection's own configuration — use search_path for PostgreSQL or database for MySQL on that connection. There is no separate schema option.

Embedded and Polyglot Usage

This package provides the application-embedded version of Durable Workflow for Laravel.

Use it when your workflows and activities run within a Laravel application and you do not need workers written in other languages.

For standalone or polyglot orchestration, run the standalone Durable Workflow server and install the PHP SDK in framework-neutral PHP applications and remote workers:

curl -fsSL https://durable-workflow.com/install-sdk.sh | sh -s -- php

The standalone server allows PHP, Python, Rust, and other supported SDKs to participate in the same workflow system.

Deployment mode PHP package Runtime owner
Embedded Laravel durable-workflow/workflow The Laravel application owns durable state and queue execution.
Standalone server host durable-workflow/workflow inside durable-workflow/server The server hosts Workflow's engine contracts and persistence.
Standalone PHP client or remote worker durable-workflow/sdk The SDK owns authentication, transport, protocol types, client operations, and worker polling.

Sponsors

The Durable Workflow package is sustained by the community via sponsors and volunteers.

  • Andriy Karpishyn
  • Freispace Resource Scheduling
  • Translate a Book

Monitoring

Waterline is a separate UI that works nicely alongside Horizon. Think of Waterline as being to workflows what Horizon is to queues. Waterline is a technical runtime UI for operators: use it for fleet health, queues, waits, retries, failures, repair, and history diagnostics. Business dashboards should read app-owned milestone projections keyed by workflow_id and run_id, not Waterline data or workflow runtime tables.

Dashboard View

Waterline dashboard

Workflow View

Waterline workflow detail

Refer to https://github.com/durable-workflow/waterline for installation and configuration instructions.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator