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(experiments): add an activity task queue input to the recalculation workflow (#118930)

Rodrigo Iloro7872c65eec72
diff --git a/products/experiments/backend/temporal/models.py b/products/experiments/backend/temporal/models.py
index 1f1b860362f2..d622ce6e060f 100644
--- a/products/experiments/backend/temporal/models.py
+++ b/products/experiments/backend/temporal/models.py
@@ -89,7 +89,7 @@ METRIC_FAILURE_BACKSTOP_MAX_ATTEMPTS = 3
METRIC_FAILURE_BACKSTOP_SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS = 120
[email protected](frozen=False)
class ExperimentMetricsRecalculationWorkflowInputs:
"""Input to the batch metrics recalculation workflow."""
@@ -97,6 +97,9 @@ class ExperimentMetricsRecalculationWorkflowInputs:
# Task-queue fairness key for the calc activities (the org id, matching the app_per_org limiter scope).
# None falls back to default dispatch order.
fairness_key: str | None = None
+ # Task queue for the metric calculation activity, chosen when the run starts so replay stays deterministic.
+ # None keeps the activity on the workflow's own queue.
+ activity_task_queue: str | None = None
def _role_from_either_field(role: str, metric_type: str) -> str: