Managing the State
Learn how to pass data around the workflow
Workflow Input/Output
// 1. Provide an initial state as workflow input to feed in some data
$workflow = Workflow::make(state: new WorkflowState(['query' => 'Hi!']))
->addNode(new InitialNode())
->addNode(...)
->addNode(...);
// 2. Execute the workflow and get the final state
$finalState = $workflow->init()->run();
// 3. Use the final state data
echo $finalState->get('message');Using state in nodes
Typed State
Last updated