Skip to content

Commit 4d973ff

Browse files
aadamgoughAdam Gough
andauthored
Fix(yaml env var): added env var fallback (#1300)
* added env var to route * lint --------- Co-authored-by: Adam Gough <[email protected]>
1 parent 8841e9b commit 4d973ff

File tree

1 file changed

+3
-2
lines changed
  • apps/sim/app/api/workflows/[id]/yaml

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type NextRequest, NextResponse } from 'next/server'
44
import { z } from 'zod'
55
import { env } from '@/lib/env'
66
import { 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'
88
import { generateRequestId } from '@/lib/utils'
99
import {
1010
loadWorkflowFromNormalizedTables,
@@ -20,6 +20,7 @@ import { customTools, workflowCheckpoints, workflow as workflowTable } from '@/d
2020
import { generateLoopBlocks, generateParallelBlocks } from '@/stores/workflows/workflow/utils'
2121

2222
const logger = createLogger('YamlWorkflowAPI')
23+
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
2324

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

Comments
 (0)