Skip to content

Commit c19263e

Browse files
waleedlatif1claude
andcommitted
fix(duplicate): unlock all blocks when duplicating workflow
- Server-side workflow duplication now sets locked: false for all blocks - regenerateWorkflowStateIds also unlocks blocks for templates - Client-side regenerateBlockIds already handled this (for paste/import) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 63eba0f commit c19263e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

apps/sim/lib/workflows/persistence/duplicate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export async function duplicateWorkflow(
189189
parentId: newParentId,
190190
extent: newExtent,
191191
data: updatedData,
192+
locked: false, // Duplicated blocks should always be unlocked
192193
createdAt: now,
193194
updatedAt: now,
194195
}

apps/sim/lib/workflows/persistence/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ export function regenerateWorkflowStateIds(state: RegenerateStateInput): Regener
629629
// Regenerate blocks with updated references
630630
Object.entries(state.blocks || {}).forEach(([oldId, block]) => {
631631
const newId = blockIdMapping.get(oldId)!
632-
const newBlock: BlockState = { ...block, id: newId }
632+
// Duplicated blocks are always unlocked so users can edit them
633+
const newBlock: BlockState = { ...block, id: newId, locked: false }
633634

634635
// Update parentId reference if it exists
635636
if (newBlock.data?.parentId) {

0 commit comments

Comments
 (0)