Description
When the AI assistant generates a workflow, the workflow name is not validated for uniqueness. If the generated name matches an existing workflow in the project, the save fails with a validation error and the user cannot recover — the name field is not editable from that state.
The same issue can occur with duplicate job names within the generated workflow.
Steps to reproduce
- Create a workflow named "My Workflow"
- Open the AI assistant and ask it to generate a new workflow
- If the AI names it "My Workflow" (matching the existing one), the save fails
- The user is stuck — cannot manually edit the workflow name
Expected behavior
Workflow and job names should be automatically deduplicated (e.g., "My Workflow 1", "My Workflow 2") when applied, regardless of whether the workflow was created manually, from a template, or via AI.
Root cause
The importWorkflow function in the workflow store did not call validateWorkflowName (which triggers the server-side ensure_unique_name logic). The manual import path in WorkflowEditor called it, but the AI path in useAIWorkflowApplications did not.
Fix
PR #4606 centralizes both workflow name validation and job name deduplication inside importWorkflow so all import paths get it automatically.
Description
When the AI assistant generates a workflow, the workflow name is not validated for uniqueness. If the generated name matches an existing workflow in the project, the save fails with a validation error and the user cannot recover — the name field is not editable from that state.
The same issue can occur with duplicate job names within the generated workflow.
Steps to reproduce
Expected behavior
Workflow and job names should be automatically deduplicated (e.g., "My Workflow 1", "My Workflow 2") when applied, regardless of whether the workflow was created manually, from a template, or via AI.
Root cause
The
importWorkflowfunction in the workflow store did not callvalidateWorkflowName(which triggers the server-sideensure_unique_namelogic). The manual import path inWorkflowEditorcalled it, but the AI path inuseAIWorkflowApplicationsdid not.Fix
PR #4606 centralizes both workflow name validation and job name deduplication inside
importWorkflowso all import paths get it automatically.