Skip to content

Fix 'workflow not found' when the chat assistant creates a workflow - #12

Merged
Evanfeenstra merged 1 commit into
mainfrom
claude/workflow-creation-sync-error-cdcdbf
Sep 18, 2026
Merged

Evanfeenstra merged 1 commit into
mainfrom
claude/workflow-creation-sync-error-cdcdbf

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Contributor

What changed

ChatFlyout now calls onWorkflowCreated from onToolResult instead of onToolCall. It only fires when create_workflow succeeds (output.ok), and it passes the name the server returns (output.name).

Why

When the assistant created a workflow, the UI showed "workflow not found" until the page was refreshed. The tool-input event fires before the tool runs, so the sidebar refresh and getWorkflowFlow fetch happened before the workflow existed and got a 404. That set loadError.

This also fixes two related problems:

  • Renamed workflows: if the requested name is taken, create_workflow may save under a different one, and the old code selected the requested name.
  • Failed validation: when validation fails nothing is saved, but the old code still selected the workflow.

Reviewer notes

  • This follows the same pattern run_workflow already uses in the same handler.
  • Not typechecked or tested in the running app. The worktree had no node_modules.
  • To check it: ask the assistant to create a workflow. The canvas should open it with no error.

The chat UI selected the new workflow on the tool-call event, which fires
before the tool executes, so the sidebar refresh and flow fetch raced the
publish and 404'd. Move it to the tool-result event, gate on ok, and use
the final (possibly collision-renamed) name.
@Evanfeenstra
Evanfeenstra merged commit 010e7ff into main Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant