Skip to content

Conversation

@simvlad
Copy link
Contributor

@simvlad simvlad commented Jan 12, 2026

What changed?

Added TemporalExternalPayloadSizeBytes and TemporalExternalPayloadCount to Visibility Schema as pre-defined search attribute.

Why?

We are planning to expose external payload size and count as the search attributes. They are pre-defined, rather than system, because they won't be set on every single workflow, but only ones which store large payloads externally (e.g. in S3).

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

Incorrectly modified schema

@simvlad simvlad requested review from a team as code owners January 12, 2026 22:06
@simvlad simvlad marked this pull request as draft January 14, 2026 20:54
@simvlad simvlad marked this pull request as ready for review January 14, 2026 22:03
@@ -0,0 +1,25 @@
ALTER TABLE executions_visibility
ADD COLUMN TemporalExternalPayloadSizeBytes BIGINT
GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadSizeBytes");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadSizeBytes");
GENERATED ALWAYS AS (search_attributes->"$.TemporalExternalPayloadSizeBytes");


ALTER TABLE executions_visibility
ADD COLUMN TemporalExternalPayloadCount BIGINT
GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadCount");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadCount");
GENERATED ALWAYS AS (search_attributes->"$.TemporalExternalPayloadCount");

Comment on lines 54 to 55
TemporalExternalPayloadSizeBytes BIGINT GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadSizeBytes"),
TemporalExternalPayloadCount BIGINT GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadCount"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
TemporalExternalPayloadSizeBytes BIGINT GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadSizeBytes"),
TemporalExternalPayloadCount BIGINT GENERATED ALWAYS AS (search_attributes->>"$.TemporalExternalPayloadCount"),
TemporalExternalPayloadSizeBytes BIGINT GENERATED ALWAYS AS (search_attributes->"$.TemporalExternalPayloadSizeBytes"),
TemporalExternalPayloadCount BIGINT GENERATED ALWAYS AS (search_attributes->"$.TemporalExternalPayloadCount"),

@simvlad simvlad force-pushed the simvlad/add-external-payload-stats-to-visibility branch from cc5e52f to f1ba85c Compare January 15, 2026 17:57
@simvlad simvlad requested a review from rodrigozhou January 15, 2026 18:08
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