@@ -57,6 +57,7 @@ import {
5757import { flattenWorkflowOutputs } from '@/lib/workflows/blocks/flatten-outputs'
5858import { normalizeInputFormatValue } from '@/lib/workflows/input-format'
5959import type { DeployedWorkflowData } from '@/lib/workflows/persistence/utils'
60+ import { TriggerUtils } from '@/lib/workflows/triggers/triggers'
6061import { ResolvedSecretTraceRegistry } from '@/executor/utils/resolved-secret-trace-registry'
6162
6263export type { WorkflowGroupCellPayload }
@@ -85,15 +86,15 @@ export function assertWorkflowGroupMatchesLatestDeployment(
8586 )
8687 }
8788
88- const startBlock = Object . values ( deployment . blocks ) . find (
89- ( block ) => block . type === 'start_trigger'
90- )
91- if ( ! startBlock ) {
89+ const startCandidate = TriggerUtils . findStartBlock ( deployment . blocks , 'manual' )
90+ if ( ! startCandidate ) {
9291 throw new Error ( 'Workflow is missing a Start trigger' )
9392 }
9493
9594 const validInputNames = new Set (
96- normalizeInputFormatValue ( startBlock . subBlocks ?. inputFormat ?. value ) . map ( ( input ) => input . name )
95+ normalizeInputFormatValue ( startCandidate . block . subBlocks ?. inputFormat ?. value ) . map (
96+ ( input ) => input . name
97+ )
9798 )
9899 const invalidInput = ( group . inputMappings ?? [ ] ) . find (
99100 ( mapping ) => ! validInputNames . has ( mapping . inputName )
@@ -746,10 +747,8 @@ async function runWorkflowAndWriteTerminal(
746747 } )
747748 return 'error'
748749 }
749- const startBlock = normalizedData
750- ? Object . values ( normalizedData . blocks ) . find ( ( b ) => b ?. type === 'start_trigger' )
751- : undefined
752- if ( ! startBlock ) {
750+ const startCandidate = TriggerUtils . findStartBlock ( normalizedData . blocks , 'manual' )
751+ if ( ! startCandidate ) {
753752 await writeState ( {
754753 status : 'error' ,
755754 executionId,
@@ -1037,7 +1036,7 @@ async function runWorkflowAndWriteTerminal(
10371036 } ,
10381037 executionMode : 'sync' ,
10391038 workflowTriggerType : 'table' ,
1040- triggerBlockId : startBlock . id ,
1039+ triggerBlockId : startCandidate . blockId ,
10411040 useDraftState : false ,
10421041 workflowStateOverride : normalizedData ,
10431042 abortSignal : attemptSignal ,
0 commit comments