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): Don't report executions that have been paused as failed to rudderstack and log streams #8501

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cli/src/InternalHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ export class InternalHooks {
return;
}

if (runData?.status === 'waiting') {
Copy link
Member

Choose a reason for hiding this comment

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

perhaps the issue here is that onWorkflowPostExecuteis being called in the first place. we should prevent that, instead of adding a return here.
@krynble opinions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the same thought and we discussed this here: https://linear.app/n8n/issue/PAY-1298/bug-log-streaming-fires-failed-workflow-notification-on-long-wait#comment-b8670cbe

I think we can change that when we refactor the workflow life-cycle hooks in general. Let me know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think for the sake of clarity it's best to call the function and return early rather than not call it, otherwise anyone looking at this function alone would expect it to run always.

// No need to send telemetry or logs when the workflow hasn't finished yet.
return;
}

const promises = [];

const telemetryProperties: IExecutionTrackProperties = {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/WorkflowExecuteAdditionalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {

const workflowStatusFinal = determineFinalExecutionStatus(fullRunData);

if (workflowStatusFinal !== 'success') {
if (workflowStatusFinal !== 'success' && workflowStatusFinal !== 'waiting') {
executeErrorWorkflow(
this.workflowData,
fullRunData,
Expand Down
Loading