: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(error-tracking): scaffold lifecycle temporal queue (#72593)
Hugues Pouillotef8690edc279
diff --git a/posthog/management/commands/start_temporal_worker.py b/posthog/management/commands/start_temporal_worker.pyindex d6c17d67423d..043e45c261c9 100644--- a/posthog/management/commands/start_temporal_worker.py+++ b/posthog/management/commands/start_temporal_worker.py@@ -190,6 +190,8 @@ from products.conversations.backend.temporal import (from products.engineering_analytics.backend.facade.temporal import JOB_LOGS_ACTIVITIES, JOB_LOGS_WORKFLOWSfrom products.error_tracking.backend.facade.temporal import (ACTIVITIES as ERROR_TRACKING_ACTIVITIES,+ LIFECYCLE_ACTIVITIES as ERROR_TRACKING_LIFECYCLE_ACTIVITIES,+ LIFECYCLE_WORKFLOWS as ERROR_TRACKING_LIFECYCLE_WORKFLOWS,WORKFLOWS as ERROR_TRACKING_WORKFLOWS,)from products.experiments.backend.temporal import (@@ -456,6 +458,11 @@ _task_queue_specs = [ERROR_TRACKING_WORKFLOWS,ERROR_TRACKING_ACTIVITIES,),+ (+ settings.ERROR_TRACKING_LIFECYCLE_TASK_QUEUE,+ ERROR_TRACKING_LIFECYCLE_WORKFLOWS,+ ERROR_TRACKING_LIFECYCLE_ACTIVITIES,+ ),(settings.EVENT_SCREENSHOTS_TASK_QUEUE,EVENT_SCREENSHOTS_WORKFLOWS,diff --git a/posthog/settings/temporal.py b/posthog/settings/temporal.pyindex 3c9953158f55..12f4eefb50f7 100644--- a/posthog/settings/temporal.py+++ b/posthog/settings/temporal.py@@ -159,6 +159,7 @@ LLMA_EVALS_TASK_QUEUE = _set_temporal_task_queue("llm-analytics-evals-task-queueLLMA_TASK_QUEUE = _set_temporal_task_queue("llm-analytics-task-queue")MCPA_TASK_QUEUE = _set_temporal_task_queue("mcp-analytics-task-queue")ERROR_TRACKING_TASK_QUEUE = _set_temporal_task_queue("error-tracking-task-queue")+ERROR_TRACKING_LIFECYCLE_TASK_QUEUE = _set_temporal_task_queue("error-tracking-lifecycle-task-queue")EVENT_SCREENSHOTS_TASK_QUEUE = _set_temporal_task_queue("event-screenshots-task-queue")LOGS_ALERTING_TASK_QUEUE = _set_temporal_task_queue("logs-alerting-task-queue")RASTERIZATION_TASK_QUEUE = "rasterization-task-queue" # Not collapsed in dev — separate Node.js worker processdiff --git a/products/error_tracking/backend/facade/temporal.py b/products/error_tracking/backend/facade/temporal.pyindex cb658f1a8042..9b2d2ef1e1e0 100644--- a/products/error_tracking/backend/facade/temporal.py+++ b/products/error_tracking/backend/facade/temporal.py@@ -6,7 +6,7 @@ objects, not data, so they live in their own facade submodule — keeping the``temporalio`` imports out of ``facade/api.py``."""-from products.error_tracking.backend.temporal import ACTIVITIES, WORKFLOWS+from products.error_tracking.backend.temporal import ACTIVITIES, LIFECYCLE_ACTIVITIES, LIFECYCLE_WORKFLOWS, WORKFLOWSfrom products.error_tracking.backend.temporal.recommendations_refresh.types import RecommendationsRefreshInputsfrom products.error_tracking.backend.temporal.spike_event_cleanup.schedule import (create_error_tracking_spike_event_cleanup_schedule,@@ -17,6 +17,8 @@ from products.error_tracking.backend.temporal.symbol_set_cleanup.schedule import__all__ = ["ACTIVITIES",+ "LIFECYCLE_ACTIVITIES",+ "LIFECYCLE_WORKFLOWS","WORKFLOWS","RecommendationsRefreshInputs","create_error_tracking_spike_event_cleanup_schedule",diff --git a/products/error_tracking/backend/temporal/__init__.py b/products/error_tracking/backend/temporal/__init__.pyindex c8186a2dcc4d..b7d84324b0d7 100644--- a/products/error_tracking/backend/temporal/__init__.py+++ b/products/error_tracking/backend/temporal/__init__.py@@ -1,3 +1,7 @@+from collections.abc import Callable++from posthog.temporal.common.base import PostHogWorkflow+from products.error_tracking.backend.temporal.fingerprint_embedding_result import (ACTIVITIES as FINGERPRINT_EMBEDDING_RESULT_ACTIVITIES,WORKFLOWS as FINGERPRINT_EMBEDDING_RESULT_WORKFLOWS,@@ -37,8 +41,13 @@ ACTIVITIES = (+ FINGERPRINT_EMBEDDING_RESULT_ACTIVITIES)+LIFECYCLE_WORKFLOWS: list[type[PostHogWorkflow]] = []+LIFECYCLE_ACTIVITIES: list[Callable[..., object]] = []+__all__ = ["ACTIVITIES",+ "LIFECYCLE_ACTIVITIES",+ "LIFECYCLE_WORKFLOWS","WORKFLOWS","ErrorTrackingFingerprintEmbeddingResultWorkflow","ErrorTrackingRecommendationsRefreshWorkflow",