Skip to content

Conversation

@ArchishmanSengupta
Copy link

What changed?

Add CONTAINS operator support for substring matching in workflow visibility queries.

Files modified:

  • common/persistence/visibility/store/sql/query_converter.go + tests
  • common/persistence/visibility/store/elasticsearch/converter.go
  • common/persistence/visibility/store/query/converter.go
  • go.mod (replace directive for local sqlparser)

Query transformation:

WorkflowId CONTAINS "substring" 
→ SQL: LIKE '%substring%' ESCAPE '!'
→ ES: WildcardQuery("*substring*")

Related PRs: sqlparser ([link]) and UI ([link]) - all three must merge together.

Why?

Enable substring search for WorkflowId/WorkflowType. Currently only prefix matching (STARTS_WITH) is available.

Example use case: Find workflows containing "user-service" anywhere in the name:

  • ai-agent-user-service-1
  • api-user-service-sync
  • backend-payment-service

How did you test it?

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

Manual testing: Created test workflows, verified CONTAINS query returns correct results via CLI and UI.

Potential risks

Performance: LIKE '%value%' cannot use indexes (leading wildcard). May be slower on large datasets. Mitigate by combining with other filters (timerange, status).

Dependencies: Requires sqlparser PR merged first. Remove replace directive in go.mod before merging.

Related PRs: sqlparser ([link]) and UI ([link]) - all three must merge together.

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