Skip to content

[P3] AI-generated workflows can't be saved when name collides with existing workflow #4607

@elias-ba

Description

@elias-ba

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

  1. Create a workflow named "My Workflow"
  2. Open the AI assistant and ask it to generate a new workflow
  3. If the AI names it "My Workflow" (matching the existing one), the save fails
  4. 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.

Metadata

Metadata

Assignees

Labels

bugNewly identified bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions