Skip to content

Commit f259799

Browse files
committed
Don't allow edges in note block and explicitly exclude from executor
1 parent 29a5c60 commit f259799

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,11 @@ const WorkflowContent = React.memo(() => {
14471447

14481448
if (!sourceNode || !targetNode) return
14491449

1450+
// Prevent connections to/from note blocks (annotation-only, non-executable)
1451+
if (sourceNode.data?.type === 'note' || targetNode.data?.type === 'note') {
1452+
return
1453+
}
1454+
14501455
// Prevent incoming connections to trigger blocks (webhook, schedule, etc.)
14511456
if (targetNode.data?.config?.category === 'triggers') {
14521457
return

apps/sim/executor/consts.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export enum BlockType {
2121

2222
WAIT = 'wait',
2323

24+
NOTE = 'note',
25+
2426
SENTINEL_START = 'sentinel_start',
2527
SENTINEL_END = 'sentinel_end',
2628
}
@@ -31,7 +33,11 @@ export const TRIGGER_BLOCK_TYPES = [
3133
BlockType.TRIGGER,
3234
] as const
3335

34-
export const METADATA_ONLY_BLOCK_TYPES = [BlockType.LOOP, BlockType.PARALLEL] as const
36+
export const METADATA_ONLY_BLOCK_TYPES = [
37+
BlockType.LOOP,
38+
BlockType.PARALLEL,
39+
BlockType.NOTE,
40+
] as const
3541

3642
export type LoopType = 'for' | 'forEach' | 'while' | 'doWhile'
3743

apps/sim/stores/workflows/workflow/store.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,14 @@ export const useWorkflowStore = create<WorkflowStore>()(
422422
},
423423

424424
addEdge: (edge: Edge) => {
425+
// Prevent connections to/from note blocks (annotation-only, non-executable)
426+
const sourceBlock = get().blocks[edge.source]
427+
const targetBlock = get().blocks[edge.target]
428+
429+
if (sourceBlock?.type === 'note' || targetBlock?.type === 'note') {
430+
return
431+
}
432+
425433
// Check for duplicate connections
426434
const isDuplicate = get().edges.some(
427435
(existingEdge) =>

0 commit comments

Comments
 (0)