fix: Sync partial execution version of FE and BE, also allow enforcing a specific version (#12840)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
Danny Martini
2025-02-03 14:17:31 +01:00
committed by GitHub
parent a65a9e631b
commit a15504329b
21 changed files with 193 additions and 62 deletions

View File

@@ -35,7 +35,7 @@ import { isEmpty } from '@/utils/typesUtils';
import { useI18n } from '@/composables/useI18n';
import { get } from 'lodash-es';
import { useExecutionsStore } from '@/stores/executions.store';
import { useLocalStorage } from '@vueuse/core';
import { useSettingsStore } from '@/stores/settings.store';
const getDirtyNodeNames = (
runData: IRunData,
@@ -260,18 +260,18 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
return undefined;
}
// -1 means the backend chooses the default
// 0 is the old flow
// 1 is the new flow
const partialExecutionVersion = useLocalStorage('PartialExecution.version', -1);
// partial executions must have a destination node
const isPartialExecution = options.destinationNode !== undefined;
const settingsStore = useSettingsStore();
const version = settingsStore.partialExecutionVersion;
const startRunData: IStartRunData = {
workflowData,
// With the new partial execution version the backend decides what run
// data to use and what to ignore.
runData: !isPartialExecution
? // if it's a full execution we don't want to send any run data
undefined
: partialExecutionVersion.value === 1
: version === 2
? // With the new partial execution version the backend decides
//what run data to use and what to ignore.
(runData ?? undefined)