From 175cd2d8690128849909cdf6202f1ac71b899588 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Mon, 17 Nov 2025 11:13:42 -0800 Subject: [PATCH 1/2] Fix response block --- apps/sim/app/api/workflows/[id]/execute/route.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/sim/app/api/workflows/[id]/execute/route.ts b/apps/sim/app/api/workflows/[id]/execute/route.ts index 8f2c9934ce..7216d999bb 100644 --- a/apps/sim/app/api/workflows/[id]/execute/route.ts +++ b/apps/sim/app/api/workflows/[id]/execute/route.ts @@ -15,6 +15,10 @@ import { executeWorkflowCore } from '@/lib/workflows/executor/execution-core' import { type ExecutionEvent, encodeSSEEvent } from '@/lib/workflows/executor/execution-events' import { PauseResumeManager } from '@/lib/workflows/executor/human-in-the-loop-manager' import { createStreamingResponse } from '@/lib/workflows/streaming' +import { + createHttpResponseFromBlock, + workflowHasResponseBlock, +} from '@/lib/workflows/utils' import { validateWorkflowAccess } from '@/app/api/workflows/middleware' import { type ExecutionMetadata, ExecutionSnapshot } from '@/executor/execution/snapshot' import type { StreamingExecution } from '@/executor/types' @@ -495,6 +499,11 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id: loggingSession, }) + const hasResponseBlock = workflowHasResponseBlock(result) + if (hasResponseBlock) { + return createHttpResponseFromBlock(result) + } + const filteredResult = { success: result.success, output: result.output, From d62d1be7f6583b11335bf1c9e97d7577683167b2 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Mon, 17 Nov 2025 11:42:02 -0800 Subject: [PATCH 2/2] Lint --- apps/sim/app/api/workflows/[id]/execute/route.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/sim/app/api/workflows/[id]/execute/route.ts b/apps/sim/app/api/workflows/[id]/execute/route.ts index 7216d999bb..9c6aa6542e 100644 --- a/apps/sim/app/api/workflows/[id]/execute/route.ts +++ b/apps/sim/app/api/workflows/[id]/execute/route.ts @@ -15,10 +15,7 @@ import { executeWorkflowCore } from '@/lib/workflows/executor/execution-core' import { type ExecutionEvent, encodeSSEEvent } from '@/lib/workflows/executor/execution-events' import { PauseResumeManager } from '@/lib/workflows/executor/human-in-the-loop-manager' import { createStreamingResponse } from '@/lib/workflows/streaming' -import { - createHttpResponseFromBlock, - workflowHasResponseBlock, -} from '@/lib/workflows/utils' +import { createHttpResponseFromBlock, workflowHasResponseBlock } from '@/lib/workflows/utils' import { validateWorkflowAccess } from '@/app/api/workflows/middleware' import { type ExecutionMetadata, ExecutionSnapshot } from '@/executor/execution/snapshot' import type { StreamingExecution } from '@/executor/types'