Skip to content

Commit aebf473

Browse files
fix(workflows): keep snapshot metadata first
1 parent 3f85676 commit aebf473

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

apps/sim/executor/execution/snapshot.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ describe('ExecutionSnapshot', () => {
2525
['agent.content', 123, 'function.result']
2626
)
2727

28+
expect(snapshot.toJSON()).toMatch(/^\{"metadata":/)
29+
expect(JSON.parse(snapshot.toJSON())).toMatchObject({ version: 1 })
2830
expect(snapshot.workflowVariables).toEqual({ 'var-1': variable })
2931
expect(snapshot.selectedOutputs).toEqual(['agent.content', 'function.result'])
3032
})

apps/sim/executor/execution/snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ export class ExecutionSnapshot {
6464

6565
toJSON(): string {
6666
return JSON.stringify({
67-
version: EXECUTION_SNAPSHOT_VERSION,
6867
metadata: {
6968
...this.metadata,
7069
principal: serializePrincipal(this.metadata.principal),
7170
},
71+
version: EXECUTION_SNAPSHOT_VERSION,
7272
workflow: this.workflow,
7373
input: this.input,
7474
workflowVariables: this.workflowVariables,

0 commit comments

Comments
 (0)