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.

fix(retention): move the retention sync to the analytics platform queue (#78369)

Andy Zhao8340e31a5983
diff --git a/posthog/management/commands/start_temporal_worker.py b/posthog/management/commands/start_temporal_worker.py
index 82ff218f3ecd..dfb40bdb3aee 100644
--- a/posthog/management/commands/start_temporal_worker.py
+++ b/posthog/management/commands/start_temporal_worker.py
@@ -375,8 +375,12 @@ _task_queue_specs = [
),
(
settings.ANALYTICS_PLATFORM_TASK_QUEUE,
- EXPORT_WORKFLOWS + SUBSCRIPTION_WORKFLOWS + ALERT_WORKFLOWS + PULSE_WORKFLOWS,
- EXPORT_ACTIVITIES + SUBSCRIPTION_ACTIVITIES + ALERT_ACTIVITIES + PULSE_ACTIVITIES,
+ EXPORT_WORKFLOWS + SUBSCRIPTION_WORKFLOWS + ALERT_WORKFLOWS + PULSE_WORKFLOWS + SYNC_EVENTS_RETENTION_WORKFLOWS,
+ EXPORT_ACTIVITIES
+ + SUBSCRIPTION_ACTIVITIES
+ + ALERT_ACTIVITIES
+ + PULSE_ACTIVITIES
+ + SYNC_EVENTS_RETENTION_ACTIVITIES,
),
(
settings.TASKS_TASK_QUEUE,
diff --git a/posthog/slo/types.py b/posthog/slo/types.py
index ce9bf2db1d3e..b21750dc6aad 100644
--- a/posthog/slo/types.py
+++ b/posthog/slo/types.py
@@ -56,6 +56,8 @@ class SloConfig:
Workflows opt into SLO tracking by adding ``slo: SloConfig | None = None``
to their input dataclass. The SLO interceptor reads this at workflow start.
+ The workflow's task queue must also be listed in ``SloInterceptor.task_queue``,
+ or the config is silently ignored on that worker.
``start_properties`` and ``completion_properties`` must be JSON-serializable
(they cross the Temporal serialization boundary as part of the workflow input).
diff --git a/posthog/temporal/schedule.py b/posthog/temporal/schedule.py
index f87ad30d59ca..b44bcd570933 100644
--- a/posthog/temporal/schedule.py
+++ b/posthog/temporal/schedule.py
@@ -391,7 +391,7 @@ async def create_sync_events_retention_schedule(client: Client):
),
),
id="sync-events-retention-schedule",
- task_queue=settings.GENERAL_PURPOSE_TASK_QUEUE,
+ task_queue=settings.ANALYTICS_PLATFORM_TASK_QUEUE,
retry_policy=common.RetryPolicy(
maximum_attempts=1,
),