Skip to content

Commit b8bc632

Browse files
fix(workflow-auth): adding workflowId param to only internal urls (#1710)
1 parent 4d7ebd8 commit b8bc632

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/sim/tools/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,10 @@ async function handleInternalRequest(
429429
typeof tool.request.url === 'function' ? tool.request.url(params) : tool.request.url
430430

431431
const fullUrlObj = new URL(endpointUrl, baseUrl)
432-
if (executionContext?.workflowId && typeof window === 'undefined') {
432+
const isInternalRoute = endpointUrl.startsWith('/api/')
433+
434+
// Only add workflowId to internal routes, not external APIs
435+
if (executionContext?.workflowId && typeof window === 'undefined' && isInternalRoute) {
433436
fullUrlObj.searchParams.set('workflowId', executionContext.workflowId)
434437
}
435438
const fullUrl = fullUrlObj.toString()
@@ -451,7 +454,6 @@ async function handleInternalRequest(
451454
}
452455

453456
const headers = new Headers(requestParams.headers)
454-
const isInternalRoute = endpointUrl.startsWith('/api/')
455457
if (typeof window === 'undefined') {
456458
if (isInternalRoute) {
457459
try {

0 commit comments

Comments
 (0)