mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-28 22:30:37 +02:00
19 lines
534 B
TypeScript
19 lines
534 B
TypeScript
import type { ExecutionStatus } from 'n8n-workflow';
|
|
import type { IExecutionFlattedDb, IExecutionResponse } from '@/Interfaces';
|
|
|
|
export function getStatusUsingPreviousExecutionStatusMethod(
|
|
execution: IExecutionFlattedDb | IExecutionResponse,
|
|
): 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 'error';
|
|
} else {
|
|
return 'unknown';
|
|
}
|
|
}
|