diff --git a/posthog/clickhouse/client/execute.py b/posthog/clickhouse/client/execute.py index fa499cbf83c22..adcd9b726ac65 100644 --- a/posthog/clickhouse/client/execute.py +++ b/posthog/clickhouse/client/execute.py @@ -93,13 +93,14 @@ def sync_execute( get_query_tag_value("access_method") == "personal_api_key" or # Execute all celery tasks not directly set to be online on the offline cluster - ( - get_query_tag_value("kind") == "celery" - and get_query_tag_value("id") != "posthog.tasks.tasks.process_query_task" - ) + get_query_tag_value("kind") == "celery" ): workload = Workload.OFFLINE + # Make sure we always have process_query_task on the online cluster + if get_query_tag_value("id") == "posthog.tasks.tasks.process_query_task": + workload = Workload.ONLINE + with get_pool(workload, team_id, readonly).get_client() as client: start_time = perf_counter()