From 338b0ca3fdde46599429b4f3bf25ae0c526d1fb2 Mon Sep 17 00:00:00 2001 From: Charlie Kolb Date: Thu, 15 Oct 2026 07:13:46 +0000 Subject: [PATCH] refactor(core): Move published workflow data into backend services (#41086) --- packages/@n8n/backend-services/src/index.ts | 6 ++++++ .../__tests__/workflow-published-data.service.test.ts | 4 ++-- .../src/workflows/workflow-published-data.service.ts | 2 +- .../workflow-execute-additional-data.test.ts | 4 ++-- .../workflow-tool-workflow-loader.service.test.ts | 2 +- .../tools/workflow-tool-workflow-loader.service.ts | 2 +- .../mcp/__tests__/execute-workflow.tool.test.ts | 2 +- .../install-community-node.registration.test.ts | 10 ++++++++-- .../cli/src/modules/mcp/__tests__/mcp-scopes.test.ts | 10 ++++++++-- .../cli/src/modules/mcp/__tests__/mcp.service.test.ts | 10 ++++++++-- .../mcp/__tests__/update-workflow.tool.test.ts | 4 ++-- packages/cli/src/modules/mcp/mcp.service.ts | 10 ++++++++-- .../src/modules/mcp/tools/execute-workflow.tool.ts | 2 +- .../cli/src/webhooks/__tests__/live-webhooks.test.ts | 2 +- packages/cli/src/webhooks/live-webhooks.ts | 2 +- packages/cli/src/workflow-execute-additional-data.ts | 3 +-- .../error-workflow-validation.service.test.ts | 5 +---- .../__tests__/workflow-execution.service.test.ts | 7 +++++-- .../workflows/error-workflow-validation.service.ts | 2 +- .../__tests__/workflow-publication-applier.test.ts | 2 +- .../publication/workflow-publication-applier.ts | 2 +- .../trigger-execution-context.factory.test.ts | 11 ++++++----- .../triggers/trigger-execution-context.factory.ts | 4 ++-- .../cli/src/workflows/workflow-execution.service.ts | 8 ++++++-- .../workflows/workflow-published-data.service.test.ts | 2 +- 25 files changed, 76 insertions(+), 42 deletions(-) rename packages/{cli => @n8n/backend-services}/src/workflows/__tests__/workflow-published-data.service.test.ts (98%) rename packages/{cli => @n8n/backend-services}/src/workflows/workflow-published-data.service.ts (98%) diff --git a/packages/@n8n/backend-services/src/index.ts b/packages/@n8n/backend-services/src/index.ts index da7a3534510..3ce50d6f8f2 100644 --- a/packages/@n8n/backend-services/src/index.ts +++ b/packages/@n8n/backend-services/src/index.ts @@ -68,3 +68,9 @@ export { API_KEY_PURPOSES, LEGACY_UNBOUND_PURPOSES, } from './services/token-purposes'; + +export { + WorkflowPublishedDataService, + type PublishedWorkflowData, + type PublishedWorkflowDataForExecution, +} from './workflows/workflow-published-data.service'; diff --git a/packages/cli/src/workflows/__tests__/workflow-published-data.service.test.ts b/packages/@n8n/backend-services/src/workflows/__tests__/workflow-published-data.service.test.ts similarity index 98% rename from packages/cli/src/workflows/__tests__/workflow-published-data.service.test.ts rename to packages/@n8n/backend-services/src/workflows/__tests__/workflow-published-data.service.test.ts index bb7b65e5d08..32b51543a5c 100644 --- a/packages/cli/src/workflows/__tests__/workflow-published-data.service.test.ts +++ b/packages/@n8n/backend-services/src/workflows/__tests__/workflow-published-data.service.test.ts @@ -2,11 +2,11 @@ import type { Logger } from '@n8n/backend-common'; import type { WorkflowPublishedVersionRepository, WorkflowPublishedVersion } from '@n8n/db'; import { mock } from 'vitest-mock-extended'; -import type { CacheService } from '@n8n/backend-services'; +import type { CacheService } from '../../services/cache/cache.service'; import { WorkflowPublishedDataService, type PublishedWorkflowDataForExecution, -} from '@/workflows/workflow-published-data.service'; +} from '../workflow-published-data.service'; describe('WorkflowPublishedDataService', () => { const logger = mock(); diff --git a/packages/cli/src/workflows/workflow-published-data.service.ts b/packages/@n8n/backend-services/src/workflows/workflow-published-data.service.ts similarity index 98% rename from packages/cli/src/workflows/workflow-published-data.service.ts rename to packages/@n8n/backend-services/src/workflows/workflow-published-data.service.ts index 34c755ea491..bb0a9c6a4d9 100644 --- a/packages/cli/src/workflows/workflow-published-data.service.ts +++ b/packages/@n8n/backend-services/src/workflows/workflow-published-data.service.ts @@ -8,7 +8,7 @@ import { import { Service } from '@n8n/di'; import { ensureError } from '@n8n/utils/errors/ensure-error'; -import { CacheService } from '@n8n/backend-services'; +import { CacheService } from '../services/cache/cache.service'; export type { PublishedWorkflowDataForExecution }; diff --git a/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts b/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts index f5b0a6f24a4..b906b329930 100644 --- a/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts +++ b/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts @@ -1,5 +1,5 @@ import { Logger, ModuleRegistry } from '@n8n/backend-common'; -import { EventService, UrlService } from '@n8n/backend-services'; +import { EventService, UrlService, WorkflowPublishedDataService } from '@n8n/backend-services'; import { mockInstance } from '@n8n/backend-test-utils'; import { ExecutionsConfig, GlobalConfig, type NodesConfig, WorkflowsConfig } from '@n8n/config'; import type { WorkflowEntity, Project, WorkflowHistory } from '@n8n/db'; @@ -64,7 +64,7 @@ import * as WorkflowHelpers from '@/workflow-helpers'; import { WorkflowHookContextService } from '@/workflow-hook-context.service'; import { DeprecatedNodesError } from '@/errors/response-errors/deprecated-nodes.error'; import { DeprecatedNodesValidationService } from '@/workflows/deprecated-nodes-validation.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service'; const EXECUTION_ID = '123'; diff --git a/packages/cli/src/modules/agents/tools/__tests__/workflow-tool-workflow-loader.service.test.ts b/packages/cli/src/modules/agents/tools/__tests__/workflow-tool-workflow-loader.service.test.ts index d1f5262df7c..8a62011daf3 100644 --- a/packages/cli/src/modules/agents/tools/__tests__/workflow-tool-workflow-loader.service.test.ts +++ b/packages/cli/src/modules/agents/tools/__tests__/workflow-tool-workflow-loader.service.test.ts @@ -2,7 +2,7 @@ import type { WorkflowsConfig } from '@n8n/config'; import type { WorkflowEntity, WorkflowRepository } from '@n8n/db'; import { mock } from 'vitest-mock-extended'; -import type { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import type { WorkflowPublishedDataService } from '@n8n/backend-services'; import { WorkflowToolUnavailableError } from '../workflow-tool-unavailable-error'; import { WorkflowToolWorkflowLoader } from '../workflow-tool-workflow-loader.service'; diff --git a/packages/cli/src/modules/agents/tools/workflow-tool-workflow-loader.service.ts b/packages/cli/src/modules/agents/tools/workflow-tool-workflow-loader.service.ts index 46782533ca0..e2b8fbb1a6f 100644 --- a/packages/cli/src/modules/agents/tools/workflow-tool-workflow-loader.service.ts +++ b/packages/cli/src/modules/agents/tools/workflow-tool-workflow-loader.service.ts @@ -2,7 +2,7 @@ import { WorkflowsConfig } from '@n8n/config'; import { type WorkflowEntity, WorkflowRepository } from '@n8n/db'; import { Service } from '@n8n/di'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import { WorkflowPublishedDataService } from '@n8n/backend-services'; import { WorkflowToolUnavailableError } from './workflow-tool-unavailable-error'; diff --git a/packages/cli/src/modules/mcp/__tests__/execute-workflow.tool.test.ts b/packages/cli/src/modules/mcp/__tests__/execute-workflow.tool.test.ts index 1be83a5c56c..5bdc84a78ea 100644 --- a/packages/cli/src/modules/mcp/__tests__/execute-workflow.tool.test.ts +++ b/packages/cli/src/modules/mcp/__tests__/execute-workflow.tool.test.ts @@ -23,7 +23,7 @@ import { McpService } from '@/modules/mcp/mcp.service'; import { Telemetry } from '@/telemetry'; import { WorkflowRunner } from '@/workflow-runner'; import { WorkflowFinderService } from '@/workflows/workflow-finder.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import { WorkflowPublishedDataService } from '@n8n/backend-services'; describe('execute-workflow MCP tool', () => { const user = Object.assign(new User(), { id: 'user-1' }); diff --git a/packages/cli/src/modules/mcp/__tests__/install-community-node.registration.test.ts b/packages/cli/src/modules/mcp/__tests__/install-community-node.registration.test.ts index f5d8e586f47..8f565ca4f4f 100644 --- a/packages/cli/src/modules/mcp/__tests__/install-community-node.registration.test.ts +++ b/packages/cli/src/modules/mcp/__tests__/install-community-node.registration.test.ts @@ -1,5 +1,11 @@ import { LicenseState, ModuleRegistry } from '@n8n/backend-common'; -import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services'; +import { + EventService, + UrlService, + RoleService, + FolderFinderService, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import { mockInstance, mockLogger } from '@n8n/backend-test-utils'; import { ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config'; import { ExecutionRepository, ProjectRepository, SharedWorkflowRepository, User } from '@n8n/db'; @@ -28,7 +34,7 @@ import { WorkflowCreationService } from '@/workflows/workflow-creation.service'; import { ErrorWorkflowValidationService } from '@/workflows/error-workflow-validation.service'; import { WorkflowFinderService } from '@/workflows/workflow-finder.service'; import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowService } from '@/workflows/workflow.service'; import { McpPostSaveMetricsService } from '../mcp-post-save-metrics.service'; diff --git a/packages/cli/src/modules/mcp/__tests__/mcp-scopes.test.ts b/packages/cli/src/modules/mcp/__tests__/mcp-scopes.test.ts index 2ca8eb73fea..1b0f5e38f70 100644 --- a/packages/cli/src/modules/mcp/__tests__/mcp-scopes.test.ts +++ b/packages/cli/src/modules/mcp/__tests__/mcp-scopes.test.ts @@ -1,6 +1,12 @@ import { INSTANCE_ACTIVITY_CONTEXT_FLAG } from '@n8n/api-types'; import { LicenseState, ModuleRegistry } from '@n8n/backend-common'; -import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services'; +import { + EventService, + UrlService, + RoleService, + FolderFinderService, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import { mockInstance, mockLogger } from '@n8n/backend-test-utils'; import { EndpointsConfig, ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config'; import { @@ -56,7 +62,7 @@ import { WorkflowCreationService } from '@/workflows/workflow-creation.service'; import { WorkflowFinderService } from '@/workflows/workflow-finder.service'; import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service'; import { ErrorWorkflowValidationService } from '@/workflows/error-workflow-validation.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowService } from '@/workflows/workflow.service'; vi.mock('@n8n/mcp-apps/server', async (importOriginal) => ({ diff --git a/packages/cli/src/modules/mcp/__tests__/mcp.service.test.ts b/packages/cli/src/modules/mcp/__tests__/mcp.service.test.ts index d12d3422ea5..70b9d29af00 100644 --- a/packages/cli/src/modules/mcp/__tests__/mcp.service.test.ts +++ b/packages/cli/src/modules/mcp/__tests__/mcp.service.test.ts @@ -9,7 +9,13 @@ import { INSTANCE_ACTIVITY_CONTEXT_FLAG, } from '@n8n/api-types'; import { LicenseState, ModuleRegistry, type Logger } from '@n8n/backend-common'; -import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services'; +import { + EventService, + UrlService, + RoleService, + FolderFinderService, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import { mockInstance, mockLogger } from '@n8n/backend-test-utils'; import { EndpointsConfig, ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config'; import { @@ -49,7 +55,7 @@ import { WorkflowCreationService } from '@/workflows/workflow-creation.service'; import { WorkflowFinderService } from '@/workflows/workflow-finder.service'; import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service'; import { ErrorWorkflowValidationService } from '@/workflows/error-workflow-validation.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowService } from '@/workflows/workflow.service'; import { registerWorkflowPreviewApp, WORKFLOW_PREVIEW_APP_URI } from '@n8n/mcp-apps/server'; diff --git a/packages/cli/src/modules/mcp/__tests__/update-workflow.tool.test.ts b/packages/cli/src/modules/mcp/__tests__/update-workflow.tool.test.ts index 96455fb0192..12784f97f54 100644 --- a/packages/cli/src/modules/mcp/__tests__/update-workflow.tool.test.ts +++ b/packages/cli/src/modules/mcp/__tests__/update-workflow.tool.test.ts @@ -24,11 +24,11 @@ import { SubworkflowPolicyChecker } from '@/executions/pre-execution-checks/subw import { NodeTypes } from '@/node-types'; import type { AiGatewayService } from '@/services/ai-gateway.service'; import { TagService } from '@/services/tag.service'; -import { UrlService } from '@n8n/backend-services'; +import { UrlService, WorkflowPublishedDataService } from '@n8n/backend-services'; import { Telemetry } from '@/telemetry'; import { WorkflowFinderService } from '@/workflows/workflow-finder.service'; import { ErrorWorkflowValidationService } from '@/workflows/error-workflow-validation.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowService } from '@/workflows/workflow.service'; import { shapeToStandardSchema } from '../tool-schema.util'; diff --git a/packages/cli/src/modules/mcp/mcp.service.ts b/packages/cli/src/modules/mcp/mcp.service.ts index fefeb8e9c7d..250fe250cb1 100644 --- a/packages/cli/src/modules/mcp/mcp.service.ts +++ b/packages/cli/src/modules/mcp/mcp.service.ts @@ -7,7 +7,13 @@ import { INSTANCE_ACTIVITY_CONTEXT_FLAG, } from '@n8n/api-types'; import { LicenseState, Logger, ModuleRegistry } from '@n8n/backend-common'; -import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services'; +import { + EventService, + UrlService, + RoleService, + FolderFinderService, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import { ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config'; import { ExecutionRepository, ProjectRepository, SharedWorkflowRepository, User } from '@n8n/db'; import { Container, Service } from '@n8n/di'; @@ -47,7 +53,7 @@ import { ErrorWorkflowValidationService } from '@/workflows/error-workflow-valid import { WorkflowCreationService } from '@/workflows/workflow-creation.service'; import { WorkflowFinderService } from '@/workflows/workflow-finder.service'; import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowService } from '@/workflows/workflow.service'; import { McpPostSaveMetricsService } from './mcp-post-save-metrics.service'; diff --git a/packages/cli/src/modules/mcp/tools/execute-workflow.tool.ts b/packages/cli/src/modules/mcp/tools/execute-workflow.tool.ts index a5045db165b..02565704db1 100644 --- a/packages/cli/src/modules/mcp/tools/execute-workflow.tool.ts +++ b/packages/cli/src/modules/mcp/tools/execute-workflow.tool.ts @@ -40,7 +40,7 @@ import type { McpService } from '@/modules/mcp/mcp.service'; import type { Telemetry } from '@/telemetry'; import type { WorkflowRunner } from '@/workflow-runner'; import type { WorkflowFinderService } from '@/workflows/workflow-finder.service'; -import type { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import type { WorkflowPublishedDataService } from '@n8n/backend-services'; export { type FoundWorkflow }; diff --git a/packages/cli/src/webhooks/__tests__/live-webhooks.test.ts b/packages/cli/src/webhooks/__tests__/live-webhooks.test.ts index 7d01ef44abb..023a7cfa423 100644 --- a/packages/cli/src/webhooks/__tests__/live-webhooks.test.ts +++ b/packages/cli/src/webhooks/__tests__/live-webhooks.test.ts @@ -32,7 +32,7 @@ import * as WebhookHelpers from '@/webhooks/webhook-helpers'; import type { WebhookService } from '@/webhooks/webhook.service'; import type { WebhookRequest } from '@/webhooks/webhook.types'; import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data'; -import type { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import type { WorkflowPublishedDataService } from '@n8n/backend-services'; import type { WorkflowPublisherService } from '@/workflows/workflow-publisher.service'; import type { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service'; diff --git a/packages/cli/src/webhooks/live-webhooks.ts b/packages/cli/src/webhooks/live-webhooks.ts index 934101927ae..399ad0d0a65 100644 --- a/packages/cli/src/webhooks/live-webhooks.ts +++ b/packages/cli/src/webhooks/live-webhooks.ts @@ -19,7 +19,7 @@ import { NodeTypes } from '@/node-types'; import * as WebhookHelpers from '@/webhooks/webhook-helpers'; import { WebhookService } from '@/webhooks/webhook.service'; import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import { WorkflowPublishedDataService } from '@n8n/backend-services'; import { WorkflowPublisherService } from '@/workflows/workflow-publisher.service'; import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service'; diff --git a/packages/cli/src/workflow-execute-additional-data.ts b/packages/cli/src/workflow-execute-additional-data.ts index 4d23f25a6aa..71f5ed812f0 100644 --- a/packages/cli/src/workflow-execute-additional-data.ts +++ b/packages/cli/src/workflow-execute-additional-data.ts @@ -3,7 +3,7 @@ import type { PushMessage, PushType } from '@n8n/api-types'; import { Logger, ModuleRegistry } from '@n8n/backend-common'; import { SsrfProtectionService } from '@n8n/backend-network'; -import { EventService, UrlService } from '@n8n/backend-services'; +import { EventService, UrlService, WorkflowPublishedDataService } from '@n8n/backend-services'; import { ExecutionsConfig, GlobalConfig, SsrfProtectionConfig, WorkflowsConfig } from '@n8n/config'; import { Time } from '@n8n/constants'; import { ExecutionRepository, WorkflowRepository } from '@n8n/db'; @@ -79,7 +79,6 @@ import { objectToError } from '@/utils/object-to-error'; import * as WorkflowHelpers from '@/workflow-helpers'; import { DeprecatedNodesValidationService } from '@/workflows/deprecated-nodes-validation.service'; import { getWorkflowProjectDetailsSafe } from '@/workflows/utils'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; export function getRunData( workflowData: IWorkflowBase, diff --git a/packages/cli/src/workflows/__tests__/error-workflow-validation.service.test.ts b/packages/cli/src/workflows/__tests__/error-workflow-validation.service.test.ts index 05142857884..70a82692cba 100644 --- a/packages/cli/src/workflows/__tests__/error-workflow-validation.service.test.ts +++ b/packages/cli/src/workflows/__tests__/error-workflow-validation.service.test.ts @@ -12,10 +12,7 @@ import { staticErrorWorkflowId, } from '@/workflows/error-workflow-validation.service'; import type { WorkflowFinderService } from '@/workflows/workflow-finder.service'; -import type { - PublishedWorkflowData, - WorkflowPublishedDataService, -} from '@/workflows/workflow-published-data.service'; +import type { PublishedWorkflowData, WorkflowPublishedDataService } from '@n8n/backend-services'; const ERROR_TRIGGER_TYPE = 'n8n-nodes-base.errorTrigger'; diff --git a/packages/cli/src/workflows/__tests__/workflow-execution.service.test.ts b/packages/cli/src/workflows/__tests__/workflow-execution.service.test.ts index 1925e527ee1..d1ff75b69e8 100644 --- a/packages/cli/src/workflows/__tests__/workflow-execution.service.test.ts +++ b/packages/cli/src/workflows/__tests__/workflow-execution.service.test.ts @@ -1,5 +1,9 @@ import type { Logger } from '@n8n/backend-common'; -import type { EventService, InstanceWriteAccessService } from '@n8n/backend-services'; +import type { + EventService, + InstanceWriteAccessService, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import type { GlobalConfig, WorkflowsConfig } from '@n8n/config'; import type { CreateExecutionPayload, @@ -42,7 +46,6 @@ import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-da import type { WorkflowRunner } from '@/workflow-runner'; import type { PollCursorService } from '@/workflows/triggers/poll-cursor.service'; import { WorkflowExecutionService } from '@/workflows/workflow-execution.service'; -import type { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; const webhookNode: INode = { name: 'Webhook', diff --git a/packages/cli/src/workflows/error-workflow-validation.service.ts b/packages/cli/src/workflows/error-workflow-validation.service.ts index 86d6271f9bc..8e1e241bfb6 100644 --- a/packages/cli/src/workflows/error-workflow-validation.service.ts +++ b/packages/cli/src/workflows/error-workflow-validation.service.ts @@ -5,7 +5,7 @@ import type { IWorkflowSettings } from 'n8n-workflow'; import { Workflow } from 'n8n-workflow'; import { WorkflowFinderService } from './workflow-finder.service'; -import { WorkflowPublishedDataService } from './workflow-published-data.service'; +import { WorkflowPublishedDataService } from '@n8n/backend-services'; import { SubworkflowPolicyDenialError } from '@/errors/subworkflow-policy-denial.error'; import { SubworkflowPolicyChecker } from '@/executions/pre-execution-checks/subworkflow-policy-checker'; diff --git a/packages/cli/src/workflows/publication/__tests__/workflow-publication-applier.test.ts b/packages/cli/src/workflows/publication/__tests__/workflow-publication-applier.test.ts index 6d3a796409b..cad9a35f3a9 100644 --- a/packages/cli/src/workflows/publication/__tests__/workflow-publication-applier.test.ts +++ b/packages/cli/src/workflows/publication/__tests__/workflow-publication-applier.test.ts @@ -24,7 +24,7 @@ import { WorkflowPublicationApplier } from '@/workflows/publication/workflow-pub import type { DurableJobProvisioner } from '@/scheduling/durable-job-provisioner'; import type { WorkflowScheduledJobOwner } from '@/scheduling/workflow-scheduled-job-owner'; import type { WorkflowTriggerActivator } from '@/workflows/triggers/workflow-trigger-activator'; -import type { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import type { WorkflowPublishedDataService } from '@n8n/backend-services'; import type { WorkflowService } from '@/workflows/workflow.service'; describe('WorkflowPublicationApplier', () => { diff --git a/packages/cli/src/workflows/publication/workflow-publication-applier.ts b/packages/cli/src/workflows/publication/workflow-publication-applier.ts index 88f3e18a58c..06e8ecfafa2 100644 --- a/packages/cli/src/workflows/publication/workflow-publication-applier.ts +++ b/packages/cli/src/workflows/publication/workflow-publication-applier.ts @@ -44,7 +44,7 @@ import { type TriggerOperationAbort, type TriggerTeardownFailure, } from '@/workflows/triggers/workflow-trigger-activator'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import { WorkflowPublishedDataService } from '@n8n/backend-services'; /** A node whose type this instance cannot load, with the loader's error. */ type UnresolvableNode = { node: INode; error: Error }; diff --git a/packages/cli/src/workflows/triggers/__tests__/trigger-execution-context.factory.test.ts b/packages/cli/src/workflows/triggers/__tests__/trigger-execution-context.factory.test.ts index c53f0082410..4402718403f 100644 --- a/packages/cli/src/workflows/triggers/__tests__/trigger-execution-context.factory.test.ts +++ b/packages/cli/src/workflows/triggers/__tests__/trigger-execution-context.factory.test.ts @@ -1,6 +1,10 @@ /* eslint-disable @typescript-eslint/unbound-method */ import type { Logger } from '@n8n/backend-common'; -import type { EventService } from '@n8n/backend-services'; +import type { + EventService, + PublishedWorkflowDataForExecution, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import type { Project, WorkflowEntity } from '@n8n/db'; import type { IDeferredPromise } from '@n8n/utils/promise/deferred-promise'; import { createDeferredPromise } from '@n8n/utils/promise/deferred-promise'; @@ -42,10 +46,7 @@ import type { OwnershipService } from '@/services/ownership.service'; import type { WorkflowPublisherService } from '@/workflows/workflow-publisher.service'; import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data'; import type { WorkflowExecutionService } from '@/workflows/workflow-execution.service'; -import type { - PublishedWorkflowDataForExecution, - WorkflowPublishedDataService, -} from '@/workflows/workflow-published-data.service'; + import type { EngineV2Dispatcher } from '@/services/engine-v2-dispatcher.service'; import { EngineV2PayloadFiles } from '@/services/engine-v2-payload-files.service'; import { EngineV2ActiveTriggers } from '@/workflows/triggers/engine-v2-active-triggers'; diff --git a/packages/cli/src/workflows/triggers/trigger-execution-context.factory.ts b/packages/cli/src/workflows/triggers/trigger-execution-context.factory.ts index 4ba0e7baa06..ef93b10ffcc 100644 --- a/packages/cli/src/workflows/triggers/trigger-execution-context.factory.ts +++ b/packages/cli/src/workflows/triggers/trigger-execution-context.factory.ts @@ -1,5 +1,5 @@ import { Logger } from '@n8n/backend-common'; -import { EventService } from '@n8n/backend-services'; +import { EventService, WorkflowPublishedDataService } from '@n8n/backend-services'; import { Time } from '@n8n/constants'; import type { IWorkflowDb, PollerCursor, PollLeaseFence } from '@n8n/db'; import { Service } from '@n8n/di'; @@ -46,7 +46,7 @@ import { EngineV2ActiveTriggers } from '@/workflows/triggers/engine-v2-active-tr import { PollCursorService } from '@/workflows/triggers/poll-cursor.service'; import { getWorkflowProjectDetailsSafe } from '@/workflows/utils'; import { WorkflowExecutionService } from '@/workflows/workflow-execution.service'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import { WorkflowPublisherService } from '@/workflows/workflow-publisher.service'; import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service'; diff --git a/packages/cli/src/workflows/workflow-execution.service.ts b/packages/cli/src/workflows/workflow-execution.service.ts index 71c16db42bb..df3a027dfc6 100644 --- a/packages/cli/src/workflows/workflow-execution.service.ts +++ b/packages/cli/src/workflows/workflow-execution.service.ts @@ -1,5 +1,9 @@ import { Logger } from '@n8n/backend-common'; -import { EventService, InstanceWriteAccessService } from '@n8n/backend-services'; +import { + EventService, + InstanceWriteAccessService, + WorkflowPublishedDataService, +} from '@n8n/backend-services'; import { GlobalConfig, WorkflowsConfig } from '@n8n/config'; import type { Project, @@ -55,7 +59,7 @@ import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-da import { WorkflowRunner } from '@/workflow-runner'; import { PollCursorService } from '@/workflows/triggers/poll-cursor.service'; import { getWorkflowProjectDetailsSafe } from '@/workflows/utils'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; + import type { WorkflowRequest } from '@/workflows/workflow.request'; @Service() diff --git a/packages/cli/test/integration/workflows/workflow-published-data.service.test.ts b/packages/cli/test/integration/workflows/workflow-published-data.service.test.ts index ddcd06e8982..15431a4f86c 100644 --- a/packages/cli/test/integration/workflows/workflow-published-data.service.test.ts +++ b/packages/cli/test/integration/workflows/workflow-published-data.service.test.ts @@ -4,7 +4,7 @@ import { Container } from '@n8n/di'; import type { INode } from 'n8n-workflow'; import { v4 as uuid } from 'uuid'; -import { WorkflowPublishedDataService } from '@/workflows/workflow-published-data.service'; +import { WorkflowPublishedDataService } from '@n8n/backend-services'; import { createOwner } from '../shared/db/users'; import { createWorkflowHistoryItem } from '../shared/db/workflow-history';