Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form end page not working in multi-step form (completion) #12428

Open
adrian-martinez-onestic opened this issue Jan 2, 2025 · 2 comments
Open
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@adrian-martinez-onestic
Copy link
Contributor

Bug Description

In a multi-step form, after completing first and second steps, form end page is not shown (at least when configured as Show completion screen); it fails and shows the following message: {"code":0,"message":"Workflow Form Error: Workflow could not be started!"}.

It does not work neither in test or production modes, execution fails with the following error:

Cannot read properties of undefined (reading 'redirectUrl')

Details:

{
  "errorMessage": "Cannot read properties of undefined (reading 'redirectUrl')",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.73.1 (Self Hosted)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading 'redirectUrl')",
      "    at Form.webhook (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_@aws-sdk+credential-provi_b5z6rj2bs5tsb6yffsyzoevhmy/node_modules/n8n-nodes-base/dist/nodes/Form/Form.node.js:240:24)",
      "    at WebhookService.runWebhook (/usr/local/lib/node_modules/n8n/dist/webhooks/webhook.service.js:181:30)",
      "    at Object.executeWebhook (/usr/local/lib/node_modules/n8n/dist/webhooks/webhook-helpers.js:156:96)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)"
    ]
  }
}

It's worth noting that disabling the intermediate step makes it to work properly, it seems some edge case is not properly covered in form ending case.

To Reproduce

Create a workflow based on these nodes, and execute it in test or production mode:

{
  "nodes": [
    {
      "parameters": {
        "formTitle": "Test form",
        "formDescription": "Form description",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Type a number",
              "fieldType": "number",
              "placeholder": "8",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -260,
        -120
      ],
      "id": "cf8e7744-878a-43ff-b7ca-14f891c8fa2e",
      "name": "On form submission",
      "webhookId": "a1f954e9-6d49-4a4b-8a31-829132384697"
    },
    {
      "parameters": {
        "formFields": {
          "values": [
            {
              "fieldLabel": "Type a letter",
              "placeholder": "C",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 1,
      "position": [
        -40,
        -120
      ],
      "id": "d243caad-6309-45cb-82cd-471e3d289042",
      "name": "Form",
      "webhookId": "0efe4d7a-c785-475b-9beb-cb9b26bdc215"
    },
    {
      "parameters": {
        "operation": "completion",
        "completionTitle": "OK",
        "completionMessage": "OK message",
        "options": {
          "formTitle": "Completion page title"
        }
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 1,
      "position": [
        180,
        -120
      ],
      "id": "d3dd9f75-5013-4265-8752-2f578108a449",
      "name": "Form ending",
      "webhookId": "26c54a69-c0d0-4f47-89c4-3870bf7f2256"
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form": {
      "main": [
        [
          {
            "node": "Form ending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {}
}

Expected behavior

The same as if the intermediate step wasn't there or disabled: show the completion page.

Operating System

Docker on Linux

n8n Version

1.73.1

Node.js Version

The version that 1.73.1 uses

Database

PostgreSQL

Execution mode

queue

@Joffcom
Copy link
Member

Joffcom commented Jan 2, 2025

Hey @adrian-martinez-onestic,

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

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Jan 2, 2025
@Joffcom
Copy link
Member

Joffcom commented Jan 2, 2025

Hey @adrian-martinez-onestic,

Ignore the tracking ticket above, This was reported internally last week and we have an id of NODE-2187 for that which we will use for this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants