5

I want a MQTT subscription client to consume messages from AWS IoT broker. On AWS IoT broker, wild card topic subscription is not supported. In our use case, we know the upper bound of number of possible subscriptions. We also know, when a device is set-up to deliver publications. Finally, the processing for every subscription is exactly the same. I have a message flow that is well tested for processing the data published from one device.

  1. Is there a programmatic way to deploy that flow as a new flow with only the MQTT Input node configured for a specific topic string?
  2. Conversely, is there a way to "un-deploy" a particular copy of flow for a particular topic string in cases where device maybe decommissioned?

1 Answer 1

4

You need to look at the Node-RED Admin API, this will allow you to retrieve the current flow, you can then manipulate it and push an updated version back to the runtime.

Flows are represented as JSON objects that have entries for each node on the canvas and the links between them.

The best place to get help with the API will be on the Node-RED forum or Slack team. Both are linked to from the Node-RED homepage.

2
  • Ok, use GET API to download flow. Manipulate the JSON to create a new array entry for the 'to be deployed' flow. Then, POST API to deploy this updated version. Is this correct? Commented Sep 11, 2018 at 6:25
  • 1
    yep, pretty much.
    – hardillb
    Commented Sep 11, 2018 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.