Open
Conversation
Workflow name validation and job name deduplication now happen centrally inside importWorkflow, fixing AI-generated workflows that couldn't be saved when they had a name collision with existing workflows or duplicate job names.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4606 +/- ##
==========================================
+ Coverage 89.54% 89.59% +0.05%
==========================================
Files 441 441
Lines 21355 21355
==========================================
+ Hits 19122 19133 +11
+ Misses 2233 2222 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Covers workflow name validation via channel, job name deduplication, graceful fallback when validation fails, and no-op for unique names.
Use a Set to track all used names (original + generated) instead of a simple counter, so "Transform 2" is skipped when it already exists.
Security ReviewClaude hit the max-turns limit or encountered an error before posting findings. See the workflow run for details. |
Add .catch() to the importWorkflow promise in WorkflowEditor to prevent unhandled rejections. Extract makeJob, makeWorkflowState, and getJobNames test helpers to reduce repetition in importWorkflow tests.
…union Extract selectedContextJobId with an `in` type guard to safely access job_id from the WorkflowTemplateContext discriminated union, fixing TS2339 errors and an eslint complex-expression warning.
theroinaochieng
approved these changes
Apr 9, 2026
Collaborator
theroinaochieng
left a comment
There was a problem hiding this comment.
Looks great @elias-ba!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes AI-generated workflows failing to save when the workflow name collides with an existing one or when the AI generates jobs with duplicate names.
The root cause was that workflow name validation (
ensure_unique_name) only ran in the manual import path (WorkflowEditor) but was skipped in the AI generation path (useAIWorkflowApplications). Instead of patching just the AI path, this centralizes both workflow name validation and job name deduplication insideimportWorkflowin the workflow store, so all import paths (manual, template, AI) get it automatically.Closes #4607
Validation steps
Additional notes for the reviewer
None.
AI Usage
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)