hatchet-sdk 0.5.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/hatchet/batch.rb +58 -0
- data/lib/hatchet/clients/grpc/dispatcher.rb +42 -0
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +9 -0
- data/lib/hatchet/clients/rest/README.md +16 -3
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/filter_api.rb +4 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/operator_api.rb +405 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/webhook_api.rb +2 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/worker_api.rb +3 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/api_meta.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/create_tenant_invite_request.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request.rb +105 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request_pause.rb +343 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request_unpause.rb +262 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_invite.rb +11 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_member.rb +11 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_member_role.rb +2 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_tenant_invite_request.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_tenant_member_request.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_http_operator_request.rb +346 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_event.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator.rb +372 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator_list.rb +231 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_event_type.rb +3 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_summary.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_http_operator_request.rb +252 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_workflow_run.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow.rb +43 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow_pause_scheduled_cron_run_queue_behavior.rb +40 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow_update_request.rb +7 -8
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +9 -0
- data/lib/hatchet/concurrency.rb +5 -1
- data/lib/hatchet/context.rb +42 -3
- data/lib/hatchet/contracts/dispatcher/dispatcher_pb.rb +4 -1
- data/lib/hatchet/contracts/dispatcher/dispatcher_services_pb.rb +3 -0
- data/lib/hatchet/contracts/v1/workflows_pb.rb +2 -1
- data/lib/hatchet/durable_context.rb +5 -12
- data/lib/hatchet/features/cel.rb +2 -2
- data/lib/hatchet/features/cron.rb +5 -5
- data/lib/hatchet/features/events.rb +7 -7
- data/lib/hatchet/features/filters.rb +7 -7
- data/lib/hatchet/features/logs.rb +2 -2
- data/lib/hatchet/features/metrics.rb +6 -6
- data/lib/hatchet/features/rate_limits.rb +2 -2
- data/lib/hatchet/features/runs.rb +4 -5
- data/lib/hatchet/features/scheduled.rb +7 -7
- data/lib/hatchet/features/tenant.rb +2 -2
- data/lib/hatchet/features/workers.rb +5 -5
- data/lib/hatchet/features/workflows.rb +6 -6
- data/lib/hatchet/task.rb +13 -0
- data/lib/hatchet/version.rb +1 -1
- data/lib/hatchet/worker/runner.rb +113 -0
- data/lib/hatchet/workflow.rb +77 -33
- data/lib/hatchet-sdk.rb +86 -28
- data/sig/hatchet/batch.rbs +12 -0
- data/sig/hatchet/task.rbs +2 -0
- metadata +13 -2
|
@@ -7,7 +7,7 @@ require 'google/protobuf'
|
|
|
7
7
|
require 'google/protobuf/timestamp_pb'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
descriptor_data = "\n\x1b\x64ispatcher/dispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Z\n\x0cWorkerLabels\x12\x16\n\tstr_value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tint_value\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0c\n\n_str_valueB\x0c\n\n_int_value\"\xcc\x01\n\x0bRuntimeInfo\x12\x18\n\x0bsdk_version\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x08language\x18\x02 \x01(\x0e\x32\x05.SDKSH\x01\x88\x01\x01\x12\x1d\n\x10language_version\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\x0e\n\x0c_sdk_versionB\x0b\n\t_languageB\x13\n\x11_language_versionB\x05\n\x03_osB\x08\n\x06_extra\"\xb1\x03\n\x15WorkerRegisterRequest\x12\x13\n\x0bworker_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x12\n\x05slots\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x17\n\nwebhook_id\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\'\n\x0cruntime_info\x18\x07 \x01(\x0b\x32\x0c.RuntimeInfoH\x02\x88\x01\x01\x12;\n\x0bslot_config\x18\t \x03(\x0b\x32&.WorkerRegisterRequest.SlotConfigEntry\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\x1a\x31\n\x0fSlotConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x42\x08\n\x06_slotsB\r\n\x0b_webhook_idB\x0f\n\r_runtime_info\"S\n\x16WorkerRegisterResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12\x13\n\x0bworker_name\x18\x03 \x01(\t\"\xa4\x01\n\x19UpsertWorkerLabelsRequest\x12\x11\n\tworker_id\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\"B\n\x1aUpsertWorkerLabelsResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xee\x06\n\x0e\x41ssignedAction\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x0e\n\x06job_id\x18\x04 \x01(\t\x12\x10\n\x08job_name\x18\x05 \x01(\t\x12\x12\n\njob_run_id\x18\x06 \x01(\t\x12\x0f\n\x07task_id\x18\x07 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x08 \x01(\t\x12\x11\n\taction_id\x18\t \x01(\t\x12 \n\x0b\x61\x63tion_type\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x16\n\x0e\x61\x63tion_payload\x18\x0b \x01(\t\x12\x11\n\ttask_name\x18\x0c \x01(\t\x12\x13\n\x0bretry_count\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\x12\x10\n\x08priority\x18\x12 \x01(\x05\x12\x18\n\x0bworkflow_id\x18\x13 \x01(\tH\x04\x88\x01\x01\x12 \n\x13workflow_version_id\x18\x14 \x01(\tH\x05\x88\x01\x01\x12*\n\x1d\x64urable_task_invocation_count\x18\x15 \x01(\x05H\x06\x88\x01\x01\x12)\n\x1ctriggering_event_external_id\x18\x16 \x01(\tH\x07\x88\x01\x01\x12!\n\x14triggering_event_key\x18\x17 \x01(\tH\x08\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_idB\x0e\n\x0c_workflow_idB\x16\n\x14_workflow_version_idB \n\x1e_durable_task_invocation_countB\x1f\n\x1d_triggering_event_external_idB\x17\n\x15_triggering_event_key\"(\n\x13WorkerListenRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"-\n\x18WorkerUnsubscribeRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"A\n\x19WorkerUnsubscribeResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xec\x01\n\x13GroupKeyActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x11\n\taction_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\nevent_type\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x15\n\revent_payload\x18\x07 \x01(\t\"\xde\x02\n\x0fStepActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x12\n\njob_run_id\x18\x03 \x01(\t\x12\x0f\n\x07task_id\x18\x04 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x05 \x01(\t\x12\x11\n\taction_id\x18\x06 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x15\n\revent_payload\x18\t \x01(\t\x12\x18\n\x0bretry_count\x18\n \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x0b \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\";\n\x13\x41\x63tionEventResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xcc\x01\n SubscribeToWorkflowEventsRequest\x12\x1c\n\x0fworkflow_run_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_meta_key\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\"\n\x15\x61\x64\x64itional_meta_value\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x12\n\x10_workflow_run_idB\x16\n\x14_additional_meta_keyB\x18\n\x16_additional_meta_value\"9\n\x1eSubscribeToWorkflowRunsRequest\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"\xe7\x02\n\rWorkflowEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12$\n\rresource_type\x18\x02 \x01(\x0e\x32\r.ResourceType\x12&\n\nevent_type\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x13\n\x0bresource_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\revent_payload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x19\n\x0ctask_retries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x18\n\x0bretry_count\x18\t \x01(\x05H\x01\x88\x01\x01\x12\x18\n\x0b\x65vent_index\x18\n \x01(\x03H\x02\x88\x01\x01\x42\x0f\n\r_task_retriesB\x0e\n\x0c_retry_countB\x0e\n\x0c_event_index\"\xac\x01\n\x10WorkflowRunEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12)\n\nevent_type\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x33\n\x0f\x65vent_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x92\x01\n\rStepRunResult\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x11\n\ttask_name\x18\x02 \x01(\t\x12\x12\n\njob_run_id\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\"c\n\rOverridesData\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x17\n\x0f\x63\x61ller_filename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"W\n\x10HeartbeatRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x30\n\x0cheartbeat_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"S\n\x15RefreshTimeoutRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x1c\n\x14increment_timeout_by\x18\x02 \x01(\t\"H\n\x16RefreshTimeoutResponse\x12.\n\ntimeout_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"2\n\x12ReleaseSlotRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse\"9\n\x19RestoreEvictedTaskRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\".\n\x1aRestoreEvictedTaskResponse\x12\x10\n\x08requeued\x18\x01 \x01(\x08\"\x13\n\x11GetVersionRequest\"%\n\x12GetVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t*A\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\x12\x08\n\x04RUBY\x10\x04*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\x82\x08\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\x12RestoreEvictedTask\x12\x1a.RestoreEvictedTaskRequest\x1a\x1b.RestoreEvictedTaskResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x12\x37\n\nGetVersion\x12\x12.GetVersionRequest\x1a\x13.GetVersionResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3"
|
|
10
|
+
descriptor_data = "\n\x1b\x64ispatcher/dispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Z\n\x0cWorkerLabels\x12\x16\n\tstr_value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tint_value\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0c\n\n_str_valueB\x0c\n\n_int_value\"\xcc\x01\n\x0bRuntimeInfo\x12\x18\n\x0bsdk_version\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x08language\x18\x02 \x01(\x0e\x32\x05.SDKSH\x01\x88\x01\x01\x12\x1d\n\x10language_version\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\x0e\n\x0c_sdk_versionB\x0b\n\t_languageB\x13\n\x11_language_versionB\x05\n\x03_osB\x08\n\x06_extra\"\xb1\x03\n\x15WorkerRegisterRequest\x12\x13\n\x0bworker_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x12\n\x05slots\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x17\n\nwebhook_id\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\'\n\x0cruntime_info\x18\x07 \x01(\x0b\x32\x0c.RuntimeInfoH\x02\x88\x01\x01\x12;\n\x0bslot_config\x18\t \x03(\x0b\x32&.WorkerRegisterRequest.SlotConfigEntry\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\x1a\x31\n\x0fSlotConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x42\x08\n\x06_slotsB\r\n\x0b_webhook_idB\x0f\n\r_runtime_info\"S\n\x16WorkerRegisterResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12\x13\n\x0bworker_name\x18\x03 \x01(\t\"\xa4\x01\n\x19UpsertWorkerLabelsRequest\x12\x11\n\tworker_id\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\"B\n\x1aUpsertWorkerLabelsResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xcc\x08\n\x0e\x41ssignedAction\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x0e\n\x06job_id\x18\x04 \x01(\t\x12\x10\n\x08job_name\x18\x05 \x01(\t\x12\x12\n\njob_run_id\x18\x06 \x01(\t\x12\x0f\n\x07task_id\x18\x07 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x08 \x01(\t\x12\x11\n\taction_id\x18\t \x01(\t\x12 \n\x0b\x61\x63tion_type\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x16\n\x0e\x61\x63tion_payload\x18\x0b \x01(\t\x12\x11\n\ttask_name\x18\x0c \x01(\t\x12\x13\n\x0bretry_count\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\x12\x10\n\x08priority\x18\x12 \x01(\x05\x12\x18\n\x0bworkflow_id\x18\x13 \x01(\tH\x04\x88\x01\x01\x12 \n\x13workflow_version_id\x18\x14 \x01(\tH\x05\x88\x01\x01\x12*\n\x1d\x64urable_task_invocation_count\x18\x15 \x01(\x05H\x06\x88\x01\x01\x12)\n\x1ctriggering_event_external_id\x18\x16 \x01(\tH\x07\x88\x01\x01\x12!\n\x14triggering_event_key\x18\x17 \x01(\tH\x08\x88\x01\x01\x12\x14\n\x07\x62\x61tchId\x18\x18 \x01(\tH\t\x88\x01\x01\x12\x16\n\tbatchSize\x18\x19 \x01(\x05H\n\x88\x01\x01\x12\x17\n\nbatchIndex\x18\x1a \x01(\x05H\x0b\x88\x01\x01\x12\x32\n\x11\x62\x61tchStartPayload\x18\x1b \x01(\x0b\x32\x12.BatchStartPayloadH\x0c\x88\x01\x01\x12\x15\n\x08\x62\x61tchKey\x18\x1c \x01(\tH\r\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_idB\x0e\n\x0c_workflow_idB\x16\n\x14_workflow_version_idB \n\x1e_durable_task_invocation_countB\x1f\n\x1d_triggering_event_external_idB\x17\n\x15_triggering_event_keyB\n\n\x08_batchIdB\x0c\n\n_batchSizeB\r\n\x0b_batchIndexB\x14\n\x12_batchStartPayloadB\x0b\n\t_batchKey\"q\n\x11\x42\x61tchStartPayload\x12\x15\n\rtriggerReason\x18\x01 \x01(\t\x12/\n\x0btriggerTime\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65xpectedSize\x18\x03 \x01(\x05\"(\n\x13WorkerListenRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"-\n\x18WorkerUnsubscribeRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"A\n\x19WorkerUnsubscribeResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xec\x01\n\x13GroupKeyActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x11\n\taction_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\nevent_type\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x15\n\revent_payload\x18\x07 \x01(\t\"\xde\x02\n\x0fStepActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x12\n\njob_run_id\x18\x03 \x01(\t\x12\x0f\n\x07task_id\x18\x04 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x05 \x01(\t\x12\x11\n\taction_id\x18\x06 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x15\n\revent_payload\x18\t \x01(\t\x12\x18\n\x0bretry_count\x18\n \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x0b \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\"\xa9\x01\n\x14\x42\x61tchActionEventItem\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x15\n\revent_payload\x18\x02 \x01(\t\x12\x18\n\x0bretry_count\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\"\xf1\x01\n\x10\x42\x61tchActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x11\n\taction_id\x18\x03 \x01(\t\x12\x15\n\x08\x62\x61tch_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x06 \x01(\x0e\x32\x14.StepActionEventType\x12$\n\x05items\x18\x07 \x03(\x0b\x32\x15.BatchActionEventItemB\x0b\n\t_batch_id\";\n\x13\x41\x63tionEventResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xcc\x01\n SubscribeToWorkflowEventsRequest\x12\x1c\n\x0fworkflow_run_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_meta_key\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\"\n\x15\x61\x64\x64itional_meta_value\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x12\n\x10_workflow_run_idB\x16\n\x14_additional_meta_keyB\x18\n\x16_additional_meta_value\"9\n\x1eSubscribeToWorkflowRunsRequest\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"\xe7\x02\n\rWorkflowEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12$\n\rresource_type\x18\x02 \x01(\x0e\x32\r.ResourceType\x12&\n\nevent_type\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x13\n\x0bresource_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\revent_payload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x19\n\x0ctask_retries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x18\n\x0bretry_count\x18\t \x01(\x05H\x01\x88\x01\x01\x12\x18\n\x0b\x65vent_index\x18\n \x01(\x03H\x02\x88\x01\x01\x42\x0f\n\r_task_retriesB\x0e\n\x0c_retry_countB\x0e\n\x0c_event_index\"\xac\x01\n\x10WorkflowRunEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12)\n\nevent_type\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x33\n\x0f\x65vent_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x92\x01\n\rStepRunResult\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x11\n\ttask_name\x18\x02 \x01(\t\x12\x12\n\njob_run_id\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\"c\n\rOverridesData\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x17\n\x0f\x63\x61ller_filename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"W\n\x10HeartbeatRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x30\n\x0cheartbeat_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"S\n\x15RefreshTimeoutRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x1c\n\x14increment_timeout_by\x18\x02 \x01(\t\"H\n\x16RefreshTimeoutResponse\x12.\n\ntimeout_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"2\n\x12ReleaseSlotRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse\"9\n\x19RestoreEvictedTaskRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\".\n\x1aRestoreEvictedTaskResponse\x12\x10\n\x08requeued\x18\x01 \x01(\x08\"\x13\n\x11GetVersionRequest\"%\n\x12GetVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t*A\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\x12\x08\n\x04RUBY\x10\x04*_\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\x12\x0f\n\x0bSTART_BATCH\x10\x03*\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*\xcb\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\x12\x1d\n\x19STEP_EVENT_TYPE_CANCELLED\x10\x05*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\xc5\x08\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\x12\x41\n\x14SendBatchActionEvent\x12\x11.BatchActionEvent\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\x12RestoreEvictedTask\x12\x1a.RestoreEvictedTaskRequest\x1a\x1b.RestoreEvictedTaskResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x12\x37\n\nGetVersion\x12\x12.GetVersionRequest\x1a\x13.GetVersionResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3"
|
|
11
11
|
|
|
12
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -19,11 +19,14 @@ WorkerRegisterResponse = ::Google::Protobuf::DescriptorPool.generated_pool.looku
|
|
|
19
19
|
UpsertWorkerLabelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("UpsertWorkerLabelsRequest").msgclass
|
|
20
20
|
UpsertWorkerLabelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("UpsertWorkerLabelsResponse").msgclass
|
|
21
21
|
AssignedAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("AssignedAction").msgclass
|
|
22
|
+
BatchStartPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("BatchStartPayload").msgclass
|
|
22
23
|
WorkerListenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("WorkerListenRequest").msgclass
|
|
23
24
|
WorkerUnsubscribeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("WorkerUnsubscribeRequest").msgclass
|
|
24
25
|
WorkerUnsubscribeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("WorkerUnsubscribeResponse").msgclass
|
|
25
26
|
GroupKeyActionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("GroupKeyActionEvent").msgclass
|
|
26
27
|
StepActionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("StepActionEvent").msgclass
|
|
28
|
+
BatchActionEventItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("BatchActionEventItem").msgclass
|
|
29
|
+
BatchActionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("BatchActionEvent").msgclass
|
|
27
30
|
ActionEventResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("ActionEventResponse").msgclass
|
|
28
31
|
SubscribeToWorkflowEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("SubscribeToWorkflowEventsRequest").msgclass
|
|
29
32
|
SubscribeToWorkflowRunsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("SubscribeToWorkflowRunsRequest").msgclass
|
|
@@ -23,6 +23,9 @@ module Dispatcher
|
|
|
23
23
|
rpc :SubscribeToWorkflowEvents, ::SubscribeToWorkflowEventsRequest, stream(::WorkflowEvent)
|
|
24
24
|
rpc :SubscribeToWorkflowRuns, stream(::SubscribeToWorkflowRunsRequest), stream(::WorkflowRunEvent)
|
|
25
25
|
rpc :SendStepActionEvent, ::StepActionEvent, ::ActionEventResponse
|
|
26
|
+
# SendBatchActionEvent reports a single lifecycle event (STARTED, FAILED, or CANCELLED)
|
|
27
|
+
# for every task in a batch in one call, instead of one SendStepActionEvent call per task.
|
|
28
|
+
rpc :SendBatchActionEvent, ::BatchActionEvent, ::ActionEventResponse
|
|
26
29
|
rpc :SendGroupKeyActionEvent, ::GroupKeyActionEvent, ::ActionEventResponse
|
|
27
30
|
rpc :PutOverridesData, ::OverridesData, ::OverridesDataResponse
|
|
28
31
|
rpc :Unsubscribe, ::WorkerUnsubscribeRequest, ::WorkerUnsubscribeResponse
|
|
@@ -9,7 +9,7 @@ require 'v1/shared/condition_pb'
|
|
|
9
9
|
require 'v1/shared/trigger_pb'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
descriptor_data = "\n\x12v1/workflows.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19v1/shared/condition.proto\x1a\x17v1/shared/trigger.proto\"[\n\x12\x43\x61ncelTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"[\n\x12ReplayTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"\xb7\x01\n\x0bTasksFilter\x12\x10\n\x08statuses\x18\x01 \x03(\t\x12)\n\x05since\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\x05until\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12\x14\n\x0cworkflow_ids\x18\x04 \x03(\t\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x05 \x03(\tB\x08\n\x06_until\".\n\x13\x43\x61ncelTasksResponse\x12\x17\n\x0f\x63\x61ncelled_tasks\x18\x01 \x03(\t\"-\n\x13ReplayTasksResponse\x12\x16\n\x0ereplayed_tasks\x18\x01 \x03(\t\"\xae\x02\n\x19TriggerWorkflowRunRequest\x12\x15\n\rworkflow_name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\x0c\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x03 \x01(\x0c\x12\x15\n\x08priority\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12U\n\x15\x64\x65sired_worker_labels\x18\x05 \x03(\x0b\x32\x36.v1.TriggerWorkflowRunRequest.DesiredWorkerLabelsEntry\x1aS\n\x18\x44\x65siredWorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x42\x0b\n\t_priority\"1\n\x1aTriggerWorkflowRunResponse\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\"X\n\x18\x42ranchDurableTaskRequest\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"Y\n\x19\x42ranchDurableTaskResponse\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"\xed\x04\n\x1c\x43reateWorkflowVersionRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12!\n\x05tasks\x18\x06 \x03(\x0b\x32\x12.v1.CreateTaskOpts\x12$\n\x0b\x63oncurrency\x18\x07 \x01(\x0b\x32\x0f.v1.Concurrency\x12\x17\n\ncron_input\x18\x08 \x01(\tH\x00\x88\x01\x01\x12\x30\n\x0fon_failure_task\x18\t \x01(\x0b\x32\x12.v1.CreateTaskOptsH\x01\x88\x01\x01\x12\'\n\x06sticky\x18\n \x01(\x0e\x32\x12.v1.StickyStrategyH\x02\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0b \x01(\x05H\x03\x88\x01\x01\x12(\n\x0f\x63oncurrency_arr\x18\x0c \x03(\x0b\x32\x0f.v1.Concurrency\x12*\n\x0f\x64\x65\x66\x61ult_filters\x18\r \x03(\x0b\x32\x11.v1.DefaultFilter\x12\x1e\n\x11input_json_schema\x18\x0e \x01(\x0cH\x04\x88\x01\x01\x12/\n\x0bidempotency\x18\x0f \x01(\x0b\x32\x15.v1.IdempotencyConfigH\x05\x88\x01\x01\x42\r\n\x0b_cron_inputB\x12\n\x10_on_failure_taskB\t\n\x07_stickyB\x13\n\x11_default_priorityB\x14\n\x12_input_json_schemaB\x0e\n\x0c_idempotency\"n\n\x11IdempotencyConfig\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x0e\n\x06ttl_ms\x18\x02 \x01(\x03\x12*\n\x06method\x18\x03 \x01(\x0e\x32\x15.v1.IdempotencyMethodH\x00\x88\x01\x01\x42\t\n\x07_method\"`\n\x19IdempotencyCollisionError\x12 \n\x18\x65xisting_run_external_id\x18\x01 \x01(\t\x12!\n\x19\x63olliding_run_external_id\x18\x02 \x01(\t\"\x87\x01\n$BulkTriggerIdempotencyCollisionError\x12,\n$successful_workflow_run_external_ids\x18\x01 \x03(\t\x12\x31\n\ncollisions\x18\x02 \x03(\x0b\x32\x1d.v1.IdempotencyCollisionError\"T\n\rDefaultFilter\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\x12\x14\n\x07payload\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\n\n\x08_payload\"\x93\x01\n\x0b\x43oncurrency\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x39\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x1c.v1.ConcurrencyLimitStrategyH\x01\x88\x01\x01\x42\x0b\n\t_max_runsB\x11\n\x0f_limit_strategy\"\
|
|
12
|
+
descriptor_data = "\n\x12v1/workflows.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19v1/shared/condition.proto\x1a\x17v1/shared/trigger.proto\"[\n\x12\x43\x61ncelTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"[\n\x12ReplayTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"\xb7\x01\n\x0bTasksFilter\x12\x10\n\x08statuses\x18\x01 \x03(\t\x12)\n\x05since\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\x05until\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12\x14\n\x0cworkflow_ids\x18\x04 \x03(\t\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x05 \x03(\tB\x08\n\x06_until\".\n\x13\x43\x61ncelTasksResponse\x12\x17\n\x0f\x63\x61ncelled_tasks\x18\x01 \x03(\t\"-\n\x13ReplayTasksResponse\x12\x16\n\x0ereplayed_tasks\x18\x01 \x03(\t\"\xae\x02\n\x19TriggerWorkflowRunRequest\x12\x15\n\rworkflow_name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\x0c\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x03 \x01(\x0c\x12\x15\n\x08priority\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12U\n\x15\x64\x65sired_worker_labels\x18\x05 \x03(\x0b\x32\x36.v1.TriggerWorkflowRunRequest.DesiredWorkerLabelsEntry\x1aS\n\x18\x44\x65siredWorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x42\x0b\n\t_priority\"1\n\x1aTriggerWorkflowRunResponse\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\"X\n\x18\x42ranchDurableTaskRequest\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"Y\n\x19\x42ranchDurableTaskResponse\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"\xed\x04\n\x1c\x43reateWorkflowVersionRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12!\n\x05tasks\x18\x06 \x03(\x0b\x32\x12.v1.CreateTaskOpts\x12$\n\x0b\x63oncurrency\x18\x07 \x01(\x0b\x32\x0f.v1.Concurrency\x12\x17\n\ncron_input\x18\x08 \x01(\tH\x00\x88\x01\x01\x12\x30\n\x0fon_failure_task\x18\t \x01(\x0b\x32\x12.v1.CreateTaskOptsH\x01\x88\x01\x01\x12\'\n\x06sticky\x18\n \x01(\x0e\x32\x12.v1.StickyStrategyH\x02\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0b \x01(\x05H\x03\x88\x01\x01\x12(\n\x0f\x63oncurrency_arr\x18\x0c \x03(\x0b\x32\x0f.v1.Concurrency\x12*\n\x0f\x64\x65\x66\x61ult_filters\x18\r \x03(\x0b\x32\x11.v1.DefaultFilter\x12\x1e\n\x11input_json_schema\x18\x0e \x01(\x0cH\x04\x88\x01\x01\x12/\n\x0bidempotency\x18\x0f \x01(\x0b\x32\x15.v1.IdempotencyConfigH\x05\x88\x01\x01\x42\r\n\x0b_cron_inputB\x12\n\x10_on_failure_taskB\t\n\x07_stickyB\x13\n\x11_default_priorityB\x14\n\x12_input_json_schemaB\x0e\n\x0c_idempotency\"n\n\x11IdempotencyConfig\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x0e\n\x06ttl_ms\x18\x02 \x01(\x03\x12*\n\x06method\x18\x03 \x01(\x0e\x32\x15.v1.IdempotencyMethodH\x00\x88\x01\x01\x42\t\n\x07_method\"`\n\x19IdempotencyCollisionError\x12 \n\x18\x65xisting_run_external_id\x18\x01 \x01(\t\x12!\n\x19\x63olliding_run_external_id\x18\x02 \x01(\t\"\x87\x01\n$BulkTriggerIdempotencyCollisionError\x12,\n$successful_workflow_run_external_ids\x18\x01 \x03(\t\x12\x31\n\ncollisions\x18\x02 \x03(\x0b\x32\x1d.v1.IdempotencyCollisionError\"T\n\rDefaultFilter\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\x12\x14\n\x07payload\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\n\n\x08_payload\"\x93\x01\n\x0b\x43oncurrency\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x39\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x1c.v1.ConcurrencyLimitStrategyH\x01\x88\x01\x01\x42\x0b\n\t_max_runsB\x11\n\x0f_limit_strategy\"\x89\x02\n\x0fTaskBatchConfig\x12\x16\n\x0e\x62\x61tch_max_size\x18\x01 \x01(\x05\x12\"\n\x15\x62\x61tch_max_interval_ms\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x1c\n\x0f\x62\x61tch_group_key\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x62\x61tch_group_max_runs\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x1d\n\x10\x62roadcast_output\x18\x05 \x01(\x08H\x03\x88\x01\x01\x42\x18\n\x16_batch_max_interval_msB\x12\n\x10_batch_group_keyB\x17\n\x15_batch_group_max_runsB\x13\n\x11_broadcast_output\"\xea\x05\n\x0e\x43reateTaskOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x0f\n\x07retries\x18\x06 \x01(\x05\x12,\n\x0brate_limits\x18\x07 \x03(\x0b\x32\x17.v1.CreateTaskRateLimit\x12;\n\rworker_labels\x18\x08 \x03(\x0b\x32$.v1.CreateTaskOpts.WorkerLabelsEntry\x12\x1b\n\x0e\x62\x61\x63koff_factor\x18\t \x01(\x02H\x00\x88\x01\x01\x12 \n\x13\x62\x61\x63koff_max_seconds\x18\n \x01(\x05H\x01\x88\x01\x01\x12$\n\x0b\x63oncurrency\x18\x0b \x03(\x0b\x32\x0f.v1.Concurrency\x12+\n\nconditions\x18\x0c \x01(\x0b\x32\x12.v1.TaskConditionsH\x02\x88\x01\x01\x12\x1d\n\x10schedule_timeout\x18\r \x01(\tH\x03\x88\x01\x01\x12\x12\n\nis_durable\x18\x0e \x01(\x08\x12;\n\rslot_requests\x18\x0f \x03(\x0b\x32$.v1.CreateTaskOpts.SlotRequestsEntry\x12\'\n\x05\x62\x61tch\x18\x10 \x01(\x0b\x32\x13.v1.TaskBatchConfigH\x04\x88\x01\x01\x1aL\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x1a\x33\n\x11SlotRequestsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x42\x11\n\x0f_backoff_factorB\x16\n\x14_backoff_max_secondsB\r\n\x0b_conditionsB\x13\n\x11_schedule_timeoutB\x08\n\x06_batch\"\xfd\x01\n\x13\x43reateTaskRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x12\n\x05units\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08key_expr\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nunits_expr\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11limit_values_expr\x18\x05 \x01(\tH\x03\x88\x01\x01\x12,\n\x08\x64uration\x18\x06 \x01(\x0e\x32\x15.v1.RateLimitDurationH\x04\x88\x01\x01\x42\x08\n\x06_unitsB\x0b\n\t_key_exprB\r\n\x0b_units_exprB\x14\n\x12_limit_values_exprB\x0b\n\t_duration\"@\n\x1d\x43reateWorkflowVersionResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\"+\n\x14GetRunDetailsRequest\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\"\xaa\x01\n\rTaskRunDetail\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\x12\x1d\n\x06status\x18\x02 \x01(\x0e\x32\r.v1.RunStatus\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x04 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x0breadable_id\x18\x05 \x01(\t\x12\x12\n\nis_evicted\x18\x06 \x01(\x08\x42\x08\n\x06_errorB\t\n\x07_output\"\x84\x02\n\x15GetRunDetailsResponse\x12\r\n\x05input\x18\x01 \x01(\x0c\x12\x1d\n\x06status\x18\x02 \x01(\x0e\x32\r.v1.RunStatus\x12:\n\ttask_runs\x18\x03 \x03(\x0b\x32\'.v1.GetRunDetailsResponse.TaskRunsEntry\x12\x0c\n\x04\x64one\x18\x04 \x01(\x08\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x05 \x01(\x0c\x12\x12\n\nis_evicted\x18\x06 \x01(\x08\x1a\x42\n\rTaskRunsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.v1.TaskRunDetail:\x02\x38\x01*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06*[\n\tRunStatus\x12\n\n\x06QUEUED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tCOMPLETED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0b\n\x07\x45VICTED\x10\x05*(\n\x11IdempotencyMethod\x12\x07\n\x03TTL\x10\x00\x12\n\n\x06STATUS\x10\x01*\xc1\x01\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03\x12\x11\n\rCANCEL_NEWEST\x10\x04\x12\x1f\n\x1b\x43\x41NCEL_QUEUED_EXCEPT_NEWEST\x10\x05\x12\x1f\n\x1b\x43\x41NCEL_QUEUED_EXCEPT_OLDEST\x10\x06\x32\xcf\x03\n\x0c\x41\x64minService\x12R\n\x0bPutWorkflow\x12 .v1.CreateWorkflowVersionRequest\x1a!.v1.CreateWorkflowVersionResponse\x12>\n\x0b\x43\x61ncelTasks\x12\x16.v1.CancelTasksRequest\x1a\x17.v1.CancelTasksResponse\x12>\n\x0bReplayTasks\x12\x16.v1.ReplayTasksRequest\x1a\x17.v1.ReplayTasksResponse\x12S\n\x12TriggerWorkflowRun\x12\x1d.v1.TriggerWorkflowRunRequest\x1a\x1e.v1.TriggerWorkflowRunResponse\x12\x44\n\rGetRunDetails\x12\x18.v1.GetRunDetailsRequest\x1a\x19.v1.GetRunDetailsResponse\x12P\n\x11\x42ranchDurableTask\x12\x1c.v1.BranchDurableTaskRequest\x1a\x1d.v1.BranchDurableTaskResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/shared/proto/v1b\x06proto3"
|
|
13
13
|
|
|
14
14
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
15
15
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -30,6 +30,7 @@ module V1
|
|
|
30
30
|
BulkTriggerIdempotencyCollisionError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.BulkTriggerIdempotencyCollisionError").msgclass
|
|
31
31
|
DefaultFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.DefaultFilter").msgclass
|
|
32
32
|
Concurrency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.Concurrency").msgclass
|
|
33
|
+
TaskBatchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.TaskBatchConfig").msgclass
|
|
33
34
|
CreateTaskOpts = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.CreateTaskOpts").msgclass
|
|
34
35
|
CreateTaskRateLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.CreateTaskRateLimit").msgclass
|
|
35
36
|
CreateWorkflowVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.CreateWorkflowVersionResponse").msgclass
|
|
@@ -5,14 +5,12 @@ require "securerandom"
|
|
|
5
5
|
|
|
6
6
|
module Hatchet
|
|
7
7
|
# Extended context for durable tasks that supports sleep and event-waiting
|
|
8
|
-
# across task suspensions.
|
|
8
|
+
# across task suspensions. All methods and attributes of {Context} are also
|
|
9
|
+
# available.
|
|
9
10
|
#
|
|
10
11
|
# Durable tasks can be suspended and resumed by the Hatchet engine,
|
|
11
12
|
# allowing long-running workflows that survive process restarts.
|
|
12
13
|
#
|
|
13
|
-
# Uses V1::V1Dispatcher for registering and listening for durable events
|
|
14
|
-
# via bidirectional gRPC streaming.
|
|
15
|
-
#
|
|
16
14
|
# @example Sleep for a duration
|
|
17
15
|
# hatchet.durable_task(name: "my_task") do |input, ctx|
|
|
18
16
|
# ctx.sleep_for(duration: 60) # sleep for 60 seconds
|
|
@@ -42,10 +40,8 @@ module Hatchet
|
|
|
42
40
|
attr_accessor :engine_version
|
|
43
41
|
|
|
44
42
|
# Sleep for a specified duration. The task is suspended and resumed
|
|
45
|
-
# by the engine after the duration expires
|
|
46
|
-
#
|
|
47
|
-
# Delegates to {#wait_for} with a {Hatchet::SleepCondition} so that both
|
|
48
|
-
# sleeps and event waits share a single registration / eviction path.
|
|
43
|
+
# by the engine after the duration expires, so no worker slot is blocked
|
|
44
|
+
# while sleeping (subject to the task's eviction policy).
|
|
49
45
|
#
|
|
50
46
|
# @param duration [Integer, String] Duration in seconds, or a duration string (e.g. "60s")
|
|
51
47
|
# @param label [String, nil] Optional wait label shown in durable event logs.
|
|
@@ -62,11 +58,8 @@ module Hatchet
|
|
|
62
58
|
# Wait for a condition to be met (event or sleep).
|
|
63
59
|
# The task is suspended and resumed when the condition is satisfied.
|
|
64
60
|
#
|
|
65
|
-
# Register the durable wait with ``send_event`` first, then start eviction
|
|
66
|
-
# tracking only while blocked on ``wait_for_callback``.
|
|
67
|
-
#
|
|
68
61
|
# @param key [String] A unique key for this wait operation
|
|
69
|
-
# @param condition [
|
|
62
|
+
# @param condition [UserEventCondition, SleepCondition, OrCondition] The condition to wait for
|
|
70
63
|
# @param label [String, nil] Optional wait label shown in durable event logs.
|
|
71
64
|
# @return [Hash] Result from the wait, including which condition was satisfied
|
|
72
65
|
def wait_for(key, condition, label: nil)
|
data/lib/hatchet/features/cel.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Hatchet
|
|
|
23
23
|
# CEL (Common Expression Language) expressions used in filters and conditions.
|
|
24
24
|
#
|
|
25
25
|
# @example Debugging a CEL expression
|
|
26
|
-
# result =
|
|
26
|
+
# result = hatchet.cel.debug(
|
|
27
27
|
# expression: 'input.value > 10',
|
|
28
28
|
# input: { value: 15 }
|
|
29
29
|
# )
|
|
@@ -59,7 +59,7 @@ module Hatchet
|
|
|
59
59
|
# @raise [RuntimeError] If no response is received from the CEL debug API
|
|
60
60
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
61
61
|
# @example
|
|
62
|
-
# result =
|
|
62
|
+
# result = hatchet.cel.debug(
|
|
63
63
|
# expression: 'input.count > 5 && metadata.env == "prod"',
|
|
64
64
|
# input: { count: 10 },
|
|
65
65
|
# additional_metadata: { env: 'prod' }
|
|
@@ -8,7 +8,7 @@ module Hatchet
|
|
|
8
8
|
# listing, and retrieving cron workflow triggers.
|
|
9
9
|
#
|
|
10
10
|
# @example Creating a cron trigger
|
|
11
|
-
# cron =
|
|
11
|
+
# cron = hatchet.cron.create(
|
|
12
12
|
# workflow_name: "my-workflow",
|
|
13
13
|
# cron_name: "daily-run",
|
|
14
14
|
# expression: "0 0 * * *",
|
|
@@ -45,7 +45,7 @@ module Hatchet
|
|
|
45
45
|
# @raise [ArgumentError] If the cron expression is invalid
|
|
46
46
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
47
47
|
# @example
|
|
48
|
-
# cron =
|
|
48
|
+
# cron = hatchet.cron.create(
|
|
49
49
|
# workflow_name: "my-workflow",
|
|
50
50
|
# cron_name: "hourly-run",
|
|
51
51
|
# expression: "0 * * * *",
|
|
@@ -76,7 +76,7 @@ module Hatchet
|
|
|
76
76
|
# @return [void]
|
|
77
77
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
78
78
|
# @example
|
|
79
|
-
#
|
|
79
|
+
# hatchet.cron.delete("cron-123")
|
|
80
80
|
def delete(cron_id)
|
|
81
81
|
@workflow_api.workflow_cron_delete(@config.tenant_id, cron_id.to_s)
|
|
82
82
|
end
|
|
@@ -94,7 +94,7 @@ module Hatchet
|
|
|
94
94
|
# @return [Object] A list of cron workflows
|
|
95
95
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
96
96
|
# @example
|
|
97
|
-
# crons =
|
|
97
|
+
# crons = hatchet.cron.list(limit: 10, workflow_name: "my-workflow")
|
|
98
98
|
def list(offset: nil, limit: nil, workflow_id: nil, additional_metadata: nil,
|
|
99
99
|
order_by_field: nil, order_by_direction: nil, workflow_name: nil, cron_name: nil)
|
|
100
100
|
@workflow_api.cron_workflow_list(
|
|
@@ -118,7 +118,7 @@ module Hatchet
|
|
|
118
118
|
# @return [Object] The requested cron workflow instance
|
|
119
119
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
120
120
|
# @example
|
|
121
|
-
# cron =
|
|
121
|
+
# cron = hatchet.cron.get("cron-123")
|
|
122
122
|
def get(cron_id)
|
|
123
123
|
@workflow_api.workflow_cron_get(@config.tenant_id, cron_id.to_s)
|
|
124
124
|
end
|
|
@@ -11,9 +11,9 @@ module Hatchet
|
|
|
11
11
|
# the REST API for read operations (list, get, etc.).
|
|
12
12
|
#
|
|
13
13
|
# @example Creating an event
|
|
14
|
-
# response = events.push(
|
|
15
|
-
#
|
|
16
|
-
#
|
|
14
|
+
# response = hatchet.events.push(
|
|
15
|
+
# "user-login",
|
|
16
|
+
# { user_id: 123, action: "login" },
|
|
17
17
|
# additional_metadata: { ip_address: "192.168.1.1" }
|
|
18
18
|
# )
|
|
19
19
|
#
|
|
@@ -53,7 +53,7 @@ module Hatchet
|
|
|
53
53
|
# @raise [ArgumentError] If required parameters are missing
|
|
54
54
|
# @raise [Hatchet::Error] If the API request fails or returns an error
|
|
55
55
|
# @example Creating a simple event
|
|
56
|
-
# response = events.create(
|
|
56
|
+
# response = hatchet.events.create(
|
|
57
57
|
# key: "user-login",
|
|
58
58
|
# data: { user_id: 123, action: "login" },
|
|
59
59
|
# additional_metadata: { ip_address: "192.168.1.1" }
|
|
@@ -80,7 +80,7 @@ module Hatchet
|
|
|
80
80
|
# @return [Object] The gRPC response containing the created event details
|
|
81
81
|
# @raise [Hatchet::Error] If the API request fails or returns an error
|
|
82
82
|
# @example Push a simple event
|
|
83
|
-
# response = events.push(
|
|
83
|
+
# response = hatchet.events.push(
|
|
84
84
|
# "user-signup",
|
|
85
85
|
# { user_id: 456, email: "user@example.com" },
|
|
86
86
|
# additional_metadata: { source: "web" }
|
|
@@ -106,7 +106,7 @@ module Hatchet
|
|
|
106
106
|
# { key: "user-signup", data: { user_id: 1 } },
|
|
107
107
|
# { key: "user-login", data: { user_id: 1 }, priority: 1 }
|
|
108
108
|
# ]
|
|
109
|
-
# response = events.bulk_push(events_data)
|
|
109
|
+
# response = hatchet.events.bulk_push(events_data)
|
|
110
110
|
def bulk_push(events, namespace: nil)
|
|
111
111
|
grpc_events = events.map do |event|
|
|
112
112
|
{
|
|
@@ -135,7 +135,7 @@ module Hatchet
|
|
|
135
135
|
# @return [HatchetSdkRest::V1EventList] List of events matching the filters
|
|
136
136
|
# @raise [Hatchet::Error] If the API request fails or returns an error
|
|
137
137
|
# @example List recent events
|
|
138
|
-
# events =
|
|
138
|
+
# events = hatchet.events.list(
|
|
139
139
|
# limit: 10,
|
|
140
140
|
# since: Time.now - 24 * 60 * 60,
|
|
141
141
|
# keys: ["user-signup", "user-login"]
|
|
@@ -8,10 +8,10 @@ module Hatchet
|
|
|
8
8
|
# listing, updating, and deleting filters in the Hatchet system.
|
|
9
9
|
#
|
|
10
10
|
# @example Listing filters
|
|
11
|
-
# filters =
|
|
11
|
+
# filters = hatchet.filters.list(limit: 10, workflow_ids: ["wf-1"])
|
|
12
12
|
#
|
|
13
13
|
# @example Creating a filter
|
|
14
|
-
# filter =
|
|
14
|
+
# filter = hatchet.filters.create(
|
|
15
15
|
# workflow_id: "wf-1",
|
|
16
16
|
# expression: 'input.priority > 5',
|
|
17
17
|
# scope: "high-priority"
|
|
@@ -40,7 +40,7 @@ module Hatchet
|
|
|
40
40
|
# @return [Object] A list of filters matching the specified criteria
|
|
41
41
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
42
42
|
# @example
|
|
43
|
-
# filters =
|
|
43
|
+
# filters = hatchet.filters.list(limit: 10, workflow_ids: ["wf-1"])
|
|
44
44
|
def list(limit: nil, offset: nil, workflow_ids: nil, scopes: nil)
|
|
45
45
|
@filter_api.v1_filter_list(
|
|
46
46
|
@config.tenant_id,
|
|
@@ -59,7 +59,7 @@ module Hatchet
|
|
|
59
59
|
# @return [Object] The filter details
|
|
60
60
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
61
61
|
# @example
|
|
62
|
-
# filter =
|
|
62
|
+
# filter = hatchet.filters.get("filter-123")
|
|
63
63
|
def get(filter_id)
|
|
64
64
|
@filter_api.v1_filter_get(@config.tenant_id, filter_id)
|
|
65
65
|
end
|
|
@@ -73,7 +73,7 @@ module Hatchet
|
|
|
73
73
|
# @return [Object] The created filter
|
|
74
74
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
75
75
|
# @example
|
|
76
|
-
# filter =
|
|
76
|
+
# filter = hatchet.filters.create(
|
|
77
77
|
# workflow_id: "wf-1",
|
|
78
78
|
# expression: 'input.value > 10',
|
|
79
79
|
# scope: "my-scope",
|
|
@@ -95,7 +95,7 @@ module Hatchet
|
|
|
95
95
|
# @return [Object] The deleted filter
|
|
96
96
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
97
97
|
# @example
|
|
98
|
-
#
|
|
98
|
+
# hatchet.filters.delete("filter-123")
|
|
99
99
|
def delete(filter_id)
|
|
100
100
|
@filter_api.v1_filter_delete(@config.tenant_id, filter_id)
|
|
101
101
|
end
|
|
@@ -107,7 +107,7 @@ module Hatchet
|
|
|
107
107
|
# @return [Object] The updated filter
|
|
108
108
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
109
109
|
# @example
|
|
110
|
-
#
|
|
110
|
+
# hatchet.filters.update("filter-123", { expression: 'input.value > 20' })
|
|
111
111
|
def update(filter_id, updates)
|
|
112
112
|
update_request = HatchetSdkRest::V1UpdateFilterRequest.new(updates)
|
|
113
113
|
@filter_api.v1_filter_update(@config.tenant_id, filter_id, update_request)
|
|
@@ -10,7 +10,7 @@ module Hatchet
|
|
|
10
10
|
# associated with task runs in the Hatchet system.
|
|
11
11
|
#
|
|
12
12
|
# @example Listing logs for a task run
|
|
13
|
-
# logs =
|
|
13
|
+
# logs = hatchet.logs.list("task-run-id", limit: 100)
|
|
14
14
|
#
|
|
15
15
|
# @since 0.1.0
|
|
16
16
|
class Logs
|
|
@@ -35,7 +35,7 @@ module Hatchet
|
|
|
35
35
|
# @return [Object] A list of log lines for the specified task run
|
|
36
36
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
37
37
|
# @example
|
|
38
|
-
# logs =
|
|
38
|
+
# logs = hatchet.logs.list("task-run-123", limit: 500, since: Time.now - 3600)
|
|
39
39
|
def list(task_run_id, limit: 1000, since: nil, until_time: nil)
|
|
40
40
|
@log_api.v1_log_line_list(
|
|
41
41
|
task_run_id,
|
|
@@ -13,10 +13,10 @@ module Hatchet
|
|
|
13
13
|
# Prometheus metrics, task statistics, and task metrics from the Hatchet system.
|
|
14
14
|
#
|
|
15
15
|
# @example Getting queue metrics
|
|
16
|
-
# metrics =
|
|
16
|
+
# metrics = hatchet.metrics.get_queue_metrics
|
|
17
17
|
#
|
|
18
18
|
# @example Getting task metrics
|
|
19
|
-
# task_metrics =
|
|
19
|
+
# task_metrics = hatchet.metrics.get_task_metrics(
|
|
20
20
|
# since: Time.now - 86400,
|
|
21
21
|
# workflow_ids: ["wf-1"]
|
|
22
22
|
# )
|
|
@@ -41,7 +41,7 @@ module Hatchet
|
|
|
41
41
|
# @return [Hash] The current queue metrics
|
|
42
42
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
43
43
|
# @example
|
|
44
|
-
# queues =
|
|
44
|
+
# queues = hatchet.metrics.get_queue_metrics
|
|
45
45
|
def get_queue_metrics
|
|
46
46
|
result = @tenant_api.tenant_get_step_run_queue_metrics(@config.tenant_id)
|
|
47
47
|
result.queues || {}
|
|
@@ -52,7 +52,7 @@ module Hatchet
|
|
|
52
52
|
# @return [String] The metrics in Prometheus text format
|
|
53
53
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
54
54
|
# @example
|
|
55
|
-
# prometheus_text =
|
|
55
|
+
# prometheus_text = hatchet.metrics.scrape_tenant_prometheus_metrics
|
|
56
56
|
def scrape_tenant_prometheus_metrics
|
|
57
57
|
@tenant_api.tenant_get_prometheus_metrics(@config.tenant_id)
|
|
58
58
|
end
|
|
@@ -62,7 +62,7 @@ module Hatchet
|
|
|
62
62
|
# @return [Object] The task statistics
|
|
63
63
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
64
64
|
# @example
|
|
65
|
-
# stats =
|
|
65
|
+
# stats = hatchet.metrics.get_task_stats
|
|
66
66
|
def get_task_stats
|
|
67
67
|
@tenant_api.tenant_get_task_stats(@config.tenant_id)
|
|
68
68
|
end
|
|
@@ -77,7 +77,7 @@ module Hatchet
|
|
|
77
77
|
# @return [TaskMetrics] Task metrics with counts per status
|
|
78
78
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
79
79
|
# @example
|
|
80
|
-
# metrics =
|
|
80
|
+
# metrics = hatchet.metrics.get_task_metrics(
|
|
81
81
|
# since: Time.now - 86400,
|
|
82
82
|
# workflow_ids: ["wf-1"]
|
|
83
83
|
# )
|
|
@@ -8,7 +8,7 @@ module Hatchet
|
|
|
8
8
|
# rate limits using the gRPC Admin client.
|
|
9
9
|
#
|
|
10
10
|
# @example Setting a rate limit
|
|
11
|
-
#
|
|
11
|
+
# hatchet.rate_limits.put(key: "api-calls", limit: 100, duration: :SECOND)
|
|
12
12
|
#
|
|
13
13
|
# @since 0.1.0
|
|
14
14
|
class RateLimits
|
|
@@ -31,7 +31,7 @@ module Hatchet
|
|
|
31
31
|
# @return [void]
|
|
32
32
|
# @raise [GRPC::BadStatus] If the gRPC request fails
|
|
33
33
|
# @example
|
|
34
|
-
#
|
|
34
|
+
# hatchet.rate_limits.put(key: "api-calls", limit: 100, duration: :SECOND)
|
|
35
35
|
def put(key:, limit:, duration: :SECOND)
|
|
36
36
|
@admin_grpc.put_rate_limit(key: key, limit: limit, duration: duration)
|
|
37
37
|
end
|
|
@@ -72,8 +72,7 @@ module Hatchet
|
|
|
72
72
|
# convenient Ruby interface.
|
|
73
73
|
#
|
|
74
74
|
# @example Creating a workflow run
|
|
75
|
-
#
|
|
76
|
-
# response = runs.create(
|
|
75
|
+
# response = hatchet.runs.create(
|
|
77
76
|
# name: "my-workflow",
|
|
78
77
|
# input: { key: "value" },
|
|
79
78
|
# additional_metadata: { source: "api" }
|
|
@@ -289,7 +288,7 @@ module Hatchet
|
|
|
289
288
|
# @raise [ArgumentError] If the workflow_name or input parameters are nil or invalid
|
|
290
289
|
# @raise [Hatchet::Error] If the API request fails or returns an error
|
|
291
290
|
# @example Creating a workflow run
|
|
292
|
-
# response = runs.create(
|
|
291
|
+
# response = hatchet.runs.create(
|
|
293
292
|
# name: "simple-workflow",
|
|
294
293
|
# input: { user_id: 123, action: "process_data" },
|
|
295
294
|
# additional_metadata: { source: "api", priority: "high" }
|
|
@@ -446,9 +445,9 @@ module Hatchet
|
|
|
446
445
|
# @raise [Timeout::Error] If the timeout is reached before completion
|
|
447
446
|
# @raise [Hatchet::Error] If the API request fails or returns an error
|
|
448
447
|
# @example Poll with default settings (1s interval, no timeout)
|
|
449
|
-
# result = runs.poll("workflow-run-123")
|
|
448
|
+
# result = hatchet.runs.poll("workflow-run-123")
|
|
450
449
|
# @example Poll with custom interval and timeout
|
|
451
|
-
# result = runs.poll("workflow-run-123", interval: 2.0, timeout: 30.0)
|
|
450
|
+
# result = hatchet.runs.poll("workflow-run-123", interval: 2.0, timeout: 30.0)
|
|
452
451
|
# @since 0.1.0
|
|
453
452
|
def poll(workflow_run_id, interval: 1.0, timeout: nil)
|
|
454
453
|
start_time = Time.now
|
|
@@ -10,7 +10,7 @@ module Hatchet
|
|
|
10
10
|
# updating, bulk operations, listing, and retrieving scheduled workflow runs.
|
|
11
11
|
#
|
|
12
12
|
# @example Creating a scheduled workflow
|
|
13
|
-
# scheduled =
|
|
13
|
+
# scheduled = hatchet.scheduled.create(
|
|
14
14
|
# workflow_name: "my-workflow",
|
|
15
15
|
# trigger_at: Time.now + 3600,
|
|
16
16
|
# input: { key: "value" },
|
|
@@ -44,7 +44,7 @@ module Hatchet
|
|
|
44
44
|
# @return [Object] The created scheduled workflow instance
|
|
45
45
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
46
46
|
# @example
|
|
47
|
-
# scheduled =
|
|
47
|
+
# scheduled = hatchet.scheduled.create(
|
|
48
48
|
# workflow_name: "my-workflow",
|
|
49
49
|
# trigger_at: Time.now + 3600,
|
|
50
50
|
# input: { key: "value" },
|
|
@@ -70,7 +70,7 @@ module Hatchet
|
|
|
70
70
|
# @return [void]
|
|
71
71
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
72
72
|
# @example
|
|
73
|
-
#
|
|
73
|
+
# hatchet.scheduled.delete("scheduled-123")
|
|
74
74
|
def delete(scheduled_id)
|
|
75
75
|
@workflow_api.workflow_scheduled_delete(@config.tenant_id, scheduled_id)
|
|
76
76
|
end
|
|
@@ -85,7 +85,7 @@ module Hatchet
|
|
|
85
85
|
# @return [Object] The updated scheduled workflow instance
|
|
86
86
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
87
87
|
# @example
|
|
88
|
-
#
|
|
88
|
+
# hatchet.scheduled.update("scheduled-123", trigger_at: Time.now + 7200)
|
|
89
89
|
def update(scheduled_id, trigger_at:)
|
|
90
90
|
request = HatchetSdkRest::UpdateScheduledWorkflowRunRequest.new(
|
|
91
91
|
trigger_at: trigger_at.utc.iso8601,
|
|
@@ -139,7 +139,7 @@ module Hatchet
|
|
|
139
139
|
# @return [Object] The bulk update response containing updated IDs and per-item errors
|
|
140
140
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
141
141
|
# @example
|
|
142
|
-
#
|
|
142
|
+
# hatchet.scheduled.bulk_update([
|
|
143
143
|
# { id: "scheduled-1", trigger_at: Time.now + 3600 },
|
|
144
144
|
# { id: "scheduled-2", trigger_at: Time.now + 7200 }
|
|
145
145
|
# ])
|
|
@@ -171,7 +171,7 @@ module Hatchet
|
|
|
171
171
|
# @return [Object] A list of scheduled workflows matching the provided filters
|
|
172
172
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
173
173
|
# @example
|
|
174
|
-
# scheduled =
|
|
174
|
+
# scheduled = hatchet.scheduled.list(limit: 10, workflow_id: "wf-1")
|
|
175
175
|
def list(offset: nil, limit: nil, workflow_id: nil, parent_workflow_run_id: nil,
|
|
176
176
|
statuses: nil, additional_metadata: nil, order_by_field: nil, order_by_direction: nil)
|
|
177
177
|
@workflow_api.workflow_scheduled_list(
|
|
@@ -195,7 +195,7 @@ module Hatchet
|
|
|
195
195
|
# @return [Object] The requested scheduled workflow instance
|
|
196
196
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
197
197
|
# @example
|
|
198
|
-
# scheduled =
|
|
198
|
+
# scheduled = hatchet.scheduled.get("scheduled-123")
|
|
199
199
|
def get(scheduled_id)
|
|
200
200
|
@workflow_api.workflow_scheduled_get(@config.tenant_id, scheduled_id)
|
|
201
201
|
end
|
|
@@ -8,7 +8,7 @@ module Hatchet
|
|
|
8
8
|
# from the Hatchet system.
|
|
9
9
|
#
|
|
10
10
|
# @example Getting the current tenant
|
|
11
|
-
# tenant_info =
|
|
11
|
+
# tenant_info = hatchet.tenant.get
|
|
12
12
|
#
|
|
13
13
|
# @since 0.1.0
|
|
14
14
|
class Tenant
|
|
@@ -29,7 +29,7 @@ module Hatchet
|
|
|
29
29
|
# @return [Object] The tenant details
|
|
30
30
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
31
31
|
# @example
|
|
32
|
-
# tenant =
|
|
32
|
+
# tenant = hatchet.tenant.get
|
|
33
33
|
def get
|
|
34
34
|
@tenant_api.tenant_get(@config.tenant_id)
|
|
35
35
|
end
|
|
@@ -8,10 +8,10 @@ module Hatchet
|
|
|
8
8
|
# updating workers in the Hatchet system.
|
|
9
9
|
#
|
|
10
10
|
# @example Getting a worker
|
|
11
|
-
# worker =
|
|
11
|
+
# worker = hatchet.workers.get("worker-id")
|
|
12
12
|
#
|
|
13
13
|
# @example Listing all workers
|
|
14
|
-
# workers =
|
|
14
|
+
# workers = hatchet.workers.list
|
|
15
15
|
#
|
|
16
16
|
# @since 0.1.0
|
|
17
17
|
class Workers
|
|
@@ -33,7 +33,7 @@ module Hatchet
|
|
|
33
33
|
# @return [Object] The worker details
|
|
34
34
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
35
35
|
# @example
|
|
36
|
-
# worker =
|
|
36
|
+
# worker = hatchet.workers.get("worker-123")
|
|
37
37
|
def get(worker_id)
|
|
38
38
|
@worker_api.worker_get(worker_id)
|
|
39
39
|
end
|
|
@@ -43,7 +43,7 @@ module Hatchet
|
|
|
43
43
|
# @return [Object] A list of workers
|
|
44
44
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
45
45
|
# @example
|
|
46
|
-
# workers =
|
|
46
|
+
# workers = hatchet.workers.list
|
|
47
47
|
def list
|
|
48
48
|
@worker_api.worker_list(@config.tenant_id)
|
|
49
49
|
end
|
|
@@ -55,7 +55,7 @@ module Hatchet
|
|
|
55
55
|
# @return [Object] The updated worker
|
|
56
56
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
57
57
|
# @example
|
|
58
|
-
# updated =
|
|
58
|
+
# updated = hatchet.workers.update("worker-123", { is_paused: true })
|
|
59
59
|
def update(worker_id, opts)
|
|
60
60
|
update_request = HatchetSdkRest::UpdateWorkerRequest.new(opts)
|
|
61
61
|
@worker_api.worker_update(worker_id, update_request)
|
|
@@ -8,10 +8,10 @@ module Hatchet
|
|
|
8
8
|
# If you're looking for runs, use the Runs client instead.
|
|
9
9
|
#
|
|
10
10
|
# @example Getting a workflow
|
|
11
|
-
# workflow =
|
|
11
|
+
# workflow = hatchet.workflows.get("workflow-id")
|
|
12
12
|
#
|
|
13
13
|
# @example Listing workflows
|
|
14
|
-
# workflows =
|
|
14
|
+
# workflows = hatchet.workflows.list(workflow_name: "my-workflow", limit: 10)
|
|
15
15
|
#
|
|
16
16
|
# @since 0.1.0
|
|
17
17
|
class Workflows
|
|
@@ -33,7 +33,7 @@ module Hatchet
|
|
|
33
33
|
# @return [Object] The workflow details
|
|
34
34
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
35
35
|
# @example
|
|
36
|
-
# workflow =
|
|
36
|
+
# workflow = hatchet.workflows.get("workflow-123")
|
|
37
37
|
def get(workflow_id)
|
|
38
38
|
@workflow_api.workflow_get(workflow_id)
|
|
39
39
|
end
|
|
@@ -46,7 +46,7 @@ module Hatchet
|
|
|
46
46
|
# @return [Object] A list of workflows
|
|
47
47
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
48
48
|
# @example
|
|
49
|
-
# workflows =
|
|
49
|
+
# workflows = hatchet.workflows.list(workflow_name: "my-workflow", limit: 10, offset: 0)
|
|
50
50
|
def list(workflow_name: nil, limit: nil, offset: nil)
|
|
51
51
|
@workflow_api.workflow_list(
|
|
52
52
|
@config.tenant_id,
|
|
@@ -65,7 +65,7 @@ module Hatchet
|
|
|
65
65
|
# @return [Object] The workflow version
|
|
66
66
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
67
67
|
# @example
|
|
68
|
-
# version =
|
|
68
|
+
# version = hatchet.workflows.get_version("workflow-123", version: "v2")
|
|
69
69
|
def get_version(workflow_id, version: nil)
|
|
70
70
|
@workflow_api.workflow_version_get(workflow_id, { version: version })
|
|
71
71
|
end
|
|
@@ -78,7 +78,7 @@ module Hatchet
|
|
|
78
78
|
# @return [void]
|
|
79
79
|
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
80
80
|
# @example
|
|
81
|
-
#
|
|
81
|
+
# hatchet.workflows.delete("workflow-123")
|
|
82
82
|
def delete(workflow_id)
|
|
83
83
|
@workflow_api.workflow_delete(workflow_id)
|
|
84
84
|
end
|