diff --git a/apps/realtime/src/database/operations.ts b/apps/realtime/src/database/operations.ts
index cec1c8c0ba4..475fdbf6b29 100644
--- a/apps/realtime/src/database/operations.ts
+++ b/apps/realtime/src/database/operations.ts
@@ -32,6 +32,8 @@ import {
isKnownWorkflowTriggerBlock,
isWorkflowAnnotationOnlyBlockType,
isWorkflowBlockProtected,
+ normalizeWorkflowEdgeSourceHandle,
+ normalizeWorkflowEdgeTargetHandle,
} from '@sim/workflow-types/workflow'
import { and, eq, inArray, isNull, or, sql } from 'drizzle-orm'
import { drizzle } from 'drizzle-orm/postgres-js'
@@ -57,13 +59,21 @@ function toEdgeHandles(edge: PersistedEdgeRecord) {
}
interface EdgeAddCandidate {
- id?: string
+ id: string
source: string
target: string
sourceHandle?: string | null
targetHandle?: string | null
}
+function canonicalizeEdgeAddCandidate(edge: EdgeAddCandidate): EdgeAddCandidate {
+ return {
+ ...edge,
+ sourceHandle: normalizeWorkflowEdgeSourceHandle(edge.sourceHandle),
+ targetHandle: normalizeWorkflowEdgeTargetHandle(edge.targetHandle),
+ }
+}
+
interface FilterEdgesForPersistResult
+ The canonical workflow field language. These examples exercise shared EMCN chrome + before workflow-specific adapters add variables, references, and generated content. +
+No versions yet
++ Your deployment history will appear here. +
+ No live version +
++ Deploy this workflow to create a live preview and version history. +
{section.description}
+