mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
chore: add documentation for template context variables
This commit is contained in:
parent
8b3dc02722
commit
bb5f56bfb7
2 changed files with 35 additions and 0 deletions
|
|
@ -111,6 +111,31 @@ Access in prompts as `{{customer.name}}` and `{{customer.address.city}}`.
|
|||
|
||||
The request has a **10-second timeout**. If your API does not respond within this window, the call proceeds without the fetched data. Design your endpoint to respond as quickly as possible to minimize the ring-back tone duration.
|
||||
|
||||
## Testing with Test Calls
|
||||
|
||||
<iframe
|
||||
src="https://www.tella.tv/video/vid_cmnrnu19v011z04l1hvwiezaz/embed?b=0&title=0&a=1&loop=0&autoPlay=false&t=0&wt=0"
|
||||
allowFullScreen
|
||||
allowTransparency
|
||||
style={{ width: "100%", aspectRatio: "16/9", border: "none", borderRadius: "12px" }}
|
||||
/>
|
||||
|
||||
When a real phone call comes in, the `caller_number` and `called_number` context variables are automatically set by the telephony provider and included in the pre-call data fetch request as `from_number` and `to_number`. However, when you make a test call — either a **web call** (WebRTC) or a **phone test call** from the workflow editor — these variables are not available by default.
|
||||
|
||||
To simulate telephony data during testing:
|
||||
|
||||
1. Open your workflow and go to **Settings**.
|
||||
2. Under **Context Variables**, add the following variables:
|
||||
- `caller_number` — set to a phone number you want to simulate as the caller (e.g., `+12137771234`).
|
||||
- `called_number` — set to the number that would be dialed (e.g., `+12137771235`).
|
||||
3. Save the settings.
|
||||
|
||||
Now when you make a test call (web or phone), these values will be sent in the pre-call data fetch request to your endpoint, allowing you to test the full flow as if a real inbound call were coming in.
|
||||
|
||||
<Note>
|
||||
These context variables are only used during test calls from the workflow editor. On production inbound calls and campaign outbound calls, the actual telephony data is used and these values are ignored.
|
||||
</Note>
|
||||
|
||||
## Example Integration
|
||||
|
||||
A simple Node.js endpoint that looks up a customer by phone number:
|
||||
|
|
|
|||
|
|
@ -24,5 +24,15 @@ You can write your prompt to access the user's name as below
|
|||
|
||||
Prompt: `You are Alice, who is talking to {{initial_context.user.name}}.`
|
||||
|
||||
### Using Template Variables for Testing
|
||||
|
||||
Template variables defined in your workflow **Settings > Context Variables** are included in test calls (both web and phone) made from the workflow editor. This is useful for simulating data that would normally come from telephony or an API trigger.
|
||||
|
||||
For example, you can set `caller_number` and `called_number` as context variables to test [Pre-Call Data Fetch](/voice-agent/pre-call-data-fetch#testing-with-test-calls) without needing a real inbound call.
|
||||
|
||||
<Note>
|
||||
These context variables are only used during test calls from the workflow editor. On production inbound calls and campaign outbound calls, the actual telephony data is used and these values are ignored.
|
||||
</Note>
|
||||
|
||||
### Nodes
|
||||
Dograh Voice Agents are composed of various nodes. These nodes can provide instructions to the voice agent, help you setup a [trigger](/voice-agent/api-trigger) where you can trigger the voice agent to call someone, or help you setup a [webhook](/voice-agent/webhook), where you can update the results of the call in your CRM or trigger a downstream workflow in n8n. In the next steps, we will be documenting the nodes that you can use in building the voice agent.
|
||||
Loading…
Add table
Add a link
Reference in a new issue