11import { normalizeInputFormatValue } from '@/lib/workflows/input-format'
2- import { normalizeName } from '@/executor/constants'
2+ import { isTriggerBehavior , normalizeName } from '@/executor/constants'
33import type { ExecutionContext } from '@/executor/types'
44import type { OutputSchema } from '@/executor/utils/block-reference'
55import type { SerializedBlock } from '@/serializer/types'
@@ -13,18 +13,20 @@ export interface BlockDataCollection {
1313}
1414
1515/**
16- * Triggers where inputFormat fields should be merged into outputs schema.
16+ * Block types where inputFormat fields should be merged into outputs schema.
1717 * These are blocks where users define custom fields via inputFormat that become
18- * valid output paths (e.g., <start.myField>, <webhook1.customField>).
18+ * valid output paths (e.g., <start.myField>, <webhook1.customField>, <hitl1.resumeField>).
19+ *
20+ * Note: This includes non-trigger blocks like 'starter' and 'human_in_the_loop' which
21+ * have category 'blocks' but still need their inputFormat exposed as outputs.
1922 */
20- const TRIGGERS_WITH_INPUT_FORMAT_OUTPUTS = [
23+ const BLOCKS_WITH_INPUT_FORMAT_OUTPUTS = [
2124 'start_trigger' ,
2225 'starter' ,
2326 'api_trigger' ,
2427 'input_trigger' ,
2528 'generic_webhook' ,
2629 'human_in_the_loop' ,
27- 'approval' ,
2830] as const
2931
3032function getInputFormatFields ( block : SerializedBlock ) : OutputSchema {
@@ -48,17 +50,15 @@ export function getBlockSchema(
4850 block : SerializedBlock ,
4951 toolConfig ?: ToolConfig
5052) : OutputSchema | undefined {
51- const isTrigger =
52- block . metadata ?. category === 'triggers' ||
53- ( block . config ?. params as Record < string , unknown > | undefined ) ?. triggerMode === true
54-
5553 const blockType = block . metadata ?. id
5654
55+ // For blocks that expose inputFormat as outputs, always merge them
56+ // This includes both triggers (start_trigger, generic_webhook) and
57+ // non-triggers (starter, human_in_the_loop) that have inputFormat
5758 if (
58- isTrigger &&
5959 blockType &&
60- TRIGGERS_WITH_INPUT_FORMAT_OUTPUTS . includes (
61- blockType as ( typeof TRIGGERS_WITH_INPUT_FORMAT_OUTPUTS ) [ number ]
60+ BLOCKS_WITH_INPUT_FORMAT_OUTPUTS . includes (
61+ blockType as ( typeof BLOCKS_WITH_INPUT_FORMAT_OUTPUTS ) [ number ]
6262 )
6363 ) {
6464 const baseOutputs = ( block . outputs as OutputSchema ) || { }
@@ -69,6 +69,8 @@ export function getBlockSchema(
6969 }
7070 }
7171
72+ const isTrigger = isTriggerBehavior ( block )
73+
7274 if ( isTrigger && block . outputs && Object . keys ( block . outputs ) . length > 0 ) {
7375 return block . outputs as OutputSchema
7476 }
0 commit comments