Skip to content

Commit 825b455

Browse files
Adam GoughAdam Gough
authored andcommitted
added env var to route
1 parent 3d4b9f0 commit 825b455

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • apps/sim/app/api/workflows/[id]/yaml

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { env } from '@/lib/env'
66
import { createLogger } from '@/lib/logs/console/logger'
77
import { simAgentClient } from '@/lib/sim-agent'
88
import { generateRequestId } from '@/lib/utils'
9+
import { SIM_AGENT_API_URL_DEFAULT } from '@/lib/sim-agent'
910
import {
1011
loadWorkflowFromNormalizedTables,
1112
saveWorkflowToNormalizedTables,
@@ -20,6 +21,7 @@ import { customTools, workflowCheckpoints, workflow as workflowTable } from '@/d
2021
import { generateLoopBlocks, generateParallelBlocks } from '@/stores/workflows/workflow/utils'
2122

2223
const logger = createLogger('YamlWorkflowAPI')
24+
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
2325

2426
const 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

Comments
 (0)