fix: Store workflow settings when saving an execution (#8288)

This commit is contained in:
Omar Ajoue 2024-01-10 14:20:37 +00:00 committed by GitHub
parent 3b01eb60c9
commit 8a7c629ea1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -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);

View file

@ -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"},{}]');
});