Skip to content

feat: Add server-side column sorting to the workflows table. - #3717

Open
tristal wants to merge 1 commit into
temporalio:mainfrom
tristal:tristal/sort-columns
Open

feat: Add server-side column sorting to the workflows table.#3717
tristal wants to merge 1 commit into
temporalio:mainfrom
tristal:tristal/sort-columns

Conversation

@tristal

@tristal tristal commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description & motivation 💭

Workflows always come back in the server's default order (CloseTime DESC NULLS FIRST, StartTime DESC). Filtering is the only way to narrow them down.

Click a column header to sort: desc > asc > off. This goes to the server as an ORDER BY clause on ListWorkflowExecutions, so it sorts the whole result set and not just the visible page.

  • Sort lives in the URL (?sort=StartTime&sort-order=desc), so it's shareable. Changing it resets pagination.
  • Sortable columns come from the namespace's search attributes. Text and KeywordList are excluded since the server can't sort them. Custom attribute columns work, Parent Namespace and friends don't.
  • order by is appended to the list query only, never the count query (which appends its own GROUP BY), so the header counts stay correct.

Off by default behind workflowSortingEnabled / TEMPORAL_WORKFLOW_SORTING_ENABLED, because server support is thin:

Visibility store ORDER BY
SQL (MySQL/Postgres/SQLite) rejected
Elasticsearch, default config rejected, visibilityDisableOrderByClause defaults to true
Elasticsearch + that set to false works
Temporal Cloud not supported

Gate is workflowSortingEnabled && !isCloud && visibilityStore == elasticsearch. That last part also fixes supportsAdvancedVisibilityWithOrderBy, which OR'd in isCloud — backwards, Cloud doesn't support it.

Screenshots (if applicable) 📸

1-sort-affordance-on-hover 2-sorted-ascending-workflow-id 3-sorted-descending-type 4-unsupported-toast

Design Considerations 🎨

Chevrons stay hidden until you hover or focus a sortable header; the active one stays lit. Headers carry aria-sort and the control is a real button.

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

@tristal
tristal requested a review from a team as a code owner July 24, 2026 02:28
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

@tristal is attempting to deploy a commit to the Temporal Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant