mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix: Store workflow settings when saving an execution (#8288)
This commit is contained in:
parent
3b01eb60c9
commit
8a7c629ea1
|
@ -226,10 +226,10 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
|||
const { data, workflowData, ...rest } = execution;
|
||||
const { identifiers: inserted } = await this.insert(rest);
|
||||
const { id: executionId } = inserted[0] as { id: string };
|
||||
const { connections, nodes, name } = workflowData ?? {};
|
||||
const { connections, nodes, name, settings } = workflowData ?? {};
|
||||
await this.executionDataRepository.insert({
|
||||
executionId,
|
||||
workflowData: { connections, nodes, name, id: workflowData?.id },
|
||||
workflowData: { connections, nodes, name, settings, id: workflowData?.id },
|
||||
data: stringify(data),
|
||||
});
|
||||
return String(executionId);
|
||||
|
|
|
@ -20,7 +20,7 @@ describe('ExecutionRepository', () => {
|
|||
describe('createNewExecution', () => {
|
||||
it('should save execution data', async () => {
|
||||
const executionRepo = Container.get(ExecutionRepository);
|
||||
const workflow = await createWorkflow();
|
||||
const workflow = await createWorkflow({ settings: { executionOrder: 'v1' } });
|
||||
const executionId = await executionRepo.createNewExecution({
|
||||
workflowId: workflow.id,
|
||||
data: {
|
||||
|
@ -48,6 +48,7 @@ describe('ExecutionRepository', () => {
|
|||
connections: workflow.connections,
|
||||
nodes: workflow.nodes,
|
||||
name: workflow.name,
|
||||
settings: workflow.settings,
|
||||
});
|
||||
expect(executionData?.data).toEqual('[{"resultData":"1"},{}]');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue