List Workflow Query Behaviour Mismatch

compose.yml

services:
  primary-db:
    image: postgres:16.3
    environment:
      - POSTGRES_DB=primary
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    healthcheck:
      interval: 3s
      retries: 5
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      timeout: 5s
    ports:
      - 5432:5432
    profiles:
      - infra
    restart: on-failure

  temporal:
    image: temporalio/auto-setup:1.24.2
    environment:
      - DB=postgres12_pgx
      - DB_PORT=5432
      - POSTGRES_USER=postgres
      - POSTGRES_PWD=postgres
      - POSTGRES_SEEDS=primary-db
    depends_on:
      - primary-db
    ports:
      - 7233:7233
    profiles:
      - infra
    restart: on-failure

  temporal-ui:
    image: temporalio/ui:2.30.1
    environment:
      - TEMPORAL_ADDRESS=temporal:7233
      - TEMPORAL_CORS_ORIGINS=http://localhost:3000
    depends_on:
      - temporal
    ports:
      - 8000:8080
    profiles:
      - infra
    restart: on-failure

Our workflow ID format is <UUIDv7>-<timestamp> (e.g. 0191a170-b004-72d7-816a-d1caa2479069-1724996470635194000) and we’re currently using Go SDK to list workflow executions as below:

c.ListWorkflow(ctx, &workflowservice.ListWorkflowExecutionsRequest{
  Namespace: h.Config.TemporalNamespace,
  PageSize:  10,
  Query:     fmt.Sprintf(`WorkflowId BETWEEN "%s-" AND "%s-~"`, workflowId, workflowId),
})

The code above works well with Temporal Cloud, but not the temporal auto-setup in docker compose cluster. Does anyone know what we’re missing here? Thanks.

Just realised for ListWorkflow query to work, we need to setup Elasticsearch as well.