From ca9b3c6ff6b86fb7ad055be5322bb1dee67a502b Mon Sep 17 00:00:00 2001 From: rafid saad Date: Mon, 2 Feb 2026 17:29:58 -0800 Subject: [PATCH] Add enabled to the client --- libs/sdk-py/langgraph_sdk/client.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index ca1f62786..ac7869032 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -6306,6 +6306,7 @@ class SyncCronClient: webhook: str | None = None, multitask_strategy: str | None = None, end_time: datetime | None = None, + enabled: bool | None = None, headers: Mapping[str, str] | None = None, params: QueryParamTypes | None = None, ) -> Run: @@ -6329,6 +6330,7 @@ class SyncCronClient: multitask_strategy: Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. end_time: The time to stop running the cron job. If not provided, the cron job will run indefinitely. + enabled: Whether the cron job is enabled. By default, it is considered enabled. headers: Optional custom headers to include with the request. Returns: @@ -6348,7 +6350,8 @@ class SyncCronClient: interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], webhook="https://my.fake.webhook.com", - multitask_strategy="interrupt" + multitask_strategy="interrupt", + enabled=True ) ``` """ @@ -6365,6 +6368,7 @@ class SyncCronClient: "webhook": webhook, "multitask_strategy": multitask_strategy, "end_time": end_time.isoformat() if end_time else None, + "enabled": enabled, } payload = {k: v for k, v in payload.items() if v is not None} return self.http.post( @@ -6390,6 +6394,7 @@ class SyncCronClient: on_run_completed: OnCompletionBehavior | None = None, multitask_strategy: str | None = None, end_time: datetime | None = None, + enabled: bool | None = None, headers: Mapping[str, str] | None = None, params: QueryParamTypes | None = None, ) -> Run: @@ -6416,6 +6421,7 @@ class SyncCronClient: multitask_strategy: Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. end_time: The time to stop running the cron job. If not provided, the cron job will run indefinitely. + enabled: Whether the cron job is enabled. By default, it is considered enabled. headers: Optional custom headers to include with the request. Returns: @@ -6435,7 +6441,8 @@ class SyncCronClient: interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], webhook="https://my.fake.webhook.com", - multitask_strategy="interrupt" + multitask_strategy="interrupt", + enabled=True ) ``` @@ -6454,6 +6461,7 @@ class SyncCronClient: "on_run_completed": on_run_completed, "multitask_strategy": multitask_strategy, "end_time": end_time.isoformat() if end_time else None, + "enabled": enabled } payload = {k: v for k, v in payload.items() if v is not None} return self.http.post( @@ -6494,6 +6502,7 @@ class SyncCronClient: *, assistant_id: str | None = None, thread_id: str | None = None, + enabled: bool | None = None, limit: int = 10, offset: int = 0, sort_by: CronSortBy | None = None, @@ -6507,6 +6516,7 @@ class SyncCronClient: Args: assistant_id: The assistant ID or graph name to search for. thread_id: the thread ID to search for. + enabled: Whether the cron job is enabled. limit: The maximum number of results to return. offset: The number of results to skip. headers: Optional custom headers to include with the request. @@ -6521,6 +6531,7 @@ class SyncCronClient: cron_jobs = client.crons.search( assistant_id="my_assistant_id", thread_id="my_thread_id", + enabled=True, limit=5, offset=5, ) @@ -6554,6 +6565,7 @@ class SyncCronClient: payload = { "assistant_id": assistant_id, "thread_id": thread_id, + "enabled": enabled, "limit": limit, "offset": offset, }