Calling a shared module from multiple inbound flows in Architect

Trying to reuse a Common Module for auth across three inbound flows. The docs say you just add the module to the flow, but when I trigger it, the context variables from the main flow are null inside the module. Is there a specific JSON mapping or API call needed to pass the interaction data? Or do I have to use a Data Action to merge the payloads before the module call?

Context variables don’t pass by magic into shared modules. You have to explicitly define the inputs in the module definition.

Here’s how I handle this in my flows:

  • Define inputs in the Shared Module. Go to the module settings and add the variables you need (e.g., authToken, userId) as input parameters.
  • Map the values in the parent flow. When you drop the module into the inbound flow, you’ll see a configuration panel. Map the current flow’s variables to the module’s input parameters.
{
 "module": {
 "id": "shared-auth-module",
 "inputs": {
 "authToken": "{flow.authToken}",
 "userId": "{flow.userId}"
 }
 }
}

If the variables are still null, check the scope. Make sure the source variables are set at the conversation level, not just step level. Step-level variables often disappear when the context switches to a module execution.