n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
49.52k stars 7.98k forks source link

Form redirection to form-waiting is not occurring if there is a lambda #11826

Open barn4k opened 4 days ago

barn4k commented 4 days ago

Bug Description

If a lambda node will be before the first Next Page form node then the form will be freezed until an ABL/proxy kills the session (in our case it's 60 seconds) after which the URL redirection from /form/ or /form-test/ to /form-waiting/ may or may not occur. If there is no ALB/proxy in front of n8n, then the execution will be completely hanged

with ALB and timeout setting of 60 secs image

No ALB and the execution hanged. image

image

Which may work if I resend the form request image

To Reproduce

the workflow

{
  "meta": {
    "instanceId": "e56b502a7237cfd497427bf449a6e848ce88d35e16388a590c008c1c9e963d05"
  },
  "nodes": [
    {
      "parameters": {
        "function": "arn:aws:lambda:us-west-2:114025810846accountId:function:functionName",
        "qualifier": "stable",
        "payload": "{\"action\":\"help\"}"
      },
      "id": "e44ba5a3-5d9e-4b8b-a547-8c15354d166c",
      "name": "get graph endpoints",
      "type": "n8n-nodes-base.awsLambda",
      "typeVersion": 1,
      "position": [
        860,
        320
      ],
      "credentials": {
        "aws": {
          "id": "39dpCmpkOxSsq2il",
          "name": "AWS account"
        }
      }
    },
    {
      "parameters": {
        "formFields": {
          "values": [
            {
              "fieldLabel": "test",
              "placeholder": "test"
            }
          ]
        },
        "options": {
          "formDescription": "Choose Endpoint",
          "buttonLabel": "Next"
        }
      },
      "id": "d7cf01cf-a945-4dfe-8a15-04a424b1a6c2",
      "name": "Form graph endpoint",
      "type": "n8n-nodes-base.form",
      "typeVersion": 1,
      "position": [
        1120,
        320
      ],
      "webhookId": "a49c2294-8df9-4de7-9c91-e6252bdbffc9"
    },
    {
      "parameters": {
        "formTitle": "Lambda payload generator",
        "formDescription": "That form will return a payload for Code node or the ready-to-use node content",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Press the Next button"
            }
          ]
        },
        "options": {
          "buttonLabel": "Next"
        }
      },
      "id": "414a171a-39f7-42de-82d8-aa5ece842185",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        560,
        320
      ],
      "webhookId": "411cbebe-fa97-434b-a096-894992c9974d"
    }
  ],
  "connections": {
    "get graph endpoints": {
      "main": [
        [
          {
            "node": "Form graph endpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "get graph endpoints",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {}
}

Expected behavior

a redirection to form-waiting will occur normally

Operating System

cloud, docker

n8n Version

1.66.0, 1.68.0

Node.js Version

cloud, docker

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 4 days ago

Hey @barn4k,

We have created an internal ticket to look into this which we will be tracking as "GHC-471"