Glitch when communicating with Azure Site

Describe the problem/error/question

Hello,
My team built a website that is built on Azure. It is essentially a user interface that when prompted, runs and n8n workflow and returns the output. However, if the n8n workflow takes more than 2 minutes to run, the site gives an error. The n8n workflow itself has no issue running independently for more than 2 minutes, it only has an issue when communicating with the site. Anyone have any ideas about how to fix this? Let me know if you need any more info.

Hi @CSIS_Dev

The problem is that Azure has a built-in “timer” for all web connections. When your website asks n8n to do something, Azure keeps the line open and waits for an answer. However, if n8n takes longer than two minutes to respond, Azure assumes something has gone wrong and automatically cuts the connection to save resources, which is why your site shows an error even though n8n is still working.

You cannot easily fix this by just increasing the timer, as these limits are deeply embedded in how Azure handles network traffic. Relying on a single, long-running connection is unstable because any small flicker in the internet connection during those two minutes would also cause the whole process to fail.

The best fix is to change the conversation between your site and n8n. Instead of the site waiting on the line for the final answer, n8n should immediately reply with a message saying, “I’ve started the work; here is your tracking ID.” Your website can then show a loading spinner and check back every few seconds to see if the work is finished, allowing the result to be delivered without ever hitting that two-minute limit.

To implement this, you actually need two separate workflows: one to trigger the work and return the ID immediately, and another to allow the website to check if the work is finished. It should look something like below:

Workflow 1: The Trigger & Processor

Workflow 2: The Status Checker (Polling Endpoint)

welcome to the n8n community @CSIS_Dev
i recommend this workflow, reach out if you have any questions.

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "azure-callback",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "f5ca2af4-dfdc-45ce-8c79-d87f386f8a03",
      "name": "Receive Request from Azure",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        0
      ],
      "webhookId": "3690eef2-1947-4027-b3c7-eb5401cc6a39"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "{ \"status\": \"processing\", \"message\": \"Workflow started, waiting for callback.\" }",
        "options": {}
      },
      "id": "39859cb5-60c9-4e97-bff5-82fd56dbc662",
      "name": "Respond 200 Immediately",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.5,
      "position": [
        224,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "resultado",
              "name": "resultado",
              "value": "\
<__PLACEHOLDER_VALUE__Put your processing result here__>",
              "type": "string"
            },
            {
              "id": "callbackUrl",
              "name": "callbackUrl",
              "value": "={{ $('Receive Request from Azure').item.json.body.callbackUrl }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "ae23458e-7109-4600-91c4-e05ace37ac09",
      "name": "Process Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        448,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $json.callbackUrl }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={ \"status\": \"done\", \"resultado\": \"{{ $json.resultado }}\" }",
        "options": {}
      },
      "id": "849a3532-bde9-41e5-b6e9-17f80bb38d96",
      "name": "Send Result to Azure",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        672,
        0
      ]
    }
  ],
  "connections": {
    "Receive Request from Azure": {
      "main": [
        [
          {
            "node": "Respond 200 Immediately",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond 200 Immediately": {
      "main": [
        [
          {
            "node": "Process Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Data": {
      "main": [
        [
          {
            "node": "Send Result to Azure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "aiBuilderAssisted": true,
    "builderVariant": "mcp",
    "instanceId": "ea0c2eec4b76caa69b4b4c5710d93f227ef34fb351dbfc568d1671e154e38c4a"
  }
}