Laravel Workflow is a Durable workflow engine that allows users to write long-running persistent distributed workflows (orchestrations) in PHP powered by Laravel Queues. composer require laravel-workflow/laravel-workflow php artisan vendor:publish --provider="Workflow\Providers\WorkflowServiceProvider" --tag="migrations" class MyWorkflow extends Workflow { public function execute() { $result = yield ActivityStub::make(MyActivity::class); return $result; }}
class MyWorkflow extends Workflow { private bool $isReady = false; #[SignalMethod] public function ready() { $this->isReady = true; } public function execute() { $result = yield ActivityStub::make(MyActivity::class); yield WorkflowStub::await(fn () => $this->isReady); $otherResult = yield ActivityStub::make(MyOtherActivity::class); return $result. $otherResult; }}
$result = yield WorkflowStub::awaitWithTimeout(300, fn () => $this->isReady); This will wait like the previous signal example but it will timeout after 5 minutes.