When designing a WhatsApp data channel flow, you might come across this error:
INVALID_ROUTING_MODEL: Invalid screen found in the routing model: (screenId).
This error is common, especially when your flow includes screens that aren't properly linked or referenced. Let’s break down what it means and how to fix it.
What This Error Means?
This error shows up when:
A screen exists in your screens array,
But it is not referenced anywhere in the routing_model.
In simpler terms: You created a screen, but didn’t connect it to the flow—so the system doesn’t know when (or if) to show it.
Example of the Error
{
"routing_model": {
"FIRST_SCREEN": []
},
"screens": [
{
"id": "FIRST_SCREEN",
"terminal": true
},
{
"id": "SECOND_SCREEN"
}
]
}
Here:
SECOND_SCREEN exists in the screens array,
But it's not referenced in routing_model as a destination from any screen.
This causes the INVALID_ROUTING_MODEL error.
How to Fix It?
To fix this:
Make sure every screen in your screens list is referenced at least once in the routing_model.
If a screen is unused, remove it—or connect it properly in the routing logic.
Fixed Example
{
"routing_model": {
"FIRST_SCREEN": ["SECOND_SCREEN"]
},
"screens": [
{
"id": "FIRST_SCREEN"
},
{
"id": "SECOND_SCREEN",
"terminal": true
}
]
}
Now:
Both screens are connected in the flow.
No screen is left unreferenced.
Error gone.
Pro Tip
Even if a screen is terminal (i.e. it ends the flow), it must be referenced in the routing model—otherwise, the system doesn’t know how it fits into the conversation path.
For more troubleshooting insights related to WhatsApp Business API, check out heltar.com/blogs.