: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(warehouse-sources): add loops event_patterns table (#114897)
Tom Owers1ca48b9987ea
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 c16cf6292a52..d452e8b1bb40 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@@ -5298,12 +5298,11 @@ Today (12): `audience_segments`, `campaign_groups`, `campaign_metrics`, `campaigDiffed against: <https://loops.so/docs/openapi.json>-- [ ] `GET /v1/event-patterns` — lookup of event definitions that workflows and campaigns trigger on (high)-- [ ] `GET /v1/contacts/suppression` — suppressed contacts, needed to reconcile deliverable audience (medium)+- [x] `GET /v1/event-patterns` — lookup of event definitions that workflows and campaigns trigger on (`event_patterns`)- [x] `GET /v1/campaigns/{campaignId}/metrics` — all-time engagement counters per sent campaign (`campaign_metrics`)- [x] `GET /v1/transactional-emails/{transactionalId}/metrics` — all-time delivery counters per transactional email (`transactional_email_metrics`)-Note: Coverage is close to complete — the spec has ~20 listable GET collections and 10 are already exposed. Loops has no bulk contacts list endpoint (only /v1/contacts/find by email or userId), so a contacts table is not implementable against this API; /v1/email-messages/{id} is likewise single-fetch only. Remaining unexposed paths are config/plumbing (api-key, dedicated-sending-ips, uploads) or per-node workflow mutations.+Note: Coverage is close to complete — the spec has ~20 listable GET collections and 10 are already exposed. Loops has no bulk contacts list endpoint (only /v1/contacts/find by email or userId), so a contacts table is not implementable against this API; /v1/email-messages/{id} is likewise single-fetch only, and /v1/contacts/suppression only checks one contact by email or userId rather than listing suppressed contacts. Remaining unexposed paths are config/plumbing (api-key, dedicated-sending-ips, uploads) or per-node workflow mutations.## Luma — gapsdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/loops/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/loops/canonical_descriptions.pyindex f4cb9dce7e41..3a80b39c05de 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/loops/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/loops/canonical_descriptions.py@@ -118,6 +118,15 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"lmx": "The component's LMX markup.",},},+ "event_patterns": {+ "description": "An event pattern that workflow event triggers can start on, either a custom event or one from an incoming webhook.",+ "docs_url": "https://loops.so/docs/api-reference/list-event-patterns",+ "columns": {+ "id": "The ID of the event pattern.",+ "eventName": "The name of the event pattern. Use this when sending events with the API.",+ "incomingWebhookPlatform": "The platform that sent this event pattern if it comes from an incoming webhook (clerk, polar, stripe, supabase), or null for custom events.",+ },+ },"campaign_metrics": {"description": "All-time email engagement counters for a sent campaign. Opens and clicks count sends, not events.","docs_url": "https://loops.so/docs/api-reference/get-campaign-metrics",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/loops/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/loops/settings.pyindex 5784cdaf7ae0..d0baab02001c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/loops/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/loops/settings.py@@ -86,6 +86,10 @@ LOOPS_ENDPOINTS: dict[str, LoopsEndpointConfig] = {name="components",path="/v1/components",),+ "event_patterns": LoopsEndpointConfig(+ name="event_patterns",+ path="/v1/event-patterns",+ ),# The metrics bodies carry no id, so the parent's id is injected as the primary key."campaign_metrics": LoopsEndpointConfig(name="campaign_metrics",