Overview
V2 removes everything that was deprecated in V1 and tightens the types that were previously coerced. See the V2 migration guide for before and after examples of every breaking change, including a quick reference table suitable for handing to a coding agent.
Removed
- The
run_no_wait,aio_run_no_wait,run_many_no_wait, andaio_run_many_no_waitmethods. Passwait_for_result=Falsetorun,aio_run,run_many, andaio_run_manyinstead. - The
optionsparameter onrun,aio_run,schedule,aio_schedule, andcreate_bulk_run_item, and onevents.pushandevents.aio_push. Pass the fields as keyword arguments instead.PushEventOptionsandBulkPushEventOptionshave been removed. - The
keyparameter oncreate_bulk_run_item. Usechild_keyinstead. - The
parent_id,parent_step_run_id,child_index,key, andnamespacefields onTriggerWorkflowOptionsandScheduleTriggerWorkflowOptions, and thekeyfield onWorkflowRunTriggerConfig. - The
desired_worker_idparameter onrun,aio_run, andcreate_bulk_run_item, and thedesired_worker_idfield onTriggerWorkflowOptions. Passsticky=Trueto run a child on the same worker as the task that triggers it. EmptyModel. Tasks and workflows with no input validator now receiveNoneas their input, and running a task that returns nothing givesNone.- Every SDK enum. Fixed sets of choices are plain strings typed as
Literals:RunStatus("QUEUED","RUNNING","COMPLETED","CANCELLED","FAILED"),Priority("LOW","MEDIUM","HIGH"),WorkerLabelComparator("EQUAL","LESS_THAN", ...),SlotType("default","durable"),HTTPMethod,OTelAttribute(the span attribute name, such as"step_name"), andWorkerStatus. These names survive asLiteraltype aliases.ConcurrencyLimitStrategy,StickyStrategy,RateLimitDuration, andMCPProviderare gone entirely; pass the member name as a string (for example"CANCEL_IN_PROGRESS","SOFT","MINUTE","CLAUDE").QUEUE_NEWESTandQUEUE_OLDESThave no replacement, since the engine no longer supports them. - String durations such as
"10s".execution_timeout,schedule_timeout,ctx.refresh_timeout,ctx.aio_sleep_for, andSleepConditiononly accept atimedelta. - Integer priorities. Every
priorityanddefault_priorityparameter and field only accepts"LOW","MEDIUM", or"HIGH". Usepriority_to_intfromhatchet_sdk.types.priorityto compare them. TaskDefaults.priority, which was never read. Setdefault_priorityon the workflow instead.dictvalues fordesired_worker_labels, and integercomparatorvalues onDesiredWorkerLabel. Use alist[DesiredWorkerLabel]and a comparator name such as"EQUAL".dictvalues for thelabelsargument tohatchet.workerand theWorkerconstructor. Use alist[WorkerLabel].- Synchronous durable tasks. Declaring one raises a
TypeError. ctx.step_run_id,ctx.workflow_input,ctx.input,ctx.done,ctx.exit_flag,ctx.aio_task_output,ctx.fetch_task_run_error, andctx.worker, along with theWorkerContextclass. Usectx.task_run_id, the task'sinputargument,ctx.is_cancelled,ctx.task_output,ctx.get_task_run_error,ctx.worker_id,ctx.worker_labels, andctx.upsert_worker_labels.ctx.trigger_data. Usectx.filter_payload, which holds itsfilter_payloadentry.- The
raise_on_errorparameter onctx.logandctx.aio_log. - Internal
Contextproperties:data,action,dispatcher_client,admin_client,event_client,runs_client,log_sender, anddurable_event_listener, andDurableContext.wait_index. Hatchet.get_current_context(). Use thehatchet.current_contextproperty.- The
debugandclientparameters on theHatchetconstructor, thedebugparameter on theWorkerconstructor, and the internalhatchet_sdk.client.Clientclass. SetHATCHET_CLIENT_DEBUG=trueand passconfig=ClientConfig(...)instead. - The
handle_killparameter on theWorkerconstructor.Worker.start()returns after a graceful shutdown instead of exiting the process. - The
hatchet.listenerandhatchet.dispatcherproperties, thelog,stream, andaio_streammethods and thetokenandnamespaceattributes on the events client, and theworkflow_run_listener,workflow_run_event_listener, andadmin_clientproperties onhatchet.runs,WorkflowRunRef, andTaskRunRef. runs.list_with_paginationandruns.aio_list_with_pagination.runs.listandruns.aio_listnow paginate internally.workers.updateandworkers.aio_update. Useworkers.pauseandworkers.unpause, or theiraio_variants.- The
statusesparameter onscheduled.bulk_deleteandscheduled.aio_bulk_delete. The API has no status filter for bulk deletes, so it was ignored. - The
streammethod onWorkflowRunRefandTaskRunRef. Usehatchet.streams, or the deprecatedhatchet.runs.aio_subscribe_to_stream(ref.workflow_run_id). - The
create_traceparent,parse_carrier_from_metadata, andinject_traceparent_into_metadatafunctions inhatchet_sdk.opentelemetry.instrumentor.HatchetInstrumentorhas propagated the traceparent automatically since 1.11.0. WorkerStartOptionsand theoptionsparameter onWorker.start, andWorker.register_workflow_from_opts.- Internal
Worker,Workflow,Task, and condition attributes and methods, includingworker.config,worker.slot_config,worker.labels,worker.action_registry,worker.exit_gracefully,workflow.config,workflow.client,workflow.service_name,workflow.create_action_name,workflow.to_proto,task.fn,task.slot_requests,task.call,task.aio_call,task.to_proto, the task settings (task.type,task.retries,task.execution_timeout,task.schedule_timeout,task.parents,task.rate_limits,task.desired_worker_labels,task.backoff_factor,task.backoff_max_seconds,task.concurrency,task.wait_for,task.skip_if,task.cancel_if,task.batch, andtask.eviction_policy),Standalone.is_async_function, thebaseattribute andto_protomethod on conditions, thehatchet_sdk.conditions.Actionenum, andDepends(...).fn.task.nameis still public. TaskRunError.serialize,TaskRunError.deserialize, andTaskRunError.from_exception. Usestr(error), or theexc,exc_type, andtraceattributes.- The
config,tracer_provider, andmeter_providerattributes and theextract_bound_argsmethod onHatchetInstrumentor. - The
StepRunEventTypeandWorkflowRunEventTypeexports, and theStepRunEventclass.runs.aio_subscribe_to_streamyields plainstrchunks, so there are no event types to match on. - The
event_timestampfield onEventand itseventTimestampandadditionalMetadataaliases. Useseen_atandadditional_metadata. - The
hatchet_sdk.labels,hatchet_sdk.rate_limit, andhatchet_sdk.utils.prioritymodule aliases. - The re-exports in the
hatchet_sdk.typespackage (DesiredWorkerLabel,WorkerLabelComparator,Priority,RateLimit, andSlotType). Import them fromhatchet_sdk. - Top-level
hatchet_sdkexports of the V0 REST models, the pagination wrapper types, andCreateWorkflowVersionOpts. Import REST models fromhatchet_sdk.clients.rest.models. - The
PARENT_ID,PARENT_STEP_RUN_ID,CHILD_INDEX, andDESIRED_WORKER_IDmembers ofOTelAttribute. Their values (parent_id,parent_step_run_id,child_index,desired_worker_id) are no longer valid entries inOpenTelemetryConfig.excluded_attributesorHATCHET_CLIENT_OPENTELEMETRY_EXCLUDED_ATTRIBUTES. - The
hatchet.namespaceandhatchet.keyattributes on the run, bulk run, and schedule spans. The child key is still reported ashatchet.child_key. The run, bulk run, and durable spawn spans also no longer sethatchet.desired_worker_id. - The
V1TaskStatusexport fromhatchet_sdk. UseRunStatusinstead. RunStatus.from_proto,RunStatus.from_v1_task_status, andRunStatus.to_v1_task_status.ctx.pause_rate_limitandctx.aio_pause_rate_limit. Usehatchet.rate_limits.pauseandhatchet.rate_limits.aio_pause.- The
ScheduledRunStatus,CronWorkflowsOrderByField,ScheduledWorkflowsOrderByField,RateLimitOrderByField,RateLimitOrderByDirection,WorkflowRunOrderByDirection,V1WebhookSourceName,V1WebhookHMACAlgorithm,V1WebhookHMACEncoding,V1WebhookBasicAuth,V1WebhookAPIKeyAuth, andV1WebhookHMACAuthexports fromhatchet_sdk. - The
TriggerWorkflowOptions,ScheduleTriggerWorkflowOptions,RunEventListener, andWorkflowConfigexports fromhatchet_sdk. No public method accepts them now that theoptionsparameters are gone. To build aWorkflowRunTriggerConfig, usecreate_bulk_run_iteminstead of constructing one by hand.
Changed
- Python 3.11 or newer is required.
- Optional parameters that follow a method's main arguments are keyword-only, so passing them positionally raises a
TypeError. This coversrun,aio_run,run_many,aio_run_many,create_bulk_run_item,schedule,aio_schedule,create_cron,aio_create_cron,create_filter,aio_create_filter,list_runs,aio_list_runs,pause,aio_pause,mock_run, andaio_mock_runon workflows and tasks; thetask,durable_task,batch_task,on_failure_task, andon_success_taskdecorators on a workflow (aftername);hatchet.workerand theWorkerconstructor;poll_intervalonWorkflowRunRef.resultandTaskRunRef.result;SleepCondition,UserEventCondition, andParentCondition; thelabelparameter onctx.aio_sleep_forandctx.aio_sleep_until;streams.aio_reset; everyHatchetInstrumentorparameter; and, along with theiraio_variants,cel.debug,crons.create,crons.list,events.push,events.list,filters.create,filters.list,logs.list,metrics.get_task_metrics,rate_limits.put,rate_limits.list,runs.list,runs.create,runs.reset_durable_task,scheduled.create,scheduled.list,streams.topic_metadata,webhooks.create,webhooks.update,webhooks.list,workflows.list,workflows.get_version, andworkflows.pause. Pass these arguments by keyword.inputandadditional_metadataoncrons.createandscheduled.createare still required. hatchet.eventhas been renamed tohatchet.events, andhatchet.cronhas been renamed tohatchet.crons, consistent with the other (plural) feature clients.runs.subscribe_to_streamhas been renamed toruns.aio_subscribe_to_stream, consistent with theaio_prefix on every other async method.streams.publishhas been renamed tostreams.aio_publish, andstreams.subscribehas been renamed tostreams.aio_subscribe, since both are async.runs.bulk_replay_by_filters_with_paginationandruns.bulk_cancel_by_filters_with_pagination, and theiraio_variants, have been renamed tobulk_replay_by_filters_in_chunksandbulk_cancel_by_filters_in_chunks. Theirsleep_timeparameter (an integer number of seconds) has been renamed todelay_between_chunksand takes atimedelta.ConcurrencyExpressionhas been renamed toConcurrencyStrategy, and itslimit_strategyfield has been renamed tostrategy.TriggerWorkflowOptions.desired_worker_labelhas been renamed todesired_worker_labelsand only accepts alist[DesiredWorkerLabel].- Every
listandaio_listmethod on the feature clients returns a plainlistinstead of a paginated wrapper, so there is no.rowsto unwrap. crons.create,crons.get,crons.list, theiraio_variants, andworkflow.create_cronreturn the SDK'sCronTriggerinstead of theCronWorkflowsREST model. Readcron.idinstead ofcron.metadata.id,cron.created_atandcron.updated_atinstead ofcron.metadata.created_atandcron.metadata.updated_at, andcron.expressioninstead ofcron.cron.inputandadditional_metadataare empty dictionaries instead ofNonewhen unset.scheduled.create,scheduled.update,scheduled.get,scheduled.list, theiraio_variants, andworkflow.scheduleandworkflow.aio_schedulereturn the SDK'sScheduledRun. Thescheduledclient previously returned theScheduledWorkflowsREST model, so readscheduled.idinstead ofscheduled.metadata.id.workflow.schedulepreviously returned the V0WorkflowVersionprotobuf, so readscheduled.idinstead ofscheduled.scheduled_workflows[0].id.ScheduledRun.workflow_run_statusis aRunStatus, orNonebefore the schedule has triggered:PENDING,QUEUED, andBACKOFFbecomeQUEUED, andSUCCEEDEDbecomesCOMPLETED.inputandadditional_metadataare empty dictionaries instead ofNonewhen unset.runs.list,runs.get_task_run, theiraio_variants, andworkflow.list_runsandworkflow.aio_list_runsreturn the SDK'sTaskRunSummaryinstead of theV1TaskSummaryREST model. Readrun.idinstead ofrun.metadata.id,task_run_idinstead oftask_external_id,workflow_run_idinstead ofworkflow_run_external_id, andparent_task_run_idinstead ofparent_task_external_id.durationis atimedeltainstead of an integer number of milliseconds, andadditional_metadatais an empty dictionary instead ofNonewhen unset. The internaltask_id,task_inserted_at,step_id,action_id, andworkflow_configfields have been dropped.- The
workflow.idproperty has been replaced byworkflow.get_id()andworkflow.aio_get_id(), which fetch the ID on the first call and cache it. filters.updateandfilters.aio_updatetakeexpression,scope, andpayloadkeyword arguments instead of aV1UpdateFilterRequest. Fields left asNoneare not changed.ctx.aio_wait_forreturns alist[SleepResult | EventWaitResult | OrGroupResult]instead of adict, andctx.aio_wait_for_eventreturns anEventWaitResultwhose.payloadholds the event data.ctx.aio_wait_forno longer takes a signal key as its first argument. Pass the conditions directly, and passsignal_key=by keyword if you need a specific key. When it is left out, the key is generated from the order of the wait within the task run, which is stable across replays.ctx.refresh_timeout,ctx.aio_refresh_timeout,ctx.put_stream, andctx.aio_put_streamraise when the request fails, instead of logging the error and returning.ctx.prioritynow returns"LOW","MEDIUM","HIGH", orNoneinstead ofint | None.ctx.worker_labelsis alist[WorkerLabel]instead of adict, andctx.upsert_worker_labelsandctx.aio_upsert_worker_labelstake alist[WorkerLabel], matching thelabelsargument tohatchet.worker.- The
task_run_errorsparameter onmock_runandaio_mock_runtakes adict[str, TaskRunError]instead of serialized error strings, matchingctx.task_run_errors. Theirtrigger_dataparameter has been replaced byfilter_payload, which setsctx.filter_payload. from hatchet_sdk import Eventnow resolves to the SDK's own event class instead of the V0 REST model. Every method on the events client returns it:push,bulk_push,get, andlist, along with theiraio_variants.getandlistpreviously returned theV1EventREST model, so readevent.idinstead ofevent.metadata.id.Event.event_idhas been renamed toEvent.id.Event.payloadandEvent.additional_metadataare now dictionaries instead of JSON strings, so there is no need to calljson.loadson them.additional_metadatais an empty dictionary when the event has none.BulkPushEventWithMetadata.keyis now required.workflow.input_validatorandworkflow.input_validator_typereturnNonefor a workflow with no input validator.Worker.register_workflownow raises on registration failure instead of callingsys.exit(1), andWorker.start()raises if the action listener process fails to start, also instead of callingsys.exit(1).Worker.start()returns after a graceful shutdown (onSIGTERMorSIGINT, or afterterminate_worker_after_num_taskstasks) instead of callingsys.exit(0), so code afterworker.start()now runs. A forced shutdown still exits with status 1.FailedTaskRunExceptionGroupis now anExceptionGroup[TaskRunError]instead of aValueError.except ValueErrorno longer catches it, andexcept* TaskRunErrordoes..exceptionsis a tuple instead of a list, and holds a singleTaskRunErrorcarrying the message when the run failed without reporting any task errors.str()is unchanged, and.messagenow holds the same text, the run's failure message followed by each task error, sopytest.raises(FailedTaskRunExceptionGroup, match=...)still matches on task errors.backoff_max_seconds(an integer number of seconds) has been renamed tobackoff_maxand takes atimedelta, on every task decorator and onTaskDefaults. It is sent to the engine as whole seconds.poll_intervalonWorkflowRunRef.resultandTaskRunRef.resulttakes atimedeltainstead of a number of seconds.ClientConfig.sync_result_poll_intervalis atimedeltainstead of afloat.HATCHET_CLIENT_SYNC_RESULT_POLL_INTERVALis still a number of seconds.DEFAULT_SYNC_RESULT_POLL_INTERVAL_SECONDSinhatchet_sdk.confighas been renamed toDEFAULT_SYNC_RESULT_POLL_INTERVALand is atimedelta.ClientConfig.listener_v2_timeout(an integer number of seconds) has been renamed toaction_listener_timeoutand takes atimedelta. Its environment variable is nowHATCHET_CLIENT_ACTION_LISTENER_TIMEOUT, still a number of seconds.EmbeddedHatchetConfig.ready_timeout_secondshas been renamed toready_timeoutand takes atimedelta. Its environment variable is nowHATCHET_CLIENT_EMBEDDED_READY_TIMEOUT, still a number of seconds.DEFAULT_READY_TIMEOUT_SECONDSinhatchet_sdk.confighas been renamed toDEFAULT_EMBEDDED_READY_TIMEOUTand is atimedelta.OpenTelemetryConfig.include_task_name_in_start_step_run_span_namehas been renamed toinclude_task_name_in_span_name, and its environment variable toHATCHET_CLIENT_OPENTELEMETRY_INCLUDE_TASK_NAME_IN_SPAN_NAME.HealthcheckConfig.event_loop_block_threshold_secondshas been renamed toevent_loop_block_threshold, and its environment variable toHATCHET_CLIENT_WORKER_HEALTHCHECK_EVENT_LOOP_BLOCK_THRESHOLD.ClientTLSConfig.strategyis now typed asLiteral["tls", "mtls", "none"].TaskDefaultsrejects unknown fields, so a leftover field such asbackoff_max_secondsorpriorityraises aValidationErrorinstead of being ignored.WorkerLabel.keyis required, andDesiredWorkerLabelno longer subclassesWorkerLabel.- The default
readable_data_keyof aParentConditionis the parent task's name, followed by:and the expression when one is set. It previously also included the time the condition was created, so the workflow definition changed every time the worker started. TwoParentConditions on the same task with the same parent and expression now need distinctreadable_data_keyvalues, or registering the workflow raises aValueError. RunStatusis now the only run status type. Every status the SDK accepts or returns is aRunStatus, includingTaskRunSummary.status,ScheduledRun.workflow_run_status, thestatusfield on REST models, and thestatusesfilters onruns.listandevents.list.- The
statusesfilter onscheduled.listandscheduled.aio_listtakesRunStatusvalues, plus"SCHEDULED"for schedules that have not triggered yet, instead ofScheduledRunStatus. - The
order_by_fieldandorder_by_directionparameters oncrons.list,scheduled.list,rate_limits.list, and theiraio_variants take snake_case strings ("created_at","trigger_at","limit_value", ...) and"asc"or"desc", instead of the REST ordering enums. webhooks.createandwebhooks.aio_createtakeWebhookBasicAuth,WebhookAPIKeyAuth, orWebhookHMACAuth, with snake_case fields and string HMAC algorithms and encodings, instead of theV1Webhook*AuthREST models.source_nameonwebhooks.createandsource_namesonwebhooks.listare strings.NotFoundExceptionhas been renamed toNotFoundError.- The events client module has moved from
hatchet_sdk.clients.eventstohatchet_sdk.features.events, alongside the other feature clients. - The
parent_step_run_idparameter onscheduled.bulk_deleteandscheduled.aio_bulk_deletehas been renamed toparent_task_run_id. - Worker log messages and error messages refer to tasks instead of steps.
NonRetryableExceptionhas been renamed toNonRetryableError, andRetryAfterExceptionhas been renamed toRetryAfterError.ctx.task_run_errorsreturns adict[str, TaskRunError]instead of a dictionary of serialized error strings, and no longer logs an error when there are no upstream errors.BulkCancelReplayOptshas been renamed toBulkCancelReplayOptions, and theoptsparameter onruns.bulk_cancelandruns.bulk_replayhas been renamed tooptions.- The
run_atparameter onscheduleandaio_schedulehas been renamed totrigger_at, matching the scheduled runs client and thetrigger_atfield on scheduled runs. - Run ID parameters now use one name per kind of ID.
runs.get_result,runs.get_details, and theget_run_ref,get_result, andaio_get_resultmethods on a standalone task takeworkflow_run_id.runs.reset_durable_tasktakestask_run_idinstead oftask_external_id.runs.cancelandruns.replaykeeprun_id, since they accept either kind. Theparent_task_external_idandtriggering_event_external_idfilters onruns.list,metrics.get_task_metrics,workflow.list_runs, and theiraio_variants have been renamed toparent_task_run_idandtriggering_event_id. runs.list,runs.aio_list,workflow.list_runs, andworkflow.aio_list_runspage through every result internally, and leavinglimitunset returns every matching run. In V1,runs.listreturned the first 50 runs, andworkflow.list_runsreturned up to 100 runs for each day in the range.limitandoffsetnow apply to the whole time range.from hatchet_sdk import Workflownow resolves to the workflow class returned byhatchet.workflow()instead of the REST model, and theWorkflowVersionREST model is no longer exported fromhatchet_sdk.- Passing an input when running, scheduling, or bulk running a task or workflow that has no
input_validatorraises aTypeErrorinstead of silently dropping the input. Declareinput_validator=dict[str, Any]to accept untyped input. schedule_timeout,execution_timeout, andretriesonWorkflow.task,Workflow.durable_task,Workflow.on_failure_task, andWorkflow.on_success_task, andschedule_timeoutandexecution_timeoutonWorkflow.batch_task, default toNone, which falls back to the workflow'stask_defaultsand then to the built-in defaults (5 minutes, 60 seconds, and 0).on_failure_taskandon_success_taskpreviously ignoredtask_defaults, includingbackoff_factorandbackoff_max. An explicit value that equals a built-in default, such asretries=0, is no longer replaced bytask_defaults.IdempotencyCollisionErrorandBulkTriggerIdempotencyCollisionErrornow carry a message naming the colliding runs.- Scheduling a run with a timezone-aware, non-UTC datetime no longer logs a warning. The datetime was already converted correctly.
resultandaio_resultonWorkflowRunRefandTaskRunRefraiseRuntimeErrorinstead ofValueErrorwhen fetching the run's status fails repeatedly. A cancelled run still raisesValueError.ctx.aio_wait_for_eventraises aValueErrorif the wait completes without a matching event.ctx.aio_wait_forraises aValueErrorif two of its conditions have the samereadable_data_key, which includes identical conditions with default keys in differentOrGroups. Previously one of their results was silently dropped.ctx.task_output(parent)returns adictfor a parent task with no return annotation, and running ahatchet.stubs.taskwith nooutput_validatorreturns the remote task's output as adict, both instead of anEmptyModelwith attribute access.hatchet_sdk.types.idempotency.BaseIdemotencyConfighas been renamed toBaseIdempotencyConfig.hatchet_sdk.runnables.contextvars.ctx_step_run_idhas been renamed toctx_task_run_external_id.- The generated REST client packages import their models and APIs on first use, which makes
import hatchet_sdkfaster.
Added
resultandaio_resultonWorkflowRunRefandTaskRunRefaccept an optionaltimeout(atimedelta) and raiseTimeoutErrorwhen it elapses.CronTrigger,ScheduledRun, andTaskRunSummary, the SDK's own models for cron triggers, scheduled runs, and task run summaries.SleepResult,EventWaitResult,OrGroupResult,HTTPMethod,CronTrigger,ScheduledRun,TaskRunSummary,TaskRunDetail,WorkflowRunDetail,TaskMetrics,NotFoundError,WebhookBasicAuth,WebhookAPIKeyAuth,WebhookHMACAuth,WebhookSourceName,WebhookHMACAlgorithm, andWebhookHMACEncodingare exported fromhatchet_sdk, so every type a public method accepts or returns can be imported from the top level.durable_taskdecorators acceptslot_cost, controlling how many durable slots the task consumes.hatchet.batch_taskacceptson_events,on_crons,cron_input, anddefault_additional_metadata, matching the other standalone task decorators.hatchet.tenant, a client for reading details about the current tenant.Standalone, the class returned by thehatchet.task,hatchet.durable_task, andhatchet.batch_taskdecorators, is exported fromhatchet_sdk.
Deprecated
ctx.put_stream,ctx.aio_put_stream, andhatchet.runs.aio_subscribe_to_stream, which now emit aDeprecationWarning. Use durable streams (hatchet.streams.aio_publishandhatchet.streams.aio_subscribe) instead.
Fixed
- Running a standalone task that returned
{}orNoneno longer gives the caller a dictionary keyed by the task name. A task annotated to return adictgives{}, and a task with no return annotation or one that allowsNonegivesNone. - A
hatchet.batch_taskwith noinput_validatornow receivesNonefor each item, like every other task with no input validator. - Passing a tuple of
ConcurrencyStrategyobjects asconcurrencytohatchet.taskorhatchet.durable_taskno longer discards them, and passing a singleConcurrencyStrategytoworkflow.task,workflow.durable_task,workflow.on_failure_task, orworkflow.on_success_taskno longer fails when the workflow is registered. mock_runandaio_mock_runnow pass adictinput through to the task instead of replacing it with{}.- Cron expressions that use day or month names, or ranges with steps, such as
0 9 * * MON-FRI, are no longer rejected before they reach the engine. ctx.aio_sleep_untilwith a time in the past completes immediately instead of sleeping for a negative duration.HATCHET_CLIENT_TENACITY_*environment variables set afterhatchet_sdkis imported are now read when aClientConfigis created.TaskRunErrorsetsargs, so it can be pickled.- The
hatchet.durable.wait_forspan reports the actual number of conditions inhatchet.num_conditionsinstead of always 2, and leaves outhatchet.signal_keywhen the key was generated. HatchetInstrumentor.uninstrument()now also unwrapsevents.aio_pushandevents.aio_bulk_push.
Documentation for agents
The linked pages serve plain markdown for tools and agents. Full docs index: https://docs.hatchet.run/llms.txt
Setup and local development:
- Quickstart: https://docs.hatchet.run/v1/quickstart.md
- Running Hatchet locally: https://docs.hatchet.run/v1/running-locally.md
- Embedded mode: https://docs.hatchet.run/v1/embedded.md
Core concepts:
- Tasks: https://docs.hatchet.run/v1/tasks.md
- Workers: https://docs.hatchet.run/v1/workers.md
- Running tasks: https://docs.hatchet.run/v1/running-your-task.md
- DAGs: https://docs.hatchet.run/v1/directed-acyclic-graphs.md
- Durable execution: https://docs.hatchet.run/v1/durable-execution.md
Flow control:
- Concurrency: https://docs.hatchet.run/v1/concurrency.md
- Rate limits: https://docs.hatchet.run/v1/rate-limits.md
- Retries: https://docs.hatchet.run/v1/retry-policies.md
- Idempotency: https://docs.hatchet.run/v1/idempotency.md
- CEL expressions: https://docs.hatchet.run/v1/cel-expressions.md
Python SDK reference (overview: https://docs.hatchet.run/reference/python.md):
- CEL: https://docs.hatchet.run/reference/python/feature-clients/cel.md (guide: https://docs.hatchet.run/v1/cel-expressions.md)
- Crons: https://docs.hatchet.run/reference/python/feature-clients/crons.md (guide: https://docs.hatchet.run/v1/cron-runs.md)
- Events: https://docs.hatchet.run/reference/python/feature-clients/events.md (guide: https://docs.hatchet.run/v1/events.md)
- Filters: https://docs.hatchet.run/reference/python/feature-clients/filters.md (guide: https://docs.hatchet.run/v1/events.md)
- Logs: https://docs.hatchet.run/reference/python/feature-clients/logs.md (guide: https://docs.hatchet.run/v1/logging.md)
- Metrics: https://docs.hatchet.run/reference/python/feature-clients/metrics.md (guide: https://docs.hatchet.run/v1/prometheus-metrics.md)
- Rate Limits: https://docs.hatchet.run/reference/python/feature-clients/rate_limits.md (guide: https://docs.hatchet.run/v1/rate-limits.md)
- Runs: https://docs.hatchet.run/reference/python/feature-clients/runs.md (guide: https://docs.hatchet.run/v1/running-your-task.md)
- Scheduled Runs: https://docs.hatchet.run/reference/python/feature-clients/scheduled.md (guide: https://docs.hatchet.run/v1/scheduled-runs.md)
- Streams: https://docs.hatchet.run/reference/python/feature-clients/streams.md
- Stubs: https://docs.hatchet.run/reference/python/feature-clients/stubs.md (guide: https://docs.hatchet.run/v1/inter-service-triggering.md)
- Tenant: https://docs.hatchet.run/reference/python/feature-clients/tenant.md
- Webhooks: https://docs.hatchet.run/reference/python/feature-clients/webhooks.md (guide: https://docs.hatchet.run/v1/webhooks.md)
- Workers: https://docs.hatchet.run/reference/python/feature-clients/workers.md (guide: https://docs.hatchet.run/v1/workers.md)
- Workflows: https://docs.hatchet.run/reference/python/feature-clients/workflows.md (guide: https://docs.hatchet.run/v1/tasks.md)
Installation
Install the SDK using pip:
pip install hatchet-sdkOr using poetry:
poetry add hatchet-sdkDocumentation
For detailed documentation, examples, and best practices, visit: