fix(n8n Form Node): Redirection update (no-changelog) (#13104)

Co-authored-by: Dana <152518854+dana-gill@users.noreply.github.com>
This commit is contained in:
Michael Kret
2025-02-19 14:59:38 +02:00
committed by GitHub
parent 60ff82f648
commit 755734d349
15 changed files with 288 additions and 131 deletions

View File

@@ -7,7 +7,12 @@ import type {
IDisplayOptions,
IWebhookFunctions,
} from 'n8n-workflow';
import { NodeOperationError, NodeConnectionType, WAIT_INDEFINITELY } from 'n8n-workflow';
import {
NodeOperationError,
NodeConnectionType,
WAIT_INDEFINITELY,
FORM_TRIGGER_NODE_TYPE,
} from 'n8n-workflow';
import { updateDisplayOptions } from '../../utils/utilities';
import {
@@ -459,7 +464,25 @@ export class Wait extends Webhook {
const resume = context.getNodeParameter('resume', 0) as string;
if (['webhook', 'form'].includes(resume)) {
return await this.configureAndPutToWait(context);
let hasFormTrigger = false;
if (resume === 'form') {
const parentNodes = context.getParentNodes(context.getNode().name);
hasFormTrigger = parentNodes.some((node) => node.type === FORM_TRIGGER_NODE_TYPE);
}
const returnData = await this.configureAndPutToWait(context);
if (resume === 'form' && hasFormTrigger) {
context.sendResponse({
headers: {
location: context.evaluateExpression('{{ $execution.resumeFormUrl }}', 0),
},
statusCode: 307,
});
}
return returnData;
}
let waitTill: Date;