fix(core): Assign execute method to declarative nodes even if they have methods property (#17796)

This commit is contained in:
RomanDavydchuk
2025-07-31 01:44:23 +03:00
committed by GitHub
parent bc97584c0c
commit 3f1016f1ad
2 changed files with 11 additions and 2 deletions

View File

@@ -58,11 +58,20 @@ describe('shouldAssignExecuteMethod', () => {
expect(shouldAssignExecuteMethod(nodeType)).toBe(true);
});
it('should return false when node has methods', () => {
it('should return false when node has methods and is not declarative', () => {
const nodeType = {
methods: {},
} as unknown as INodeType;
expect(shouldAssignExecuteMethod(nodeType)).toBe(false);
});
it('should return true when node has methods but is declarative', () => {
const nodeType = {
description: { requestDefaults: {} }, // Declarative node
methods: {},
} as unknown as INodeType;
expect(shouldAssignExecuteMethod(nodeType)).toBe(true);
});
});

View File

@@ -89,6 +89,6 @@ export const shouldAssignExecuteMethod = (nodeType: INodeType) => {
!nodeType.poll &&
!nodeType.trigger &&
(!nodeType.webhook || isDeclarativeNode) &&
!nodeType.methods
(!nodeType.methods || isDeclarativeNode)
);
};