class documentation

Driver for storing and retrieving Temporal payloads in Amazon S3.

Requires an S3StorageDriverClient and a bucket. Payloads are keyed by a SHA-256 hash of their serialized bytes, segmented by namespace and workflow/activity identifiers derived from the serialization context.

Warning

This API is experimental.

Method __init__ Constructs the S3 driver.
Method name Return the driver instance name.
Async Method retrieve Retrieves payloads from S3 for the given temporalio.extstore.DriverClaim list.
Async Method store Stores payloads in S3 and returns a temporalio.extstore.DriverClaim for each one.
Method type Return the driver type identifier.
Method _get_bucket Resolve bucket using the configured strategy.
Instance Variable _bucket Undocumented
Instance Variable _client Undocumented
Instance Variable _driver_name Undocumented
Instance Variable _max_payload_size Undocumented
def __init__(self, client: S3StorageDriverClient, bucket: str | Callable[[StorageDriverStoreContext, Payload], str], driver_name: str = 'aws.s3driver', max_payload_size: int = 50 * 1024 * 1024): (source)

Constructs the S3 driver.

Parameters
client:S3StorageDriverClientAn S3StorageDriverClient implementation. Use temporalio.contrib.aws.s3driver.aioboto3.new_aioboto3_client to wrap an aioboto3 S3 client.
bucket:str | Callable[[StorageDriverStoreContext, Payload], str]S3 bucket name, access point ARN, or a callable that accepts (StorageDriverStoreContext, Payload) and returns a bucket name. A callable allows dynamic per-payload bucket selection.
driver_name:strName of this driver instance. Defaults to "aws.s3driver". Override when registering multiple S3StorageDriver instances with distinct configurations under the same temporalio.extstore.Options.drivers list.
max_payload_size:intMaximum serialized payload size in bytes that the driver will accept. Defaults to 52428800 (50 MiB). Raise this value if your workload requires larger payloads; lower it to enforce stricter limits.
def name(self) -> str: (source)

Return the driver instance name.

async def retrieve(self, context: StorageDriverRetrieveContext, claims: Sequence[StorageDriverClaim]) -> list[Payload]: (source)

Retrieves payloads from S3 for the given temporalio.extstore.DriverClaim list.

async def store(self, context: StorageDriverStoreContext, payloads: Sequence[Payload]) -> list[StorageDriverClaim]: (source)

Stores payloads in S3 and returns a temporalio.extstore.DriverClaim for each one.

Payloads are keyed by their SHA-256 hash, so identical serialized bytes share the same S3 object. Deduplication is best-effort because the same Python value may serialize differently across payload converter versions (e.g. proto binary). The returned list is the same length as payloads.

def type(self) -> str: (source)

Return the driver type identifier.

def _get_bucket(self, context: StorageDriverStoreContext, payload: Payload) -> str: (source)

Resolve bucket using the configured strategy.

Undocumented

Undocumented

_driver_name = (source)

Undocumented

_max_payload_size = (source)

Undocumented