@@ -6,6 +6,7 @@ import { env } from '@/lib/env'
66import { createLogger } from '@/lib/logs/console/logger'
77import { simAgentClient } from '@/lib/sim-agent'
88import { generateRequestId } from '@/lib/utils'
9+ import { SIM_AGENT_API_URL_DEFAULT } from '@/lib/sim-agent'
910import {
1011 loadWorkflowFromNormalizedTables ,
1112 saveWorkflowToNormalizedTables ,
@@ -20,6 +21,7 @@ import { customTools, workflowCheckpoints, workflow as workflowTable } from '@/d
2021import { generateLoopBlocks , generateParallelBlocks } from '@/stores/workflows/workflow/utils'
2122
2223const logger = createLogger ( 'YamlWorkflowAPI' )
24+ const SIM_AGENT_API_URL = env . SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
2325
2426const YamlWorkflowRequestSchema = z . object ( {
2527 yamlContent : z . string ( ) . min ( 1 , 'YAML content is required' ) ,
@@ -292,7 +294,7 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
292294 { } as Record < string , BlockConfig >
293295 )
294296
295- const conversionResponse = await fetch ( `${ env . SIM_AGENT_API_URL } /api/yaml/to-workflow` , {
297+ const conversionResponse = await fetch ( `${ SIM_AGENT_API_URL } /api/yaml/to-workflow` , {
296298 method : 'POST' ,
297299 headers : {
298300 'Content-Type' : 'application/json' ,
0 commit comments