From 66fcc91d6998189cd08dc776d6ef0105d985361f Mon Sep 17 00:00:00 2001 From: Stephen Wright Date: Mon, 1 Sep 2025 16:44:06 +0100 Subject: [PATCH 1/3] add missing status field for select --- packages/@n8n/db/src/repositories/execution.repository.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@n8n/db/src/repositories/execution.repository.ts b/packages/@n8n/db/src/repositories/execution.repository.ts index c86feea5d9412..3d0e9c77a33a8 100644 --- a/packages/@n8n/db/src/repositories/execution.repository.ts +++ b/packages/@n8n/db/src/repositories/execution.repository.ts @@ -706,6 +706,7 @@ export class ExecutionRepository extends Repository { 'workflowId', 'waitTill', 'finished', + 'status', ], where, order: { id: 'DESC' }, From e6aefd5e103f3e40d9b1ead67951eabc31a9233f Mon Sep 17 00:00:00 2001 From: Stephen Wright Date: Tue, 2 Sep 2025 09:58:55 +0100 Subject: [PATCH 2/3] update examples --- .../v1/handlers/executions/spec/schemas/execution.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cli/src/public-api/v1/handlers/executions/spec/schemas/execution.yml b/packages/cli/src/public-api/v1/handlers/executions/spec/schemas/execution.yml index ce40c69ceede0..936b1961dad8f 100644 --- a/packages/cli/src/public-api/v1/handlers/executions/spec/schemas/execution.yml +++ b/packages/cli/src/public-api/v1/handlers/executions/spec/schemas/execution.yml @@ -33,3 +33,6 @@ properties: format: date-time customData: type: object + status: + type: string + enum: ['canceled', 'crashed', 'error', 'new', 'running', 'success', 'unknown', 'waiting'] From 50873e934f638711b65be66e36e13a3d45b0e722 Mon Sep 17 00:00:00 2001 From: Stephen Wright Date: Tue, 2 Sep 2025 11:22:36 +0100 Subject: [PATCH 3/3] add test extensions --- .../cli/test/integration/public-api/executions.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/cli/test/integration/public-api/executions.test.ts b/packages/cli/test/integration/public-api/executions.test.ts index c423f0710a2ba..fabbd80cf3ba6 100644 --- a/packages/cli/test/integration/public-api/executions.test.ts +++ b/packages/cli/test/integration/public-api/executions.test.ts @@ -263,6 +263,7 @@ describe('GET /executions', () => { stoppedAt, workflowId, waitTill, + status, } = response.body.data[0]; expect(id).toBeDefined(); @@ -274,6 +275,7 @@ describe('GET /executions', () => { expect(stoppedAt).not.toBeNull(); expect(workflowId).toBe(successfulExecution.workflowId); expect(waitTill).toBeNull(); + expect(status).toBe(successfulExecution.status); }); test('should paginate two executions', async () => { @@ -317,6 +319,7 @@ describe('GET /executions', () => { stoppedAt, workflowId, waitTill, + status, } = executions[i]; expect(id).toBeDefined(); @@ -328,6 +331,7 @@ describe('GET /executions', () => { expect(stoppedAt).not.toBeNull(); expect(workflowId).toBe(successfulExecutions[i].workflowId); expect(waitTill).toBeNull(); + expect(status).toBe(successfulExecutions[i].status); } }); @@ -356,6 +360,7 @@ describe('GET /executions', () => { stoppedAt, workflowId, waitTill, + status, } = response.body.data[0]; expect(id).toBeDefined(); @@ -367,6 +372,7 @@ describe('GET /executions', () => { expect(stoppedAt).not.toBeNull(); expect(workflowId).toBe(errorExecution.workflowId); expect(waitTill).toBeNull(); + expect(status).toBe(errorExecution.status); }); test('should return all waiting executions', async () => { @@ -396,6 +402,7 @@ describe('GET /executions', () => { stoppedAt, workflowId, waitTill, + status, } = response.body.data[0]; expect(id).toBeDefined(); @@ -407,6 +414,7 @@ describe('GET /executions', () => { expect(stoppedAt).not.toBeNull(); expect(workflowId).toBe(waitingExecution.workflowId); expect(new Date(waitTill).getTime()).toBeGreaterThan(Date.now() - 1000); + expect(status).toBe(waitingExecution.status); }); test('should retrieve all executions of specific workflow', async () => { @@ -434,6 +442,7 @@ describe('GET /executions', () => { stoppedAt, workflowId, waitTill, + status, } = execution; expect(savedExecutions.some((exec) => exec.id === id)).toBe(true); @@ -445,6 +454,7 @@ describe('GET /executions', () => { expect(stoppedAt).not.toBeNull(); expect(workflowId).toBe(workflow.id); expect(waitTill).toBeNull(); + expect(status).toBe(execution.status); } });