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(core): Consider subworkflows successfully run when in waiting state #7699

Conversation

flipswitchingmonkey
Copy link
Contributor

Github issue / Community forum post (link here to close automatically):
#7189

@@ -902,10 +903,11 @@ async function executeWorkflow(
}
data = await workflowExecute.processRunExecutionData(workflow);
} catch (error) {
const executionError = error ? (error as ExecutionError) : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the error we're throwing here? Is it possible to prevent it being thrown at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That error has nothing to do with the bug reported, I just noticed that it was untyped. I guess anything that could go wrong during the execution would throw that particular error.

@@ -953,21 +955,23 @@ async function executeWorkflow(

void internalHooks.onWorkflowPostExecute(executionId, workflowData, data, additionalData.userId);

if (data.finished === true) {
// subworkflow either finished, or is in status waiting due to a wait node, both cases are considered successes here
if (data.finished === true || data.status === 'waiting') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to change the check to data.status !== 'error'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would not be just error I guess, it would have to be canceled, crashed, error, failed, unknown, warning, new - so I think this way around is easier

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Nov 13, 2023
Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this change and it's working. We plan on refactoring parts of this file and then we should be adding tests for this code.

Copy link

cypress bot commented Nov 14, 2023

3 flaky tests on run #2862 ↗︎

0 277 3 0 Flakiness 3

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 flipswitchingmonkey 🗃️ e2e/*
Project: n8n Commit: 364552ac1d
Status: Passed Duration: 07:54 💡
Started: Nov 14, 2023 9:43 AM Ended: Nov 14, 2023 9:51 AM
Flakiness  6-code-node.cy.ts • 1 flaky test

View
Output
Video

Test Artifacts
Code node > Code editor > should execute the placeholder successfully in both modes Screenshots Video
Flakiness  28-resource-mapper.cy.ts • 2 flaky tests

View
Output
Video

Test Artifacts
Resource Mapper > should correctly delete single field Screenshots Video
Resource Mapper > should correctly delete all fields Screenshots Video

Review all test suite changes for PR #7699 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@flipswitchingmonkey flipswitchingmonkey merged commit 0e00dab into master Nov 14, 2023
59 of 60 checks passed
@flipswitchingmonkey flipswitchingmonkey deleted the pay-998-main-workflow-crashes-if-sub-workflow-has-a-wait-that-needs branch November 14, 2023 10:04
@github-actions github-actions bot mentioned this pull request Nov 15, 2023
ivov added a commit that referenced this pull request Nov 15, 2023
#
[1.17.0](https://github.com/n8n-io/n8n/compare/n8n@1.16.0...n8n@1.17.0)
(2023-11-15)


### Bug Fixes

* **Convert to/from binary data Node:** Better mime type defaults
([#7693](#7693))
([9b3be0c](9b3be0c))
* **core:** Consider subworkflows successfully run when in waiting state
([#7699](#7699))
([0e00dab](0e00dab))
* **core:** Fix named parameter resolution in migrations
([#7688](#7688))
([4441ed5](4441ed5)),
closes [#7628](#7628)
* **core:** Initialize JWT Secret before it's used anywhere
([#7707](#7707))
([3460eb5](3460eb5))
* **core:** Reduce memory usage in credentials risk auditing
([#7663](#7663))
([9fd6319](9fd6319))
* **Date & Time Node:** Add fromFormat option to solve ambiguous date
strings ([#7675](#7675))
([d2d11e0](d2d11e0))
* **editor:** Fix resource mapper component being truncated
([#7664](#7664))
([00dff50](00dff50))
* **editor:** More securely clear executions tab auto refresh timer
([#7685](#7685))
([37dd658](37dd658))
* **editor:** Redirect to workflow editor after saving in debug mode
([#7645](#7645))
([020042e](020042e))
* **Google Sheets Node:** Append exceeding grid limits
([#7684](#7684))
([88efb99](88efb99))
* **HTTP Request Node:** Support generic credentials when using
pagination ([#7686](#7686))
([48b240b](48b240b)),
closes [#7653](#7653)
* **HubSpot Node:** Fetching available parameters fails when using
expressions ([#7672](#7672))
([a9ab738](a9ab738))
* **HubSpot Node:** Update deal owner on Hubspot Deal
([#7673](#7673))
([3c0734b](3c0734b))
* **Spreadsheet File Node:** Read file as utf-8 in v1
([#7701](#7701))
([786b4ad](786b4ad))


### Features

* **core:** Expression function $ifEmpty
([#7660](#7660))
([1c7225e](1c7225e))
* **Date & Time Node:** Option to include other fields in output item
([#7661](#7661))
([aea3c50](aea3c50))
* **Discord Node:** Overhaul
([#5351](#5351))
([6a53c2a](6a53c2a))
* **Discourse Node:** Add new options to Get Users
([#7674](#7674))
([2e8c841](2e8c841))
* **editor:** Add color selector to sticky node
([#7453](#7453))
([8359364](8359364))
* **editor:** Add HTTP request nodes for credentials without a node
([#7157](#7157))
([14035e1](14035e1))
* **editor:** Add workflow filters to querystring
([#7456](#7456))
([afd637b](afd637b))
* **editor:** Adds a EE view to show worker details and job status
([#7600](#7600))
([cbc6909](cbc6909))
* **GitLab Node:** Add support for pagination on getIssues
([#7529](#7529))
([0a0798e](0a0798e))
* **OpenAI Node:** Add dall-e-3 support
([#7655](#7655))
([a9c7188](a9c7188))
* **RabbitMQ Trigger Node:** Add exchange and routing key options
([#7547](#7547))
([5aee2b7](5aee2b7))
* **Telegram Node:** Add support for markdownv2
([#7679](#7679))
([819b3a7](819b3a7))
* **Venafi TLS Protect Cloud Node:** Add region parameter to Venafi
protect cloud ([#7689](#7689))
([a08fca5](a08fca5))


### Performance Improvements

* **core:** Lazyload security audit reporters
([#7696](#7696))
([b2ca050](b2ca050))

Co-authored-by: ivov <ivov@users.noreply.github.com>
@janober
Copy link
Member

janober commented Nov 15, 2023

Got released with n8n@1.17.0

@mutdmour
Copy link
Contributor

@krynble @flipswitchingmonkey can you please make sure to add tests?

@krynble
Copy link
Contributor

krynble commented Nov 22, 2023

@mutdmour we will refactor this part of the code as part of our quarterly goals, it's currently impossible to add tests as it's convoluted, that's why I approved it without it, see my comment above.

@mutdmour
Copy link
Contributor

@krynble great thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released skip-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants