@@ -19,7 +19,6 @@ import {
19
19
WAIT_INDEFINITELY ,
20
20
} from 'n8n-workflow' ;
21
21
22
- import { type CompletionPageConfig } from './interfaces' ;
23
22
import { formDescription , formFields , formTitle } from '../Form/common.descriptions' ;
24
23
import { prepareFormReturnItem , renderForm , resolveRawData } from '../Form/utils' ;
25
24
@@ -273,19 +272,19 @@ export class Form extends Node {
273
272
const method = context . getRequestObject ( ) . method ;
274
273
275
274
if ( operation === 'completion' && method === 'GET' ) {
276
- const staticData = context . getWorkflowStaticData ( 'node' ) ;
277
- const id = ` ${ context . getExecutionId ( ) } - ${ context . getNode ( ) . name } ` ;
278
- const config = staticData ?. [ id ] as CompletionPageConfig ;
279
- delete staticData [ id ] ;
275
+ const completionTitle = context . getNodeParameter ( 'completionTitle' , '' ) as string ;
276
+ const completionMessage = context . getNodeParameter ( 'completionMessage' , '' ) as string ;
277
+ const redirectUrl = context . getNodeParameter ( 'redirectUrl' , '' ) as string ;
278
+ const options = context . getNodeParameter ( 'options' , { } ) as { formTitle : string } ;
280
279
281
- if ( config . redirectUrl ) {
280
+ if ( redirectUrl ) {
282
281
res . send (
283
- `<html><head><meta http-equiv="refresh" content="0; url=${ config . redirectUrl } "></head></html>` ,
282
+ `<html><head><meta http-equiv="refresh" content="0; url=${ redirectUrl } "></head></html>` ,
284
283
) ;
285
284
return { noWebhookResponse : true } ;
286
285
}
287
286
288
- let title = config . pageTitle ;
287
+ let title = options . formTitle ;
289
288
if ( ! title ) {
290
289
title = context . evaluateExpression (
291
290
`{{ $('${ trigger ?. name } ').params.formTitle }}` ,
@@ -296,8 +295,8 @@ export class Form extends Node {
296
295
) as boolean ;
297
296
298
297
res . render ( 'form-trigger-completion' , {
299
- title : config . completionTitle ,
300
- message : config . completionMessage ,
298
+ title : completionTitle ,
299
+ message : completionMessage ,
301
300
formTitle : title ,
302
301
appendAttribution,
303
302
} ) ;
@@ -419,28 +418,7 @@ export class Form extends Node {
419
418
) ;
420
419
}
421
420
422
- if ( operation !== 'completion' ) {
423
- await context . putExecutionToWait ( WAIT_INDEFINITELY ) ;
424
- } else {
425
- const staticData = context . getWorkflowStaticData ( 'node' ) ;
426
- const completionTitle = context . getNodeParameter ( 'completionTitle' , 0 , '' ) as string ;
427
- const completionMessage = context . getNodeParameter ( 'completionMessage' , 0 , '' ) as string ;
428
- const redirectUrl = context . getNodeParameter ( 'redirectUrl' , 0 , '' ) as string ;
429
- const options = context . getNodeParameter ( 'options' , 0 , { } ) as { formTitle : string } ;
430
- const id = `${ context . getExecutionId ( ) } -${ context . getNode ( ) . name } ` ;
431
-
432
- const config : CompletionPageConfig = {
433
- completionTitle,
434
- completionMessage,
435
- redirectUrl,
436
- pageTitle : options . formTitle ,
437
- } ;
438
-
439
- staticData [ id ] = config ;
440
-
441
- const waitTill = new Date ( WAIT_INDEFINITELY ) ;
442
- await context . putExecutionToWait ( waitTill ) ;
443
- }
421
+ await context . putExecutionToWait ( WAIT_INDEFINITELY ) ;
444
422
445
423
return [ context . getInputData ( ) ] ;
446
424
}
0 commit comments