Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Fix and report settings being null in workflow payloads (no-changelog) #9227

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/editor-ui/src/stores/workflows.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import { useUsersStore } from '@/stores/users.store';
import { useSettingsStore } from '@/stores/settings.store';
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
import { i18n } from '@/plugins/i18n';
import { ErrorReporterProxy as EventReporter } from 'n8n-workflow';

const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
name: '',
Expand Down Expand Up @@ -1312,6 +1313,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
forceSave = false,
): Promise<IWorkflowDb> {
const rootStore = useRootStore();

if (data.settings === null) {
EventReporter.info('Detected workflow payload with settings as null');
data.settings = undefined;
}

return await makeRestApiRequest(
rootStore.getRestApiContext,
'PATCH',
Expand All @@ -1322,6 +1329,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {

async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
const rootStore = useRootStore();

if (startRunData.workflowData.settings === null) {
EventReporter.info('Detected workflow payload with settings as null');
startRunData.workflowData.settings = undefined;
}

try {
return await makeRestApiRequest(
rootStore.getRestApiContext,
Expand Down
Loading