Hitting a 400 Bad Request every time I try to update the target flow on a common module reference via the JS SDK.
{
“code”: 400,
“message”: “Invalid flow reference configuration. Target flow must be of type ‘common’.”
}
We’ve got about a dozen inbound voice flows that all need to drop into the same post-call survey logic. Instead of duplicating the entire survey tree, the plan is to spin up a single common flow and wire each inbound flow to it using a Flow Reference node. The manual drag-and-drop in Architect works fine, but the pipeline needs to handle this automatically.
Here’s what the update payload looks like in the code:
const updateRef = await client.architectApi.architectFlowReferencesUpdate({
flowReferenceId: ‘ref-uuid-123’,
body: {
flowId: ‘common-survey-uuid-456’,
type: ‘common’,
parameters: {
input: { value: ‘{{trigger.input}}’ },
output: { value: ‘{{survey.result}}’ }
}
}
});
The flowId definitely points to a flow with flowType: ‘common’. I even cross-checked the GET request for that target flow and it’s marked correctly. The reference itself exists, but the patch keeps rejecting the type mismatch.
Is the SDK stripping out the type field during serialization? I’ve tried adding it to the query string, but the Architect API doesn’t seem to accept it there. The docs show the FlowReference object should take a flowId and flowType, but the generated TypeScript types only expose flowId and parameters.
Anyone else run into this when automating shared flow wiring? I’m just going to try hitting the raw /api/v2/architect/flowreferences/{id} endpoint tomorrow morning. The TypeScript types are definitely missing the flowType field anyway. Going to bypass the SDK for now.