n8n
Version:
n8n Workflow Automation Tool
48 lines (47 loc) • 3.43 kB
TypeScript
import { Logger } from '@n8n/backend-common';
import type { IWorkflowDb } 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 { 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;
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);
getExecuteTriggerFunctions(workflowData: IWorkflowDb, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, resolveWorkflowData: () => Promise<IWorkflowBase>, onTriggerFailure: TriggerFailureHandler, scheduleCollectionSession: ScheduleTriggerCollectionSession): IGetExecuteTriggerFunctions;
getExecutePollFunctions(workflowData: IWorkflowBase, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, resolveWorkflowData: () => Promise<IWorkflowBase>): IGetExecutePollFunctions;
createPollExecutionContext(workflowData: IWorkflowBase, node: INode): Promise<{
workflow: Workflow;
pollFunctions: IPollFunctions;
}>;
executeErrorWorkflow(error: ExecutionError, workflowData: IWorkflowBase, mode: WorkflowExecuteMode): void;
loadPublishedWorkflowData(workflowId: string, { bypassCache }?: {
bypassCache?: boolean;
}): Promise<IWorkflowBase>;
}