https://retellai.com/?utm_source=discord&utm_medium=seo logo
Switching from outbound to inbound changes the arc...
# ❓・ai-evy-support
v
@AI Evy Switching from outbound to inbound changes the architecture slightly. With an outbound call, you push the data (name, expiration date) to Retell before the call starts. With an inbound call, Retell receives the call and needs to pull that data from SharePoint in real-time. Since you are already using Power Automate (from your Python script), the most seamless way to do this is using Retell’s Inbound Call Webhook combined with a Power Automate flow. Here is exactly how to build this so the agent instantly greets them by name when they call. The Architecture: Retell "Pre-Call" Webhook Instead of adding a "stalling node" where the agent says "Hold on let me look you up," Retell allows you to fire a webhook the millisecond the phone rings. Call comes in. Retell pauses for ~1 second and sends an HTTP POST to your Power Automate with the caller's phone number (user_number). Power Automate searches your SharePoint list for that number. Power Automate returns a JSON payload with first_name, expirationDate, etc. Retell injects those variables into the Welcome Node and starts speaking. Step 1: Create the Power Automate "Lookup" Flow You need a Power Automate flow that acts as the bridge between Retell and SharePoint. Trigger: Create a new flow starting with "When an HTTP request is received". Schema: Retell will send a payload that includes the caller's number. Set your JSON can you give me the JSON
a
Thanks for tagging me @Vyyy. I'll look through relevant sources and get back to you shortly.
### Answer When an inbound call comes in, Retell sends a POST request to your webhook with this payload structure [(1) ]() :
Copy code
json
{
  "event": "call_inbound",
  "call_inbound": {
    "agent_id": "agent_12345",
    "agent_version": 1,
    "from_number": "+12137771234",
    "to_number": "+12137771235"
  }
}
The key field you need is
from_number
- this is the caller's phone number that you'll use to look up their SharePoint data . Your Power Automate flow should expect this JSON structure and extract the
from_number
value to search SharePoint. Then, your Power Automate flow must return a JSON response with this structure :
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "first_name": "John",
      "expirationDate": "2025-12-31"
    }
  }
}
The
dynamic_variables
object is where you inject the SharePoint data (name, expiration date, etc.) that Retell will use in the conversation [(1) ]() [(2) ]() . These variables can then be referenced in your agent's prompts using the
{{variable_name}}
syntax [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​