v0.4.0 — workflows are classes
Breaking change: AgentWorkflow::define() is removed. Every workflow is now a dedicated class, generated with php artisan make:agent-workflow and registered in the config workflows array — which loads at boot on every process, so queue workers always know your definitions (the failure mode where define() ran somewhere workers never boot is no longer possible to write).
class TicketReply extends Workflow
{
public function build(WorkflowDefinition $workflow): WorkflowDefinition
{
return $workflow
->step(DraftReplyAgent::class,
prompt: fn ($state) => 'Draft a reply to: '.$state->get('ticket_message'))
->awaitHuman(reason: 'Review the drafted reply', schema: ['final_reply' => 'required|string'])
->step(SendReply::class);
}
}// config/agent-workflows.php
'workflows' => [App\AgentWorkflows\TicketReply::class],
// start by class (type-safe) or by registered name:
AgentWorkflow::start(TicketReply::class, input: [...]);Migration: move each define() chain into a Workflow class's build() method and list the class in config. AgentWorkflow::register() remains for runtime registration (tests, packages).