Skip to content

docs: add go docs for payload storage#4424

Open
lennessyy wants to merge 18 commits intomainfrom
large-payload-go
Open

docs: add go docs for payload storage#4424
lennessyy wants to merge 18 commits intomainfrom
large-payload-go

Conversation

@lennessyy
Copy link
Copy Markdown
Contributor

@lennessyy lennessyy commented Apr 9, 2026

What does this PR do?

  • Add go docs for payload storage

Notes to reviewers

┆Attachments: EDU-6196 docs: add go docs for payload storage

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment Apr 10, 2026 8:00pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

📖 Docs PR preview links

@lennessyy lennessyy marked this pull request as ready for review April 9, 2026 20:15
@lennessyy lennessyy requested a review from a team as a code owner April 9, 2026 20:15
Copy link
Copy Markdown
Contributor

@flippedcoder flippedcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of small things to consider!

layers that handle different concerns:

<CaptionedImage
src="/diagrams/data-converter-flow-with-external-storage.svg"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arrows in and out of the container looked a little weird to me in dark mode. It could be fine, just worth another look.
Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched to themed images. i think maybe after this PR i will just update our captioned images component to have a dark/light theme

@@ -0,0 +1,315 @@
---
id: large-payload-storage
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the id be changed to external-storage to match the page title? Maybe external-storage-aws if the other cloud platforms are coming later.

```go
import (
"github.com/aws/aws-sdk-go-v2/config"
awss3 "github.com/aws/aws-sdk-go-v2/service/s3"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why you aliased the import to awss3 instead of just using the default and calling s3.NewFromConfig?

<!--SNIPEND-->

By default, payloads larger than 256 KiB are offloaded to external storage. You can adjust this with the
`PayloadSizeThreshold` option, even setting it to 0 to externalize all payloads regardless of size. Refer to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`PayloadSizeThreshold` option, even setting it to 0 to externalize all payloads regardless of size. Refer to
`PayloadSizeThreshold` option, even setting it to 1 to externalize all payloads regardless of size. Refer to

The minimum value for externalizing all payloads in the Go SDK is 1. That is because the construction of the ExternalStorage struct already has this field set to 0. We interpret 0 to mean the default value.


- `Name()` returns a unique string that identifies the driver instance. The SDK stores this name in the claim check
reference so it can route retrieval requests to the correct driver. Changing the name after payloads have been stored
breaks retrieval. For example, two S3 drivers could be named `"s3-us-east"` and `"s3-eu-west"`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that drivers would actually be named after the region that they might be targeting. Maybe they'd be named for why they are stored differently.

reference so it can route retrieval requests to the correct driver. Changing the name after payloads have been stored
breaks retrieval. For example, two S3 drivers could be named `"s3-us-east"` and `"s3-eu-west"`.
- `Type()` returns a string that identifies the driver implementation. Unlike `Name()`, this must be the same across all
instances of the same driver type regardless of configuration. Both S3 drivers in the example above would return
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both S3 drivers in the example above would return"aws.s3driver" as their type.

Only the example at the top of the page would return this. The sample driver you wrote just above this would return local-disk.

Copy link
Copy Markdown
Contributor Author

@lennessyy lennessyy Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was referring the example in text s3-us-east etc, but will clarify here

storeDir string
}

func NewLocalDiskStorageDriver(storeDir string) *LocalDiskStorageDriver {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to return StorageDriver instead of *LocalDiskStorageDriver.

## Configure payload size threshold

You can configure the payload size threshold that triggers external storage. By default, payloads larger than 256 KiB
are offloaded to external storage. You can adjust this with the `PayloadSizeThreshold` option, or set it to 0 to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about how 1 is the minimum for externalizing all payloads in Go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh that's right

c, err := client.Dial(client.Options{
ExternalStorage: converter.ExternalStorage{
Drivers: []converter.StorageDriver{driver},
PayloadSizeThreshold: 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants