Skip to content

Commit d146c31

Browse files
fix(tables): pin deployed workflow variables
1 parent 5f75d0b commit d146c31

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

apps/sim/executor/execution/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface ExecutionMetadata {
5656
edges: Edge[]
5757
loops?: Record<string, any>
5858
parallels?: Record<string, any>
59+
variables?: Record<string, unknown>
5960
deploymentVersionId?: string
6061
}
6162
largeValueExecutionIds?: string[]

apps/sim/lib/workflows/executor/execute-workflow.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ describe('executeWorkflow', () => {
240240
edges: [],
241241
loops: {},
242242
parallels: {},
243+
variables: {
244+
'variable-1': { id: 'variable-1', name: 'deployed', value: 'frozen' },
245+
},
243246
deploymentVersionId: 'deployment-version-1',
244247
}
245248

@@ -254,6 +257,7 @@ describe('executeWorkflow', () => {
254257
snapshot: ExecutionSnapshot
255258
}
256259
expect(coreParams.snapshot.metadata.workflowStateOverride).toEqual(workflowStateOverride)
260+
expect(coreParams.snapshot.workflowVariables).toEqual(workflowStateOverride.variables)
257261
})
258262

259263
it('waits for post-execution persistence before resolving', async () => {

apps/sim/lib/workflows/executor/execute-workflow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export async function executeWorkflow(
166166
metadata,
167167
workflow,
168168
input,
169-
workflow.variables || {},
169+
streamConfig?.workflowStateOverride?.variables ?? workflow.variables ?? {},
170170
streamConfig?.selectedOutputs || []
171171
)
172172

0 commit comments

Comments
 (0)