import { LicenseState, Logger } from '@n8n/backend-common';
import { GlobalConfig } from '@n8n/config';
import type { User, WorkflowEntity } from '@n8n/db';
import { SharedWorkflow, ExecutionRepository, FolderRepository, WorkflowTagMappingRepository, SharedWorkflowRepository, WorkflowRepository, WorkflowPublishedVersionRepository, WorkflowPublishHistoryRepository, ProjectRepository } from '@n8n/db';
import type { Scope } from '@n8n/permissions';
import type { EntityManager } from '@n8n/typeorm';
import { BinaryDataService } from 'n8n-core';
import type { INode, IConnections } from 'n8n-workflow';
import { WorkflowFinderService } from './workflow-finder.service';
import { WorkflowHistoryService } from './workflow-history/workflow-history.service';
import { ActiveWorkflowManager } from '../active-workflow-manager';
import { EventService } from '../events/event.service';
import { ExternalHooks } from '../external-hooks';
import { NodeTypes } from '../node-types';
import type { ListQuery } from '../requests';
import { OwnershipService } from '../services/ownership.service';
import { ProjectService } from '../services/project.service.ee';
import { RoleService } from '../services/role.service';
import { TagService } from '../services/tag.service';
import { WorkflowValidationService } from './workflow-validation.service';
import { WebhookService } from '../webhooks/webhook.service';
export declare class WorkflowService {
    private readonly logger;
    private readonly sharedWorkflowRepository;
    private readonly workflowRepository;
    private readonly workflowTagMappingRepository;
    private readonly binaryDataService;
    private readonly ownershipService;
    private readonly tagService;
    private readonly workflowHistoryService;
    private readonly externalHooks;
    private readonly activeWorkflowManager;
    private readonly roleService;
    private readonly projectService;
    private readonly executionRepository;
    private readonly eventService;
    private readonly globalConfig;
    private readonly folderRepository;
    private readonly workflowFinderService;
    private readonly workflowPublishedVersionRepository;
    private readonly workflowPublishHistoryRepository;
    private readonly workflowValidationService;
    private readonly nodeTypes;
    private readonly webhookService;
    private readonly licenseState;
    private readonly projectRepository;
    constructor(logger: Logger, sharedWorkflowRepository: SharedWorkflowRepository, workflowRepository: WorkflowRepository, workflowTagMappingRepository: WorkflowTagMappingRepository, binaryDataService: BinaryDataService, ownershipService: OwnershipService, tagService: TagService, workflowHistoryService: WorkflowHistoryService, externalHooks: ExternalHooks, activeWorkflowManager: ActiveWorkflowManager, roleService: RoleService, projectService: ProjectService, executionRepository: ExecutionRepository, eventService: EventService, globalConfig: GlobalConfig, folderRepository: FolderRepository, workflowFinderService: WorkflowFinderService, workflowPublishedVersionRepository: WorkflowPublishedVersionRepository, workflowPublishHistoryRepository: WorkflowPublishHistoryRepository, workflowValidationService: WorkflowValidationService, nodeTypes: NodeTypes, webhookService: WebhookService, licenseState: LicenseState, projectRepository: ProjectRepository);
    getMany(user: User, options?: ListQuery.Options, includeScopes?: boolean, includeFolders?: boolean, onlySharedWithMe?: boolean, requiredScopes?: Scope[]): Promise<{
        workflows: ((Pick<WorkflowEntity, "id"> & Partial<Pick<WorkflowEntity, "description" | "tags" | "name" | "active" | "versionId" | "activeVersionId" | "createdAt" | "updatedAt">>) | (import("@n8n/db").Folder & {
            workflowCount?: boolean;
            subFolderCount?: number;
        } & {
            resource: import("@n8n/db").ResourceType;
        }))[];
        count: number;
    }>;
    private addResolvableCredentialsFlag;
    private processSharedWorkflows;
    private addSharedRelation;
    private addUserScopes;
    private cleanupSharedField;
    private mergeProcessedWorkflows;
    update(user: User, workflowUpdateData: WorkflowEntity, workflowId: string, options?: {
        tagIds?: string[];
        parentFolderId?: string;
        forceSave?: boolean;
        publicApi?: boolean;
        publishIfActive?: boolean;
        aiBuilderAssisted?: boolean;
        expectedChecksum?: string;
        autosaved?: boolean;
    }): Promise<WorkflowEntity>;
    private _addToActiveWorkflowManager;
    private _findConflictingWebhooks;
    private _detectWebhookConflicts;
    activateWorkflow(user: User, workflowId: string, options?: {
        versionId?: string;
        name?: string;
        description?: string;
        expectedChecksum?: string;
    }, publicApi?: boolean): Promise<WorkflowEntity>;
    deactivateWorkflow(user: User, workflowId: string, options?: {
        expectedChecksum?: string;
        publicApi?: boolean;
    }): Promise<WorkflowEntity>;
    delete(user: User, workflowId: string, force?: boolean): Promise<WorkflowEntity | undefined>;
    archive(user: User, workflowId: string, options?: {
        skipArchived?: boolean;
        expectedChecksum?: string;
        publicApi?: boolean;
    }): Promise<WorkflowEntity | undefined>;
    unarchive(user: User, workflowId: string, options?: {
        publicApi?: boolean;
    }): Promise<WorkflowEntity | undefined>;
    archiveForPublicApi(user: User, workflowId: string): Promise<WorkflowEntity | undefined>;
    unarchiveForPublicApi(user: User, workflowId: string): Promise<WorkflowEntity | undefined>;
    getWorkflowScopes(user: User, workflowId: string): Promise<Scope[]>;
    transferAll(fromProjectId: string, toProjectId: string, trx?: EntityManager): Promise<void>;
    getWorkflowsWithNodesIncluded(user: User, nodeTypes: string[], includeNodes?: boolean): Promise<{
        nodes?: INode[] | undefined;
        id: string;
        description?: string | null | undefined;
        tags?: import("@n8n/db").TagEntity[] | undefined;
        name?: string | undefined;
        active?: boolean | undefined;
        versionId?: string | undefined;
        activeVersionId?: string | null | undefined;
        createdAt?: Date | undefined;
        updatedAt?: Date | undefined;
        scopes: Scope[];
        shared?: SharedWorkflow[] | undefined;
        resourceType: string;
    }[]>;
    _detectConflicts(dbWorkflow: WorkflowEntity, expectedChecksum: string): Promise<void>;
    _validateNodes(workflowId: string, nodes: INode[], connections: IConnections): void;
    private _validateDynamicCredentials;
    private calculateSettingsChanges;
    private _validateSubWorkflowReferences;
}
