https://retellai.com/?utm_source=discord&utm_medium=seo logo
I was working on the new version of my agent - it'...
# ❓・ai-evy-support
a
@AI Evy I was working on the new version of my agent - it's in draft and I haven't published it, but for some reason when I check new calls they use this draft version. Why is it so? Why did it uses draft version that is not published yet? Does all changes immideately reflected in production?
a
Thanks for tagging me @Alex. I'll look through relevant sources and get back to you shortly.
### Answer This behavior depends on which version your phone number is configured to use. If your phone number is set to use
Draft
, it will always fetch the latest (draft) version of the agent. [(1) ]() To ensure your production calls use a published version instead of the draft: 1. Go to the Phone Numbers tab in the dashboard. 2. Check which version is assigned to your phone number. 3. If it shows
Draft
, that's why your calls are using unpublished changes. To lock in a specific published version for production, select a specific version number (e.g., version 0, 1, 2) rather than
Draft
for that phone number. Published versions cannot be changed, while the draft is always editable. When you publish, it creates a new version snapshot and a fresh draft you can continue editing.
​ To learn more, see the sources I considered: [[1] Setup versioning for agents](https://docs.retellai.com/agent/version) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy I use web call, not a phone call
a
Thanks for the follow-up, @Alex. I'll get back to you soon.
### Answer For web calls, the version behavior works the same way. When you call the
create_web_call
API, you can specify a version number to control which agent version is used. [(1) ]() If you don't specify a version, the SDK defaults to the latest version of the agent. To ensure your web calls use a specific published version instead of the draft: - Pass the
version
parameter when creating the web call - Example:
get_agent(version=2)
gets version 2, while
get_agent()
gets the latest version So if your web calls are picking up draft changes, you're likely not specifying a version number in your
create_web_call
request, which means it defaults to the latest (draft) version. To lock in a published version, explicitly pass the version number when creating the web call.
​ To learn more, see the sources I considered: [[1] Setup versioning for agents](https://docs.retellai.com/agent/version) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy what if I make changes daily? Is there a way to just configure it to use the latest published version and not the draft version?
a
Thanks for the follow-up, @Alex. I'll get back to you soon.
### Answer Based on the available documentation, there isn't a built-in option to automatically use "latest published version" (excluding draft) for web calls. The versioning system works as follows: - If you don't specify a version, it defaults to the latest version of the agent [(1) ]() - The version number is a monotonically increasing integer that gets updated when you publish via the "Deployment" button - Published versions cannot be changed, and only the latest version (draft) can be modified Workaround approach: Since you make changes daily, you would need to: 1. Track your latest published version number - Each time you publish, note the new version number (e.g., version 5) 2. Explicitly pass that version when creating web calls using the
agent_version
parameter [(2) ]()
Copy code
javascript
const callResponse = await client.call.createWebCall({
  agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  agent_version: 5  // specify your latest published version
}) ;
This means after each publish, you'd update the version number in your code to point to the newly published version. Unfortunately, there's no documented "latest published" option that automatically excludes draft—you either get "draft" (by not specifying) or a specific version number.
​ To learn more, see the sources I considered: [[1] Setup versioning for agents](https://docs.retellai.com/agent/version) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.