We are trying to refactor our inbound voice flows to reduce duplication by calling a single Shared Flow module from multiple entry points. I have created a Data Action in the main flow to trigger the shared logic. The problem is the JSON payload structure for the invoke action. I am not seeing clear documentation on how to pass the flowId and moduleRef correctly. Here is what I have so far:
{
"type": "invoke",
"flowId": "shared-verification-module-id",
"moduleRef": "Start",
"inputs": {
"callerId": "{{contact.attributes.callerId}}"
}
}
When I test this, the call drops immediately after the Data Action executes. The logs show a 404 Not Found error when the platform attempts to resolve the module reference. I suspect the moduleRef syntax is wrong or I need to specify the version explicitly. Is there a specific format for referencing the entry point of a Shared Flow? Also, how do we handle the return values from that shared module back to the original flow context?
The docs for the Architect API are a bit light on the exact JSON structure for data actions, especially when mixing in shared flow references. The key is that you don’t just pass the ID. You need the full resource path for the moduleRef.
Here is the working JSON payload for the data action configuration. I pulled this from a recent integration where I had to trigger a shared flow from a C# service via the API.
{
"type": "invoke",
"moduleId": "your-shared-flow-module-id-here",
"moduleRef": "/api/v2/architect/sharedflows/your-shared-flow-id-here/modules/your-module-id-here",
"inputs": {
"inputParam1": "{{contact.phoneNumber}}"
},
"outputs": {
"result": "{{output.result}}"
}
}
The moduleId in the data action JSON must match the ID of the specific module inside the shared flow. The moduleRef is the critical part that gets missed. It’s not just the flow ID. It’s the path to the module.
From the Genesys Cloud API documentation for POST /api/v2/architect/sharedflows/{sharedFlowId}/modules:
“The module ID is unique within the shared flow. When invoking, the reference must point to the specific module endpoint.”
If you are using the .NET SDK, the DataAction class expects this structure. You’ll need to set the ModuleRef property explicitly.
var dataAction = new DataAction
{
Type = "invoke",
ModuleId = "module-uuid-from-shared-flow",
ModuleRef = $"/api/v2/architect/sharedflows/{sharedFlowId}/modules/{moduleId}",
Inputs = new Dictionary<string, string>
{
{ "customerName", "{{contact.name}}" }
}
};
Make sure the shared flow is published. If it’s in draft, the invoke action will fail silently or throw a validation error depending on where you are calling it from. Also, check the scopes. Your user or app needs architect:sharedflow:execute scope. Without that, you get a 403 even if the JSON is perfect.