Skip to content

Commit

Permalink
allow setting the default partial execution flow with an env variable
Browse files Browse the repository at this point in the history
PARTIAL_EXECUTION_VERSION_DEFAULT can be 0 or 1
  • Loading branch information
despairblue committed Aug 1, 2024
1 parent 13cd3eb commit 37f5e28
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
},
};
4 changes: 3 additions & 1 deletion packages/cli/src/workflows/workflows.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/editor-ui/src/stores/workflows.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IWorkflowDb>(createEmptyWorkflow());
const usedCredentials = ref<Record<string, IUsedCredential>>({});
Expand Down

0 comments on commit 37f5e28

Please sign in to comment.