mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix, WIP
This commit is contained in:
parent
8496adb94f
commit
726cd86378
|
@ -320,7 +320,7 @@ const nodeTitle = computed(() => {
|
||||||
const waiting = computed(() => {
|
const waiting = computed(() => {
|
||||||
const workflowExecution = workflowsStore.getWorkflowExecution as ExecutionSummary;
|
const workflowExecution = workflowsStore.getWorkflowExecution as ExecutionSummary;
|
||||||
|
|
||||||
if (workflowExecution?.waitTill) {
|
if (workflowExecution?.waitTill && !workflowExecution?.finished) {
|
||||||
const lastNodeExecuted = get(workflowExecution, 'data.resultData.lastNodeExecuted');
|
const lastNodeExecuted = get(workflowExecution, 'data.resultData.lastNodeExecuted');
|
||||||
if (props.name === lastNodeExecuted) {
|
if (props.name === lastNodeExecuted) {
|
||||||
const waitDate = new Date(workflowExecution.waitTill);
|
const waitDate = new Date(workflowExecution.waitTill);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import type {
|
||||||
IRun,
|
IRun,
|
||||||
INode,
|
INode,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import { NodeConnectionType } from 'n8n-workflow';
|
import { NodeConnectionType, sleep } from 'n8n-workflow';
|
||||||
|
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||||
|
@ -295,6 +295,40 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
|
||||||
shouldShowForm,
|
shouldShowForm,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
if (runWorkflowApiResponse.executionId) {
|
||||||
|
const execution = await workflowsStore.getExecution(runWorkflowApiResponse.executionId);
|
||||||
|
if (!execution) break;
|
||||||
|
console.log(execution.startedAt, execution.stoppedAt);
|
||||||
|
|
||||||
|
if (execution.finished) {
|
||||||
|
workflowsStore.setWorkflowExecutionData(execution);
|
||||||
|
nodeHelpers.updateNodesExecutionIssues();
|
||||||
|
|
||||||
|
return runWorkflowApiResponse;
|
||||||
|
} else {
|
||||||
|
await sleep(2000);
|
||||||
|
|
||||||
|
if (execution.data) {
|
||||||
|
workflowsStore.setWorkflowExecutionRunData(execution.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
displayForm({
|
||||||
|
nodes: workflowData.nodes,
|
||||||
|
runData: workflowsStore.getWorkflowExecution?.data?.resultData?.runData,
|
||||||
|
destinationNode: options.destinationNode,
|
||||||
|
pinData,
|
||||||
|
directParentNodes,
|
||||||
|
formWaitingUrl: rootStore.formWaitingUrl,
|
||||||
|
executionId: runWorkflowApiResponse.executionId,
|
||||||
|
source: options.source,
|
||||||
|
getTestUrl,
|
||||||
|
shouldShowForm,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else break;
|
||||||
|
}
|
||||||
|
|
||||||
await useExternalHooks().run('workflowRun.runWorkflow', {
|
await useExternalHooks().run('workflowRun.runWorkflow', {
|
||||||
nodeName: options.destinationNode,
|
nodeName: options.destinationNode,
|
||||||
source: options.source,
|
source: options.source,
|
||||||
|
|
Loading…
Reference in a new issue