fix(editor): Ensure no running node when execution finished (#15299)

This commit is contained in:
Suguru Inoue
2025-05-12 10:39:51 +02:00
committed by GitHub
parent ab27f91944
commit d12c7ee87f
2 changed files with 19 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import type {
ExpressionError,
IDataObject,
IRunExecutionData,
IRunData,
} from 'n8n-workflow';
import { codeNodeEditorEventBus, globalLinkActionsEventBus } from '@/event-bus';
import { h } from 'vue';
@@ -466,6 +467,8 @@ export function setRunExecutionData(
runExecutionData.resultData.runData = workflowsStore.getWorkflowRunData;
}
removeRunningTaskData(runExecutionData.resultData.runData);
workflowsStore.executingNode.length = 0;
workflowsStore.setWorkflowExecutionData({
@@ -505,3 +508,11 @@ export function setRunExecutionData(
const lineNumber = runExecutionData.resultData?.error?.lineNumber;
codeNodeEditorEventBus.emit('highlightLine', lineNumber ?? 'last');
}
function removeRunningTaskData(runData: IRunData): void {
for (const [nodeName, taskItems] of Object.entries(runData)) {
if (taskItems.some((item) => item.executionStatus === 'running')) {
runData[nodeName] = taskItems.filter((item) => item.executionStatus !== 'running');
}
}
}