Skip to content

Commit 0fe6960

Browse files
committed
fix(envvars): restore workflowUserId fallback for scheduled execution env var resolution
1 parent b0cb95b commit 0fe6960

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/sim/lib/workflows/executor/execution-core.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,13 @@ export async function executeWorkflowCore(
325325

326326
const mergedStates = mergeSubblockStateWithValues(blocks)
327327

328-
const personalEnvUserId = metadata.sessionUserId || metadata.userId
328+
const personalEnvUserId =
329+
metadata.isClientSession && metadata.sessionUserId
330+
? metadata.sessionUserId
331+
: metadata.workflowUserId
329332

330333
if (!personalEnvUserId) {
331-
throw new Error('Missing execution actor for environment resolution')
334+
throw new Error('Missing workflowUserId in execution metadata')
332335
}
333336

334337
const { personalEncrypted, workspaceEncrypted, personalDecrypted, workspaceDecrypted } =

0 commit comments

Comments
 (0)