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 { data, workflowData, ...rest } = execution;
|
||||||
const { identifiers: inserted } = await this.insert(rest);
|
const { identifiers: inserted } = await this.insert(rest);
|
||||||
const { id: executionId } = inserted[0] as { id: string };
|
const { id: executionId } = inserted[0] as { id: string };
|
||||||
const { connections, nodes, name } = workflowData ?? {};
|
const { connections, nodes, name, settings } = workflowData ?? {};
|
||||||
await this.executionDataRepository.insert({
|
await this.executionDataRepository.insert({
|
||||||
executionId,
|
executionId,
|
||||||
workflowData: { connections, nodes, name, id: workflowData?.id },
|
workflowData: { connections, nodes, name, settings, id: workflowData?.id },
|
||||||
data: stringify(data),
|
data: stringify(data),
|
||||||
});
|
});
|
||||||
return String(executionId);
|
return String(executionId);
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('ExecutionRepository', () => {
|
||||||
describe('createNewExecution', () => {
|
describe('createNewExecution', () => {
|
||||||
it('should save execution data', async () => {
|
it('should save execution data', async () => {
|
||||||
const executionRepo = Container.get(ExecutionRepository);
|
const executionRepo = Container.get(ExecutionRepository);
|
||||||
const workflow = await createWorkflow();
|
const workflow = await createWorkflow({ settings: { executionOrder: 'v1' } });
|
||||||
const executionId = await executionRepo.createNewExecution({
|
const executionId = await executionRepo.createNewExecution({
|
||||||
workflowId: workflow.id,
|
workflowId: workflow.id,
|
||||||
data: {
|
data: {
|
||||||
|
@ -48,6 +48,7 @@ describe('ExecutionRepository', () => {
|
||||||
connections: workflow.connections,
|
connections: workflow.connections,
|
||||||
nodes: workflow.nodes,
|
nodes: workflow.nodes,
|
||||||
name: workflow.name,
|
name: workflow.name,
|
||||||
|
settings: workflow.settings,
|
||||||
});
|
});
|
||||||
expect(executionData?.data).toEqual('[{"resultData":"1"},{}]');
|
expect(executionData?.data).toEqual('[{"resultData":"1"},{}]');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue