:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(data-warehouse): add vapi simulation_runs table (#113861)
Tom Owers4d52929d197e
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex 2f45d3a9e542..175825fcaa4c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -9280,7 +9280,7 @@ Note: Spec is Vantage's own OpenAPI at api.vantage.sh/v2/swagger.json (v2.0.0);## Vapi — gaps-Today (9): `assistants`, `calls`, `campaigns`, `chats`, `files`, `phone_numbers`, `sessions`, `squads`, `tools`+Today (10): `assistants`, `calls`, `campaigns`, `chats`, `files`, `phone_numbers`, `sessions`, `simulation_runs`, `squads`, `tools`Diffed against: <https://api.vapi.ai/api-json>@@ -9290,6 +9290,7 @@ Diffed against: <https://api.vapi.ai/api-json>- [ ] `GET /call/{id}/call-logs` — per-call turn/system log lines for the calls we already sync (medium)- [ ] `POST /analytics` — Vapi's aggregate analytics query API (minutes, spend, call outcomes) — the headline metrics surface (medium)- [ ] `GET /structured-output` — lookup for the extraction schemas whose extracted values appear on call records (low)+- [x] `GET /eval/simulation/run` — simulation run results for assistants and squads, with pass/fail item counts (medium)Note: Full OpenAPI fetched live from api.vapi.ai/api-json. Note /reporting/insight is a saved-query definition (its data only comes back via POST /reporting/insight/{id}/run), and /provider/{provider}/{resourceName} is a passthrough to Twilio/Vonage account resources — both excluded as plumbing. /v2/campaign is a newer version of the /campaign the source already uses, not a distinct resource.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/canonical_descriptions.pyindex edaaf6d07a6c..03ff6e057b23 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/canonical_descriptions.py@@ -154,6 +154,27 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"updatedAt": "ISO 8601 timestamp indicating when the session was last updated.",},},+ "simulation_runs": {+ "description": "Simulation runs that test an assistant or squad against simulations or suites of AI-tester conversations, with pass/fail item counts.",+ "docs_url": "https://docs.vapi.ai/api-reference/simulation-runs/simulation-run-controller-find-all",+ "columns": {+ "id": "Unique identifier for the run.",+ "orgId": "Unique identifier for the org that this run belongs to.",+ "status": "Current status of the run (queued, running, or ended).",+ "queuedAt": "ISO 8601 date-time string of when the run was queued.",+ "startedAt": "ISO 8601 date-time string of when the run started.",+ "endedAt": "ISO 8601 date-time string of when the run ended.",+ "endedReason": "Reason the run ended.",+ "itemCounts": "Aggregate counts of run items by status (total, passed, failed, running, queued, canceled).",+ "simulations": "Simulations and/or simulation suites included in the run.",+ "target": "Assistant or squad the run tests against.",+ "iterations": "Number of times each simulation runs.",+ "transport": "Transport configuration for the simulation conversations.",+ "summary": "Summary of the run's results.",+ "createdAt": "ISO 8601 date-time string of when the run was created.",+ "updatedAt": "ISO 8601 date-time string of when the run was last updated.",+ },+ },"campaigns": {"description": "Outbound call campaigns that dial a list of customers with an assistant or workflow, with live progress counters.","docs_url": "https://docs.vapi.ai/api-reference/campaigns/list",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/settings.pyindex a44c3cf4a1dc..5e68221ef00a 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/settings.py@@ -125,6 +125,13 @@ VAPI_ENDPOINTS: dict[str, VapiEndpointConfig] = {pagination="page",incremental_fields=[_datetime_incremental_field("createdAt")],),+ # Run status and itemCounts change until the run ends, and the API can't sort by updatedAt, so+ # a createdAt watermark would freeze in-flight runs; the table is small, so full refresh only.+ "simulation_runs": VapiEndpointConfig(+ name="simulation_runs",+ path="/eval/simulation/run",+ pagination="page",+ ),# Campaigns mutate heavily (status plus per-call counters), so createdAt-incremental would go# stale immediately; the table is small, so full refresh only."campaigns": VapiEndpointConfig(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/tests/test_vapi.py b/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/tests/test_vapi.pyindex a0034185cf2b..2736b24480c0 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/tests/test_vapi.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/vapi/tests/test_vapi.py@@ -181,6 +181,23 @@ class TestPageEndpoints:)assert fetched == list(pages)+ def test_bare_array_response_stops_on_short_page(self, monkeypatch: Any) -> None:+ # /eval/simulation/run may answer with a bare array instead of the {results, metadata} envelope.+ pages = {+ "https://api.vapi.ai/eval/simulation/run?limit=2&page=1&sortOrder=ASC&sortBy=createdAt": [+ {"id": "r1", "createdAt": "2026-01-01T00:00:00.000Z"},+ {"id": "r2", "createdAt": "2026-01-02T00:00:00.000Z"},+ ],+ "https://api.vapi.ai/eval/simulation/run?limit=2&page=2&sortOrder=ASC&sortBy=createdAt": [+ {"id": "r3", "createdAt": "2026-01-03T00:00:00.000Z"},+ ],+ }+ fetched = _patch_fetch(monkeypatch, pages)+ rows = _collect(monkeypatch, _FakeResumableManager(), endpoint="simulation_runs")++ assert [r["id"] for r in rows] == ["r1", "r2", "r3"]+ assert fetched == list(pages)+class TestSensitiveValueScrubbing:def test_auth_material_redacted_before_batching(self, monkeypatch: Any) -> None: