You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/polyglot/python.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,55 @@ async with Client(
134
134
set, control-plane methods use `control_token` and worker-plane methods use
135
135
`worker_token`.
136
136
137
+
### External Payload Storage
138
+
139
+
The SDK exports the same external-payload reference contract used by the server
140
+
and CLI storage APIs. Use it when Python activity handlers or invocable
141
+
carriers need to decode large payload references from workflow history, or when
142
+
a Python process needs to create a language-neutral payload envelope without
143
+
embedding large bytes inline.
144
+
145
+
| API | Role | Failure surface |
146
+
| --- | --- | --- |
147
+
|`ExternalStorageDriver`| Protocol for `put(data, sha256=..., codec=...)`, `get(uri)`, and `delete(uri)`. | Driver-raised storage errors. |
148
+
|`LocalFilesystemExternalStorage`| Dependency-free `file://` driver for local development and tests. |`ValueError` when a referenced URI escapes the configured root. |
149
+
|`S3ExternalStorage`| Adapter for a boto3-compatible client. |`ValueError` for foreign bucket/prefix references or non-byte responses. |
150
+
|`GCSExternalStorage`| Adapter for a google-cloud-storage-style client. |`ValueError` for foreign bucket/prefix references or non-byte responses. |
151
+
|`AzureBlobExternalStorage`| Adapter for an Azure container client. |`ValueError` for foreign container/prefix references or non-byte responses. |
152
+
|`ExternalPayloadReference`| Immutable wire reference with `uri`, `sha256`, `size_bytes`, `codec`, and schema. |`ValueError` when `from_dict()` receives an unsupported schema or malformed fields. |
153
+
|`ExternalPayloadCache`| Bounded replay cache for already verified external payload bytes. | Constructor rejects non-positive entry or byte limits. |
154
+
|`store_external_payload()`| Stores encoded bytes through a driver and returns `ExternalPayloadReference`. | Driver errors. |
155
+
|`fetch_external_payload()`| Fetches referenced bytes, then verifies size and SHA-256 before decode. |`ExternalPayloadIntegrityError` on size/hash mismatch. |
156
+
|`external_storage_envelope()`| Encodes a value inline until the threshold is crossed, then writes bytes through a driver. |`ValueError` when the threshold is invalid or no driver can resolve a reference. |
157
+
158
+
```python
159
+
from durable_workflow import (
160
+
ExternalPayloadCache,
161
+
LocalFilesystemExternalStorage,
162
+
external_storage_envelope,
163
+
to_avro_payload_value,
164
+
)
165
+
from durable_workflow.external_storage import fetch_external_payload, store_external_payload
0 commit comments