Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup code
  • Loading branch information
icecrasher321 committed Dec 4, 2025
commit dd73d94ecef328e56451fe8008413a9762780e01
3 changes: 0 additions & 3 deletions apps/sim/app/api/workflows/[id]/execute/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export async function executeWorkflow(
metadata,
workflow,
input,
{},
workflow.variables || {},
streamConfig?.selectedOutputs || []
)
Expand Down Expand Up @@ -517,7 +516,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
metadata,
workflow,
processedInput,
{},
workflow.variables || {},
selectedOutputs
)
Expand Down Expand Up @@ -785,7 +783,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
metadata,
workflow,
processedInput,
{},
workflow.variables || {},
selectedOutputs
)
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/background/schedule-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ async function runWorkflowExecution({

const mergedStates = mergeSubblockState(blocks)

// Use workflow owner's personal env vars for scheduled executions
const personalEnvUserId = workflowRecord.userId || actorUserId
const personalEnvUserId = workflowRecord.userId

const { personalEncrypted, workspaceEncrypted } = await getPersonalAndWorkspaceEnv(
personalEnvUserId,
Expand Down Expand Up @@ -253,7 +252,6 @@ async function runWorkflowExecution({
metadata,
workflowRecord,
input,
{},
workflowRecord.variables || {},
[]
)
Expand Down
10 changes: 1 addition & 9 deletions apps/sim/background/webhook-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ async function executeWebhookJobInternal(
metadata,
workflow,
airtableInput,
{},
workflowVariables,
[]
)
Expand Down Expand Up @@ -443,14 +442,7 @@ async function executeWebhookJobInternal(
isClientSession: false,
}

const snapshot = new ExecutionSnapshot(
metadata,
workflow,
input || {},
{},
workflowVariables,
[]
)
const snapshot = new ExecutionSnapshot(metadata, workflow, input || {}, workflowVariables, [])

const executionResult = await executeWorkflowCore({
snapshot,
Expand Down
1 change: 0 additions & 1 deletion apps/sim/background/workflow-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export async function executeWorkflowJob(payload: WorkflowExecutionPayload) {
metadata,
workflow,
payload.input,
{},
workflow.variables || {},
[]
)
Expand Down
1 change: 0 additions & 1 deletion apps/sim/executor/execution/snapshot-serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export function serializePauseSnapshot(
executionMetadata,
context.workflow,
{},
context.environmentVariables ?? {},
context.workflowVariables ?? {},
context.selectedOutputs ?? [],
state
Expand Down
7 changes: 4 additions & 3 deletions apps/sim/executor/execution/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,20 @@ export class ExecutionSnapshot {
public readonly metadata: ExecutionMetadata,
public readonly workflow: any,
public readonly input: any,
public readonly environmentVariables: Record<string, string>,
public readonly workflowVariables: Record<string, any>,
public readonly selectedOutputs: string[] = [],
public readonly state?: SerializableExecutionState
) {}

get environmentVariables(): Record<string, string> {
return {}
}
Comment thread
icecrasher321 marked this conversation as resolved.
Outdated

toJSON(): string {
return JSON.stringify({
metadata: this.metadata,
workflow: this.workflow,
input: this.input,
environmentVariables: this.environmentVariables,
workflowVariables: this.workflowVariables,
selectedOutputs: this.selectedOutputs,
state: this.state,
Expand All @@ -83,7 +85,6 @@ export class ExecutionSnapshot {
data.metadata,
data.workflow,
data.input,
data.environmentVariables,
data.workflowVariables,
data.selectedOutputs,
data.state
Expand Down
7 changes: 2 additions & 5 deletions apps/sim/lib/workflows/executor/execution-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ export async function executeWorkflowCore(
options: ExecuteWorkflowCoreOptions
): Promise<ExecutionResult> {
const { snapshot, callbacks, loggingSession, skipLogCreation } = options
const { metadata, workflow, input, environmentVariables, workflowVariables, selectedOutputs } =
snapshot
const { metadata, workflow, input, workflowVariables, selectedOutputs } = snapshot
const { requestId, workflowId, userId, triggerType, executionId, triggerBlockId, useDraftState } =
metadata
const { onBlockStart, onBlockComplete, onStream, onExecutorCreated } = callbacks
Expand Down Expand Up @@ -153,9 +152,7 @@ export async function executeWorkflowCore(
const mergedStates = mergeSubblockState(blocks)

const personalEnvUserId =
metadata.isClientSession && metadata.sessionUserId
? metadata.sessionUserId
: workflow.userId || userId
metadata.isClientSession && metadata.sessionUserId ? metadata.sessionUserId : workflow.userId

const { personalEncrypted, workspaceEncrypted, personalDecrypted, workspaceDecrypted } =
await getPersonalAndWorkspaceEnv(personalEnvUserId, providedWorkspaceId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ export class PauseResumeManager {
metadata,
baseSnapshot.workflow,
resumeInput ?? {},
baseSnapshot.environmentVariables || {},
baseSnapshot.workflowVariables || {},
baseSnapshot.selectedOutputs || [],
stateCopy
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@radix-ui/react-visually-hidden": "1.2.4",
"@react-email/components": "^0.0.34",
"@react-email/render": "2.0.0",
"@trigger.dev/sdk": "4.0.4",
"@trigger.dev/sdk": "4.1.2",
"@types/three": "0.177.0",
"better-auth": "1.3.12",
"browser-image-compression": "^2.0.2",
Expand Down Expand Up @@ -135,7 +135,7 @@
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@trigger.dev/build": "4.0.4",
"@trigger.dev/build": "4.1.2",
"@types/html-to-text": "9.0.4",
"@types/js-yaml": "4.0.9",
"@types/jsdom": "21.1.7",
Expand Down
Loading