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.

428 B
Raw Blame
from asgiref.sync import sync_to_async
from temporalio import activity

from posthog.dataclasses import frozen

from ..logic.sync import sync_access_rules


@frozen
class SyncOutcome:
    status: str
    rule_count: int | None


@activity.defn
async def sync_access_rules_activity() -> SyncOutcome:
    result = await sync_to_async(sync_access_rules)()
    return SyncOutcome(status=result.status, rule_count=result.rule_count)