# Fixing INVALID_ROUTING_MODEL: Invalid screens found in the routing model in WhatsApp Flow JSON
Author: Prashant Jangid
Author URL: https://www.heltar.com/blogs/author/prashant-jangid
Published: 2025-04-08
Category: Troubleshoot
Category URL: https://www.heltar.com/blogs/category/troubleshoot
Tags: WhatsApp Flows Error
Tag URLs: WhatsApp Flows Error (https://www.heltar.com/blogs/tag/whatsapp-flows-error)
URL: https://www.heltar.com/blogs/fixing-invalidroutingmodel-invalid-screens-found-in-the-routing-model-in-whatsapp-flow-json-cm98iquum001k9eyzrf83b11o

When working with WhatsApp’s Flow Builder or sending custom Flow JSON, you might come across this error:

**INVALID\_ROUTING\_MODEL**

**Invalid screens found in the routing model: (screenIDs)**

This error happens when your routing\_model includes screen IDs that are not defined in the screens array.

## Root Cause

In WhatsApp Flow JSON, the routing\_model defines how users move between screens. Each key in the routing\_model must reference a valid screen ID declared in the screens array. If any key (i.e., source screen) in routing\_model doesn’t match a defined screen, WhatsApp throws this error.

## JSON Structure Breakdown

### screens

This is the list of all UI screens in your flow.

```
"screens": [
  {
    "id": "FIRST_SCREEN",
    "type": "FORM",
    ...
  }
]
```

### routing\_model

Defines the flow logic between screens — each key must match a screen.id.

```
"routing_model": {
  "FIRST_SCREEN": []
}
```

## Invalid Example

Here’s a broken flow:

```
{
  "routing_model": {
    "ABC": []
  },
  "screens": [
    {
      "id": "FIRST_SCREEN",
      "type": "FORM"
    }
  ]
}
```

Issue:

- ABC is defined as a routing key (source screen).
- But there's no screen with id: "ABC" in the screens array.

So WhatsApp throws:

**INVALID\_ROUTING\_MODEL**

**Invalid screens found in the routing model: ABC**

## Fixed Example

```
{
  "routing_model": {
    "FIRST_SCREEN": []
  },
  "screens": [
    {
      "id": "FIRST_SCREEN",
      "type": "FORM"
    }
  ]
}
```

Now:

- routing\_model uses FIRST\_SCREEN, which exists in screens.
- All keys in the routing model are valid.
- Flow is deployable.

## How to Fix This Error

1. **Check the Error Message:** Invalid screens found in the routing model: SCREEN\_X

2. **Compare Routing Keys vs Screen IDs:** Each key in routing\_model must exist in screens.

3. **Fix One of the Following:** Rename the routing key to match an existing screen ID. Add the missing screen to the screens array


WhatsApp Flow JSON is strict. Every screen ID in routing\_model — whether it's a source or a target — must exist in screens. If it doesn’t, the API throws INVALID\_ROUTING\_MODEL.

Before deploying:

- Validate your flow

- Cross-check all screen references

- Keep routing logic and screen definitions in sync


For more troubleshooting insights related to WhatsApp Business API, check out [heltar.com/blogs](http://heltar.com/blogs).


---
This blog is powered by Superblog. Visit https://superblog.ai to know more.
---

