@@ -4,7 +4,7 @@ import { type NextRequest, NextResponse } from 'next/server'
44import { z } from 'zod'
55import { env } from '@/lib/env'
66import { createLogger } from '@/lib/logs/console/logger'
7- import { simAgentClient } from '@/lib/sim-agent'
7+ import { SIM_AGENT_API_URL_DEFAULT , simAgentClient } from '@/lib/sim-agent'
88import { generateRequestId } from '@/lib/utils'
99import {
1010 loadWorkflowFromNormalizedTables ,
@@ -20,6 +20,7 @@ import { customTools, workflowCheckpoints, workflow as workflowTable } from '@/d
2020import { generateLoopBlocks , generateParallelBlocks } from '@/stores/workflows/workflow/utils'
2121
2222const logger = createLogger ( 'YamlWorkflowAPI' )
23+ const SIM_AGENT_API_URL = env . SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
2324
2425const YamlWorkflowRequestSchema = z . object ( {
2526 yamlContent : z . string ( ) . min ( 1 , 'YAML content is required' ) ,
@@ -292,7 +293,7 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
292293 { } as Record < string , BlockConfig >
293294 )
294295
295- const conversionResponse = await fetch ( `${ env . SIM_AGENT_API_URL } /api/yaml/to-workflow` , {
296+ const conversionResponse = await fetch ( `${ SIM_AGENT_API_URL } /api/yaml/to-workflow` , {
296297 method : 'POST' ,
297298 headers : {
298299 'Content-Type' : 'application/json' ,
0 commit comments