feat(workflows): lock/duplicate improvements for workflows#4387
feat(workflows): lock/duplicate improvements for workflows#4387icecrasher321 merged 11 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Introduces folder/workflow row-level locking controls and inherited lock behavior in the UI. Folder/workflow list items and the editor/panel now compute an effective lock (row lock or locked ancestor folder) via new Tightens and refactors duplication. Folder duplication now runs fully in a single transaction, blocks cross-workspace duplication, skips archived items, prevents duplicating into self/descendants, enforces parent-folder mutability, deduplicates target names, resets Also removes workspace duplicate/export/import UI + API endpoint, and updates contracts/query mapping to include Reviewed by Cursor Bugbot for commit 2f3f6dc. Configure here. |
Greptile SummaryThis PR adds workflow and folder lock/duplicate improvements: a new
Confidence Score: 3/5Two gaps in lock enforcement allow item creation inside locked folders — safe to merge only after those are fixed. Two P1 findings (missing assertFolderMutable on workflow and folder creation) leave real holes in the lock invariant. All other mutation paths are correctly guarded, the DB migration is clean, and the duplicate refactor is solid. apps/sim/app/api/workflows/route.ts (POST handler) and apps/sim/app/api/folders/route.ts (POST handler) both need assertFolderMutable added before the insert. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client mutation request] --> B{Route type}
B -->|PUT/DELETE workflow| C[assertWorkflowMutable]
B -->|POST workflow CREATE| X[❌ No lock check]
B -->|PUT/DELETE folder| D[assertFolderMutable on folder]
B -->|POST folder CREATE| Y[❌ No lock check]
B -->|reorder workflows| E[assertWorkflowMutable per item]
B -->|reorder folders| F[assertFolderMutable per item]
B -->|state/variables/autolayout| G[assertWorkflowMutable]
B -->|deploy/undeploy/revert| H[assertWorkflowMutable]
B -->|duplicate workflow| I[assertTargetFolderMutable in tx]
B -->|duplicate folder| J[assertTargetParentFolderMutable in tx]
B -->|realtime ops/subblocks/variables| K[assertWorkflowMutable]
C --> L{Locked?}
D --> L
E --> L
F --> L
G --> L
H --> L
I --> L
J --> L
K --> L
L -->|Yes| M[HTTP 423 WorkflowLockedError / FolderLockedError]
L -->|No| N[Proceed with DB write]
X --> N
Y --> N
|
|
bugbot run |
|
@greptile |
|
bugbot run |
|
@greptile |
|
bugbot run |
|
@greptile |
|
bugbot run |
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2f3f6dc. Configure here.

Summary
Lock/Duplicate Workflows, Folders.
Type of Change
Testing
Tested manually
Checklist