diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index dc63f53099659..704c9714b3fba 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -792,4 +792,13 @@ export const schema = { env: 'N8N_PROXY_HOPS', doc: 'Number of reverse-proxies n8n is running behind', }, + + featureFlags: { + partialExecutionVersionDefault: { + format: String, + default: '0', + env: 'PARTIAL_EXECUTION_VERSION_DEFAULT', + doc: 'Set this to 1 to enable the new partial execution logic by default.', + }, + }, }; diff --git a/packages/cli/src/workflows/workflows.controller.ts b/packages/cli/src/workflows/workflows.controller.ts index 914b8d5a9f6a4..f568c430166bd 100644 --- a/packages/cli/src/workflows/workflows.controller.ts +++ b/packages/cli/src/workflows/workflows.controller.ts @@ -406,7 +406,9 @@ export class WorkflowsController { req.body, req.user, req.headers['push-ref'] as string, - req.query.partialExecutionVersion, + req.query.partialExecutionVersion === '-1' + ? config.getEnv('featureFlags.partialExecutionVersionDefault') + : req.query.partialExecutionVersion, ); } diff --git a/packages/editor-ui/src/stores/workflows.store.ts b/packages/editor-ui/src/stores/workflows.store.ts index ad1e85b9a8ac4..fdd42f421dbd0 100644 --- a/packages/editor-ui/src/stores/workflows.store.ts +++ b/packages/editor-ui/src/stores/workflows.store.ts @@ -102,7 +102,10 @@ let cachedWorkflow: Workflow | null = null; export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => { const uiStore = useUIStore(); - const partialExecutionVersion = useLocalStorage('PartialExecution.version', 0); + // -1 means the backend chooses the default + // 0 is the old flow + // 1 is the new flow + const partialExecutionVersion = useLocalStorage('PartialExecution.version', -1); const workflow = ref(createEmptyWorkflow()); const usedCredentials = ref>({});