From 0bb09e7b3c5d12a3d26a8ec26d14e905b199bc9a Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Thu, 5 Feb 2026 23:33:50 -0800 Subject: [PATCH 1/4] fix(resolver): response format in deactivated branch --- apps/sim/executor/utils/block-data.ts | 31 ++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/apps/sim/executor/utils/block-data.ts b/apps/sim/executor/utils/block-data.ts index 9875c79e98..68df4f3371 100644 --- a/apps/sim/executor/utils/block-data.ts +++ b/apps/sim/executor/utils/block-data.ts @@ -1,3 +1,7 @@ +import { + extractFieldsFromSchema, + parseResponseFormatSafely, +} from '@/lib/core/utils/response-format' import { normalizeInputFormatValue } from '@/lib/workflows/input-format' import { isTriggerBehavior, normalizeName } from '@/executor/constants' import type { ExecutionContext } from '@/executor/types' @@ -51,15 +55,31 @@ function getInputFormatFields(block: SerializedBlock): OutputSchema { return schema } +function getResponseFormatSchema(block: SerializedBlock): OutputSchema | undefined { + const responseFormatValue = block.config?.params?.responseFormat + if (!responseFormatValue) return undefined + + const parsed = parseResponseFormatSafely(responseFormatValue, block.id) + if (!parsed) return undefined + + const fields = extractFieldsFromSchema(parsed) + if (fields.length === 0) return undefined + + const schema: OutputSchema = {} + for (const field of fields) { + schema[field.name] = { + type: (field.type || 'any') as 'string' | 'number' | 'boolean' | 'object' | 'array' | 'any', + } + } + return schema +} + export function getBlockSchema( block: SerializedBlock, toolConfig?: ToolConfig ): OutputSchema | undefined { const blockType = block.metadata?.id - // For blocks that expose inputFormat as outputs, always merge them - // This includes both triggers (start_trigger, generic_webhook) and - // non-triggers (starter, human_in_the_loop) that have inputFormat if ( blockType && BLOCKS_WITH_INPUT_FORMAT_OUTPUTS.includes( @@ -74,6 +94,11 @@ export function getBlockSchema( } } + const responseFormatSchema = getResponseFormatSchema(block) + if (responseFormatSchema) { + return responseFormatSchema + } + const isTrigger = isTriggerBehavior(block) if (isTrigger && block.outputs && Object.keys(block.outputs).length > 0) { From 12400d58f6652aabe0185aa999aefff08e104ac8 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Thu, 5 Feb 2026 23:51:42 -0800 Subject: [PATCH 2/4] add evaluator metrics too --- apps/sim/executor/utils/block-data.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apps/sim/executor/utils/block-data.ts b/apps/sim/executor/utils/block-data.ts index 68df4f3371..c70b5023cd 100644 --- a/apps/sim/executor/utils/block-data.ts +++ b/apps/sim/executor/utils/block-data.ts @@ -55,6 +55,24 @@ function getInputFormatFields(block: SerializedBlock): OutputSchema { return schema } +function getEvaluatorMetricsSchema(block: SerializedBlock): OutputSchema | undefined { + if (block.metadata?.id !== 'evaluator') return undefined + + const metrics = block.config?.params?.metrics + if (!Array.isArray(metrics) || metrics.length === 0) return undefined + + const validMetrics = metrics.filter( + (m: { name?: string }) => m?.name && typeof m.name === 'string' + ) + if (validMetrics.length === 0) return undefined + + const schema: OutputSchema = { ...(block.outputs as OutputSchema) } + for (const metric of validMetrics) { + schema[metric.name.toLowerCase()] = { type: 'number' } + } + return schema +} + function getResponseFormatSchema(block: SerializedBlock): OutputSchema | undefined { const responseFormatValue = block.config?.params?.responseFormat if (!responseFormatValue) return undefined @@ -94,6 +112,11 @@ export function getBlockSchema( } } + const evaluatorSchema = getEvaluatorMetricsSchema(block) + if (evaluatorSchema) { + return evaluatorSchema + } + const responseFormatSchema = getResponseFormatSchema(block) if (responseFormatSchema) { return responseFormatSchema From 2327844bcceee9be2cb9b80103e5b8f623b623fe Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Thu, 5 Feb 2026 23:58:16 -0800 Subject: [PATCH 3/4] add child workflow id to the workflow block outputs --- apps/sim/blocks/blocks/workflow.ts | 1 + apps/sim/blocks/blocks/workflow_input.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/sim/blocks/blocks/workflow.ts b/apps/sim/blocks/blocks/workflow.ts index d30ab4c6d3..37d0826aa8 100644 --- a/apps/sim/blocks/blocks/workflow.ts +++ b/apps/sim/blocks/blocks/workflow.ts @@ -42,6 +42,7 @@ export const WorkflowBlock: BlockConfig = { outputs: { success: { type: 'boolean', description: 'Execution success status' }, childWorkflowName: { type: 'string', description: 'Child workflow name' }, + childWorkflowId: { type: 'string', description: 'Child workflow ID' }, result: { type: 'json', description: 'Workflow execution result' }, error: { type: 'string', description: 'Error message' }, childTraceSpans: { diff --git a/apps/sim/blocks/blocks/workflow_input.ts b/apps/sim/blocks/blocks/workflow_input.ts index 24c3b3f670..febed399c8 100644 --- a/apps/sim/blocks/blocks/workflow_input.ts +++ b/apps/sim/blocks/blocks/workflow_input.ts @@ -41,6 +41,7 @@ export const WorkflowInputBlock: BlockConfig = { outputs: { success: { type: 'boolean', description: 'Execution success status' }, childWorkflowName: { type: 'string', description: 'Child workflow name' }, + childWorkflowId: { type: 'string', description: 'Child workflow ID' }, result: { type: 'json', description: 'Workflow execution result' }, error: { type: 'string', description: 'Error message' }, childTraceSpans: { From bf4f8796252948969f1d517c40436e98c4b71c57 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Fri, 6 Feb 2026 00:01:55 -0800 Subject: [PATCH 4/4] cleanup typing --- apps/sim/executor/utils/block-data.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/sim/executor/utils/block-data.ts b/apps/sim/executor/utils/block-data.ts index c70b5023cd..a5ef28d99e 100644 --- a/apps/sim/executor/utils/block-data.ts +++ b/apps/sim/executor/utils/block-data.ts @@ -47,9 +47,7 @@ function getInputFormatFields(block: SerializedBlock): OutputSchema { const schema: OutputSchema = {} for (const field of inputFormat) { if (!field.name) continue - schema[field.name] = { - type: (field.type || 'any') as 'string' | 'number' | 'boolean' | 'object' | 'array' | 'any', - } + schema[field.name] = { type: field.type || 'any' } } return schema @@ -85,9 +83,7 @@ function getResponseFormatSchema(block: SerializedBlock): OutputSchema | undefin const schema: OutputSchema = {} for (const field of fields) { - schema[field.name] = { - type: (field.type || 'any') as 'string' | 'number' | 'boolean' | 'object' | 'array' | 'any', - } + schema[field.name] = { type: field.type || 'any' } } return schema }