Weave Code
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 reliable workflows and activities in PHP, run them async via queues, manage retries/errors, and orchestrate complex business processes like sagas, pipelines, transactions, and AI-driven agentic flows.

View on GitHub
Deep Wiki
Context7

Core package for defining and running durable workflows and activities. Supports long-running persistent workflows, retries, queues, parallel execution, workflow monitoring, dedicated storage connections, and orchestration for microservices, data pipelines, sagas, agentic workflows, and other complex business processes.

Frequently asked questions about Workflow
How do I install Durable Workflow in a Laravel 11+ project?
Run `composer require durable-workflow/workflow` to install the package. Ensure your project uses PHP 8.2+ and Laravel 11+. The package auto-registers its service provider, but verify your `.env` includes a supported queue driver (e.g., `QUEUE_CONNECTION=database` or `redis`).
Can I use Durable Workflow with Laravel Horizon for monitoring?
Yes, workflows appear in Horizon as 'Workflow Jobs' with custom metrics like `activities_completed` and `retries_attempted`. No additional configuration is needed beyond installing the package and running Horizon’s queue worker.
What Laravel versions does Durable Workflow support?
Durable Workflow requires Laravel 11+ (PHP 8.2+) due to dependency updates. Older Laravel versions (e.g., 10.x) are unsupported, though you can check the GitHub issues for potential downgrade paths or community forks.
How do I define a workflow with activities in PHP?
Use the `Workflow` class to define steps and `Activity` classes for tasks. For example, create a `PaymentWorkflow` with `ChargeActivity` and `NotifyActivity`, then dispatch it via `dispatch(new WorkflowJob($workflowDefinition))`. The package provides a declarative syntax for sequencing.
Does Durable Workflow support parallel execution of activities?
Yes, workflows can execute activities in parallel using the `--concurrency` flag with the `workflow:execute` Artisan command. For example, `php artisan workflow:execute --concurrency=5` runs up to 5 activities concurrently. Adjust based on your queue driver’s capacity.
How do I handle retries for failed activities in a workflow?
Retries are built into the package. Configure retry logic via the `retry` method in your `Activity` class (e.g., `retry(3, 100)` for 3 attempts with 100ms delay). Failed activities trigger Laravel’s queue retry mechanism, and you can customize error handling via `WorkflowObserver`.
Can I integrate Durable Workflow with non-PHP services (e.g., Go, Java)?
Yes, use the `WorkerProtocolClient` with gRPC to call activities implemented in other languages. The package handles serialization/deserialization of complex payloads. Ensure your services expose gRPC endpoints and your PHP environment has the `grpc/grpc` extension installed.
What storage options are supported for workflow persistence?
Durable Workflow supports PostgreSQL, MySQL, and SQLite (with limitations). PostgreSQL/MySQL require `jsonb` for activity context, which may need schema migrations. SQLite users should avoid alpha features like the LAMBDA queue driver, as it lacks full support.
How do I monitor workflow progress in real-time?
Workflow events implement `ShouldBroadcast`, so you can push updates to clients via Laravel Echo/Pusher. Subscribe to events like `WorkflowStarted` or `ActivityCompleted` in your frontend. The package also logs workflow lifecycle events to Laravel’s log system.
Are there alternatives to Durable Workflow for Laravel workflows?
Alternatives include `spatie/laravel-workflow` (simpler, less feature-rich) and `laravel-activity` for basic task orchestration. For advanced use cases like sagas or microservice orchestration, Durable Workflow offers superior parallelism, retries, and cross-language support. Evaluate based on your need for durability and complexity.
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.
graham-campbell/flysystem
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi