https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> is there a way to different...
# ❓・ai-evy-support
s
@AI Evy is there a way to differentiate between an inbound call vs. an outbound call in the workflow builder on Retell? I want to have two different prompts based on which one it was
a
Thanks for tagging me @Shaan@beHuman. I'll look through relevant sources and get back to you shortly.
### Answer For inbound calls, you can use the inbound call webhook to dynamically override the agent based on call context [(1) ]() . The webhook allows you to set an
override_agent_id
field to specify a different agent for that specific inbound call [(2) ]() . The inbound call webhook receives a payload with call information and you can respond with:
Copy code
json
{
  "call_inbound": {
    "override_agent_id": "agent_12345",
    "dynamic_variables": {
        "customer_name": "John Doe"
    },
    "metadata": {
        "random_id": "12345"
    }
  }
}
This allows you to check the caller information and assign different agents with different prompts based on whether it's an inbound or outbound scenario [(1) ]() . For example, you could have one agent configured for inbound customer service calls and another for outbound sales calls [(3) ](

▾

) . For outbound calls, you directly specify the agent when creating the call using the create phone call API [(4) ]() , so you can assign your outbound-specific agent at that point. The key is setting up different agents with different prompts and using the inbound webhook to dynamically route to the appropriate agent based on call direction [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[3] LIVE WORKSHOP: Build an Outbound AI Caller for Mortgage Leads!](

https://www.youtube.com/watch?v=ID1d1bkVuNU▾

) [[4] Outbound calls (make calls)](https://docs.retellai.com/deploy/outbound-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.