feat(core): Improve handling of manual executions with wait nodes (#11750)

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-11-18 12:58:26 +01:00
committed by GitHub
parent d5ba1a059b
commit 61696c3db3
21 changed files with 325 additions and 402 deletions

View File

@@ -232,7 +232,7 @@ export default defineComponent({
const { callDebounced } = useDebounce();
const canvasPanning = useCanvasPanning(nodeViewRootRef, { onMouseMoveEnd });
const workflowHelpers = useWorkflowHelpers({ router });
const { runWorkflow, stopCurrentExecution, runWorkflowResolvePending } = useRunWorkflow({
const { runWorkflow, stopCurrentExecution } = useRunWorkflow({
router,
});
const { addBeforeUnloadEventBindings, removeBeforeUnloadEventBindings } = useBeforeUnload({
@@ -254,7 +254,6 @@ export default defineComponent({
onMouseMoveEnd,
workflowHelpers,
runWorkflow,
runWorkflowResolvePending,
stopCurrentExecution,
callDebounced,
...useCanvasMouseSelect(),
@@ -852,11 +851,7 @@ export default defineComponent({
this.$telemetry.track('User clicked execute node button', telemetryPayload);
void this.externalHooks.run('nodeView.onRunNode', telemetryPayload);
if (!this.isExecutionPreview && this.workflowsStore.isWaitingExecution) {
void this.runWorkflowResolvePending({ destinationNode: nodeName, source });
} else {
void this.runWorkflow({ destinationNode: nodeName, source });
}
void this.runWorkflow({ destinationNode: nodeName, source });
},
async onOpenChat() {
const telemetryPayload = {
@@ -883,11 +878,7 @@ export default defineComponent({
void this.externalHooks.run('nodeView.onRunWorkflow', telemetryPayload);
});
if (!this.isExecutionPreview && this.workflowsStore.isWaitingExecution) {
void this.runWorkflowResolvePending({});
} else {
void this.runWorkflow({});
}
void this.runWorkflow({});
this.refreshEndpointsErrorsState();
},
@@ -1758,6 +1749,8 @@ export default defineComponent({
} else {
this.showError(error, this.i18n.baseText('nodeView.showError.stopExecution.title'));
}
} finally {
this.workflowsStore.markExecutionAsStopped();
}
this.stopExecutionInProgress = false;
void this.workflowHelpers.getWorkflowDataToSave().then((workflowData) => {