fix(core): Resolves response promise for active execution on job finished in queue mode (#15643)

Co-authored-by: Jaakko Husso <jaakko@n8n.io>
This commit is contained in:
Guillaume Jacquart
2025-06-04 10:25:00 +02:00
committed by GitHub
parent 92cf3cedbb
commit 7cd7883b34
4 changed files with 44 additions and 4 deletions

View File

@@ -105,6 +105,7 @@ export function getWorkflowWebhooks(
return returnData;
}
// eslint-disable-next-line complexity
export function autoDetectResponseMode(
workflowStartNode: INode,
workflow: Workflow,
@@ -126,6 +127,21 @@ export function autoDetectResponseMode(
}
}
// If there are form nodes connected to a current form node we're dealing with a multipage form
// and we need to return the formPage response mode when a second page of the form gets submitted
// to be able to show potential form errors correctly.
if (workflowStartNode.type === FORM_NODE_TYPE && method === 'POST') {
const connectedNodes = workflow.getChildNodes(workflowStartNode.name);
for (const nodeName of connectedNodes) {
const node = workflow.nodes[nodeName];
if (node.type === FORM_NODE_TYPE && !node.disabled) {
return 'formPage';
}
}
}
if (workflowStartNode.type === WAIT_NODE_TYPE && workflowStartNode.parameters.resume !== 'form') {
return undefined;
}