Skip to content

perf: Optimize workflow name dropdowns with /names API#1013

Draft
akhilpathivada wants to merge 1 commit intoconductor-oss:mainfrom
akhilpathivada:feature/lightweight-workflow-names
Draft

perf: Optimize workflow name dropdowns with /names API#1013
akhilpathivada wants to merge 1 commit intoconductor-oss:mainfrom
akhilpathivada:feature/lightweight-workflow-names

Conversation

@akhilpathivada
Copy link
Copy Markdown
Contributor

@akhilpathivada akhilpathivada commented Apr 14, 2026

Resolves #1014

Summary

  • Add GET /metadata/workflow/names endpoint that returns distinct workflow names via SELECT DISTINCT name — avoids loading json_data column and JSON deserialization entirely
  • Update UI hooks (useWorkflowNames, useWorkflowNamesAndVersions) to call lightweight endpoints directly instead of deriving from useWorkflowDefs() which loads all full definitions
  • On pages with both dropdowns (e.g., Workbench), /names loads the name dropdown and /names-and-versions is fetched in parallel for the version dropdown. Both return only lightweight metadata — no full definition bodies are loaded until the user picks a specific version via GET /metadata/workflow/{name}?version=N
  • On pages with only a name dropdown (e.g., Execution Search, Task Search), only /names is
    called — the version summaries are never fetched at all

Changes

Backend

  • MetadataDAO: Added default getWorkflowNames() method — backward-compatible fallback for persistence modules that don't override it
  • PostgresMetadataDAO: Optimized override using SELECT DISTINCT name FROM meta_workflow_def ORDER BY name — index-only scan, zero deserialization
  • MetadataService / MetadataServiceImpl: Added getWorkflowNames() delegation
  • MetadataResource: New GET /metadata/workflow/names REST endpoint

UI

  • useWorkflowNames(): Now calls /metadata/workflow/names directly
  • useWorkflowNamesAndVersions(): Now calls /metadata/workflow/names-and-versions directly
  • Both hooks previously derived their data from useWorkflowDefs()GET /metadata/workflow
    which loaded all full WorkflowDef objects

Tests

  • MetadataServiceTest: Unit test for getWorkflowNames()
  • PostgresMetadataDAOTest: Integration test for the optimized DAO method
  • MetadataResourceTest: REST endpoint test
  • Cypress: Added fixture and intercept for /metadata/workflow/names

Backward Compatibility

  • No database schema changes or migrations
  • No existing endpoints modified or removed
  • MetadataDAO.getWorkflowNames() is a default method — existing DAO implementations (Redis, MySQL, etc.) continue to work without changes
  • Deploy backend before (or together with) UI

Future Scope

  • Introduce a per-workflow versions endpoint (e.g., GET /metadata/workflow/{name}/versions) to fetch version details lazily only when a user selects a specific workflow, instead of loading all workflows' version summaries upfront via /names-and-versions

Test Plan

  • ./gradlew spotlessApply passes
  • ./gradlew test passes (core, rest, postgres-persistence)
  • Cypress UI tests pass
  • Verify workflow name dropdown loads on Execution Search page
  • Verify workflow name dropdown loads on Workbench page
  • Verify version dropdown populates after selecting a workflow name on Workbench
  • Verify workflow name dropdown loads on Start Workflow page
  • Verify no regression on Workflow Definitions listing page (/definitions/workflow)

@akhilpathivada akhilpathivada force-pushed the feature/lightweight-workflow-names branch from 7cc0f0d to 7dfab79 Compare April 14, 2026 15:30
Signed-off-by: akhilpathivada <akhil.pathivada.21@gmail.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.

[PERF] Optimize Workflow Name dropdowns to avoid loading full definitions at scale

1 participant