import { Logger } from '@n8n/backend-common'; import { GlobalConfig } from '@n8n/config'; import type { IWorkflowDb, PollerCursor, PollLeaseFence } from '@n8n/db'; import { ErrorReporter, StorageConfig, type IGetExecutePollFunctions, type IGetExecuteTriggerFunctions } from 'n8n-core'; import type { ExecutionError, INode, IPollFunctions, IWorkflowBase, IWorkflowExecuteAdditionalData, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow'; import { Workflow } from 'n8n-workflow'; import { ActiveExecutions } from '../../active-executions'; import { EventService } from '../../events/event.service'; import { ExecutionService } from '../../executions/execution.service'; import { NodeTypes } from '../../node-types'; import type { ScheduleTriggerCollectionSession } from '../../scheduling/schedule-trigger-node/schedule-trigger-job-registrar'; import { ScheduleTriggerJobRegistrar } from '../../scheduling/schedule-trigger-node/schedule-trigger-job-registrar'; import { OwnershipService } from '../../services/ownership.service'; import { EngineV2ActiveTriggers } from '../../workflows/triggers/engine-v2-active-triggers'; import { PollCursorService } from '../../workflows/triggers/poll-cursor.service'; import { WorkflowExecutionService } from '../../workflows/workflow-execution.service'; import { WorkflowPublishedDataService } from '../../workflows/workflow-published-data.service'; import { WorkflowStaticDataService } from '../../workflows/workflow-static-data.service'; export type TriggerFailureHandler = (opts: { error: Error; node: INode; workflowData: IWorkflowDb; mode: WorkflowExecuteMode; activation: WorkflowActivateMode; }) => void; export declare class TriggerExecutionContextFactory { private logger; private readonly errorReporter; private readonly activeExecutions; private readonly eventService; private readonly executionService; private readonly workflowStaticDataService; private readonly workflowExecutionService; private readonly storageConfig; private readonly workflowPublishedDataService; private readonly scheduleTriggerJobRegistrar; private readonly ownershipService; private readonly nodeTypes; private readonly pollCursorService; private readonly globalConfig; private readonly engineV2ActiveTriggers; constructor(logger: Logger, errorReporter: ErrorReporter, activeExecutions: ActiveExecutions, eventService: EventService, executionService: ExecutionService, workflowStaticDataService: WorkflowStaticDataService, workflowExecutionService: WorkflowExecutionService, storageConfig: StorageConfig, workflowPublishedDataService: WorkflowPublishedDataService, scheduleTriggerJobRegistrar: ScheduleTriggerJobRegistrar, ownershipService: OwnershipService, nodeTypes: NodeTypes, pollCursorService: PollCursorService, globalConfig: GlobalConfig, engineV2ActiveTriggers: EngineV2ActiveTriggers); private settleDonePromise; private assertEngineV2Supported; private logTriggerExecutionFailure; private recordTriggerFailure; getExecuteTriggerFunctions(workflowData: IWorkflowDb, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, resolveWorkflowData: () => Promise, onTriggerFailure: TriggerFailureHandler, scheduleCollectionSession: ScheduleTriggerCollectionSession): IGetExecuteTriggerFunctions; getExecutePollFunctions(workflowData: IWorkflowBase, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, resolveWorkflowData: () => Promise, fence?: PollLeaseFence, prefetchedCursor?: PollerCursor): IGetExecutePollFunctions; createPollExecutionContext(workflowData: IWorkflowBase, node: INode, fence?: PollLeaseFence, prefetchedCursor?: PollerCursor): Promise<{ workflow: Workflow; pollFunctions: IPollFunctions; }>; executeErrorWorkflow(error: ExecutionError, workflowData: IWorkflowBase, mode: WorkflowExecuteMode): void; findPublishedWorkflowData(workflowId: string, { bypassCache }?: { bypassCache?: boolean; }): Promise; loadPublishedWorkflowData(workflowId: string, options?: { bypassCache?: boolean; }): Promise; }