Check if data is still being send

Hi all :wave: :wave:

I am trying to create a flow where it checks for data every single time from an inject node. For example, This is the example flow where it will continuously inject data.
image

But once one of them stops sending data or injecting for more than 5 seconds , it will trigger and give me and output that says which node fails or at the debug node it will output "Faulty" . Is there a simple or easier way to this function in node red?? if so please guide me

Thanks for the help if possible! :smiling_face: :smiling_face:

You can set a different msg.topic for each of the inject nodes. They will then be treated as individual streams.

Something like this:

[
    {
        "id": "596128453f0016d1",
        "type": "inject",
        "z": "815093ee06b3ca8a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "one",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 80,
        "wires": [
            [
                "af82aeaf606832e4",
                "5b805670b897d9e0"
            ]
        ]
    },
    {
        "id": "329ecd3f4b50cb8b",
        "type": "inject",
        "z": "815093ee06b3ca8a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "two",
        "payload": "",
        "payloadType": "date",
        "x": 150,
        "y": 140,
        "wires": [
            [
                "af82aeaf606832e4",
                "5b805670b897d9e0"
            ]
        ]
    },
    {
        "id": "af82aeaf606832e4",
        "type": "trigger",
        "z": "815093ee06b3ca8a",
        "name": "",
        "op1": "",
        "op2": "fail",
        "op1type": "nul",
        "op2type": "str",
        "duration": "5",
        "extend": true,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "topic",
        "topic": "topic",
        "outputs": 2,
        "x": 400,
        "y": 180,
        "wires": [
            [
                "5b805670b897d9e0"
            ],
            [
                "8df68fb32e9336e7"
            ]
        ]
    },
    {
        "id": "5b805670b897d9e0",
        "type": "debug",
        "z": "815093ee06b3ca8a",
        "name": "debug 5",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 80,
        "wires": []
    },
    {
        "id": "8df68fb32e9336e7",
        "type": "debug",
        "z": "815093ee06b3ca8a",
        "name": "debug 6",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload &\" \"& topic",
        "targetType": "jsonata",
        "statusVal": "",
        "statusType": "auto",
        "x": 620,
        "y": 180,
        "wires": []
    }
]

Hello @ghayne,

Thanks for the Solution. For trigger node, only able to have 2 outputs, so is there a way that can check up to 10 Inject nodes? :smiling_face:

Just give each inject node a different topic, it will work for more than 2 inputs, this was only to demonstrate.

@ghayne i see , let me test it out! Thank you for your solution and reply!

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