hatchet-sdk 0.40.0a9__py3-none-any.whl → 0.42.0__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 (152) hide show
  1. hatchet_sdk/clients/admin.py +129 -59
  2. hatchet_sdk/clients/dispatcher/action_listener.py +25 -2
  3. hatchet_sdk/clients/events.py +91 -52
  4. hatchet_sdk/clients/rest/__init__.py +21 -0
  5. hatchet_sdk/clients/rest/api/api_token_api.py +12 -9
  6. hatchet_sdk/clients/rest/api/default_api.py +24 -18
  7. hatchet_sdk/clients/rest/api/event_api.py +32 -24
  8. hatchet_sdk/clients/rest/api/github_api.py +4 -3
  9. hatchet_sdk/clients/rest/api/log_api.py +4 -3
  10. hatchet_sdk/clients/rest/api/metadata_api.py +12 -9
  11. hatchet_sdk/clients/rest/api/rate_limits_api.py +7 -4
  12. hatchet_sdk/clients/rest/api/slack_api.py +8 -6
  13. hatchet_sdk/clients/rest/api/sns_api.py +12 -9
  14. hatchet_sdk/clients/rest/api/step_run_api.py +28 -21
  15. hatchet_sdk/clients/rest/api/tenant_api.py +67 -49
  16. hatchet_sdk/clients/rest/api/user_api.py +24 -18
  17. hatchet_sdk/clients/rest/api/worker_api.py +12 -9
  18. hatchet_sdk/clients/rest/api/workflow_api.py +3073 -936
  19. hatchet_sdk/clients/rest/api/workflow_run_api.py +669 -21
  20. hatchet_sdk/clients/rest/api_client.py +34 -11
  21. hatchet_sdk/clients/rest/configuration.py +161 -36
  22. hatchet_sdk/clients/rest/models/__init__.py +21 -0
  23. hatchet_sdk/clients/rest/models/api_errors.py +3 -3
  24. hatchet_sdk/clients/rest/models/bulk_create_event_request.py +3 -3
  25. hatchet_sdk/clients/rest/models/bulk_create_event_response.py +3 -3
  26. hatchet_sdk/clients/{cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py → rest/models/create_cron_workflow_trigger_request.py} +18 -14
  27. hatchet_sdk/clients/{cloud_rest/models/github_app_list_installations200_response_rows_inner.py → rest/models/cron_workflows.py} +54 -21
  28. hatchet_sdk/clients/{cloud_rest/models/log_list200_response.py → rest/models/cron_workflows_list.py} +13 -22
  29. hatchet_sdk/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  30. hatchet_sdk/clients/rest/models/event_list.py +3 -3
  31. hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +3 -3
  32. hatchet_sdk/clients/rest/models/job.py +3 -3
  33. hatchet_sdk/clients/rest/models/job_run.py +3 -3
  34. hatchet_sdk/clients/rest/models/list_api_tokens_response.py +3 -3
  35. hatchet_sdk/clients/rest/models/list_pull_requests_response.py +3 -3
  36. hatchet_sdk/clients/rest/models/list_slack_webhooks.py +3 -3
  37. hatchet_sdk/clients/rest/models/list_sns_integrations.py +3 -3
  38. hatchet_sdk/clients/rest/models/log_line_list.py +3 -3
  39. hatchet_sdk/clients/rest/models/rate_limit_list.py +3 -3
  40. hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +3 -3
  41. hatchet_sdk/clients/{cloud_rest/models/log_list200_response_rows_inner.py → rest/models/schedule_workflow_run_request.py} +12 -12
  42. hatchet_sdk/clients/rest/models/scheduled_run_status.py +42 -0
  43. hatchet_sdk/clients/rest/models/scheduled_workflows.py +153 -0
  44. hatchet_sdk/clients/{cloud_rest/models/managed_worker_list200_response.py → rest/models/scheduled_workflows_list.py} +13 -22
  45. hatchet_sdk/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  46. hatchet_sdk/clients/rest/models/step_run_archive_list.py +3 -3
  47. hatchet_sdk/clients/rest/models/step_run_event_list.py +3 -3
  48. hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +3 -3
  49. hatchet_sdk/clients/rest/models/tenant_invite_list.py +3 -3
  50. hatchet_sdk/clients/rest/models/tenant_list.py +3 -3
  51. hatchet_sdk/clients/rest/models/tenant_member_list.py +3 -3
  52. hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +16 -0
  53. hatchet_sdk/clients/rest/models/tenant_resource_policy.py +3 -3
  54. hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +1 -1
  55. hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +3 -3
  56. hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +3 -3
  57. hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +3 -3
  58. hatchet_sdk/clients/rest/models/worker.py +20 -9
  59. hatchet_sdk/clients/rest/models/worker_list.py +3 -3
  60. hatchet_sdk/clients/{cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py → rest/models/worker_runtime_info.py} +23 -19
  61. hatchet_sdk/clients/rest/models/worker_runtime_sdks.py +38 -0
  62. hatchet_sdk/clients/rest/models/workflow.py +9 -9
  63. hatchet_sdk/clients/rest/models/workflow_list.py +3 -3
  64. hatchet_sdk/clients/rest/models/workflow_run.py +3 -3
  65. hatchet_sdk/clients/rest/models/workflow_run_list.py +3 -3
  66. hatchet_sdk/clients/rest/models/workflow_run_shape.py +3 -3
  67. hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +1 -5
  68. hatchet_sdk/clients/rest/models/workflow_triggers.py +6 -6
  69. hatchet_sdk/clients/rest/models/workflow_version.py +3 -3
  70. hatchet_sdk/clients/rest/rest.py +3 -3
  71. hatchet_sdk/clients/rest_client.py +200 -21
  72. hatchet_sdk/contracts/dispatcher_pb2.py +71 -67
  73. hatchet_sdk/contracts/dispatcher_pb2.pyi +31 -2
  74. hatchet_sdk/contracts/events_pb2.pyi +2 -0
  75. hatchet_sdk/contracts/workflows_pb2.py +42 -40
  76. hatchet_sdk/contracts/workflows_pb2.pyi +24 -6
  77. hatchet_sdk/features/cron.py +286 -0
  78. hatchet_sdk/features/scheduled.py +248 -0
  79. hatchet_sdk/hatchet.py +80 -79
  80. hatchet_sdk/loader.py +37 -14
  81. hatchet_sdk/utils/serialization.py +15 -0
  82. hatchet_sdk/utils/tracing.py +67 -0
  83. hatchet_sdk/worker/runner/runner.py +158 -112
  84. hatchet_sdk/worker/worker.py +1 -17
  85. hatchet_sdk/workflow.py +4 -0
  86. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/METADATA +8 -2
  87. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/RECORD +89 -143
  88. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/entry_points.txt +1 -1
  89. hatchet_sdk/clients/cloud_rest/__init__.py +0 -186
  90. hatchet_sdk/clients/cloud_rest/api/__init__.py +0 -14
  91. hatchet_sdk/clients/cloud_rest/api/billing_api.py +0 -819
  92. hatchet_sdk/clients/cloud_rest/api/build_api.py +0 -298
  93. hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +0 -295
  94. hatchet_sdk/clients/cloud_rest/api/github_api.py +0 -1347
  95. hatchet_sdk/clients/cloud_rest/api/log_api.py +0 -971
  96. hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +0 -2546
  97. hatchet_sdk/clients/cloud_rest/api/metadata_api.py +0 -265
  98. hatchet_sdk/clients/cloud_rest/api/metrics_api.py +0 -1026
  99. hatchet_sdk/clients/cloud_rest/api/tenant_api.py +0 -301
  100. hatchet_sdk/clients/cloud_rest/api/user_api.py +0 -473
  101. hatchet_sdk/clients/cloud_rest/api/workflow_api.py +0 -369
  102. hatchet_sdk/clients/cloud_rest/api_client.py +0 -727
  103. hatchet_sdk/clients/cloud_rest/api_response.py +0 -22
  104. hatchet_sdk/clients/cloud_rest/configuration.py +0 -488
  105. hatchet_sdk/clients/cloud_rest/exceptions.py +0 -200
  106. hatchet_sdk/clients/cloud_rest/models/__init__.py +0 -157
  107. hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +0 -85
  108. hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +0 -121
  109. hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +0 -86
  110. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +0 -119
  111. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +0 -95
  112. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +0 -98
  113. hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +0 -86
  114. hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +0 -107
  115. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +0 -136
  116. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +0 -83
  117. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +0 -100
  118. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +0 -86
  119. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +0 -83
  120. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +0 -128
  121. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +0 -121
  122. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +0 -166
  123. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +0 -119
  124. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +0 -117
  125. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +0 -119
  126. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +0 -113
  127. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +0 -154
  128. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +0 -151
  129. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +0 -109
  130. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +0 -171
  131. hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +0 -131
  132. hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +0 -101
  133. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +0 -105
  134. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +0 -102
  135. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +0 -108
  136. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +0 -102
  137. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +0 -113
  138. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +0 -93
  139. hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +0 -83
  140. hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +0 -114
  141. hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +0 -88
  142. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +0 -170
  143. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +0 -137
  144. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +0 -103
  145. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +0 -114
  146. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +0 -107
  147. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +0 -105
  148. hatchet_sdk/clients/cloud_rest/rest.py +0 -182
  149. hatchet_sdk/compute/__init__.py +0 -0
  150. hatchet_sdk/compute/configs.py +0 -34
  151. hatchet_sdk/compute/managed_compute.py +0 -111
  152. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/WHEEL +0 -0
@@ -81,7 +81,7 @@ class RESTClientObject:
81
81
  self.retry_client = aiohttp_retry.RetryClient(
82
82
  client_session=self.pool_manager,
83
83
  retry_options=aiohttp_retry.ExponentialRetry(
84
- attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0
84
+ attempts=retries, factor=2.0, start_timeout=0.1, max_timeout=120.0
85
85
  ),
86
86
  )
87
87
  else:
@@ -164,10 +164,10 @@ class RESTClientObject:
164
164
  data.add_field(k, v)
165
165
  args["data"] = data
166
166
 
167
- # Pass a `bytes` parameter directly in the body to support
167
+ # Pass a `bytes` or `str` parameter directly in the body to support
168
168
  # other content types than Json when `body` argument is provided
169
169
  # in serialized form
170
- elif isinstance(body, bytes):
170
+ elif isinstance(body, str) or isinstance(body, bytes):
171
171
  args["data"] = body
172
172
  else:
173
173
  # Cannot generate the request from given parameters
@@ -1,13 +1,11 @@
1
1
  import asyncio
2
2
  import atexit
3
+ import datetime
3
4
  import threading
4
- from typing import Any
5
+ from typing import Any, Coroutine, List
6
+
7
+ from pydantic import StrictInt
5
8
 
6
- from hatchet_sdk.clients.cloud_rest.api.managed_worker_api import ManagedWorkerApi
7
- from hatchet_sdk.clients.cloud_rest.api_client import ApiClient as CloudApiClient
8
- from hatchet_sdk.clients.cloud_rest.configuration import (
9
- Configuration as CloudConfiguration,
10
- )
11
9
  from hatchet_sdk.clients.rest.api.event_api import EventApi
12
10
  from hatchet_sdk.clients.rest.api.log_api import LogApi
13
11
  from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
@@ -17,6 +15,13 @@ from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
17
15
  from hatchet_sdk.clients.rest.api_client import ApiClient
18
16
  from hatchet_sdk.clients.rest.configuration import Configuration
19
17
  from hatchet_sdk.clients.rest.models import TriggerWorkflowRunRequest
18
+ from hatchet_sdk.clients.rest.models.create_cron_workflow_trigger_request import (
19
+ CreateCronWorkflowTriggerRequest,
20
+ )
21
+ from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
22
+ from hatchet_sdk.clients.rest.models.cron_workflows_order_by_field import (
23
+ CronWorkflowsOrderByField,
24
+ )
20
25
  from hatchet_sdk.clients.rest.models.event_list import EventList
21
26
  from hatchet_sdk.clients.rest.models.event_order_by_direction import (
22
27
  EventOrderByDirection,
@@ -35,6 +40,13 @@ from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import (
35
40
  from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import (
36
41
  ReplayWorkflowRunsResponse,
37
42
  )
43
+ from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
44
+ ScheduleWorkflowRunRequest,
45
+ )
46
+ from hatchet_sdk.clients.rest.models.scheduled_workflows import ScheduledWorkflows
47
+ from hatchet_sdk.clients.rest.models.scheduled_workflows_order_by_field import (
48
+ ScheduledWorkflowsOrderByField,
49
+ )
38
50
  from hatchet_sdk.clients.rest.models.workflow import Workflow
39
51
  from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind
40
52
  from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList
@@ -65,15 +77,7 @@ class AsyncRestApi:
65
77
  access_token=api_key,
66
78
  )
67
79
 
68
- self.cloud_config = CloudConfiguration(
69
- host=host,
70
- access_token=api_key,
71
- )
72
-
73
80
  self._api_client = None
74
- self._cloud_api_client = None
75
- self._managed_worker_api = None
76
-
77
81
  self._workflow_api = None
78
82
  self._workflow_run_api = None
79
83
  self._step_run_api = None
@@ -84,15 +88,8 @@ class AsyncRestApi:
84
88
  def api_client(self):
85
89
  if self._api_client is None:
86
90
  self._api_client = ApiClient(configuration=self.config)
87
- self._cloud_api_client = CloudApiClient(configuration=self.cloud_config)
88
91
  return self._api_client
89
92
 
90
- @property
91
- def managed_worker_api(self):
92
- if self._managed_worker_api is None:
93
- self._managed_worker_api = ManagedWorkerApi(self.api_client)
94
- return self._managed_worker_api
95
-
96
93
  @property
97
94
  def workflow_api(self):
98
95
  if self._workflow_api is None:
@@ -223,9 +220,112 @@ class AsyncRestApi:
223
220
  version=version,
224
221
  trigger_workflow_run_request=TriggerWorkflowRunRequest(
225
222
  input=input,
223
+ additional_metadata=additional_metadata,
224
+ ),
225
+ )
226
+
227
+ async def cron_create(
228
+ self,
229
+ workflow_name: str,
230
+ cron_name: str,
231
+ expression: str,
232
+ input: dict[str, Any],
233
+ additional_metadata: dict[str, str],
234
+ ):
235
+ return await self.workflow_run_api.cron_workflow_trigger_create(
236
+ tenant=self.tenant_id,
237
+ workflow=workflow_name,
238
+ create_cron_workflow_trigger_request=CreateCronWorkflowTriggerRequest(
239
+ cronName=cron_name,
240
+ expression=expression,
241
+ input=input,
242
+ additional_metadata=additional_metadata,
243
+ ),
244
+ )
245
+
246
+ async def cron_delete(self, cron_trigger_id: str):
247
+ return await self.workflow_api.workflow_cron_delete(
248
+ tenant=self.tenant_id,
249
+ cron_workflow=cron_trigger_id,
250
+ )
251
+
252
+ async def cron_list(
253
+ self,
254
+ offset: StrictInt | None = None,
255
+ limit: StrictInt | None = None,
256
+ workflow_id: str | None = None,
257
+ additional_metadata: list[str] | None = None,
258
+ order_by_field: CronWorkflowsOrderByField | None = None,
259
+ order_by_direction: WorkflowRunOrderByDirection | None = None,
260
+ ):
261
+ return await self.workflow_api.cron_workflow_list(
262
+ tenant=self.tenant_id,
263
+ offset=offset,
264
+ limit=limit,
265
+ workflow_id=workflow_id,
266
+ additional_metadata=additional_metadata,
267
+ order_by_field=order_by_field,
268
+ order_by_direction=order_by_direction,
269
+ )
270
+
271
+ async def cron_get(self, cron_trigger_id: str):
272
+ return await self.workflow_api.workflow_cron_get(
273
+ tenant=self.tenant_id,
274
+ cron_workflow=cron_trigger_id,
275
+ )
276
+
277
+ async def schedule_create(
278
+ self,
279
+ name: str,
280
+ trigger_at: datetime.datetime,
281
+ input: dict[str, Any],
282
+ additional_metadata: dict[str, str],
283
+ ):
284
+ return await self.workflow_run_api.scheduled_workflow_run_create(
285
+ tenant=self.tenant_id,
286
+ workflow=name,
287
+ create_schedule_workflow_trigger_request=ScheduleWorkflowRunRequest(
288
+ triggerAt=trigger_at,
289
+ input=input,
290
+ additional_metadata=additional_metadata,
226
291
  ),
227
292
  )
228
293
 
294
+ async def schedule_delete(self, scheduled_trigger_id: str):
295
+ return await self.workflow_api.workflow_scheduled_delete(
296
+ tenant=self.tenant_id,
297
+ scheduled_workflow_run=scheduled_trigger_id,
298
+ )
299
+
300
+ async def schedule_list(
301
+ self,
302
+ offset: StrictInt | None = None,
303
+ limit: StrictInt | None = None,
304
+ workflow_id: str | None = None,
305
+ additional_metadata: list[str] | None = None,
306
+ parent_workflow_run_id: str | None = None,
307
+ parent_step_run_id: str | None = None,
308
+ order_by_field: ScheduledWorkflowsOrderByField | None = None,
309
+ order_by_direction: WorkflowRunOrderByDirection | None = None,
310
+ ):
311
+ return await self.workflow_api.workflow_scheduled_list(
312
+ tenant=self.tenant_id,
313
+ offset=offset,
314
+ limit=limit,
315
+ workflow_id=workflow_id,
316
+ parent_workflow_run_id=parent_workflow_run_id,
317
+ parent_step_run_id=parent_step_run_id,
318
+ additional_metadata=additional_metadata,
319
+ order_by_field=order_by_field,
320
+ order_by_direction=order_by_direction,
321
+ )
322
+
323
+ async def schedule_get(self, scheduled_trigger_id: str):
324
+ return await self.workflow_api.workflow_scheduled_get(
325
+ tenant=self.tenant_id,
326
+ scheduled_workflow_run=scheduled_trigger_id,
327
+ )
328
+
229
329
  async def list_logs(
230
330
  self,
231
331
  step_run_id: str,
@@ -380,6 +480,85 @@ class RestApi:
380
480
  )
381
481
  )
382
482
 
483
+ def cron_create(
484
+ self,
485
+ workflow_name: str,
486
+ cron_name: str,
487
+ expression: str,
488
+ input: dict[str, Any],
489
+ additional_metadata: dict[str, str],
490
+ ) -> CronWorkflows:
491
+ return self._run_coroutine(
492
+ self.aio.cron_create(
493
+ workflow_name, cron_name, expression, input, additional_metadata
494
+ )
495
+ )
496
+
497
+ def cron_delete(self, cron_trigger_id: str):
498
+ return self._run_coroutine(self.aio.cron_delete(cron_trigger_id))
499
+
500
+ def cron_list(
501
+ self,
502
+ offset: int | None = None,
503
+ limit: int | None = None,
504
+ workflow_id: str | None = None,
505
+ additional_metadata: list[str] | None = None,
506
+ order_by_field: CronWorkflowsOrderByField | None = None,
507
+ order_by_direction: WorkflowRunOrderByDirection | None = None,
508
+ ):
509
+ return self._run_coroutine(
510
+ self.aio.cron_list(
511
+ offset,
512
+ limit,
513
+ workflow_id,
514
+ additional_metadata,
515
+ order_by_field,
516
+ order_by_direction,
517
+ )
518
+ )
519
+
520
+ def cron_get(self, cron_trigger_id: str):
521
+ return self._run_coroutine(self.aio.cron_get(cron_trigger_id))
522
+
523
+ def schedule_create(
524
+ self,
525
+ workflow_name: str,
526
+ trigger_at: datetime.datetime,
527
+ input: dict[str, Any],
528
+ additional_metadata: dict[str, str],
529
+ ):
530
+ return self._run_coroutine(
531
+ self.aio.schedule_create(
532
+ workflow_name, trigger_at, input, additional_metadata
533
+ )
534
+ )
535
+
536
+ def schedule_delete(self, scheduled_trigger_id: str):
537
+ return self._run_coroutine(self.aio.schedule_delete(scheduled_trigger_id))
538
+
539
+ def schedule_list(
540
+ self,
541
+ offset: int | None = None,
542
+ limit: int | None = None,
543
+ workflow_id: str | None = None,
544
+ additional_metadata: list[str] | None = None,
545
+ order_by_field: CronWorkflowsOrderByField | None = None,
546
+ order_by_direction: WorkflowRunOrderByDirection | None = None,
547
+ ):
548
+ return self._run_coroutine(
549
+ self.aio.schedule_list(
550
+ offset,
551
+ limit,
552
+ workflow_id,
553
+ additional_metadata,
554
+ order_by_field,
555
+ order_by_direction,
556
+ )
557
+ )
558
+
559
+ def schedule_get(self, scheduled_trigger_id: str):
560
+ return self._run_coroutine(self.aio.schedule_get(scheduled_trigger_id))
561
+
383
562
  def list_logs(
384
563
  self,
385
564
  step_run_id: str,
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
15
15
  from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
16
16
 
17
17
 
18
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64ispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"V\n\x0cWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValue\"\x88\x02\n\x15WorkerRegisterRequest\x12\x12\n\nworkerName\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x14\n\x07maxRuns\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x16\n\twebhookId\x18\x06 \x01(\tH\x01\x88\x01\x01\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\x42\n\n\x08_maxRunsB\x0c\n\n_webhookId\"P\n\x16WorkerRegisterResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\x12\x12\n\nworkerName\x18\x03 \x01(\t\"\xa3\x01\n\x19UpsertWorkerLabelsRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.UpsertWorkerLabelsRequest.LabelsEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\"@\n\x1aUpsertWorkerLabelsResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\x86\x04\n\x0e\x41ssignedAction\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\r\n\x05jobId\x18\x04 \x01(\t\x12\x0f\n\x07jobName\x18\x05 \x01(\t\x12\x10\n\x08jobRunId\x18\x06 \x01(\t\x12\x0e\n\x06stepId\x18\x07 \x01(\t\x12\x11\n\tstepRunId\x18\x08 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\t \x01(\t\x12\x1f\n\nactionType\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x15\n\ractionPayload\x18\x0b \x01(\t\x12\x10\n\x08stepName\x18\x0c \x01(\t\x12\x12\n\nretryCount\x18\r \x01(\x05\x12 \n\x13\x61\x64\x64itional_metadata\x18\x0e \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63hild_workflow_index\x18\x0f \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x12\x63hild_workflow_key\x18\x10 \x01(\tH\x02\x88\x01\x01\x12#\n\x16parent_workflow_run_id\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x16\n\x14_additional_metadataB\x17\n\x15_child_workflow_indexB\x15\n\x13_child_workflow_keyB\x19\n\x17_parent_workflow_run_id\"\'\n\x13WorkerListenRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\",\n\x18WorkerUnsubscribeRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\"?\n\x19WorkerUnsubscribeResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xe1\x01\n\x13GroupKeyActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\teventType\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x14\n\x0c\x65ventPayload\x18\x07 \x01(\t\"\xec\x01\n\x0fStepActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\r\n\x05jobId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x0e\n\x06stepId\x18\x04 \x01(\t\x12\x11\n\tstepRunId\x18\x05 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x06 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\teventType\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x14\n\x0c\x65ventPayload\x18\t \x01(\t\"9\n\x13\x41\x63tionEventResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xc0\x01\n SubscribeToWorkflowEventsRequest\x12\x1a\n\rworkflowRunId\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11\x61\x64\x64itionalMetaKey\x18\x02 \x01(\tH\x01\x88\x01\x01\x12 \n\x13\x61\x64\x64itionalMetaValue\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x10\n\x0e_workflowRunIdB\x14\n\x12_additionalMetaKeyB\x16\n\x14_additionalMetaValue\"7\n\x1eSubscribeToWorkflowRunsRequest\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\"\xb2\x02\n\rWorkflowEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12#\n\x0cresourceType\x18\x02 \x01(\x0e\x32\r.ResourceType\x12%\n\teventType\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x12\n\nresourceId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65ventPayload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x18\n\x0bstepRetries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nretryCount\x18\t \x01(\x05H\x01\x88\x01\x01\x42\x0e\n\x0c_stepRetriesB\r\n\x0b_retryCount\"\xa8\x01\n\x10WorkflowRunEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12(\n\teventType\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x8a\x01\n\rStepRunResult\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x16\n\x0estepReadableId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_errorB\t\n\x07_output\"W\n\rOverridesData\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61llerFilename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"U\n\x10HeartbeatRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12/\n\x0bheartbeatAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"F\n\x15RefreshTimeoutRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x1a\n\x12incrementTimeoutBy\x18\x02 \x01(\t\"G\n\x16RefreshTimeoutResponse\x12-\n\ttimeoutAt\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\'\n\x12ReleaseSlotRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse*N\n\nActionType\x12\x12\n\x0eSTART_STEP_RUN\x10\x00\x12\x13\n\x0f\x43\x41NCEL_STEP_RUN\x10\x01\x12\x17\n\x13START_GET_GROUP_KEY\x10\x02*\xa2\x01\n\x17GroupKeyActionEventType\x12 \n\x1cGROUP_KEY_EVENT_TYPE_UNKNOWN\x10\x00\x12 \n\x1cGROUP_KEY_EVENT_TYPE_STARTED\x10\x01\x12\"\n\x1eGROUP_KEY_EVENT_TYPE_COMPLETED\x10\x02\x12\x1f\n\x1bGROUP_KEY_EVENT_TYPE_FAILED\x10\x03*\xac\x01\n\x13StepActionEventType\x12\x1b\n\x17STEP_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1b\n\x17STEP_EVENT_TYPE_STARTED\x10\x01\x12\x1d\n\x19STEP_EVENT_TYPE_COMPLETED\x10\x02\x12\x1a\n\x16STEP_EVENT_TYPE_FAILED\x10\x03\x12 \n\x1cSTEP_EVENT_TYPE_ACKNOWLEDGED\x10\x04*e\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\x1a\n\x16RESOURCE_TYPE_STEP_RUN\x10\x01\x12\x1e\n\x1aRESOURCE_TYPE_WORKFLOW_RUN\x10\x02*\xfe\x01\n\x11ResourceEventType\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_STARTED\x10\x01\x12!\n\x1dRESOURCE_EVENT_TYPE_COMPLETED\x10\x02\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_FAILED\x10\x03\x12!\n\x1dRESOURCE_EVENT_TYPE_CANCELLED\x10\x04\x12!\n\x1dRESOURCE_EVENT_TYPE_TIMED_OUT\x10\x05\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_STREAM\x10\x06*<\n\x14WorkflowRunEventType\x12$\n WORKFLOW_RUN_EVENT_TYPE_FINISHED\x10\x00\x32\xf8\x06\n\nDispatcher\x12=\n\x08Register\x12\x16.WorkerRegisterRequest\x1a\x17.WorkerRegisterResponse\"\x00\x12\x33\n\x06Listen\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x35\n\x08ListenV2\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x34\n\tHeartbeat\x12\x11.HeartbeatRequest\x1a\x12.HeartbeatResponse\"\x00\x12R\n\x19SubscribeToWorkflowEvents\x12!.SubscribeToWorkflowEventsRequest\x1a\x0e.WorkflowEvent\"\x00\x30\x01\x12S\n\x17SubscribeToWorkflowRuns\x12\x1f.SubscribeToWorkflowRunsRequest\x1a\x11.WorkflowRunEvent\"\x00(\x01\x30\x01\x12?\n\x13SendStepActionEvent\x12\x10.StepActionEvent\x1a\x14.ActionEventResponse\"\x00\x12G\n\x17SendGroupKeyActionEvent\x12\x14.GroupKeyActionEvent\x1a\x14.ActionEventResponse\"\x00\x12<\n\x10PutOverridesData\x12\x0e.OverridesData\x1a\x16.OverridesDataResponse\"\x00\x12\x46\n\x0bUnsubscribe\x12\x19.WorkerUnsubscribeRequest\x1a\x1a.WorkerUnsubscribeResponse\"\x00\x12\x43\n\x0eRefreshTimeout\x12\x16.RefreshTimeoutRequest\x1a\x17.RefreshTimeoutResponse\"\x00\x12:\n\x0bReleaseSlot\x12\x13.ReleaseSlotRequest\x1a\x14.ReleaseSlotResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3')
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64ispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"V\n\x0cWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValue\"\xc8\x01\n\x0bRuntimeInfo\x12\x17\n\nsdkVersion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x08language\x18\x02 \x01(\x0e\x32\x05.SDKSH\x01\x88\x01\x01\x12\x1c\n\x0flanguageVersion\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x0f\n\x02os\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05\x65xtra\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\r\n\x0b_sdkVersionB\x0b\n\t_languageB\x12\n\x10_languageVersionB\x05\n\x03_osB\x08\n\x06_extra\"\xc0\x02\n\x15WorkerRegisterRequest\x12\x12\n\nworkerName\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x14\n\x07maxRuns\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x16\n\twebhookId\x18\x06 \x01(\tH\x01\x88\x01\x01\x12&\n\x0bruntimeInfo\x18\x07 \x01(\x0b\x32\x0c.RuntimeInfoH\x02\x88\x01\x01\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\x42\n\n\x08_maxRunsB\x0c\n\n_webhookIdB\x0e\n\x0c_runtimeInfo\"P\n\x16WorkerRegisterResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\x12\x12\n\nworkerName\x18\x03 \x01(\t\"\xa3\x01\n\x19UpsertWorkerLabelsRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.UpsertWorkerLabelsRequest.LabelsEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\"@\n\x1aUpsertWorkerLabelsResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\x86\x04\n\x0e\x41ssignedAction\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\r\n\x05jobId\x18\x04 \x01(\t\x12\x0f\n\x07jobName\x18\x05 \x01(\t\x12\x10\n\x08jobRunId\x18\x06 \x01(\t\x12\x0e\n\x06stepId\x18\x07 \x01(\t\x12\x11\n\tstepRunId\x18\x08 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\t \x01(\t\x12\x1f\n\nactionType\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x15\n\ractionPayload\x18\x0b \x01(\t\x12\x10\n\x08stepName\x18\x0c \x01(\t\x12\x12\n\nretryCount\x18\r \x01(\x05\x12 \n\x13\x61\x64\x64itional_metadata\x18\x0e \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63hild_workflow_index\x18\x0f \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x12\x63hild_workflow_key\x18\x10 \x01(\tH\x02\x88\x01\x01\x12#\n\x16parent_workflow_run_id\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x16\n\x14_additional_metadataB\x17\n\x15_child_workflow_indexB\x15\n\x13_child_workflow_keyB\x19\n\x17_parent_workflow_run_id\"\'\n\x13WorkerListenRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\",\n\x18WorkerUnsubscribeRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\"?\n\x19WorkerUnsubscribeResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xe1\x01\n\x13GroupKeyActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\teventType\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x14\n\x0c\x65ventPayload\x18\x07 \x01(\t\"\xec\x01\n\x0fStepActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\r\n\x05jobId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x0e\n\x06stepId\x18\x04 \x01(\t\x12\x11\n\tstepRunId\x18\x05 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x06 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\teventType\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x14\n\x0c\x65ventPayload\x18\t \x01(\t\"9\n\x13\x41\x63tionEventResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xc0\x01\n SubscribeToWorkflowEventsRequest\x12\x1a\n\rworkflowRunId\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11\x61\x64\x64itionalMetaKey\x18\x02 \x01(\tH\x01\x88\x01\x01\x12 \n\x13\x61\x64\x64itionalMetaValue\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x10\n\x0e_workflowRunIdB\x14\n\x12_additionalMetaKeyB\x16\n\x14_additionalMetaValue\"7\n\x1eSubscribeToWorkflowRunsRequest\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\"\xb2\x02\n\rWorkflowEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12#\n\x0cresourceType\x18\x02 \x01(\x0e\x32\r.ResourceType\x12%\n\teventType\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x12\n\nresourceId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65ventPayload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x18\n\x0bstepRetries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nretryCount\x18\t \x01(\x05H\x01\x88\x01\x01\x42\x0e\n\x0c_stepRetriesB\r\n\x0b_retryCount\"\xa8\x01\n\x10WorkflowRunEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12(\n\teventType\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x8a\x01\n\rStepRunResult\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x16\n\x0estepReadableId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_errorB\t\n\x07_output\"W\n\rOverridesData\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61llerFilename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"U\n\x10HeartbeatRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12/\n\x0bheartbeatAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"F\n\x15RefreshTimeoutRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x1a\n\x12incrementTimeoutBy\x18\x02 \x01(\t\"G\n\x16RefreshTimeoutResponse\x12-\n\ttimeoutAt\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\'\n\x12ReleaseSlotRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse*7\n\x04SDKS\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x06\n\x02GO\x10\x01\x12\n\n\x06PYTHON\x10\x02\x12\x0e\n\nTYPESCRIPT\x10\x03*N\n\nActionType\x12\x12\n\x0eSTART_STEP_RUN\x10\x00\x12\x13\n\x0f\x43\x41NCEL_STEP_RUN\x10\x01\x12\x17\n\x13START_GET_GROUP_KEY\x10\x02*\xa2\x01\n\x17GroupKeyActionEventType\x12 \n\x1cGROUP_KEY_EVENT_TYPE_UNKNOWN\x10\x00\x12 \n\x1cGROUP_KEY_EVENT_TYPE_STARTED\x10\x01\x12\"\n\x1eGROUP_KEY_EVENT_TYPE_COMPLETED\x10\x02\x12\x1f\n\x1bGROUP_KEY_EVENT_TYPE_FAILED\x10\x03*\xac\x01\n\x13StepActionEventType\x12\x1b\n\x17STEP_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1b\n\x17STEP_EVENT_TYPE_STARTED\x10\x01\x12\x1d\n\x19STEP_EVENT_TYPE_COMPLETED\x10\x02\x12\x1a\n\x16STEP_EVENT_TYPE_FAILED\x10\x03\x12 \n\x1cSTEP_EVENT_TYPE_ACKNOWLEDGED\x10\x04*e\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\x1a\n\x16RESOURCE_TYPE_STEP_RUN\x10\x01\x12\x1e\n\x1aRESOURCE_TYPE_WORKFLOW_RUN\x10\x02*\xfe\x01\n\x11ResourceEventType\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_STARTED\x10\x01\x12!\n\x1dRESOURCE_EVENT_TYPE_COMPLETED\x10\x02\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_FAILED\x10\x03\x12!\n\x1dRESOURCE_EVENT_TYPE_CANCELLED\x10\x04\x12!\n\x1dRESOURCE_EVENT_TYPE_TIMED_OUT\x10\x05\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_STREAM\x10\x06*<\n\x14WorkflowRunEventType\x12$\n WORKFLOW_RUN_EVENT_TYPE_FINISHED\x10\x00\x32\xf8\x06\n\nDispatcher\x12=\n\x08Register\x12\x16.WorkerRegisterRequest\x1a\x17.WorkerRegisterResponse\"\x00\x12\x33\n\x06Listen\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x35\n\x08ListenV2\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x34\n\tHeartbeat\x12\x11.HeartbeatRequest\x1a\x12.HeartbeatResponse\"\x00\x12R\n\x19SubscribeToWorkflowEvents\x12!.SubscribeToWorkflowEventsRequest\x1a\x0e.WorkflowEvent\"\x00\x30\x01\x12S\n\x17SubscribeToWorkflowRuns\x12\x1f.SubscribeToWorkflowRunsRequest\x1a\x11.WorkflowRunEvent\"\x00(\x01\x30\x01\x12?\n\x13SendStepActionEvent\x12\x10.StepActionEvent\x1a\x14.ActionEventResponse\"\x00\x12G\n\x17SendGroupKeyActionEvent\x12\x14.GroupKeyActionEvent\x1a\x14.ActionEventResponse\"\x00\x12<\n\x10PutOverridesData\x12\x0e.OverridesData\x1a\x16.OverridesDataResponse\"\x00\x12\x46\n\x0bUnsubscribe\x12\x19.WorkerUnsubscribeRequest\x1a\x1a.WorkerUnsubscribeResponse\"\x00\x12\x43\n\x0eRefreshTimeout\x12\x16.RefreshTimeoutRequest\x1a\x17.RefreshTimeoutResponse\"\x00\x12:\n\x0bReleaseSlot\x12\x13.ReleaseSlotRequest\x1a\x14.ReleaseSlotResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3')
19
19
 
20
20
  _globals = globals()
21
21
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -27,72 +27,76 @@ if _descriptor._USE_C_DESCRIPTORS == False:
27
27
  _globals['_WORKERREGISTERREQUEST_LABELSENTRY']._serialized_options = b'8\001'
28
28
  _globals['_UPSERTWORKERLABELSREQUEST_LABELSENTRY']._options = None
29
29
  _globals['_UPSERTWORKERLABELSREQUEST_LABELSENTRY']._serialized_options = b'8\001'
30
- _globals['_ACTIONTYPE']._serialized_start=3225
31
- _globals['_ACTIONTYPE']._serialized_end=3303
32
- _globals['_GROUPKEYACTIONEVENTTYPE']._serialized_start=3306
33
- _globals['_GROUPKEYACTIONEVENTTYPE']._serialized_end=3468
34
- _globals['_STEPACTIONEVENTTYPE']._serialized_start=3471
35
- _globals['_STEPACTIONEVENTTYPE']._serialized_end=3643
36
- _globals['_RESOURCETYPE']._serialized_start=3645
37
- _globals['_RESOURCETYPE']._serialized_end=3746
38
- _globals['_RESOURCEEVENTTYPE']._serialized_start=3749
39
- _globals['_RESOURCEEVENTTYPE']._serialized_end=4003
40
- _globals['_WORKFLOWRUNEVENTTYPE']._serialized_start=4005
41
- _globals['_WORKFLOWRUNEVENTTYPE']._serialized_end=4065
30
+ _globals['_SDKS']._serialized_start=3484
31
+ _globals['_SDKS']._serialized_end=3539
32
+ _globals['_ACTIONTYPE']._serialized_start=3541
33
+ _globals['_ACTIONTYPE']._serialized_end=3619
34
+ _globals['_GROUPKEYACTIONEVENTTYPE']._serialized_start=3622
35
+ _globals['_GROUPKEYACTIONEVENTTYPE']._serialized_end=3784
36
+ _globals['_STEPACTIONEVENTTYPE']._serialized_start=3787
37
+ _globals['_STEPACTIONEVENTTYPE']._serialized_end=3959
38
+ _globals['_RESOURCETYPE']._serialized_start=3961
39
+ _globals['_RESOURCETYPE']._serialized_end=4062
40
+ _globals['_RESOURCEEVENTTYPE']._serialized_start=4065
41
+ _globals['_RESOURCEEVENTTYPE']._serialized_end=4319
42
+ _globals['_WORKFLOWRUNEVENTTYPE']._serialized_start=4321
43
+ _globals['_WORKFLOWRUNEVENTTYPE']._serialized_end=4381
42
44
  _globals['_WORKERLABELS']._serialized_start=53
43
45
  _globals['_WORKERLABELS']._serialized_end=139
44
- _globals['_WORKERREGISTERREQUEST']._serialized_start=142
45
- _globals['_WORKERREGISTERREQUEST']._serialized_end=406
46
- _globals['_WORKERREGISTERREQUEST_LABELSENTRY']._serialized_start=320
47
- _globals['_WORKERREGISTERREQUEST_LABELSENTRY']._serialized_end=380
48
- _globals['_WORKERREGISTERRESPONSE']._serialized_start=408
49
- _globals['_WORKERREGISTERRESPONSE']._serialized_end=488
50
- _globals['_UPSERTWORKERLABELSREQUEST']._serialized_start=491
51
- _globals['_UPSERTWORKERLABELSREQUEST']._serialized_end=654
52
- _globals['_UPSERTWORKERLABELSREQUEST_LABELSENTRY']._serialized_start=320
53
- _globals['_UPSERTWORKERLABELSREQUEST_LABELSENTRY']._serialized_end=380
54
- _globals['_UPSERTWORKERLABELSRESPONSE']._serialized_start=656
55
- _globals['_UPSERTWORKERLABELSRESPONSE']._serialized_end=720
56
- _globals['_ASSIGNEDACTION']._serialized_start=723
57
- _globals['_ASSIGNEDACTION']._serialized_end=1241
58
- _globals['_WORKERLISTENREQUEST']._serialized_start=1243
59
- _globals['_WORKERLISTENREQUEST']._serialized_end=1282
60
- _globals['_WORKERUNSUBSCRIBEREQUEST']._serialized_start=1284
61
- _globals['_WORKERUNSUBSCRIBEREQUEST']._serialized_end=1328
62
- _globals['_WORKERUNSUBSCRIBERESPONSE']._serialized_start=1330
63
- _globals['_WORKERUNSUBSCRIBERESPONSE']._serialized_end=1393
64
- _globals['_GROUPKEYACTIONEVENT']._serialized_start=1396
65
- _globals['_GROUPKEYACTIONEVENT']._serialized_end=1621
66
- _globals['_STEPACTIONEVENT']._serialized_start=1624
67
- _globals['_STEPACTIONEVENT']._serialized_end=1860
68
- _globals['_ACTIONEVENTRESPONSE']._serialized_start=1862
69
- _globals['_ACTIONEVENTRESPONSE']._serialized_end=1919
70
- _globals['_SUBSCRIBETOWORKFLOWEVENTSREQUEST']._serialized_start=1922
71
- _globals['_SUBSCRIBETOWORKFLOWEVENTSREQUEST']._serialized_end=2114
72
- _globals['_SUBSCRIBETOWORKFLOWRUNSREQUEST']._serialized_start=2116
73
- _globals['_SUBSCRIBETOWORKFLOWRUNSREQUEST']._serialized_end=2171
74
- _globals['_WORKFLOWEVENT']._serialized_start=2174
75
- _globals['_WORKFLOWEVENT']._serialized_end=2480
76
- _globals['_WORKFLOWRUNEVENT']._serialized_start=2483
77
- _globals['_WORKFLOWRUNEVENT']._serialized_end=2651
78
- _globals['_STEPRUNRESULT']._serialized_start=2654
79
- _globals['_STEPRUNRESULT']._serialized_end=2792
80
- _globals['_OVERRIDESDATA']._serialized_start=2794
81
- _globals['_OVERRIDESDATA']._serialized_end=2881
82
- _globals['_OVERRIDESDATARESPONSE']._serialized_start=2883
83
- _globals['_OVERRIDESDATARESPONSE']._serialized_end=2906
84
- _globals['_HEARTBEATREQUEST']._serialized_start=2908
85
- _globals['_HEARTBEATREQUEST']._serialized_end=2993
86
- _globals['_HEARTBEATRESPONSE']._serialized_start=2995
87
- _globals['_HEARTBEATRESPONSE']._serialized_end=3014
88
- _globals['_REFRESHTIMEOUTREQUEST']._serialized_start=3016
89
- _globals['_REFRESHTIMEOUTREQUEST']._serialized_end=3086
90
- _globals['_REFRESHTIMEOUTRESPONSE']._serialized_start=3088
91
- _globals['_REFRESHTIMEOUTRESPONSE']._serialized_end=3159
92
- _globals['_RELEASESLOTREQUEST']._serialized_start=3161
93
- _globals['_RELEASESLOTREQUEST']._serialized_end=3200
94
- _globals['_RELEASESLOTRESPONSE']._serialized_start=3202
95
- _globals['_RELEASESLOTRESPONSE']._serialized_end=3223
96
- _globals['_DISPATCHER']._serialized_start=4068
97
- _globals['_DISPATCHER']._serialized_end=4956
46
+ _globals['_RUNTIMEINFO']._serialized_start=142
47
+ _globals['_RUNTIMEINFO']._serialized_end=342
48
+ _globals['_WORKERREGISTERREQUEST']._serialized_start=345
49
+ _globals['_WORKERREGISTERREQUEST']._serialized_end=665
50
+ _globals['_WORKERREGISTERREQUEST_LABELSENTRY']._serialized_start=563
51
+ _globals['_WORKERREGISTERREQUEST_LABELSENTRY']._serialized_end=623
52
+ _globals['_WORKERREGISTERRESPONSE']._serialized_start=667
53
+ _globals['_WORKERREGISTERRESPONSE']._serialized_end=747
54
+ _globals['_UPSERTWORKERLABELSREQUEST']._serialized_start=750
55
+ _globals['_UPSERTWORKERLABELSREQUEST']._serialized_end=913
56
+ _globals['_UPSERTWORKERLABELSREQUEST_LABELSENTRY']._serialized_start=563
57
+ _globals['_UPSERTWORKERLABELSREQUEST_LABELSENTRY']._serialized_end=623
58
+ _globals['_UPSERTWORKERLABELSRESPONSE']._serialized_start=915
59
+ _globals['_UPSERTWORKERLABELSRESPONSE']._serialized_end=979
60
+ _globals['_ASSIGNEDACTION']._serialized_start=982
61
+ _globals['_ASSIGNEDACTION']._serialized_end=1500
62
+ _globals['_WORKERLISTENREQUEST']._serialized_start=1502
63
+ _globals['_WORKERLISTENREQUEST']._serialized_end=1541
64
+ _globals['_WORKERUNSUBSCRIBEREQUEST']._serialized_start=1543
65
+ _globals['_WORKERUNSUBSCRIBEREQUEST']._serialized_end=1587
66
+ _globals['_WORKERUNSUBSCRIBERESPONSE']._serialized_start=1589
67
+ _globals['_WORKERUNSUBSCRIBERESPONSE']._serialized_end=1652
68
+ _globals['_GROUPKEYACTIONEVENT']._serialized_start=1655
69
+ _globals['_GROUPKEYACTIONEVENT']._serialized_end=1880
70
+ _globals['_STEPACTIONEVENT']._serialized_start=1883
71
+ _globals['_STEPACTIONEVENT']._serialized_end=2119
72
+ _globals['_ACTIONEVENTRESPONSE']._serialized_start=2121
73
+ _globals['_ACTIONEVENTRESPONSE']._serialized_end=2178
74
+ _globals['_SUBSCRIBETOWORKFLOWEVENTSREQUEST']._serialized_start=2181
75
+ _globals['_SUBSCRIBETOWORKFLOWEVENTSREQUEST']._serialized_end=2373
76
+ _globals['_SUBSCRIBETOWORKFLOWRUNSREQUEST']._serialized_start=2375
77
+ _globals['_SUBSCRIBETOWORKFLOWRUNSREQUEST']._serialized_end=2430
78
+ _globals['_WORKFLOWEVENT']._serialized_start=2433
79
+ _globals['_WORKFLOWEVENT']._serialized_end=2739
80
+ _globals['_WORKFLOWRUNEVENT']._serialized_start=2742
81
+ _globals['_WORKFLOWRUNEVENT']._serialized_end=2910
82
+ _globals['_STEPRUNRESULT']._serialized_start=2913
83
+ _globals['_STEPRUNRESULT']._serialized_end=3051
84
+ _globals['_OVERRIDESDATA']._serialized_start=3053
85
+ _globals['_OVERRIDESDATA']._serialized_end=3140
86
+ _globals['_OVERRIDESDATARESPONSE']._serialized_start=3142
87
+ _globals['_OVERRIDESDATARESPONSE']._serialized_end=3165
88
+ _globals['_HEARTBEATREQUEST']._serialized_start=3167
89
+ _globals['_HEARTBEATREQUEST']._serialized_end=3252
90
+ _globals['_HEARTBEATRESPONSE']._serialized_start=3254
91
+ _globals['_HEARTBEATRESPONSE']._serialized_end=3273
92
+ _globals['_REFRESHTIMEOUTREQUEST']._serialized_start=3275
93
+ _globals['_REFRESHTIMEOUTREQUEST']._serialized_end=3345
94
+ _globals['_REFRESHTIMEOUTRESPONSE']._serialized_start=3347
95
+ _globals['_REFRESHTIMEOUTRESPONSE']._serialized_end=3418
96
+ _globals['_RELEASESLOTREQUEST']._serialized_start=3420
97
+ _globals['_RELEASESLOTREQUEST']._serialized_end=3459
98
+ _globals['_RELEASESLOTRESPONSE']._serialized_start=3461
99
+ _globals['_RELEASESLOTRESPONSE']._serialized_end=3482
100
+ _globals['_DISPATCHER']._serialized_start=4384
101
+ _globals['_DISPATCHER']._serialized_end=5272
98
102
  # @@protoc_insertion_point(module_scope)
@@ -1,3 +1,5 @@
1
+ # type: ignore
2
+
1
3
  from google.protobuf import timestamp_pb2 as _timestamp_pb2
2
4
  from google.protobuf.internal import containers as _containers
3
5
  from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
@@ -7,6 +9,13 @@ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Map
7
9
 
8
10
  DESCRIPTOR: _descriptor.FileDescriptor
9
11
 
12
+ class SDKS(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
13
+ __slots__ = ()
14
+ UNKNOWN: _ClassVar[SDKS]
15
+ GO: _ClassVar[SDKS]
16
+ PYTHON: _ClassVar[SDKS]
17
+ TYPESCRIPT: _ClassVar[SDKS]
18
+
10
19
  class ActionType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
11
20
  __slots__ = ()
12
21
  START_STEP_RUN: _ClassVar[ActionType]
@@ -47,6 +56,10 @@ class ResourceEventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
47
56
  class WorkflowRunEventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
48
57
  __slots__ = ()
49
58
  WORKFLOW_RUN_EVENT_TYPE_FINISHED: _ClassVar[WorkflowRunEventType]
59
+ UNKNOWN: SDKS
60
+ GO: SDKS
61
+ PYTHON: SDKS
62
+ TYPESCRIPT: SDKS
50
63
  START_STEP_RUN: ActionType
51
64
  CANCEL_STEP_RUN: ActionType
52
65
  START_GET_GROUP_KEY: ActionType
@@ -79,8 +92,22 @@ class WorkerLabels(_message.Message):
79
92
  intValue: int
80
93
  def __init__(self, strValue: _Optional[str] = ..., intValue: _Optional[int] = ...) -> None: ...
81
94
 
95
+ class RuntimeInfo(_message.Message):
96
+ __slots__ = ("sdkVersion", "language", "languageVersion", "os", "extra")
97
+ SDKVERSION_FIELD_NUMBER: _ClassVar[int]
98
+ LANGUAGE_FIELD_NUMBER: _ClassVar[int]
99
+ LANGUAGEVERSION_FIELD_NUMBER: _ClassVar[int]
100
+ OS_FIELD_NUMBER: _ClassVar[int]
101
+ EXTRA_FIELD_NUMBER: _ClassVar[int]
102
+ sdkVersion: str
103
+ language: SDKS
104
+ languageVersion: str
105
+ os: str
106
+ extra: str
107
+ def __init__(self, sdkVersion: _Optional[str] = ..., language: _Optional[_Union[SDKS, str]] = ..., languageVersion: _Optional[str] = ..., os: _Optional[str] = ..., extra: _Optional[str] = ...) -> None: ...
108
+
82
109
  class WorkerRegisterRequest(_message.Message):
83
- __slots__ = ("workerName", "actions", "services", "maxRuns", "labels", "webhookId")
110
+ __slots__ = ("workerName", "actions", "services", "maxRuns", "labels", "webhookId", "runtimeInfo")
84
111
  class LabelsEntry(_message.Message):
85
112
  __slots__ = ("key", "value")
86
113
  KEY_FIELD_NUMBER: _ClassVar[int]
@@ -94,13 +121,15 @@ class WorkerRegisterRequest(_message.Message):
94
121
  MAXRUNS_FIELD_NUMBER: _ClassVar[int]
95
122
  LABELS_FIELD_NUMBER: _ClassVar[int]
96
123
  WEBHOOKID_FIELD_NUMBER: _ClassVar[int]
124
+ RUNTIMEINFO_FIELD_NUMBER: _ClassVar[int]
97
125
  workerName: str
98
126
  actions: _containers.RepeatedScalarFieldContainer[str]
99
127
  services: _containers.RepeatedScalarFieldContainer[str]
100
128
  maxRuns: int
101
129
  labels: _containers.MessageMap[str, WorkerLabels]
102
130
  webhookId: str
103
- def __init__(self, workerName: _Optional[str] = ..., actions: _Optional[_Iterable[str]] = ..., services: _Optional[_Iterable[str]] = ..., maxRuns: _Optional[int] = ..., labels: _Optional[_Mapping[str, WorkerLabels]] = ..., webhookId: _Optional[str] = ...) -> None: ...
131
+ runtimeInfo: RuntimeInfo
132
+ def __init__(self, workerName: _Optional[str] = ..., actions: _Optional[_Iterable[str]] = ..., services: _Optional[_Iterable[str]] = ..., maxRuns: _Optional[int] = ..., labels: _Optional[_Mapping[str, WorkerLabels]] = ..., webhookId: _Optional[str] = ..., runtimeInfo: _Optional[_Union[RuntimeInfo, _Mapping]] = ...) -> None: ...
104
133
 
105
134
  class WorkerRegisterResponse(_message.Message):
106
135
  __slots__ = ("tenantId", "workerId", "workerName")
@@ -1,3 +1,5 @@
1
+ # type: ignore
2
+
1
3
  from google.protobuf import timestamp_pb2 as _timestamp_pb2
2
4
  from google.protobuf.internal import containers as _containers
3
5
  from google.protobuf import descriptor as _descriptor