Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@n8n/db/src/repositories/execution.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
'workflowId',
'waitTill',
'finished',
'status',
],
where,
order: { id: 'DESC' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ properties:
format: date-time
customData:
type: object
status:
type: string
enum: ['canceled', 'crashed', 'error', 'new', 'running', 'success', 'unknown', 'waiting']
10 changes: 10 additions & 0 deletions packages/cli/test/integration/public-api/executions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ describe('GET /executions', () => {
stoppedAt,
workflowId,
waitTill,
status,
} = response.body.data[0];

expect(id).toBeDefined();
Expand All @@ -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 () => {
Expand Down Expand Up @@ -317,6 +319,7 @@ describe('GET /executions', () => {
stoppedAt,
workflowId,
waitTill,
status,
} = executions[i];

expect(id).toBeDefined();
Expand All @@ -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);
}
});

Expand Down Expand Up @@ -356,6 +360,7 @@ describe('GET /executions', () => {
stoppedAt,
workflowId,
waitTill,
status,
} = response.body.data[0];

expect(id).toBeDefined();
Expand All @@ -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 () => {
Expand Down Expand Up @@ -396,6 +402,7 @@ describe('GET /executions', () => {
stoppedAt,
workflowId,
waitTill,
status,
} = response.body.data[0];

expect(id).toBeDefined();
Expand All @@ -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 () => {
Expand Down Expand Up @@ -434,6 +442,7 @@ describe('GET /executions', () => {
stoppedAt,
workflowId,
waitTill,
status,
} = execution;

expect(savedExecutions.some((exec) => exec.id === id)).toBe(true);
Expand All @@ -445,6 +454,7 @@ describe('GET /executions', () => {
expect(stoppedAt).not.toBeNull();
expect(workflowId).toBe(workflow.id);
expect(waitTill).toBeNull();
expect(status).toBe(execution.status);
}
});

Expand Down
Loading