hatchet-sdk 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (73) hide show
  1. hatchet_sdk/__init__.py +32 -16
  2. hatchet_sdk/client.py +25 -63
  3. hatchet_sdk/clients/admin.py +203 -142
  4. hatchet_sdk/clients/dispatcher/action_listener.py +42 -42
  5. hatchet_sdk/clients/dispatcher/dispatcher.py +18 -16
  6. hatchet_sdk/clients/durable_event_listener.py +327 -0
  7. hatchet_sdk/clients/rest/__init__.py +12 -1
  8. hatchet_sdk/clients/rest/api/log_api.py +258 -0
  9. hatchet_sdk/clients/rest/api/task_api.py +32 -6
  10. hatchet_sdk/clients/rest/api/workflow_runs_api.py +626 -0
  11. hatchet_sdk/clients/rest/models/__init__.py +12 -1
  12. hatchet_sdk/clients/rest/models/v1_log_line.py +94 -0
  13. hatchet_sdk/clients/rest/models/v1_log_line_level.py +39 -0
  14. hatchet_sdk/clients/rest/models/v1_log_line_list.py +110 -0
  15. hatchet_sdk/clients/rest/models/v1_task_summary.py +80 -64
  16. hatchet_sdk/clients/rest/models/v1_trigger_workflow_run_request.py +95 -0
  17. hatchet_sdk/clients/rest/models/v1_workflow_run_display_name.py +98 -0
  18. hatchet_sdk/clients/rest/models/v1_workflow_run_display_name_list.py +114 -0
  19. hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +9 -4
  20. hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +5 -1
  21. hatchet_sdk/clients/run_event_listener.py +0 -1
  22. hatchet_sdk/clients/v1/api_client.py +81 -0
  23. hatchet_sdk/context/context.py +86 -159
  24. hatchet_sdk/contracts/dispatcher_pb2_grpc.py +1 -1
  25. hatchet_sdk/contracts/events_pb2.py +2 -2
  26. hatchet_sdk/contracts/events_pb2_grpc.py +1 -1
  27. hatchet_sdk/contracts/v1/dispatcher_pb2.py +36 -0
  28. hatchet_sdk/contracts/v1/dispatcher_pb2.pyi +38 -0
  29. hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py +145 -0
  30. hatchet_sdk/contracts/v1/shared/condition_pb2.py +39 -0
  31. hatchet_sdk/contracts/v1/shared/condition_pb2.pyi +72 -0
  32. hatchet_sdk/contracts/v1/shared/condition_pb2_grpc.py +29 -0
  33. hatchet_sdk/contracts/v1/workflows_pb2.py +67 -0
  34. hatchet_sdk/contracts/v1/workflows_pb2.pyi +228 -0
  35. hatchet_sdk/contracts/v1/workflows_pb2_grpc.py +234 -0
  36. hatchet_sdk/contracts/workflows_pb2_grpc.py +1 -1
  37. hatchet_sdk/features/cron.py +91 -121
  38. hatchet_sdk/features/logs.py +16 -0
  39. hatchet_sdk/features/metrics.py +75 -0
  40. hatchet_sdk/features/rate_limits.py +45 -0
  41. hatchet_sdk/features/runs.py +221 -0
  42. hatchet_sdk/features/scheduled.py +114 -131
  43. hatchet_sdk/features/workers.py +41 -0
  44. hatchet_sdk/features/workflows.py +55 -0
  45. hatchet_sdk/hatchet.py +463 -165
  46. hatchet_sdk/opentelemetry/instrumentor.py +8 -13
  47. hatchet_sdk/rate_limit.py +33 -39
  48. hatchet_sdk/runnables/contextvars.py +12 -0
  49. hatchet_sdk/runnables/standalone.py +192 -0
  50. hatchet_sdk/runnables/task.py +144 -0
  51. hatchet_sdk/runnables/types.py +138 -0
  52. hatchet_sdk/runnables/workflow.py +771 -0
  53. hatchet_sdk/utils/aio_utils.py +0 -79
  54. hatchet_sdk/utils/proto_enums.py +0 -7
  55. hatchet_sdk/utils/timedelta_to_expression.py +23 -0
  56. hatchet_sdk/utils/typing.py +2 -2
  57. hatchet_sdk/v0/clients/rest_client.py +9 -0
  58. hatchet_sdk/v0/worker/action_listener_process.py +18 -2
  59. hatchet_sdk/waits.py +120 -0
  60. hatchet_sdk/worker/action_listener_process.py +64 -30
  61. hatchet_sdk/worker/runner/run_loop_manager.py +35 -26
  62. hatchet_sdk/worker/runner/runner.py +72 -55
  63. hatchet_sdk/worker/runner/utils/capture_logs.py +3 -11
  64. hatchet_sdk/worker/worker.py +155 -118
  65. hatchet_sdk/workflow_run.py +4 -5
  66. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/METADATA +1 -2
  67. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/RECORD +69 -43
  68. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/entry_points.txt +2 -0
  69. hatchet_sdk/clients/rest_client.py +0 -636
  70. hatchet_sdk/semver.py +0 -30
  71. hatchet_sdk/worker/runner/utils/error_with_traceback.py +0 -6
  72. hatchet_sdk/workflow.py +0 -527
  73. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/WHEEL +0 -0
@@ -1,12 +1,13 @@
1
1
  import datetime
2
- from typing import List, Optional, Union
2
+ from typing import Optional
3
3
 
4
- from pydantic import BaseModel, Field
5
-
6
- from hatchet_sdk.client import Client
7
- from hatchet_sdk.clients.rest.models.cron_workflows_order_by_field import (
8
- CronWorkflowsOrderByField,
4
+ from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
5
+ from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
6
+ from hatchet_sdk.clients.rest.api_client import ApiClient
7
+ from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
8
+ ScheduleWorkflowRunRequest,
9
9
  )
10
+ from hatchet_sdk.clients.rest.models.scheduled_run_status import ScheduledRunStatus
10
11
  from hatchet_sdk.clients.rest.models.scheduled_workflows import ScheduledWorkflows
11
12
  from hatchet_sdk.clients.rest.models.scheduled_workflows_list import (
12
13
  ScheduledWorkflowsList,
@@ -17,43 +18,49 @@ from hatchet_sdk.clients.rest.models.scheduled_workflows_order_by_field import (
17
18
  from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import (
18
19
  WorkflowRunOrderByDirection,
19
20
  )
21
+ from hatchet_sdk.clients.v1.api_client import (
22
+ BaseRestClient,
23
+ maybe_additional_metadata_to_kv,
24
+ )
20
25
  from hatchet_sdk.utils.typing import JSONSerializableMapping
21
26
 
22
27
 
23
- class CreateScheduledTriggerJSONSerializableMapping(BaseModel):
24
- """
25
- Schema for creating a scheduled workflow run.
26
-
27
- Attributes:
28
- input (JSONSerializableMapping): The input data for the scheduled workflow.
29
- additional_metadata (JSONSerializableMapping): Additional metadata associated with the future run (e.g. ["key1:value1", "key2:value2"]).
30
- trigger_at (Optional[datetime.datetime]): The datetime when the run should be triggered.
31
- """
32
-
33
- input: JSONSerializableMapping = Field(default_factory=dict)
34
- additional_metadata: JSONSerializableMapping = Field(default_factory=dict)
35
- trigger_at: datetime.datetime
36
-
37
-
38
- class ScheduledClient:
39
- """
40
- Client for managing scheduled workflows synchronously.
28
+ class ScheduledClient(BaseRestClient):
29
+ def _wra(self, client: ApiClient) -> WorkflowRunApi:
30
+ return WorkflowRunApi(client)
41
31
 
42
- Attributes:
43
- _client (Client): The underlying client used to interact with the REST API.
44
- aio (ScheduledClientAsync): Asynchronous counterpart of ScheduledClient.
45
- """
32
+ def _wa(self, client: ApiClient) -> WorkflowApi:
33
+ return WorkflowApi(client)
46
34
 
47
- _client: Client
48
-
49
- def __init__(self, _client: Client) -> None:
35
+ async def aio_create(
36
+ self,
37
+ workflow_name: str,
38
+ trigger_at: datetime.datetime,
39
+ input: JSONSerializableMapping,
40
+ additional_metadata: JSONSerializableMapping,
41
+ ) -> ScheduledWorkflows:
50
42
  """
51
- Initializes the ScheduledClient with a given Client instance.
43
+ Creates a new scheduled workflow run asynchronously.
52
44
 
53
45
  Args:
54
- _client (Client): The client instance to be used for REST interactions.
46
+ workflow_name (str): The name of the scheduled workflow.
47
+ trigger_at (datetime.datetime): The datetime when the run should be triggered.
48
+ input (JSONSerializableMapping): The input data for the scheduled workflow.
49
+ additional_metadata (JSONSerializableMapping): Additional metadata associated with the future run.
50
+
51
+ Returns:
52
+ ScheduledWorkflows: The created scheduled workflow instance.
55
53
  """
56
- self._client = _client
54
+ async with self.client() as client:
55
+ return await self._wra(client).scheduled_workflow_run_create(
56
+ tenant=self.client_config.tenant_id,
57
+ workflow=workflow_name,
58
+ schedule_workflow_run_request=ScheduleWorkflowRunRequest(
59
+ triggerAt=trigger_at,
60
+ input=dict(input),
61
+ additionalMetadata=dict(additional_metadata),
62
+ ),
63
+ )
57
64
 
58
65
  def create(
59
66
  self,
@@ -75,37 +82,39 @@ class ScheduledClient:
75
82
  ScheduledWorkflows: The created scheduled workflow instance.
76
83
  """
77
84
 
78
- validated_input = CreateScheduledTriggerJSONSerializableMapping(
79
- trigger_at=trigger_at, input=input, additional_metadata=additional_metadata
80
- )
81
-
82
- return self._client.rest.schedule_create(
85
+ return self._run_async_from_sync(
86
+ self.aio_create,
83
87
  workflow_name,
84
- validated_input.trigger_at,
85
- validated_input.input,
86
- validated_input.additional_metadata,
88
+ trigger_at,
89
+ input,
90
+ additional_metadata,
87
91
  )
88
92
 
89
- def delete(self, scheduled: Union[str, ScheduledWorkflows]) -> None:
93
+ async def aio_delete(self, scheduled_id: str) -> None:
90
94
  """
91
95
  Deletes a scheduled workflow run.
92
96
 
93
97
  Args:
94
- scheduled (Union[str, ScheduledWorkflows]): The scheduled workflow trigger ID or ScheduledWorkflows instance to delete.
98
+ scheduled_id (str): The scheduled workflow trigger ID to delete.
95
99
  """
96
- self._client.rest.schedule_delete(
97
- scheduled.metadata.id
98
- if isinstance(scheduled, ScheduledWorkflows)
99
- else scheduled
100
- )
100
+ async with self.client() as client:
101
+ await self._wa(client).workflow_scheduled_delete(
102
+ tenant=self.client_config.tenant_id,
103
+ scheduled_workflow_run=scheduled_id,
104
+ )
101
105
 
102
- def list(
106
+ def delete(self, scheduled_id: str) -> None:
107
+ self._run_async_from_sync(self.aio_delete, scheduled_id)
108
+
109
+ async def aio_list(
103
110
  self,
104
111
  offset: int | None = None,
105
112
  limit: int | None = None,
106
113
  workflow_id: str | None = None,
107
- additional_metadata: Optional[List[str]] = None,
108
- order_by_field: Optional[CronWorkflowsOrderByField] = None,
114
+ parent_workflow_run_id: str | None = None,
115
+ statuses: list[ScheduledRunStatus] | None = None,
116
+ additional_metadata: Optional[JSONSerializableMapping] = None,
117
+ order_by_field: Optional[ScheduledWorkflowsOrderByField] = None,
109
118
  order_by_direction: Optional[WorkflowRunOrderByDirection] = None,
110
119
  ) -> ScheduledWorkflowsList:
111
120
  """
@@ -115,120 +124,94 @@ class ScheduledClient:
115
124
  offset (int | None): The starting point for the list.
116
125
  limit (int | None): The maximum number of items to return.
117
126
  workflow_id (str | None): Filter by specific workflow ID.
118
- additional_metadata (Optional[List[str]]): Filter by additional metadata keys (e.g. ["key1:value1", "key2:value2"]).
119
- order_by_field (Optional[CronWorkflowsOrderByField]): Field to order the results by.
127
+ parent_workflow_run_id (str | None): Filter by parent workflow run ID.
128
+ statuses (list[ScheduledRunStatus] | None): Filter by status.
129
+ additional_metadata (Optional[List[dict[str, str]]]): Filter by additional metadata.
130
+ order_by_field (Optional[ScheduledWorkflowsOrderByField]): Field to order the results by.
120
131
  order_by_direction (Optional[WorkflowRunOrderByDirection]): Direction to order the results.
121
132
 
122
133
  Returns:
123
134
  List[ScheduledWorkflows]: A list of scheduled workflows matching the criteria.
124
135
  """
125
- return self._client.rest.schedule_list(
126
- offset=offset,
127
- limit=limit,
128
- workflow_id=workflow_id,
129
- additional_metadata=additional_metadata,
130
- order_by_field=order_by_field,
131
- order_by_direction=order_by_direction,
132
- )
133
-
134
- def get(self, scheduled: Union[str, ScheduledWorkflows]) -> ScheduledWorkflows:
135
- """
136
- Retrieves a specific scheduled workflow by scheduled run trigger ID.
137
-
138
- Args:
139
- scheduled (Union[str, ScheduledWorkflows]): The scheduled workflow trigger ID or ScheduledWorkflows instance to retrieve.
140
-
141
- Returns:
142
- ScheduledWorkflows: The requested scheduled workflow instance.
143
- """
144
- return self._client.rest.schedule_get(
145
- scheduled.metadata.id
146
- if isinstance(scheduled, ScheduledWorkflows)
147
- else scheduled
148
- )
149
-
150
- async def aio_create(
151
- self,
152
- workflow_name: str,
153
- trigger_at: datetime.datetime,
154
- input: JSONSerializableMapping,
155
- additional_metadata: JSONSerializableMapping,
156
- ) -> ScheduledWorkflows:
157
- """
158
- Creates a new scheduled workflow run asynchronously.
136
+ async with self.client() as client:
137
+ return await self._wa(client).workflow_scheduled_list(
138
+ tenant=self.client_config.tenant_id,
139
+ offset=offset,
140
+ limit=limit,
141
+ order_by_field=order_by_field,
142
+ order_by_direction=order_by_direction,
143
+ workflow_id=workflow_id,
144
+ additional_metadata=maybe_additional_metadata_to_kv(
145
+ additional_metadata
146
+ ),
147
+ parent_workflow_run_id=parent_workflow_run_id,
148
+ statuses=statuses,
149
+ )
159
150
 
160
- Args:
161
- workflow_name (str): The name of the scheduled workflow.
162
- trigger_at (datetime.datetime): The datetime when the run should be triggered.
163
- input (JSONSerializableMapping): The input data for the scheduled workflow.
164
- additional_metadata (JSONSerializableMapping): Additional metadata associated with the future run.
165
-
166
- Returns:
167
- ScheduledWorkflows: The created scheduled workflow instance.
168
- """
169
- return await self._client.rest.aio_create_schedule(
170
- workflow_name, trigger_at, input, additional_metadata
171
- )
172
-
173
- async def aio_delete(self, scheduled: Union[str, ScheduledWorkflows]) -> None:
174
- """
175
- Deletes a scheduled workflow asynchronously.
176
-
177
- Args:
178
- scheduled (Union[str, ScheduledWorkflows]): The scheduled workflow trigger ID or ScheduledWorkflows instance to delete.
179
- """
180
- await self._client.rest.aio_delete_schedule(
181
- scheduled.metadata.id
182
- if isinstance(scheduled, ScheduledWorkflows)
183
- else scheduled
184
- )
185
-
186
- async def aio_list(
151
+ def list(
187
152
  self,
188
153
  offset: int | None = None,
189
154
  limit: int | None = None,
190
155
  workflow_id: str | None = None,
191
- additional_metadata: Optional[List[str]] = None,
156
+ parent_workflow_run_id: str | None = None,
157
+ statuses: list[ScheduledRunStatus] | None = None,
158
+ additional_metadata: Optional[JSONSerializableMapping] = None,
192
159
  order_by_field: Optional[ScheduledWorkflowsOrderByField] = None,
193
160
  order_by_direction: Optional[WorkflowRunOrderByDirection] = None,
194
161
  ) -> ScheduledWorkflowsList:
195
162
  """
196
- Retrieves a list of scheduled workflows based on provided filters asynchronously.
163
+ Retrieves a list of scheduled workflows based on provided filters.
197
164
 
198
165
  Args:
199
166
  offset (int | None): The starting point for the list.
200
167
  limit (int | None): The maximum number of items to return.
201
168
  workflow_id (str | None): Filter by specific workflow ID.
202
- additional_metadata (Optional[List[str]]): Filter by additional metadata keys (e.g. ["key1:value1", "key2:value2"]).
203
- order_by_field (Optional[CronWorkflowsOrderByField]): Field to order the results by.
169
+ parent_workflow_run_id (str | None): Filter by parent workflow run ID.
170
+ statuses (list[ScheduledRunStatus] | None): Filter by status.
171
+ additional_metadata (Optional[List[dict[str, str]]]): Filter by additional metadata.
172
+ order_by_field (Optional[ScheduledWorkflowsOrderByField]): Field to order the results by.
204
173
  order_by_direction (Optional[WorkflowRunOrderByDirection]): Direction to order the results.
205
174
 
206
175
  Returns:
207
- ScheduledWorkflowsList: A list of scheduled workflows matching the criteria.
176
+ List[ScheduledWorkflows]: A list of scheduled workflows matching the criteria.
208
177
  """
209
- return await self._client.rest.aio_list_schedule(
178
+ return self._run_async_from_sync(
179
+ self.aio_list,
210
180
  offset=offset,
211
181
  limit=limit,
212
182
  workflow_id=workflow_id,
213
183
  additional_metadata=additional_metadata,
214
184
  order_by_field=order_by_field,
215
185
  order_by_direction=order_by_direction,
186
+ parent_workflow_run_id=parent_workflow_run_id,
187
+ statuses=statuses,
216
188
  )
217
189
 
218
- async def aio_get(
219
- self, scheduled: Union[str, ScheduledWorkflows]
220
- ) -> ScheduledWorkflows:
190
+ async def aio_get(self, scheduled_id: str) -> ScheduledWorkflows:
191
+ """
192
+ Retrieves a specific scheduled workflow by scheduled run trigger ID.
193
+
194
+ Args:
195
+ scheduled (str): The scheduled workflow trigger ID to retrieve.
196
+
197
+ Returns:
198
+ ScheduledWorkflows: The requested scheduled workflow instance.
221
199
  """
222
- Retrieves a specific scheduled workflow by scheduled run trigger ID asynchronously.
200
+
201
+ async with self.client() as client:
202
+ return await self._wa(client).workflow_scheduled_get(
203
+ tenant=self.client_config.tenant_id,
204
+ scheduled_workflow_run=scheduled_id,
205
+ )
206
+
207
+ def get(self, scheduled_id: str) -> ScheduledWorkflows:
208
+ """
209
+ Retrieves a specific scheduled workflow by scheduled run trigger ID.
223
210
 
224
211
  Args:
225
- scheduled (Union[str, ScheduledWorkflows]): The scheduled workflow trigger ID or ScheduledWorkflows instance to retrieve.
212
+ scheduled (str): The scheduled workflow trigger ID to retrieve.
226
213
 
227
214
  Returns:
228
215
  ScheduledWorkflows: The requested scheduled workflow instance.
229
216
  """
230
- return await self._client.rest.aio_get_schedule(
231
- scheduled.metadata.id
232
- if isinstance(scheduled, ScheduledWorkflows)
233
- else scheduled
234
- )
217
+ return self._run_async_from_sync(self.aio_get, scheduled_id)
@@ -0,0 +1,41 @@
1
+ from hatchet_sdk.clients.rest.api.worker_api import WorkerApi
2
+ from hatchet_sdk.clients.rest.api_client import ApiClient
3
+ from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest
4
+ from hatchet_sdk.clients.rest.models.worker import Worker
5
+ from hatchet_sdk.clients.rest.models.worker_list import WorkerList
6
+ from hatchet_sdk.clients.v1.api_client import BaseRestClient
7
+
8
+
9
+ class WorkersClient(BaseRestClient):
10
+ def _wa(self, client: ApiClient) -> WorkerApi:
11
+ return WorkerApi(client)
12
+
13
+ async def aio_get(self, worker_id: str) -> Worker:
14
+ async with self.client() as client:
15
+ return await self._wa(client).worker_get(worker_id)
16
+
17
+ def get(self, worker_id: str) -> Worker:
18
+ return self._run_async_from_sync(self.aio_get, worker_id)
19
+
20
+ async def aio_list(
21
+ self,
22
+ ) -> WorkerList:
23
+ async with self.client() as client:
24
+ return await self._wa(client).worker_list(
25
+ tenant=self.client_config.tenant_id,
26
+ )
27
+
28
+ def list(
29
+ self,
30
+ ) -> WorkerList:
31
+ return self._run_async_from_sync(self.aio_list)
32
+
33
+ async def aio_update(self, worker_id: str, opts: UpdateWorkerRequest) -> Worker:
34
+ async with self.client() as client:
35
+ return await self._wa(client).worker_update(
36
+ worker=worker_id,
37
+ update_worker_request=opts,
38
+ )
39
+
40
+ def update(self, worker_id: str, opts: UpdateWorkerRequest) -> Worker:
41
+ return self._run_async_from_sync(self.aio_update, worker_id, opts)
@@ -0,0 +1,55 @@
1
+ from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
2
+ from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
3
+ from hatchet_sdk.clients.rest.api_client import ApiClient
4
+ from hatchet_sdk.clients.rest.models.workflow import Workflow
5
+ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList
6
+ from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion
7
+ from hatchet_sdk.clients.v1.api_client import BaseRestClient
8
+
9
+
10
+ class WorkflowsClient(BaseRestClient):
11
+ def _wra(self, client: ApiClient) -> WorkflowRunApi:
12
+ return WorkflowRunApi(client)
13
+
14
+ def _wa(self, client: ApiClient) -> WorkflowApi:
15
+ return WorkflowApi(client)
16
+
17
+ async def aio_get(self, workflow_id: str) -> Workflow:
18
+ async with self.client() as client:
19
+ return await self._wa(client).workflow_get(workflow_id)
20
+
21
+ def get(self, workflow_id: str) -> Workflow:
22
+ return self._run_async_from_sync(self.aio_get, workflow_id)
23
+
24
+ async def aio_list(
25
+ self,
26
+ workflow_name: str | None = None,
27
+ limit: int | None = None,
28
+ offset: int | None = None,
29
+ ) -> WorkflowList:
30
+ async with self.client() as client:
31
+ return await self._wa(client).workflow_list(
32
+ tenant=self.client_config.tenant_id,
33
+ limit=limit,
34
+ offset=offset,
35
+ name=workflow_name,
36
+ )
37
+
38
+ def list(
39
+ self,
40
+ workflow_name: str | None = None,
41
+ limit: int | None = None,
42
+ offset: int | None = None,
43
+ ) -> WorkflowList:
44
+ return self._run_async_from_sync(self.aio_list, workflow_name, limit, offset)
45
+
46
+ async def aio_get_version(
47
+ self, workflow_id: str, version: str | None = None
48
+ ) -> WorkflowVersion:
49
+ async with self.client() as client:
50
+ return await self._wa(client).workflow_version_get(workflow_id, version)
51
+
52
+ def get_version(
53
+ self, workflow_id: str, version: str | None = None
54
+ ) -> WorkflowVersion:
55
+ return self._run_async_from_sync(self.aio_get_version, workflow_id, version)