Data Explorer

Query and analyze data from your automations. Run SQL-like queries, export results, and build reports.


What Is Data Explorer?

Data Explorer lets you:

  • Query data generated by your automations
  • Analyze run history and patterns
  • Export data for external analysis
  • Build ad-hoc reports

Running Queries

Basic Query

  1. Go to Setup → Explorer
  2. Write your query in the editor
  3. Click Run or press Ctrl+Enter
SELECT * FROM automation_runs
WHERE status = 'success'
LIMIT 100

Query Editor Features

Feature Shortcut
Run query Ctrl+Enter
Format SQL Ctrl+Shift+F
Autocomplete Ctrl+Space
Comment line Ctrl+/

Available Tables

Automation Data

Table Description
automation_runs All execution records
run_steps Individual step results
run_errors Error details

Example: Run Statistics

SELECT 
  automation_name,
  COUNT(*) as total_runs,
  SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) as success,
  SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END) as failed,
  AVG(duration_ms) as avg_duration
FROM automation_runs
WHERE created_at > NOW() - INTERVAL '7 days'
GROUP BY automation_name
ORDER BY total_runs DESC

Business Data

Your automations can store custom data:

Table Description
records Generic record storage
custom_* Your custom tables

Example: Custom Records

SELECT 
  data->>'customer_name' as customer,
  data->>'order_total' as total,
  created_at
FROM records
WHERE schema = 'orders'
  AND created_at > '2024-01-01'
ORDER BY created_at DESC

Query Syntax

Filtering

-- Exact match
WHERE status = 'success'

-- Pattern matching
WHERE automation_name LIKE 'order%'

-- Multiple values
WHERE status IN ('success', 'pending')

-- Date ranges
WHERE created_at BETWEEN '2024-01-01' AND '2024-01-31'

-- Null checks
WHERE error_message IS NOT NULL

Aggregations

-- Count
SELECT COUNT(*) FROM automation_runs

-- Sum
SELECT SUM(data->>'amount') FROM records

-- Average
SELECT AVG(duration_ms) FROM automation_runs

-- Group by
SELECT status, COUNT(*) 
FROM automation_runs 
GROUP BY status

JSON Data

Access nested JSON fields:

-- Extract value
data->>'customer_name'

-- Extract nested value
data->'address'->>'city'

-- Filter by JSON value
WHERE data->>'status' = 'active'

Saving Queries

Save for Later

  1. Write your query
  2. Click Save Query
  3. Enter a name and description
  4. Access from Saved Queries tab

Share with Team

  1. Open a saved query
  2. Click Share
  3. Select team members
  4. They can view and run the query

Exporting Results

Export Formats

Format Best For
CSV Excel, Google Sheets
JSON Programmatic use
Excel Business reporting

Export Steps

  1. Run your query
  2. Click Export
  3. Choose format
  4. Download file

Large Exports

For queries returning >10,000 rows:

  1. Click Export → Background Export
  2. Receive an email when ready
  3. Download from the link

Query Templates

Start with pre-built queries:

Run Success Rate

SELECT 
  DATE_TRUNC('day', created_at) as day,
  COUNT(*) as total,
  SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END)::float 
    / COUNT(*) * 100 as success_rate
FROM automation_runs
WHERE created_at > NOW() - INTERVAL '30 days'
GROUP BY day
ORDER BY day

Slowest Automations

SELECT 
  automation_name,
  AVG(duration_ms) as avg_duration,
  MAX(duration_ms) as max_duration
FROM automation_runs
WHERE status = 'success'
  AND created_at > NOW() - INTERVAL '7 days'
GROUP BY automation_name
ORDER BY avg_duration DESC
LIMIT 10

Error Analysis

SELECT 
  error_type,
  COUNT(*) as occurrences,
  MAX(created_at) as last_occurred
FROM run_errors
WHERE created_at > NOW() - INTERVAL '7 days'
GROUP BY error_type
ORDER BY occurrences DESC

Performance Tips


Best Practices