# Blocking a triggered node or flow

**URL:** https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488
**Category:** General
**Created:** [9 January 2025 15:12 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488 "2025-01-09T15:12:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pin32](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pin32](https://discourse.nodered.org/u/pin32)
#### Post date: [9 January 2025 15:12 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/1 "2025-01-09T15:12:02Z")

</div>

I'm trying to create an application with node-red, I'm stuck managing a serial.  
I practically send commands cyclically to the serial line, the problem I would like to solve is to block the automatic cycle when there are requests from mqtt to avoid overlapping messages.  
I'm trying to understand if I can use some available node but at the moment I've tried everything without being able to solve it.  
give me a tip.

Thank 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 January 2025 16:34 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/2 "2025-01-09T16:34:07Z")

</div>

There are several ways  
use a delay node in rate limit and flush messages [Help with message queuing (maybe a repeat) - #2 by Colin](https://discourse.nodered.org/t/help-with-message-queuing-maybe-a-repeat/90134/2)

Or semaphore node [node-red-semaphore-plus (node) - Node-RED](https://flows.nodered.org/node/@marcus-j-davies/node-red-semaphore-plus)

Or simple-gate node [node-red-contrib-simple-gate (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-simple-gate)

There are also other queuing nodes available, and you can also use a switch node and context variable [Disable flow from anoter flow? - #2 by E1cid](https://discourse.nodered.org/t/disable-flow-from-anoter-flow/73163/2)

---

<div class="post-metadata">

### Author: ![pin32](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pin32](https://discourse.nodered.org/u/pin32)
#### Post date: [9 January 2025 19:06 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/3 "2025-01-09T19:06:56Z")

</div>

```auto
[
    {
        "id": "5d2825330f4481bd",
        "type": "trigger",
        "z": "72fe820689fd1404",
        "name": "",
        "op1": "close",
        "op2": "open",
        "op1type": "str",
        "op2type": "str",
        "duration": "10",
        "extend": true,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 430,
        "y": 100,
        "wires": [
            [
                "0b1fb74ac386cef7"
            ]
        ]
    },
    {
        "id": "836bc066fe4c0914",
        "type": "inject",
        "z": "72fe820689fd1404",
        "name": "any message",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "any message",
        "payloadType": "str",
        "x": 230,
        "y": 40,
        "wires": [
            [
                "5d2825330f4481bd",
                "67f3916b390943e0"
            ]
        ]
    },
    {
        "id": "0b1fb74ac386cef7",
        "type": "gate",
        "z": "72fe820689fd1404",
        "name": "demo gate",
        "controlTopic": "payload",
        "defaultState": "open",
        "openCmd": "open",
        "closeCmd": "close",
        "toggleCmd": "toggle",
        "defaultCmd": "default",
        "statusCmd": "status",
        "persist": false,
        "x": 630,
        "y": 100,
        "wires": [
            [
                "67f3916b390943e0"
            ]
        ]
    },
    {
        "id": "eb5a4d80fc3d13f5",
        "type": "inject",
        "z": "72fe820689fd1404",
        "name": "Cyclical messages ",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "message",
        "payloadType": "str",
        "x": 410,
        "y": 160,
        "wires": [
            [
                "0b1fb74ac386cef7"
            ]
        ]
    },
    {
        "id": "67f3916b390943e0",
        "type": "debug",
        "z": "72fe820689fd1404",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 840,
        "y": 40,
        "wires": []
    }
]

```

That’s what I need but I can’t make it work

---

<div class="post-metadata">

### Author: ![pin32](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pin32](https://discourse.nodered.org/u/pin32)
#### Post date: [9 January 2025 19:11 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/4 "2025-01-09T19:11:35Z")

</div>

![Schermata del 2025-01-09 20-10-29](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/788138c267040cfc162d1ddba92159eccfc128aa.png)

That’s what I need but I can’t make it work

---

<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 January 2025 19:18 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/5 "2025-01-09T19:18:11Z")

</div>

I do not have simple gate installed, but looking at your flow json your control property is payload. This would conflict with you normal payloads. Try changing the control property to control.  
eg untested.

```auto
[{"id":"836bc066fe4c0914","type":"inject","z":"667cec54c048503c","name":"any message","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"any message","payloadType":"str","x":270,"y":1300,"wires":[["5d2825330f4481bd","67f3916b390943e0"]]},{"id":"5d2825330f4481bd","type":"trigger","z":"667cec54c048503c","name":"","op1":"close","op2":"open","op1type":"str","op2type":"str","duration":"10","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":290,"y":1360,"wires":[["e66df0a111b63e06"]]},{"id":"67f3916b390943e0","type":"debug","z":"667cec54c048503c","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":880,"y":1300,"wires":[]},{"id":"e66df0a111b63e06","type":"change","z":"667cec54c048503c","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"control","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1360,"wires":[["0b1fb74ac386cef7"]]},{"id":"0b1fb74ac386cef7","type":"gate","z":"667cec54c048503c","name":"demo gate","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":720,"y":1360,"wires":[["67f3916b390943e0"]]},{"id":"eb5a4d80fc3d13f5","type":"inject","z":"667cec54c048503c","name":"Cyclical messages ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"message","payloadType":"str","x":450,"y":1420,"wires":[["0b1fb74ac386cef7"]]}]

```

---

<div class="post-metadata">

### Author: ![pin32](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pin32](https://discourse.nodered.org/u/pin32)
#### Post date: [10 January 2025 18:17 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/6 "2025-01-10T18:17:24Z")

</div>

![Schermata del 2025-01-10 19-15-51](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d917bf29456f81a472a9f7a06aab564e75d15835.png)

probably you can do better... but for now I have solved so

---

<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: [10 April 2025 18:18 UTC](https://discourse.nodered.org/t/blocking-a-triggered-node-or-flow/94488/7 "2025-04-10T18:18:19Z")

</div>

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