mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(env-vars): refactor for workspace/personal env vars to work with server side execution correctly (#2197)
* fix(env-var-resolution): new executor env var resolution changes * add sessionuser id" * cleanup code * add doc update * fix build * fix client session pass through" * add type change * fix env var with hitl * fix types
This commit is contained in:
committed by
GitHub
parent
ca818a6503
commit
8ef9a45125
@@ -208,8 +208,10 @@ async function runWorkflowExecution({
|
||||
|
||||
const mergedStates = mergeSubblockState(blocks)
|
||||
|
||||
const personalEnvUserId = workflowRecord.userId
|
||||
|
||||
const { personalEncrypted, workspaceEncrypted } = await getPersonalAndWorkspaceEnv(
|
||||
actorUserId,
|
||||
personalEnvUserId,
|
||||
workflowRecord.workspaceId || undefined
|
||||
)
|
||||
|
||||
@@ -239,17 +241,19 @@ async function runWorkflowExecution({
|
||||
workflowId: payload.workflowId,
|
||||
workspaceId: workflowRecord.workspaceId || '',
|
||||
userId: actorUserId,
|
||||
sessionUserId: undefined,
|
||||
workflowUserId: workflowRecord.userId,
|
||||
triggerType: 'schedule',
|
||||
triggerBlockId: payload.blockId || undefined,
|
||||
useDraftState: false,
|
||||
startTime: new Date().toISOString(),
|
||||
isClientSession: false,
|
||||
}
|
||||
|
||||
const snapshot = new ExecutionSnapshot(
|
||||
metadata,
|
||||
workflowRecord,
|
||||
input,
|
||||
{},
|
||||
workflowRecord.variables || {},
|
||||
[]
|
||||
)
|
||||
|
||||
@@ -222,17 +222,19 @@ async function executeWebhookJobInternal(
|
||||
workflowId: payload.workflowId,
|
||||
workspaceId,
|
||||
userId: payload.userId,
|
||||
sessionUserId: undefined,
|
||||
workflowUserId: workflow.userId,
|
||||
triggerType: payload.provider || 'webhook',
|
||||
triggerBlockId: payload.blockId,
|
||||
useDraftState: false,
|
||||
startTime: new Date().toISOString(),
|
||||
isClientSession: false,
|
||||
}
|
||||
|
||||
const snapshot = new ExecutionSnapshot(
|
||||
metadata,
|
||||
workflow,
|
||||
airtableInput,
|
||||
{},
|
||||
workflowVariables,
|
||||
[]
|
||||
)
|
||||
@@ -435,20 +437,16 @@ async function executeWebhookJobInternal(
|
||||
workflowId: payload.workflowId,
|
||||
workspaceId,
|
||||
userId: payload.userId,
|
||||
sessionUserId: undefined,
|
||||
workflowUserId: workflow.userId,
|
||||
triggerType: payload.provider || 'webhook',
|
||||
triggerBlockId: payload.blockId,
|
||||
useDraftState: false,
|
||||
startTime: new Date().toISOString(),
|
||||
isClientSession: false,
|
||||
}
|
||||
|
||||
const snapshot = new ExecutionSnapshot(
|
||||
metadata,
|
||||
workflow,
|
||||
input || {},
|
||||
{},
|
||||
workflowVariables,
|
||||
[]
|
||||
)
|
||||
const snapshot = new ExecutionSnapshot(metadata, workflow, input || {}, workflowVariables, [])
|
||||
|
||||
const executionResult = await executeWorkflowCore({
|
||||
snapshot,
|
||||
|
||||
@@ -74,16 +74,18 @@ export async function executeWorkflowJob(payload: WorkflowExecutionPayload) {
|
||||
workflowId,
|
||||
workspaceId,
|
||||
userId: actorUserId,
|
||||
sessionUserId: undefined,
|
||||
workflowUserId: workflow.userId,
|
||||
triggerType: payload.triggerType || 'api',
|
||||
useDraftState: false,
|
||||
startTime: new Date().toISOString(),
|
||||
isClientSession: false,
|
||||
}
|
||||
|
||||
const snapshot = new ExecutionSnapshot(
|
||||
metadata,
|
||||
workflow,
|
||||
payload.input,
|
||||
{},
|
||||
workflow.variables || {},
|
||||
[]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user