import type { IExecutionResponse } from '@n8n/db'; import type { ExecutionSnapshot } from '@n8n/engine'; import type { ExecutionStatus as ExecutionStatusV1, WorkflowExecuteMode, ExecutionSummary, Workflow } from 'n8n-workflow'; import { EngineDataPlaneProxyService } from '../services/engine-data-plane-proxy.service'; import type { ExecutionPosition } from './execution-cursor'; import { type WorkflowSnapshot } from './execution-data/types'; import type { ExecutionIdV2 } from './execution-id'; export type V2Scope = 'all' | ReadonlyArray; export interface EngineV2SearchQuery { status?: ExecutionStatusV1[]; mode?: WorkflowExecuteMode; startedAfter?: string; startedBefore?: string; before?: ExecutionPosition; limit: number; order?: { top?: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled'; startedAt?: 'DESC'; }; } export type EngineV2LatestQuery = Pick; export declare class EngineV2ExecutionReader { private readonly dataPlane; constructor(dataPlane: EngineDataPlaneProxyService); findMany(query: EngineV2SearchQuery, scope: V2Scope, options?: { includeTotal?: boolean; }): Promise<{ items: ExecutionSummary[]; total: number; hasMore: boolean; }>; private empty; findLatest(query: EngineV2LatestQuery, scope: V2Scope): Promise; private searchableScope; private buildSearchRequest; private buildFilter; private toExecutionSummary; findReference(executionId: ExecutionIdV2): Promise<{ id: string; workflowId: string; } | undefined>; findOne(executionId: ExecutionIdV2, sharedWorkflowIds: string[]): Promise; fromSnapshot(snapshot: ExecutionSnapshot): Promise; private toExecutionResponse; } export declare function asWorkflowSnapshot(document: unknown): WorkflowSnapshot | undefined;