From 9f0993ed57795cc1d0a6385a97bb6638734e7787 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Thu, 14 Aug 2025 02:18:18 -0500 Subject: [PATCH] fix(workflow-block): revert change bubbling up error for workflow block (#963) --- .../handlers/workflow/workflow-handler.ts | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/apps/sim/executor/handlers/workflow/workflow-handler.ts b/apps/sim/executor/handlers/workflow/workflow-handler.ts index 0291cc2607..4a78eab28b 100644 --- a/apps/sim/executor/handlers/workflow/workflow-handler.ts +++ b/apps/sim/executor/handlers/workflow/workflow-handler.ts @@ -115,12 +115,6 @@ export class WorkflowBlockHandler implements BlockHandler { duration ) - // If the child workflow failed, throw an error to trigger proper error handling in the parent - if ((mappedResult as any).success === false) { - const childError = (mappedResult as any).error || 'Unknown error' - throw new Error(`Error in child workflow "${childWorkflowName}": ${childError}`) - } - return mappedResult } catch (error: any) { logger.error(`Error executing child workflow ${workflowId}:`, error) @@ -134,15 +128,11 @@ export class WorkflowBlockHandler implements BlockHandler { const workflowMetadata = workflows[workflowId] const childWorkflowName = workflowMetadata?.name || workflowId - // Enhance error message with child workflow context - const originalError = error.message || 'Unknown error' - - // Check if error message already has child workflow context to avoid duplication - if (originalError.startsWith('Error in child workflow')) { - throw error // Re-throw as-is to avoid duplication - } - - throw new Error(`Error in child workflow "${childWorkflowName}": ${originalError}`) + return { + success: false, + error: error?.message || 'Child workflow execution failed', + childWorkflowName, + } as Record } }