Blocking a triggered node or flow

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

There are several ways
use a delay node in rate limit and flush messages Help with message queuing (maybe a repeat) - #2 by Colin

Or semaphore node node-red-semaphore-plus (node) - Node-RED

Or simple-gate node node-red-contrib-simple-gate (node) - Node-RED

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

[
    {
        "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

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

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.

[{"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"]]}]

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