diff --git a/cypress/e2e/40-manual-partial-execution.cy.ts b/cypress/e2e/40-manual-partial-execution.cy.ts new file mode 100644 index 0000000000000..5fe31b56ad137 --- /dev/null +++ b/cypress/e2e/40-manual-partial-execution.cy.ts @@ -0,0 +1,28 @@ +import { NDV, WorkflowPage } from '../pages'; + +const canvas = new WorkflowPage(); +const ndv = new NDV(); + +describe('Manual partial execution', () => { + it('should execute parent nodes with no run data only once', () => { + canvas.actions.visit(); + + cy.fixture('manual-partial-execution.json').then((data) => { + cy.get('body').paste(JSON.stringify(data)); + }); + + canvas.actions.zoomToFit(); + + canvas.actions.openNode('Edit Fields'); + + cy.get('button').contains('Test step').click(); // create run data + cy.get('button').contains('Test step').click(); // use run data + + ndv.actions.close(); + + canvas.actions.openNode('Webhook1'); + + ndv.getters.nodeRunSuccessIndicator().should('exist'); + ndv.getters.outputRunSelector().should('not.exist'); // single run + }); +}); diff --git a/cypress/fixtures/manual-partial-execution.json b/cypress/fixtures/manual-partial-execution.json new file mode 100644 index 0000000000000..9e43cd525bef0 --- /dev/null +++ b/cypress/fixtures/manual-partial-execution.json @@ -0,0 +1,107 @@ +{ + "meta": { + "templateCredsSetupCompleted": true + }, + "nodes": [ + { + "parameters": { + "options": {} + }, + "id": "f4467143-fdb9-46fa-8020-6417cc5eea7d", + "name": "Edit Fields", + "type": "n8n-nodes-base.set", + "typeVersion": 3.3, + "position": [ + 1140, + 260 + ] + }, + { + "parameters": { + "path": "30ff316d-405f-4288-a0ac-e713546c9d4e", + "options": {} + }, + "id": "4760aafb-5d56-4633-99d3-7a97c576a216", + "name": "Webhook1", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [ + 680, + 340 + ], + "webhookId": "30ff316d-405f-4288-a0ac-e713546c9d4e" + }, + { + "parameters": { + "articleId": "123", + "additionalFields": {} + }, + "id": "8c811eca-8978-44d9-b8f7-ef2c7725784c", + "name": "Hacker News", + "type": "n8n-nodes-base.hackerNews", + "typeVersion": 1, + "position": [ + 920, + 260 + ] + }, + { + "parameters": { + "path": "4a3398e4-1388-4e10-9d21-add90b804955", + "options": {} + }, + "id": "1c2c2d06-45c9-4712-9fa0-c655bef8d0e5", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [ + 680, + 180 + ], + "webhookId": "4a3398e4-1388-4e10-9d21-add90b804955" + } + ], + "connections": { + "Webhook1": { + "main": [ + [ + { + "node": "Hacker News", + "type": "main", + "index": 0 + } + ] + ] + }, + "Hacker News": { + "main": [ + [ + { + "node": "Edit Fields", + "type": "main", + "index": 0 + } + ] + ] + }, + "Webhook": { + "main": [ + [ + { + "node": "Hacker News", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "pinData": { + "Webhook": [ + { + "name": "First item", + "code": 1 + } + ] + } +} diff --git a/packages/editor-ui/src/composables/useRunWorkflow.ts b/packages/editor-ui/src/composables/useRunWorkflow.ts index 9706a57729135..71527e8ed65b1 100644 --- a/packages/editor-ui/src/composables/useRunWorkflow.ts +++ b/packages/editor-ui/src/composables/useRunWorkflow.ts @@ -334,7 +334,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType(); let newRunData: IRunData | undefined; if (runData !== null && Object.keys(runData).length !== 0) { @@ -360,7 +360,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType