How to wait for after wait-node resume before returning request response?

Hello everyone!

Describe the issue/error/question

I have a workflow containing the following:

  1. Webhook node
  2. HTTP node
  3. Wait node
  4. HTTP node

I’d like for the webhook response to happen AFTER the last HTTP node response happens. Is this a possiblity? I have not been able to get it done.

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

{
  "nodes": [
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "some url",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={ \n\"url\": \"{{$resumeWebhookUrl}}\"\n}"
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "resume": "webhook",
        "httpMethod": "POST",
        "options": {}
      },
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        670,
        300
      ],
      "webhookId": "a6ae6edf-45b6-40df-99a2-06330c2e5778"
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "some url",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={ \n\"url\": \"{{$node[\"Wait\"].json[\"properties\"]}}\"\n}"
      },
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        880,
        300
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "17d08499-e232-4d0f-849e-d3afb0f48192",
        "responseMode": "lastNode",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        200,
        300
      ],
      "webhookId": "17d08499-e232-4d0f-849e-d3afb0f48192"
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Information on your n8n setup

  • n8n version: 0.145.0
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Very sorry but that is sadly currently not possible.

The reason is that n8n stops the workflow execution and puts it to sleep to save resources as soon as a wait-node does get hit (except if “After time interval” is used smaller than 60 seconds). That means that the Wait-Node will be the last node of the Execution and the Webhook will so return its data.

1 Like