# How to implement a timeout on a subflow?

**URL:** https://discourse.nodered.org/t/how-to-implement-a-timeout-on-a-subflow/10980
**Category:** General
**Created:** [10 May 2019 07:46 UTC](https://discourse.nodered.org/t/how-to-implement-a-timeout-on-a-subflow/10980 "2019-05-10T07:46:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)
#### Post date: [10 May 2019 07:46 UTC](https://discourse.nodered.org/t/how-to-implement-a-timeout-on-a-subflow/10980/1 "2019-05-10T07:46:22Z")

</div>

I would want to write a subflow that implement a modbus-rtu request and the relative reading of the response, but in case of no answer from the mosbus client I need to "exit" from subflow with a timeout output.  
I wouldn't wait forever for the client's reply.  
How I can do it?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [10 May 2019 07:56 UTC](https://discourse.nodered.org/t/how-to-implement-a-timeout-on-a-subflow/10980/2 "2019-05-10T07:56:32Z")

</div>

Hi @naamah75

The Trigger node can be configured to send a message after a period of time unless it has been reset. That can form the starting point for a timeout flow. This recipe in the cookbook gives an example: [https://cookbook.nodered.org/basic/trigger-timeout](https://cookbook.nodered.org/basic/trigger-timeout)

---

<div class="post-metadata">

### Author: ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)
#### Post date: [10 May 2019 09:04 UTC](https://discourse.nodered.org/t/how-to-implement-a-timeout-on-a-subflow/10980/3 "2019-05-10T09:04:43Z")

</div>

Trigger node looks a lot better than my implementation...

![online](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0f6f34e9e27abd59e80eea6383c2fc8196008084.jpeg)

Thanks!
