How to Intercept HTTP Requests for Dynamic Sub-Flow Loading in Node-RED for Multi-Tenancy?

Hello Node-RED community,

I have a question regarding implementing multi-tenancy in Node-RED. In my current setup, I have different sub-flows dedicated to separate tenants. These sub-flows handle specific processes, such as placing orders to platforms like Amazon, with each tenant having unique requirements.

For example:

  • Tenant 1: "Bob Tenant"
  • Tenant 2: "Sam Tenant"

Currently, I route the main flow to the appropriate sub-flow using a switch node, based on the tenantId received from a request. While this approach works well for a few tenants, I’m concerned about scalability as the number of tenants potentially grows to 1,000 or more. Loading all sub-flows at once is not efficient or practical.

To address this, I’m looking for a way to intercept Node-RED HTTP-based requests that trigger the deployed flows, allowing me to dynamically load and execute only the desired sub-flow at runtime based on the tenantId. This would help optimize performance and manage resources more effectively as the number of tenants scales up.

Is there a recommended approach or any advice on how to intercept these HTTP requests and dynamically load sub-flows at runtime in Node-RED? Your suggestions or insights would be greatly appreciated!

Thank you in advance for your help!

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