How It Works
Continuous Query runs your Junction Sense queries automatically across all users in your team. Junction schedules most queries when new data arrives from cloud providers or mobile SDKs. Virtual resources can use a resource-specific refresh schedule. Junction pushes any result changes to your configured destinations.Key Capabilities
Automatic Evaluation
Queries run automatically on all existing and new users in your team, eliminating manual execution
Push Delivery
Result changes are pushed to your webhook or ETL pipeline destinations—no polling required
Intelligent Scheduling
Junction responds to new data points or uses a resource-specific refresh schedule, depending on the query
Pull Access
Query the latest result table through the API anytime
Common Use Cases
Health Monitoring & Reporting
Health Monitoring & Reporting
Track key health metrics over time to power patient dashboards, clinical insights, or wellness reports.Example: Daily Sleep Analysis
- Analyze sleep efficiency, scores, and chronotype for primary sleep sessions
- Filter for long sleep periods to focus on nighttime rest
- Monitor quality trends across consecutive nights
- View example →
- Calculate average resting heart rate and active duration
- Track maximum daily calorie burn and minimum step counts
- Group activity data by week for trend analysis
- View example →
Device Data Reliability
Device Data Reliability
Monitor whether expected data has been present without building a separate completeness pipeline.Use case highlights:
- Compare presence coverage across providers, source types, and resources
- Identify stale, sparse, or degraded data feeds
- Track connection status separately from observed data presence
- View Device Reliability →
Continuous Glucose Monitoring
Continuous Glucose Monitoring
Support diabetes management and metabolic health tracking with automated CGM data aggregation.Example: First Glucose Reading of Each Day
- Capture the first observed glucose value in each local-day bucket
- Group by data source and provider for device comparison
- Track morning glucose patterns over time
- View example →
- Calculate mean glucose levels throughout the day
- Combine with heart rate, HRV, and temperature data
- Analyze multi-metric patterns by device source
- View example →
Fitness & Performance Tracking
Fitness & Performance Tracking
Power adaptive training programs with continuously updated workout and activity metrics.Example: Weekly Workout Statistics
- Track calorie expenditure ranges (min/max) across workouts
- Monitor heart rate zone distribution for training intensity
- Aggregate distance and active duration metrics
- View example →
- Real-time metric tracking for goal progress
- Device-specific analysis to handle data from multiple sources
- Webhook integration for triggering adaptive training plans
- Historical trend data for personalized coaching
Longitudinal Research Studies
Longitudinal Research Studies
Support research protocols requiring consistent, automated data collection across participants.Use case highlights:
- Automatic data aggregation for all enrolled participants
- Consistent time-window grouping (daily, weekly, monthly)
- Event notifications when new data becomes available
- Result tables compatible with research analysis tools
- Source-level granularity for data quality assessment
Population Health Analytics
Population Health Analytics
Analyze health trends across user populations for public health initiatives or employer wellness programs.Use case highlights:
- Scalable aggregation across thousands of users
- Standardized metrics despite diverse device ecosystems
- Automated daily/weekly rollups for reporting dashboards
- ETL pipeline integration for data warehouses
Supported Data Sources
Continuous Query works with the following health data resources and virtual tables:- Activity - Steps, calories, distance, active duration, resting heart rate
- Sleep - Duration, stages, efficiency, scores, heart rate during sleep, sleep type filtering
- Workout - Exercise sessions, heart rate zones, distance, duration, calories
- Body - Weight, BMI, body fat percentage, temperature
- Meal - Nutritional intake, macros, timing
- Time Series - Continuous measurements including heart rate, glucose, HRV, steps, body temperature
- Device Reliability - Daily presence, gap, recency, reliability status, and connection status by provider, source type, and resource
Query Capabilities
Time-Based Aggregation
Group data by day, week, month, or other time periods to create time-series datasets:- Daily summaries for dashboards and trend visualization
- Weekly rollups for progress tracking
- Monthly aggregations for longitudinal analysis
Flexible Metrics
Calculate meaningful insights using built-in aggregation functions:- Mean/Average - Average sleep efficiency, resting heart rate, glucose levels
- Sum - Total steps, cumulative calories
- Min/Max - Lowest/highest values in a period
- Standard Deviation - Variability in metrics
- Newest/Oldest - Value from the latest or earliest table index (useful for the first observed glucose value or the latest chronotype)
Multi-Dimensional Grouping
Organize data across multiple dimensions for richer analysis:- Time periods (day, week, month)
- Data sources (provider, device type)
- Custom fields (workout type, sleep type)
Source Prioritization
When users connect multiple devices, Junction’s source prioritization ensures data quality:- Configure team-level provider priorities
- Override priorities at the query level for experiments
- Optionally split results by data source for comparative analysis
Filtering & Refinement
Use WHERE clauses to focus on specific data subsets:- Filter for main sleep sessions (
type = 'long_sleep') - Target specific workout types or activity levels
- Isolate data from particular device sources
Getting Started
Step 1: Define Your Query Use the Query DSL to specify what data to aggregate, how to group it, and which metrics to calculate. Step 2: Validate the Query Use the Junction Dashboard Query Editor to preview resources supported by Query API. For a Continuous Query-only resource such as Device Reliability, the Create Continuous Query endpoint validates the query when you submit it. Step 3: Deploy Query Deploy your query using the create endpoint or by saving your query in the Junction Dashboard. Step 4: Configure Delivery Set up webhooks or ETL pipelines to receive result updates automatically. Jump to Getting Started Guide →Query API vs. Continuous Query
Most resources use the same Query DSL with both products, making it easy to prototype with Query API and deploy to production with Continuous Query. Some virtual resources, including Device Reliability, are only available through Continuous Query and cannot be accessed with Query API. Compare in detail →What’s Next?
Manage Queries Using Junction Dashboard View Example Queries- Copy-paste examples for sleep, activity, glucose, and workout queries
- Browse examples →
- Step-by-step tutorial to create your first Junction Sense query
- Get started →
- Complete reference for building queries with available functions and constraints
- Read documentation →
- Create, manage, and retrieve results from your Continuous Queries
- View API reference →