diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index 6cb90cfe8..a987422c0 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -141,12 +141,7 @@ export const NON_ACTIVATABLE_TRIGGER_NODE_TYPES = [ EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE, ]; -export const MULTIPLE_OUTPUT_NODE_TYPES = [IF_NODE_TYPE, SWITCH_NODE_TYPE]; - -export const PIN_DATA_NODE_TYPES_DENYLIST = [ - ...MULTIPLE_OUTPUT_NODE_TYPES, - SPLIT_IN_BATCHES_NODE_TYPE, -]; +export const PIN_DATA_NODE_TYPES_DENYLIST = [SPLIT_IN_BATCHES_NODE_TYPE]; // Node creator export const CORE_NODES_CATEGORY = 'Core Nodes'; diff --git a/packages/editor-ui/src/mixins/pinData.ts b/packages/editor-ui/src/mixins/pinData.ts index 69aac7496..dbaa4e793 100644 --- a/packages/editor-ui/src/mixins/pinData.ts +++ b/packages/editor-ui/src/mixins/pinData.ts @@ -1,6 +1,6 @@ import Vue from 'vue'; import { INodeUi } from '@/Interface'; -import { IPinData } from 'n8n-workflow'; +import { INodeTypeDescription, IPinData } from 'n8n-workflow'; import { stringSizeInBytes } from '@/utils'; import { MAX_WORKFLOW_PINNED_DATA_SIZE, PIN_DATA_NODE_TYPES_DENYLIST } from '@/constants'; import { mapStores } from 'pinia'; @@ -8,6 +8,7 @@ import { useWorkflowsStore } from '@/stores/workflows'; export interface IPinDataContext { node: INodeUi; + nodeType: INodeTypeDescription; $showError(error: Error, title: string): void; } @@ -21,7 +22,14 @@ export const pinData = (Vue as Vue.VueConstructor).extend return !!this.node && typeof this.pinData !== 'undefined'; }, isPinDataNodeType(): boolean { - return !!this.node && !PIN_DATA_NODE_TYPES_DENYLIST.includes(this.node.type); + return ( + !!this.node && + !this.isMultipleOutputsNodeType && + !PIN_DATA_NODE_TYPES_DENYLIST.includes(this.node.type) + ); + }, + isMultipleOutputsNodeType(): boolean { + return this.nodeType?.outputs.length > 1; }, }, methods: {