@@ -42,7 +42,7 @@ import {
4242 type StreamingExecution ,
4343} from '@/executor/types'
4444import { hasExecutionResult } from '@/executor/utils/errors'
45- import { buildAPIUrl , buildAuthHeaders } from '@/executor/utils/http'
45+ import { buildAuthHeaders , buildInternalApiUrl } from '@/executor/utils/http'
4646import { getIterationContext } from '@/executor/utils/iteration-context'
4747import { parseJSON } from '@/executor/utils/json'
4848import { lazyCleanupInputMapping } from '@/executor/utils/lazy-cleanup'
@@ -952,7 +952,7 @@ export class WorkflowBlockHandler implements BlockHandler {
952952
953953 private async loadChildWorkflow ( workflowId : string , userId ?: string ) {
954954 const headers = await buildAuthHeaders ( userId )
955- const url = buildAPIUrl ( `/api/workflows/${ workflowId } ` )
955+ const url = buildInternalApiUrl ( `/api/workflows/${ encodeURIComponent ( workflowId ) } ` )
956956
957957 const response = await fetch ( url . toString ( ) , { headers } )
958958
@@ -1015,7 +1015,7 @@ export class WorkflowBlockHandler implements BlockHandler {
10151015 private async checkChildDeployment ( workflowId : string , userId ?: string ) : Promise < boolean > {
10161016 try {
10171017 const headers = await buildAuthHeaders ( userId )
1018- const url = buildAPIUrl ( `/api/workflows/${ workflowId } /deployed` )
1018+ const url = buildInternalApiUrl ( `/api/workflows/${ encodeURIComponent ( workflowId ) } /deployed` )
10191019
10201020 const response = await fetch ( url . toString ( ) , {
10211021 headers,
@@ -1037,7 +1037,9 @@ export class WorkflowBlockHandler implements BlockHandler {
10371037
10381038 private async loadChildWorkflowDeployed ( workflowId : string , userId ?: string ) {
10391039 const headers = await buildAuthHeaders ( userId )
1040- const deployedUrl = buildAPIUrl ( `/api/workflows/${ workflowId } /deployed` )
1040+ const deployedUrl = buildInternalApiUrl (
1041+ `/api/workflows/${ encodeURIComponent ( workflowId ) } /deployed`
1042+ )
10411043
10421044 const deployedRes = await fetch ( deployedUrl . toString ( ) , {
10431045 headers,
@@ -1058,7 +1060,7 @@ export class WorkflowBlockHandler implements BlockHandler {
10581060 throw new Error ( `Deployed state missing or invalid for child workflow ${ workflowId } ` )
10591061 }
10601062
1061- const metaUrl = buildAPIUrl ( `/api/workflows/${ workflowId } ` )
1063+ const metaUrl = buildInternalApiUrl ( `/api/workflows/${ encodeURIComponent ( workflowId ) } ` )
10621064 const metaRes = await fetch ( metaUrl . toString ( ) , {
10631065 headers,
10641066 cache : 'no-store' ,
0 commit comments