-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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(cli): Fix issue with n8n crashing when error in poll method #4008
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1648041
:bug: Fix issue with n8n crashing when error in poll method
RicardoE105 85c7122
Remove unnecessary imports and add async property
krynble c86175a
Remove unnecessary imports
krynble aa9c1ad
:zap: Move createErrorExecution to genericHelper
RicardoE105 018f02c
:zap: Improvements
RicardoE105 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krynble Should we check the workflow settings to check whether save error execution is enabled
before saving the error execution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum that's a good point. Now thinking about alternatives, we have what we call "Activation errors".
You can see in the
packages/cli/src/ActiveWorkflowRunner.ts
file specifically insideadd
function, we try to activate a workflow and if it fails, we deactivate it and add an error the user can see when opening the workflows list.Instead of generating a failed execution, what if we deactivate the workflow and display this error?
On the other hand, this is bad because we'll deactivate the workflow even if the service is temporarily down and a next poll request would work just fine.
Maybe the current approach you implemented is best for debuggability and failed executions are saved by default, so we should check this flag, yes, and only save if it's checked.
We just need to make sure that
WorkflowData
that we received was actually populated with this, because I've seen situations where this did not happen.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think this is a much better approach. For example, in the Airtable case, the issue is generated by changing the trigger column in Airtable (Workflow does not have to be touched). In case this happens, with this approach, the user will have an issue in the error tab or will be notified via the error workflow, then look at the error, and finally adjust in Airtable without having to touch the workflow. The other approach will be an extra step having to activate the workflow again, and if we do not save the execution plus they do not have an error workflow setup, they will never notice the error.