# IN node-red i want to create a flow which executes a command and if that command takes more than 15 minutes to give result it should kill itself or terminate itself

**URL:** <https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935>\
**Category:** General\
**Created:** [26 January 2024 10:29 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935 "2024-01-26T10:29:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![77raimanish](https://avatars.discourse-cdn.com/v4/letter/7/4da419/32.png) [@77raimanish](https://discourse.nodered.org/u/77raimanish)\
**Post date:** [26 January 2024 10:29 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/1 "2024-01-26T10:29:03Z")

</div>

IN node-red i want to create a flow which executes a command and if that command takes more than 15 minutes to give result it should kill itself or terminate itself .

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 January 2024 11:20 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/2 "2024-01-26T11:20:31Z")

</div>

> [@77raimanish](#):
>
> executes a command

Do you mean using and Exec node?  
If so, the Exec node has a Timeout field you can use to kill the process.

---

<div class="post-metadata">

**Author:** ![77raimanish](https://avatars.discourse-cdn.com/v4/letter/7/4da419/32.png) [@77raimanish](https://discourse.nodered.org/u/77raimanish)\
**Post date:** [26 January 2024 11:29 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/3 "2024-01-26T11:29:31Z")

</div>

iam using that but it does not work properly, actually iam running a command to trigger spiderfoot tool scan over an ip-address or domain name .  
when i do it in terminal only way to abort it is uding ctrl+c , but when i use timeout function the scan does'not get aborted and remains in the background.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 January 2024 11:32 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/4 "2024-01-26T11:32:38Z")

</div>

What version of node-red and nodejs are you using (use `node -v` to get the nodejs version)?  
Please show us how you have configured the Exec node. You can paste a screenshot here.

Also look in the node-red log to see if anything is logged when it should timeout.

---

<div class="post-metadata">

**Author:** ![77raimanish](https://avatars.discourse-cdn.com/v4/letter/7/4da419/32.png) [@77raimanish](https://discourse.nodered.org/u/77raimanish)\
**Post date:** [26 January 2024 11:35 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/5 "2024-01-26T11:35:52Z")

</div>

nodejs version is 20 and node-red v3.1.3

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 January 2024 11:39 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/7 "2024-01-26T11:39:33Z")

</div>

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![77raimanish](https://avatars.discourse-cdn.com/v4/letter/7/4da419/32.png) [@77raimanish](https://discourse.nodered.org/u/77raimanish)\
**Post date:** [26 January 2024 11:53 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/8 "2024-01-26T11:53:58Z")

</div>

```auto
[
{
"id": "37d7bbab936a0bab",
"type": "exec",
"z": "f2559bb7c755d703",
"command": "/usr/bin/python3 /home/ti/.node-red/spiderfoot/spiderfoot/sf.py -m sfp_bgpview -s 193.169.244.35 ",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "10",
"winHide": false,
"oldrc": false,
"name": "cmd",
"x": 370,
"y": 320,
"wires": [
[
"e860741d902d48b0"
],
[
"fcabbe0fc89b6b48"
],
[
"f3d631ef31777492"
]
]
},
{
"id": "46ec38b4b29524dc",
"type": "inject",
"z": "f2559bb7c755d703",
"name": "",
"props": [
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 230,
"y": 320,
"wires": [
[
"37d7bbab936a0bab"
]
]
},
{
"id": "e860741d902d48b0",
"type": "debug",
"z": "f2559bb7c755d703",
"name": "debug 68",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 240,
"wires": 
},
{
"id": "fcabbe0fc89b6b48",
"type": "debug",
"z": "f2559bb7c755d703",
"name": "debug 69",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 540,
"y": 300,
"wires": 
},
{
"id": "f3d631ef31777492",
"type": "debug",
"z": "f2559bb7c755d703",
"name": "debug 70",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 540,
"y": 340,
"wires": 
}
]

```

---

<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:** [25 April 2024 11:54 UTC](https://discourse.nodered.org/t/in-node-red-i-want-to-create-a-flow-which-executes-a-command-and-if-that-command-takes-more-than-15-minutes-to-give-result-it-should-kill-itself-or-terminate-itself/84935/9 "2024-04-25T11:54:31Z")

</div>

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