Skip to content

Commit fb6556a

Browse files
committed
fix workflow id handling
1 parent 5626b57 commit fb6556a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

  • skills/neuron-workflow-architect

skills/neuron-workflow-architect/SKILL.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ public function __invoke(ProcessEvent $event, WorkflowState $state): ResultEvent
222222
use NeuronAI\Workflow\Persistence\FilePersistence;
223223

224224
$persistence = new FilePersistence('/tmp/workflows');
225-
$workflowId = 'workflow_' . uniqid();
226225

227-
$workflow = Workflow::make($state, $persistence, $workflowId)
226+
$workflow = Workflow::make($persistence)
228227
->addNodes([...]);
229228

230229
try {
@@ -233,12 +232,11 @@ try {
233232
} catch (WorkflowInterrupt $interrupt) {
234233
// Present to user
235234
$request = $interrupt->getRequest();
236-
$state = $interrupt->getState();
235+
$workflowId = $interrupt->getWorkflowId();
237236

238237
// After user makes decisions:
239238
$resumeRequest = $this->getUserDecisions($request);
240-
$handler = $workflow->start($resumeRequest);
241-
$result = $handler->run();
239+
$result = $workflow->init($resumeRequest)->run();
242240
}
243241
```
244242

0 commit comments

Comments
 (0)