Skip to content

Automate browser based workflows with AI

docs: fix scheduling examples to use client.schedules API (#7924)

Recoordinate0a9df4899950
diff --git a/docs/cloud/building-agents/run-from-code.mdx b/docs/cloud/building-agents/run-from-code.mdx
index 6197ea00c..6aae2f1db 100644
--- a/docs/cloud/building-agents/run-from-code.mdx
+++ b/docs/cloud/building-agents/run-from-code.mdx
@@ -277,7 +277,7 @@ from skyvern import Skyvern
async def main():
client = Skyvern(api_key=os.getenv("SKYVERN_API_KEY"))
- result = await client.agent.create_workflow_schedule(
+ result = await client.schedules.create(
workflow_permanent_id="wpid_123456789",
cron_expression="0 9 * * 1-5",
timezone="America/New_York",
@@ -327,13 +327,13 @@ curl -X POST "https://api.skyvern.com/api/v1/workflows/wpid_123456789/schedules"
<CodeGroup>
```python Python
# Disable
-await client.agent.disable_workflow_schedule(
+await client.schedules.disable(
workflow_permanent_id="wpid_123456789",
workflow_schedule_id="wfs_abc123"
)
# Re-enable
-await client.agent.enable_workflow_schedule(
+await client.schedules.enable(
workflow_permanent_id="wpid_123456789",
workflow_schedule_id="wfs_abc123"
)
@@ -356,7 +356,7 @@ Permanently remove a schedule. This cannot be undone. Runs that were already tri
<CodeGroup>
```python Python
-await client.agent.delete_workflow_schedule_route(
+await client.schedules.delete(
workflow_permanent_id="wpid_123456789",
workflow_schedule_id="wfs_abc123"
)
diff --git a/docs/snippets/core-concepts-content.mdx b/docs/snippets/core-concepts-content.mdx
index abae38c7d..0dbf53020 100644
--- a/docs/snippets/core-concepts-content.mdx
+++ b/docs/snippets/core-concepts-content.mdx
@@ -188,7 +188,7 @@ A Schedule runs an agent automatically on a recurring basis. You define a cron e
<CodeGroup>
```python Python
-result = await client.agent.create_workflow_schedule(
+result = await client.schedules.create(
workflow_permanent_id="wpid_abc123",
cron_expression="0 9 * * 1-5", # Weekdays at 9 AM
timezone="America/New_York",