Files
Automata/packages/cli/src/executions/executionHelpers.ts
Michael Auerswald 17eff4d7d6 fix(core): Fix execution status filters (#5533)
* fix status filters

* fix countfilter

* add migrations to backfill status

* fix migrations
2023-02-21 21:44:46 +01:00

19 lines
495 B
TypeScript

import type { IExecutionFlattedDb } from '../Interfaces';
import type { ExecutionStatus } from 'n8n-workflow';
export function getStatusUsingPreviousExecutionStatusMethod(
execution: IExecutionFlattedDb,
): ExecutionStatus {
if (execution.waitTill) {
return 'waiting';
} else if (execution.stoppedAt === undefined) {
return 'running';
} else if (execution.finished) {
return 'success';
} else if (execution.stoppedAt !== null) {
return 'failed';
} else {
return 'unknown';
}
}