Horizon AI Query is in closed beta.

Interested in the Horizon AI Query? Get in touch with your Customer Success Manager.

You can create a Continuous Query to have your Horizon AI Query automatically evaluated by Junction as needed, and receive any query result changes through your Webhook or ETL Pipeline destinations.

With Continuous Query, you can focus on adding value to your product with the aggregated data insights:

  • you need not build your own scalable data pipeline from scratch to ingest, store and aggregate standardized device data.
  • you need not poll the Query API to receive query results.

Continuous Query requirements

While Continuous Query uses the same Query DSL as the Query API, some restrictions are in place:

Do reach out to us if your use case is hampered by these restrictions.

Subscribing to query result changes

When a Continuous Query is re-evaluated and the result set has changed, Junction sends a Result Table Changed data event to your your Webhook or ETL Pipeline destinations.

This data event includes only the delta (new rows or changed rows with respect to the group keys). To re-fetch the whole result set, use the Get Result Table endpoint.

{
  "event_type": "continuous_query.result_table.changed",
  "user_id": "4a29dbc7-6db3-4c83-bfac-70a20a4be1b2",
  "client_user_id": "01HW3FSNVCHC3B2QB5N0ZAAAVG",
  "team_id": "6b74423d-0504-4470-9afb-477252ccf67a",
  "data": [
    {
      "data": {
        "group_key.0": [
          "2025-02-17T00:00:00"
        ],
        "mean.efficiency": [
          98.22
        ],
        "mean.sleep_score": [
          76.75
        ],
        "min.sleep_score": [
          61
        ],
        "newest.chronotype": [
          "third"
        ]
      },
      "query_id": "b59425f8-eb5a-4c60-ae95-eda70179da04",
      "query_slug": "sleep-analysis-v1"
    }
  ]
}

Managing your Continuous Queries

You can manage your Continuous Query using our Org Management API:

You can also manage them through the Continuous Query section of the Vital Dashboard: