Skip to content

: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.

feat(data-warehouse): add membrain currency, activity type and process tables (#122645)

Tom Owers911140a9bd72
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.md
index 42bb1ff638d3..0efdcfedae3d 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
@@ -7772,11 +7772,11 @@ Diffed against: <https://www.membrain.com/developers/api-documentation>
- [ ] `Sales processes (GET /API/v2/salesProcesses/)` — resolve opportunity process and stage IDs, including stage order and process-specific fields (high)
- [ ] `Prospecting processes (GET /API/v2/prospectingProcesses/)` — resolve prospect process and stage IDs for conversion analysis (high)
-- [ ] `Account Growth processes (GET /API/v2/accountGrowthProcesses/)` — resolve account-growth process and stage IDs for expansion analysis (high)
-- [ ] `Ticket processes (GET /API/v2/ticketProcesses/)` — resolve ticket process and stage IDs for support workflow analysis (high)
-- [ ] `Currencies (GET /API/v2/currencies/)` — resolve ValueCurrencyId and supply exchange rates for comparable pipeline values (high)
+- [x] `Account Growth processes (GET /API/v2/accountGrowthProcesses/)` — resolve account-growth process and stage IDs for expansion analysis (high)
+- [x] `Ticket processes (GET /API/v2/ticketProcesses/)` — resolve ticket process and stage IDs for support workflow analysis (high)
+- [x] `Currencies (GET /API/v2/currencies/)` — resolve ValueCurrencyId and supply exchange rates for comparable pipeline values (high)
- [ ] `Labels (GET /API/v2/labels/)` — resolve LabelIds on companies and contacts for consistent segmentation (high)
-- [ ] `Activity types (GET /API/v2/activityTypes/)` — resolve ActivityTypeId and provide the complete activity taxonomy (high)
+- [x] `Activity types (GET /API/v2/activityTypes/)` — resolve ActivityTypeId and provide the complete activity taxonomy (high)
- [ ] `Process Container Contacts (GET /API/v2/processContainerContacts/)` — connect contacts to sales processes and their stakeholder roles (medium)
- [ ] `Opportunity Products (GET /API/v2/opportunityProducts/)` — join products to opportunities for product-level pipeline and revenue analysis (medium)
- [ ] `Orders and Order Rows (GET /API/v2/orders/; GET /API/v2/orderRows/)` — measure booked sales and item-level amounts against opportunities and products (medium)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/canonical_descriptions.py
index 29a100493b41..0e2c43520a5f 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/canonical_descriptions.py
@@ -153,4 +153,42 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"Cost": "Product cost.",
},
},
+ "currencies": {
+ "description": "Currencies available in the Membrain instance, with exchange rates relative to the primary currency.",
+ "docs_url": _DOCS_URL,
+ "columns": {
+ "Id": "Unique identifier (GUID).",
+ "Name": "Currency name.",
+ "CurrencyCode": "Currency code (for example USD, EUR, or SEK).",
+ "ExchangeRate": "Exchange rate for this currency. Always 1 for the primary currency. Divide an amount by this rate to convert it to the primary currency.",
+ },
+ },
+ "activity_types": {
+ "description": "Activity types used to categorize activities.",
+ "docs_url": _DOCS_URL,
+ "columns": {
+ "Id": "Unique identifier (GUID). Matches ActivityTypeId on activities.",
+ "Name": "Activity type name.",
+ },
+ },
+ "ticket_processes": {
+ "description": "Active ticket process definitions, including their stages, steps and custom fields.",
+ "docs_url": _DOCS_URL,
+ "columns": {
+ "Id": "Unique identifier (GUID) of the ticket process.",
+ "Name": "Name of the ticket process.",
+ "Stages": "Stages in the process, as a list of {Id, Name, Steps} objects. Each Steps entry is a list of {Id, Name} objects.",
+ "CustomFields": "Custom fields referenced in the process, with the same properties as the custom_fields table.",
+ },
+ },
+ "account_growth_processes": {
+ "description": "Active Account Growth process definitions, including their stages, steps and custom fields.",
+ "docs_url": _DOCS_URL,
+ "columns": {
+ "Id": "Unique identifier (GUID) of the Account Growth process.",
+ "Name": "Name of the Account Growth process.",
+ "Stages": "Stages in the process, as a list of {Id, Name, Steps} objects. Each Steps entry is a list of {Id, Name} objects.",
+ "CustomFields": "Custom fields referenced in the process, with the same properties as the custom_fields table.",
+ },
+ },
}
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/settings.py
index a0e7ed829b52..743fe35f6e18 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/settings.py
@@ -93,6 +93,14 @@ MEMBRAIN_ENDPOINTS: dict[str, MembrainEndpointConfig] = {
primary_keys=["EntityType", "Id"],
),
"products": MembrainEndpointConfig(name="products", path="/products/"),
+ "currencies": MembrainEndpointConfig(name="currencies", path="/currencies/"),
+ "activity_types": MembrainEndpointConfig(name="activity_types", path="/activityTypes/"),
+ # Process definitions return one row per active process with its Stages (each holding Steps)
+ # and CustomFields as nested arrays.
+ "ticket_processes": MembrainEndpointConfig(name="ticket_processes", path="/ticketProcesses/"),
+ "account_growth_processes": MembrainEndpointConfig(
+ name="account_growth_processes", path="/accountGrowthProcesses/"
+ ),
}
ENDPOINTS = tuple(MEMBRAIN_ENDPOINTS.keys())
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/tests/test_membrain.py b/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/tests/test_membrain.py
index ccabad98a1e3..965d64cd97de 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/tests/test_membrain.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/membrain/tests/test_membrain.py
@@ -157,13 +157,24 @@ class TestPagination:
class TestBareArrayEndpoints:
- @parameterized.expand([("users",), ("roles",), ("products",)])
- def test_yields_rows_from_a_single_unpaged_request(self, endpoint: str) -> None:
+ @parameterized.expand(
+ [
+ ("users", "/users/"),
+ ("roles", "/roles/"),
+ ("products", "/products/"),
+ ("currencies", "/currencies/"),
+ ("activity_types", "/activityTypes/"),
+ ("ticket_processes", "/ticketProcesses/"),
+ ("account_growth_processes", "/accountGrowthProcesses/"),
+ ]
+ )
+ def test_yields_rows_from_a_single_unpaged_request(self, endpoint: str, path: str) -> None:
result = _driver().run(endpoint, [ScriptedResponse(json=[{"Id": "u1"}, {"Id": "u2"}])])
assert result.raised is None
assert result.rows == [{"Id": "u1"}, {"Id": "u2"}]
assert len(result.requests) == 1
+ assert result.requests[0].path == f"/API/v2{path}"
assert result.params("From") == [None]
assert result.saved_states == []