Skip to content

Commit bfa7c91

Browse files
authored
fix(response): fix response block http format (#2027)
* Fix response block * Lint
1 parent e37b01b commit bfa7c91

File tree

1 file changed

+6
-0
lines changed
  • apps/sim/app/api/workflows/[id]/execute

1 file changed

+6
-0
lines changed

apps/sim/app/api/workflows/[id]/execute/route.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { executeWorkflowCore } from '@/lib/workflows/executor/execution-core'
1515
import { type ExecutionEvent, encodeSSEEvent } from '@/lib/workflows/executor/execution-events'
1616
import { PauseResumeManager } from '@/lib/workflows/executor/human-in-the-loop-manager'
1717
import { createStreamingResponse } from '@/lib/workflows/streaming'
18+
import { createHttpResponseFromBlock, workflowHasResponseBlock } from '@/lib/workflows/utils'
1819
import { validateWorkflowAccess } from '@/app/api/workflows/middleware'
1920
import { type ExecutionMetadata, ExecutionSnapshot } from '@/executor/execution/snapshot'
2021
import type { StreamingExecution } from '@/executor/types'
@@ -495,6 +496,11 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
495496
loggingSession,
496497
})
497498

499+
const hasResponseBlock = workflowHasResponseBlock(result)
500+
if (hasResponseBlock) {
501+
return createHttpResponseFromBlock(result)
502+
}
503+
498504
const filteredResult = {
499505
success: result.success,
500506
output: result.output,

0 commit comments

Comments
 (0)