1.7.0
Get from PyPI
Highlights
Workflow Update changes
💥 Breaking change on start_update
wait_for_stage=WorkflowUpdateStage.ACCEPTED
is now required when starting an update with temporalio.client.WorkflowHandle.start_update
. Although no other wait_for_stage
value is currently valid, making it required emphasizes that an update caller must wait for a response from the worker, whether using start_update
or execute_update
(in contrast to temporalio.client.Client.start_workflow
and temporalio.client.WorkflowHandle.signal
).
Waiting for handlers to finish
Workflow code can use await workflow.wait_condition(workflow.all_handlers_finished)
to wait for all update and signal handlers to complete. The worker will emit a warning every time a workflow completes or continues-as-new while signal/update handlers are still running. In general workflow code should wait for handlers to finish; an update caller will see an exception if the workflow does not wait for the update to complete.
Use the SDK's versions of asyncio.as_completed
and asyncio.wait
asyncio.as_completed
and asyncio.wait
are sometimes non-deterministic so must not be used in workflow code. Instead use the drop-in replacements provided by the SDK: workflow.as_completed
and workflow.wait
. In a future release it will be an error to use non-deterministic versions from asyncio
. When applying this change to your workflow code it should be considered backwards-incompatible, so use versioning when making this change for running workflows.
current_update_info()
Use temporalio.workflow.current_update_info()
, similar to temporalio.workflow.info()
, to obtain metadata about the current update. This includes the update ID, which is useful for in-workflow deduplication of updates (necessary when using updates with continue-as-new).
Resource-based Worker Auto-tuning (EXPERIMENTAL)
Experimental support for worker tuning has been added along with an implementation for auto-tuning based on available
resources. The temporalio.worker.Worker
class now has a temporalio.worker.Tuner
field that can be set with an instance of
temporalio.worker.WorkerTuner
. This can be a fixed-size based tuner via WorkerTuner.create_fixed
or based
on resources via WorkerTuner.create_resource_based
. Technically the interface can be manually implemented to return
custom SlotSupplier
s, but only fixed-size and resource-based slot suppliers are currently supported, custom slot
suppliers will appear in the future.
This SDK API is experimental and may change in incompatible ways in the future.
Specific Changes
2024-05-09 - f96679b - Fix issue with codecs returning passed-in payloads (#526)
2024-05-15 - a52f25d - During eviction, set is_replaying and raise special exception (#524)
2024-05-20 - 11a97d1 - Required wait update stage, update polling improvements, and other update changes (#521)
2024-05-28 - afadc15 - Allow proper stack trace on eviction deadlock (#530)
2024-06-04 - 2061835 - Update core/dependencies and call worker.validate (#541)
2024-06-04 - 365cead - Add deterministic alternatives for asyncio.wait and asyncio.as_completed (#533)
2024-06-06 - 2d65d82 - Fix GHA config for Swatinem/rust-cache@v2 (#546)
2024-06-06 - 58d6951 - Access current update info with ID inside update handler (#544)
2024-06-10 - 927415a - Remove proto wheel and other minor fixes (#547)
2024-06-17 - 18b890e - Server 1.24 related fixes (#551)
2024-06-17 - 2bb211e - Install protoc in run-bench CI job (#550)
2024-06-18 - 4f646c2 - Add __enhanced_stack_trace query to workers (#537)
2024-06-20 - 2331aa4 - Add WorkflowUpdateRPCTimeoutOrCancelledError (#548)
2024-06-26 - 2c1ac54 - New API to wait for handler executions to complete and warnings on unfinished handler executions (#556)
2024-06-26 - 7ac4445 - Expose resource based auto-tuner options (#559)
2024-07-01 - 38d9eef - Use ruff to auto-format code and sort imports. (#566)
2024-07-09 - 530cadf - skip files that are already mapped for enhanced stack traces (#574)
2024-07-10 - bcbacc2 - Experimental cloud operations client (#570)
2024-07-12 - c57df81 - Support for workflow ID conflict policy (#579)
2024-07-17 - 913b4b6 - Support query for listing schedules (#581)
2024-07-17 - e409d32 - Use minimal scope with pytest.raises (#582)
2024-07-18 - 3796ec3 - Use GH ARM runner (#580)
2024-07-19 - c4b1a01 - Update cibuildwheel (#589)
2024-07-24 - a839196 - Updated lazy loaded logger_details (#593)
2024-08-05 - 50914c4 - Honor all non-completion commands (#569)
2024-08-06 - 9142cdd - Add omes image build (#602)
2024-08-08 - 4b93d1a - Switch omes build to post merge (#604)
2024-08-09 - a5b9661 - Create commands after payload conversion (#591)
2024-08-19 - 73a1673 - Support activity retry delay (#571)
2024-08-19 - 97688cc - Unfinished handlers: add rule to warning message; test CAN, dynamic, and late-registered handlers (#612)
2024-08-20 - 185ce8c - Update Core (#605)