# Http in node - timeout?

**URL:** https://discourse.nodered.org/t/http-in-node-timeout/43917
**Category:** Share Your Projects
**Created:** [9 April 2021 11:50 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917 "2021-04-09T11:50:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![tkreks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tkreks/32/40052_2.png) [@tkreks](https://discourse.nodered.org/u/tkreks)
#### Post date: [9 April 2021 11:50 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/1 "2021-04-09T11:50:04Z")

</div>

Hi All!  
Sorry, my english is bad but i try it.  
I just met node-red yesterday. Do not swear too much.  
Flow -

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93ff528271c8fddaaaf9ba92ed70757293eb396d.png)  
Task:

1. AsteriskServer - curl request to NodeRedServer (curl [http://192.168.71.126:1880/nrdtest?phone=7987654321](http://192.168.71.126:1880/nrdtest?phone=7987654321))
2. NodeRed - accepted the request and is executing requests to the external system. The result of the requests must be returned in http response node

In my NodeRed query doesn't work. Interrupted by timeout. Tell me what I did wrong or how I can fix it.

```auto
[
    {
        "id": "603351f9.74315",
        "type": "tab",
        "label": "Поток 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "358d891c.696346",
        "type": "http in",
        "z": "603351f9.74315",
        "name": "",
        "url": "/nrdtest",
        "method": "get",
        "upload": false,
        "swaggerDoc": "",
        "x": 170,
        "y": 1200,
        "wires": [
            [
                "5a4b7e9c.c2a87",
                "6ccf5d26.4f5e44"
            ]
        ]
    },
    {
        "id": "6ccf5d26.4f5e44",
        "type": "template",
        "z": "603351f9.74315",
        "name": "",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "Hi man!\n{{managernum}}",
        "output": "str",
        "x": 960,
        "y": 1200,
        "wires": [
            [
                "1a357b22.244235",
                "d6aef389.f5059"
            ]
        ]
    },
    {
        "id": "1a357b22.244235",
        "type": "http response",
        "z": "603351f9.74315",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 1210,
        "y": 1200,
        "wires": []
    },
    {
        "id": "5a4b7e9c.c2a87",
        "type": "debug",
        "z": "603351f9.74315",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 560,
        "y": 1140,
        "wires": []
    },
    {
        "id": "e76cc0ae.f0b8e",
        "type": "change",
        "z": "603351f9.74315",
        "name": "->$inboundnumber",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "inboundnumber",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 350,
        "y": 1440,
        "wires": [
            [
                "198a3811.912ea8",
                "b46d2a1b.2f76f8"
            ]
        ]
    },
    {
        "id": "198a3811.912ea8",
        "type": "http request",
        "z": "603351f9.74315",
        "name": "Client id?",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://site.org/rest/1/AUTHTOKEN/crm.duplicate.findbycomm.json?type=PHONE&values[]={{inboundnumber}}&entity_type=CONTACT",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 540,
        "y": 1440,
        "wires": [
            [
                "a096bcbd.3fe02"
            ]
        ]
    },
    {
        "id": "a096bcbd.3fe02",
        "type": "json",
        "z": "603351f9.74315",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 690,
        "y": 1440,
        "wires": [
            [
                "fde954d.b2c2fa8"
            ]
        ]
    },
    {
        "id": "b46d2a1b.2f76f8",
        "type": "template",
        "z": "603351f9.74315",
        "name": "",
        "field": "inboundnumber",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "Inbound number is: {{inboundnumber}}",
        "output": "str",
        "x": 540,
        "y": 1400,
        "wires": [
            [
                "a7430d67.c9e01"
            ]
        ]
    },
    {
        "id": "a7430d67.c9e01",
        "type": "debug",
        "z": "603351f9.74315",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "inboundnumber",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 740,
        "y": 1400,
        "wires": []
    },
    {
        "id": "efc9c3c.966954",
        "type": "debug",
        "z": "603351f9.74315",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "clientid",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 810,
        "y": 1520,
        "wires": []
    },
    {
        "id": "fde954d.b2c2fa8",
        "type": "function",
        "z": "603351f9.74315",
        "name": "$clientid",
        "func": "var clientid = msg.payload.result.CONTACT[0];\nmsg = { payload:clientid };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 840,
        "y": 1440,
        "wires": [
            [
                "6bba056e.e6738c"
            ]
        ]
    },
    {
        "id": "3be46e78.671202",
        "type": "http request",
        "z": "603351f9.74315",
        "name": "Отвественный?",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://site.org/rest/1/AUTHTOKEN/crm.contact.get.json?ID={{clientid}}",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 740,
        "y": 1560,
        "wires": [
            [
                "e77713a7.0a587"
            ]
        ]
    },
    {
        "id": "e77713a7.0a587",
        "type": "json",
        "z": "603351f9.74315",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 910,
        "y": 1560,
        "wires": [
            [
                "99b6cc2b.5d826"
            ]
        ]
    },
    {
        "id": "6bba056e.e6738c",
        "type": "change",
        "z": "603351f9.74315",
        "name": "->$clientid",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "clientid",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 310,
        "y": 1560,
        "wires": [
            [
                "4358bec6.26588"
            ]
        ]
    },
    {
        "id": "99b6cc2b.5d826",
        "type": "function",
        "z": "603351f9.74315",
        "name": "$managerid",
        "func": "var managerid = msg.payload.result.ASSIGNED_BY_ID;\nmsg = { payload:managerid };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 290,
        "y": 1720,
        "wires": [
            [
                "b85aba94.f3bb28"
            ]
        ]
    },
    {
        "id": "b85aba94.f3bb28",
        "type": "change",
        "z": "603351f9.74315",
        "name": "->$managerid",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "managerid",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 480,
        "y": 1720,
        "wires": [
            [
                "c5890abc.0edf68",
                "dc067daa.6bbe1"
            ]
        ]
    },
    {
        "id": "4358bec6.26588",
        "type": "switch",
        "z": "603351f9.74315",
        "name": "",
        "property": "clientid",
        "propertyType": "msg",
        "rules": [
            {
                "t": "gt",
                "v": "0",
                "vt": "str"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 490,
        "y": 1560,
        "wires": [
            [
                "db3bcc40.982f3",
                "3be46e78.671202"
            ],
            []
        ]
    },
    {
        "id": "db3bcc40.982f3",
        "type": "template",
        "z": "603351f9.74315",
        "name": "",
        "field": "clientid",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "Client ID is: {{clientid}}",
        "output": "str",
        "x": 660,
        "y": 1520,
        "wires": [
            [
                "efc9c3c.966954"
            ]
        ]
    },
    {
        "id": "c5890abc.0edf68",
        "type": "http request",
        "z": "603351f9.74315",
        "name": "Отвественный?",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://site.org/rest/1/AUTHTOKEN/user.search.json?ID=1",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 680,
        "y": 1720,
        "wires": [
            [
                "d40fcd95.a5f83"
            ]
        ]
    },
    {
        "id": "d40fcd95.a5f83",
        "type": "json",
        "z": "603351f9.74315",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 850,
        "y": 1720,
        "wires": [
            [
                "2259f068.9c258"
            ]
        ]
    },
    {
        "id": "2259f068.9c258",
        "type": "function",
        "z": "603351f9.74315",
        "name": "$managerinnum",
        "func": "var managerinnum = msg.payload.result[0].UF_PHONE_INNER;\nmsg = { payload:managerinnum };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 1020,
        "y": 1720,
        "wires": [
            [
                "634b2c57.9552e4"
            ]
        ]
    },
    {
        "id": "634b2c57.9552e4",
        "type": "change",
        "z": "603351f9.74315",
        "name": "->$managernum",
        "rules": [
            {
                "t": "move",
                "p": "payload",
                "pt": "msg",
                "to": "managernum",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1220,
        "y": 1720,
        "wires": [
            [
                "6ccf5d26.4f5e44"
            ]
        ]
    },
    {
        "id": "dc067daa.6bbe1",
        "type": "template",
        "z": "603351f9.74315",
        "name": "",
        "field": "managerid",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "Manager ID is: {{managerid}}",
        "output": "str",
        "x": 660,
        "y": 1680,
        "wires": [
            [
                "572cb7d1.6c46b8"
            ]
        ]
    },
    {
        "id": "572cb7d1.6c46b8",
        "type": "debug",
        "z": "603351f9.74315",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "managerid",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 820,
        "y": 1680,
        "wires": []
    },
    {
        "id": "986bf19d.bea15",
        "type": "function",
        "z": "603351f9.74315",
        "name": "$inboundnumber",
        "func": "var inboundnumber = msg.payload.phone;\nmsg = { payload:inboundnumber };\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 310,
        "y": 1340,
        "wires": [
            [
                "e76cc0ae.f0b8e"
            ]
        ]
    },
    {
        "id": "d6aef389.f5059",
        "type": "debug",
        "z": "603351f9.74315",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "managernum",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1270,
        "y": 1080,
        "wires": []
    },
    {
        "id": "a751e00e.c8c1d",
        "type": "http request",
        "z": "603351f9.74315",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "http://192.168.71.126:1880/nrdtest/?phone=79253444462",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 950,
        "y": 960,
        "wires": [
            []
        ]
    },
    {
        "id": "f9861130.07e0d",
        "type": "inject",
        "z": "603351f9.74315",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 760,
        "y": 960,
        "wires": [
            [
                "a751e00e.c8c1d"
            ]
        ]
    }
]

```

[In youtube](https://www.youtube.com/watch?v=rcvfRRaaocw)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [9 April 2021 12:23 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/2 "2021-04-09T12:23:00Z")

</div>

The msg.res can not be overwritten and has to passed to the http response node  
$inboundnumber function has the line  
msg = {payload: inboundnumber};  
this overwrites msg and wipes msg.res  
[edit] correct msg.res.

---

<div class="post-metadata">

### Author: ![tkreks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tkreks/32/40052_2.png) [@tkreks](https://discourse.nodered.org/u/tkreks)
#### Post date: [9 April 2021 12:32 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/3 "2021-04-09T12:32:27Z")

</div>

Thanks for your reply! I need to transfer $managernum to the http response node.  
inboundnumber is needed to get clientid. $clientid is needed to get $managerid. $manageridis needed to get $managernum.  
I was able to implement all the logic, but I can't give an answer to the http response node (timeout)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [9 April 2021 12:34 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/4 "2021-04-09T12:34:50Z")

</div>

As tried to say do not overwrite the msg.res that comes from the http in node  
(typo in original reply)  
You can use  
msg.payload = inboundnumber  
as that only over writes msg.payload

---

<div class="post-metadata">

### Author: ![tkreks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tkreks/32/40052_2.png) [@tkreks](https://discourse.nodered.org/u/tkreks)
#### Post date: [9 April 2021 12:37 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/5 "2021-04-09T12:37:10Z")

</div>

Thanks for your reply! I'm going to try now.

---

<div class="post-metadata">

### Author: ![tkreks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tkreks/32/40052_2.png) [@tkreks](https://discourse.nodered.org/u/tkreks)
#### Post date: [9 April 2021 13:51 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/6 "2021-04-09T13:51:46Z")

</div>

Thank you so much! You solved my problem.  
I have servers that we don't use. If it is useful to you, I can make virtual machines for you.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [9 April 2021 13:55 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/7 "2021-04-09T13:55:55Z")

</div>

Thank you for the offer but i like to run all my own IT equipment locally, so everything works if internet is down. Glad you're up and running though.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [23 April 2021 13:56 UTC](https://discourse.nodered.org/t/http-in-node-timeout/43917/8 "2021-04-23T13:56:22Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
