Skip to main content
Python SDK v1.0.3

What’s Changed

View on GitHub
Python SDK v1.0.2

What’s Changed

View on GitHub
Python SDK v1.0.1

What’s Changed

View on GitHub
Python SDK v1.0.0
The Restate Python SDK reaches 1.0! 🎉This release brings many new features to the SDK to use together with Restate 1.7: scope and limit keys for flow control, signals for direct invocation-to-invocation communication, terminal error metadata, and several other improvements.

New Features

(Preview) Scope and limit key to enable flow control

This release adds the SDK API for flow control, the new Restate 1.7 feature to cap how many invocations run concurrently within a scope, with optional hierarchical limit keys. Use it to bound cost (especially for AI agents, where every concurrent invocation is real model/API spend), shield downstream systems from bursts, and share capacity fairly across tenants.To use scope and limit keys in service to service communication:
The scope also becomes part of the invocation’s identity and is exposed back on ctx.request().scope / ctx.request().limit_key.Check out the Flow control documentation for more details on how concurrency limits work and how to set them up.
NOTE: This API is in preview and is not enabled by default. To use it in restate-server 1.7, enable the flow control and protocol v7 experimental features via RESTATE_EXPERIMENTAL_ENABLE_PROTOCOL_V7=true and RESTATE_EXPERIMENTAL_ENABLE_VQUEUES=true (new clusters only). See https://docs.restate.dev/services/flow-control for details.

Signals

Signals let invocations communicate directly with each other: one invocation waits for a named signal, and any other handler can resolve or reject it by referencing the target invocation’s ID.
NOTE: Signals require restate-server 1.7 with RESTATE_EXPERIMENTAL_ENABLE_PROTOCOL_V7=true enabled.

TerminalError metadata

TerminalError now carries an optional metadata dictionary, propagated alongside the error message and status code. Use it to attach structured, machine-readable context to terminal failures.

General improvements

  • New cooperative suspensions behavior when awaiting futures (#192): the SDK now propagates the full tree of pending futures to the shared core to decide when and how to suspend, resulting in less concurrency-quota thrashing when fanning out many requests from one handler to others.
  • Cheaper ctx.run round-trips: instead of echoing the full completion message back to the SDK after storing a ctx.run result, the runtime replies with an ack message. This noticeably cuts network cost for handlers with many or large ctx.run entries.
  • zstd response compression on AWS Lambda (#206): on Python 3.13 or older, install the optional dependency with pip install restate_sdk[zstd] to enable it.
  • Fixed a race condition in the LangChain turnstile (#198).
  • Require tool calls to carry an ID in the LangChain extension (#199).
  • Journal the tool message ID (#200).
  • pydantic: use current_context() in RestateModelWrapper.request_stream, fixing an AttributeError on streaming / event_stream_handler (#201).
NOTE: The cooperative suspensions and run-acks improvements above are enabled in restate-server 1.7 with RESTATE_EXPERIMENTAL_ENABLE_PROTOCOL_V7=true set up.

What’s Changed

New Contributors

View on GitHub
Python SDK v0.18.1
  • PR 198 Fixed race condition in LangChain integration
View on GitHub
Python SDK v0.18.0

What’s Changed

View on GitHub
Python SDK v0.17.1

What’s Changed

View on GitHub
Python SDK v0.17.0

What’s Changed

New Contributors

View on GitHub
Python SDK v0.16.0

What’s Changed

  • Pydantic AI integration: upgrade pydantic ai library to 1.68.0. Disable autowrapping tools in ctx.run. Default retry strategy for LLM calls is now 10 attemps with 1 second minimum interval.
  • Google ADK integration: Added RestateEventsSummarizer to wrap LLM summarization calls in durable steps and added flushing compaction events in append_event to Restate.

Bug fixes

New Contributors

View on GitHub
Python SDK v0.15.0

What’s Changed

View on GitHub
Python SDK v0.14.2

What’s Changed

View on GitHub
Python SDK v0.14.0

What’s Changed

New Contributors

View on GitHub
Python SDK v0.13.2

What’s Changed

View on GitHub
Python SDK v0.13.1

What’s Changed

New Contributors

View on GitHub
Python SDK v0.13.0

New features :tada:

  • Use context manager together with service handlers:
  • Add msgspec support, works out of the box when adding restate_sdk[serde] dependency:
  • Add extension modules for Google ADK and OpenAI, more info soon!

What’s Changed

New Contributors

View on GitHub
Python SDK v0.12.0

New features :tada:

  • Added ingress client to send requests from your python applications to restate services:
  • Added new test harness constructor to be used in combination with @pytest.fixture:

What’s Changed

View on GitHub
Python SDK v0.11.0

New features

  • You can configure more retry options for ctx.run_typed:
  • You can now provide a name to sleep, you’ll be able to see this name in the UI.

Notable changes

  • When suspending, the SDK will now throw an asyncio.CancelledError, instead of the previously thrown custom error. Catch this exception only if you need to cleanup some external resources between execution attempts.

What’s Changed

View on GitHub
Python SDK v0.10.2
Removed typing_extensions dependency.View on GitHub
Python SDK v0.10.1

What’s Changed

View on GitHub
Python SDK v0.10.0

Invocation retry policy

When used with Restate 1.5, you can now configure the invocation retry policy from the SDK directly. See https://github.com/restatedev/restate/releases/tag/v1.5.0 for more details on the new invocation retry policy configuration.

What’s Changed

View on GitHub
Python SDK v0.9.1

What’s Changed

View on GitHub
Python SDK v0.9.0

New features :sparkles:

View on GitHub
Python SDK v0.8.1

What’s Changed

New Contributors

View on GitHub
Python SDK v0.8.0
  • Introduce new Service/Object/Workflow constructor fields and the decorator fields inactivity_timeout, abort_timeout, journal_retention, idempotency_retention, ingress_private, workflow_retention. Please note these work only from Restate 1.4 onward. Check the in-code documentation for more details.
  • Improved error messages

What’s Changed

New Contributors

View on GitHub
Python SDK v0.7.2

What’s Changed

View on GitHub
Python SDK v0.7.1

What’s Changed

View on GitHub
Python SDK v0.7.0

What’s Changed

View on GitHub
Python SDK v0.6.0
We are pleased to announce the release of the Python SDK 0.6.0, in combination with Restate 1.3. Check out the announcement blog post for more details about Restate 1.3 and the new SDK features: https://restate.dev/blog/announcing-restate-1.3/Check out the docs and examples to learn about the latest features: https://docs.restate.dev/category/python-sdk/

What’s Changed

New Contributors

View on GitHub
Python SDK v0.5.1

What’s Changed

New Contributors

View on GitHub
Python SDK v0.4.1

What’s Changed

View on GitHub
Python SDK v0.4.0

What’s Changed

View on GitHub
Python SDK v0.3.0

Breaking changes

This SDK is compatible only with Restate >= 1.1

New features

  • It is now possible to configure the max number of retry attempts/max duration of retries for ctx.run

What’s Changed

View on GitHub
Python SDK v0.2.0

New features

  • AWS Lambda support. Develop your service as usual and when deploying on AWS Lambda set the handler name to the variable containing restate.app.
  • Implement request verification, to secure your service when interacting with Restate cloud: https://docs.restate.dev/deploy/cloud#http
  • Implement ctx.state_keys() and ctx.clear_all()

What’s Changed

  • We now test the SDK with the new SDK test tool
View on GitHub