Skip to content

feat(workflows): add batch-workflow MCP tools#61001

Merged
mayteio merged 23 commits into
masterfrom
harley/workflows-mcp-batch
Jun 3, 2026
Merged

feat(workflows): add batch-workflow MCP tools#61001
mayteio merged 23 commits into
masterfrom
harley/workflows-mcp-batch

Conversation

@mayteio
Copy link
Copy Markdown
Contributor

@mayteio mayteio commented Jun 1, 2026

Problem

MCP had the workflow lifecycle (#60388) but no way to run a batch workflow or schedule a worflow — and a broadcast messages every matching person, so its audience needs real guardrails. Wiring these endpoints up for API/MCP also surfaced several safeguards that, until now, lived only in the frontend.

Loom demo Loom demo without disable/edit/enable flow

Note

When testing this on localhost via Claude Desktop, I had to explicitly force posthog:exec or MCP v2 by passing ?mode=cli in my MCP config as the way to use it. Because I have other MCP tools loaded (github, incident.io, slack, etc) I rapidly ran out of context with the default tools mode. The downside of this is we lose MCP-ui apps. This isn't a new issue - just worth flagging.

Changes

New batch tools (hand-rolled, composing existing REST — no new endpoints):

  • workflows-blast-radius — size the audience.
  • workflows-run-batch — one-off broadcast; requires active + acknowledged_affected_count from blast-radius (recomputed server-side, rejects on drift or over-cap).
  • workflows-schedule-create — recurring RRULE schedule.

Also: enabled workflows-list-batch-jobs / workflows-update-schedule; nested read-only schedules on workflows-get/-create/-update; exposed hide_behavioral_cohorts on cohorts-list so agents can find workflow-usable cohorts; descriptions steer toward inline person-property conditions or dynamic cohorts (which re-evaluate) over static frozen-list cohorts; PAK scopes on the custom hog_flow actions so MCP can call them at all (see Agent context).

Guards moved server-side

Exposing the batch endpoints to personal API keys made these frontend-only gates reachable directly, so they're now enforced in the serializer/endpoint (the UI keeps its own copies). Draft leniency for all of them is scoped to the web UI via get_event_source — MCP/API callers are enforced even on drafts, so an agent fails fast.

  • Behavioral cohorts can't be used in a batch/schedule audience — offline they only resolve a stale precalculated snapshot. Rejected for API/MCP, including via nested cohort dependencies. (UI hid them via hideBehavioralCohorts.)
  • Event/action filters in a batch audience are rejected — they were silently dropped, resolving the audience to everyone.
  • Manual batch runs require an active workflow — the check previously lived only in the UI (disabled trigger button) and the scheduler, so a direct call could mint a run for a draft.

How did you test this code?

  • Backend (test_hog_flow.py, test_hog_flow_schedule.py): audience validation (behavioral/event/action rejection across batch + schedule, nested deps, web-draft-lenient vs MCP-draft-enforced), active-run gate, schedule CRUD, nested-schedule surfacing.
  • MCP unit/handler + tool-schema snapshots, lint-tool-names, tsc, ruff.
  • MCP integration (workflows.integration.test.ts) against a local stack via a gitignored .env.test, incl. the cross-layer behavioral-cohort rejection (MCP tool → API → guard).

Automatic notifications

  • Publish to changelog? — Batch workflows in PostHog MCP: size a workflow's audience, run a one-off broadcast, and create recurring schedules, with a blast-radius confirmation guard.
  • Alert Sales and Marketing teams?

Docs update

Self-described via serializer help_text + tool descriptions, which flow into the generated schemas.

🤖 Agent context

Claude Code. Recurring theme: safeguards that lived only in the frontend became reachable once these endpoints were opened to API/MCP, so they're now enforced server-side, with draft leniency scoped to the web UI via get_event_source.

  • Batch tools are hand-rolled (not codegen) to carry the echo-back guard: the caller passes back the affected count it showed the user; the handler recomputes from the workflow's own trigger filters and rejects on drift/over-cap. A server-side echo-back was deferred — the CDP consumer's audience cap + skip-non-active are the hard backstops.
  • dangerously_get_required_scopes: batch_jobs/schedules are dual-method (GET=read, POST=write), but the per-action scope lists map one scope per action name, not per method. The override returns read-for-GET / write-for-POST and None elsewhere (keeping default derivation) — it never loosens anything.

mayteio added 2 commits June 1, 2026 19:35
Add MCP surface for batch workflows (one-off broadcasts + recurring schedules): workflows-blast-radius, workflows-run-batch, workflows-schedule-create (hand-rolled with a blast-radius echo-back guard), plus enabling workflows-list-batch-jobs and workflows-update-schedule. Schedules are surfaced read-only on workflows-get; the batch trigger audience rejects event/action filters.
MCP surface for batch workflows (one-off broadcasts + recurring schedules): workflows-blast-radius, workflows-run-batch, workflows-schedule-create (hand-rolled with a blast-radius echo-back guard), plus workflows-list-batch-jobs and workflows-update-schedule. Schedules surfaced read-only on workflows-get; batch audiences reject event/action filters. Custom hog_flow actions get personal-API-key scopes (read/write, method-aware for dual-method actions) so MCP can call them.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

MCP UI Apps size report

App JS CSS
debug 478.6 KB 144.8 KB
action 353.1 KB 144.8 KB
action-list 360.9 KB 144.8 KB
cohort 352.1 KB 144.8 KB
cohort-list 359.9 KB 144.8 KB
error-details 373.5 KB 144.8 KB
error-issue 352.8 KB 144.8 KB
error-issue-list 360.8 KB 144.8 KB
experiment 357.3 KB 144.8 KB
experiment-list 361.7 KB 144.8 KB
experiment-results 359.4 KB 144.8 KB
feature-flag 438.0 KB 144.8 KB
feature-flag-list 442.5 KB 144.8 KB
feature-flag-testing 430.8 KB 144.8 KB
insight-actors 355.9 KB 144.8 KB
llm-costs 355.6 KB 144.8 KB
session-recording 353.9 KB 144.8 KB
session-summary 359.9 KB 144.8 KB
survey 353.7 KB 144.8 KB
survey-global-stats 358.5 KB 144.8 KB
survey-list 361.6 KB 144.8 KB
survey-stats 358.5 KB 144.8 KB
trace-span 352.5 KB 144.8 KB
trace-span-list 360.8 KB 144.8 KB
workflow 352.5 KB 144.8 KB
workflow-list 360.2 KB 144.8 KB
query-results 375.9 KB 144.8 KB
visual-review-snapshots 357.1 KB 144.8 KB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Size Change: 0 B

Total Size: 81.6 MB

ℹ️ View Unchanged
Filename Size
frontend/dist-report/decompression-worker/src/scenes/session-recordings/player/snapshot-processing/decompressionWorker 2.85 kB
frontend/dist-report/exporter/_chunks/chunk 8.6 MB
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Action 25 kB
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Actions 1.33 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityScene 119 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 19.9 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 132 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityUsers 872 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.64 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 915 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.19 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 37.8 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.83 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillScene 929 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 946 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.31 kB
frontend/dist-report/exporter/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 19 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.67 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.06 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.06 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.82 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 34.4 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.07 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 63 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.65 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.18 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.86 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/DataWarehouseScene 46.8 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.15 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 26.6 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.1 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.31 kB
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.02 kB
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.24 kB
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointScene 40.6 kB
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointsScene 24.5 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.44 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 104 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 33.8 kB
frontend/dist-report/exporter/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.38 kB
frontend/dist-report/exporter/_parent/products/games/368Hedgehogs/368Hedgehogs 5.61 kB
frontend/dist-report/exporter/_parent/products/games/FlappyHog/FlappyHog 6.12 kB
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 60.5 kB
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 5.31 kB
frontend/dist-report/exporter/_parent/products/links/frontend/LinkScene 25.2 kB
frontend/dist-report/exporter/_parent/products/links/frontend/LinksScene 4.55 kB
frontend/dist-report/exporter/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/LogsScene 17.9 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.2 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsAlertNotificationDetailScene/LogsAlertNotificationDetailScene 8.49 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.3 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.25 kB
frontend/dist-report/exporter/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.6 kB
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.5 kB
frontend/dist-report/exporter/_parent/products/metrics/frontend/MetricsScene 16.2 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.31 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.14 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 8.47 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.41 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.6 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.35 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/observations/ReplayObservation 12.7 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 38.3 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 12.2 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.59 kB
frontend/dist-report/exporter/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.5 kB
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.05 kB
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.2 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/SlackTaskContextScene 8.88 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskDetailScene 23.8 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskTracker 14.6 kB
frontend/dist-report/exporter/_parent/products/tracing/frontend/TracingScene 67.2 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterview 9.37 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviewResponse 7.79 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviews 6.08 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.56 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.8 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.32 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.6 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/Workflows/WorkflowScene 111 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/WorkflowsScene 60.2 kB
frontend/dist-report/exporter/src/exporter/exporter 19.7 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterDashboardScene 2.02 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterHeatmapScene 19.9 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterInsightScene 3.02 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterInterviewScene 310 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterNotebookScene 2.71 MB
frontend/dist-report/exporter/src/exporter/scenes/ExporterRecordingScene 1.13 kB
frontend/dist-report/exporter/src/exporterSharedChunkAnchors 1.19 kB
frontend/dist-report/exporter/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB
frontend/dist-report/exporter/src/lib/components/MonacoDiffEditor 471 B
frontend/dist-report/exporter/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.25 kB
frontend/dist-report/exporter/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 842 B
frontend/dist-report/exporter/src/lib/lemon-ui/Link/Link 359 B
frontend/dist-report/exporter/src/lib/monaco/CodeEditorInline 832 B
frontend/dist-report/exporter/src/lib/monaco/vimMode 211 kB
frontend/dist-report/exporter/src/lib/ui/Button/ButtonPrimitives 422 B
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitals 7.52 kB
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.09 kB
frontend/dist-report/exporter/src/queries/schema 853 kB
frontend/dist-report/exporter/src/scenes/approvals/changeRequestsLogic 884 B
frontend/dist-report/exporter/src/scenes/authentication/passkeyLogic 824 B
frontend/dist-report/exporter/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.2 kB
frontend/dist-report/exporter/src/scenes/data-pipelines/TransformationsScene 6.58 kB
frontend/dist-report/exporter/src/scenes/insights/views/BoxPlot/BoxPlot 5.39 kB
frontend/dist-report/exporter/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 8.84 kB
frontend/dist-report/exporter/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB
frontend/dist-report/exporter/src/scenes/insights/views/WorldMap/WorldMap 1.04 MB
frontend/dist-report/exporter/src/scenes/models/ModelsScene 19 kB
frontend/dist-report/exporter/src/scenes/models/NodeDetailScene 17 kB
frontend/dist-report/monaco-editor-worker/src/lib/monaco/workers/monacoEditorWorker 288 kB
frontend/dist-report/monaco-json-worker/src/lib/monaco/workers/monacoJsonWorker 419 kB
frontend/dist-report/monaco-typescript-worker/src/lib/monaco/workers/monacoTsWorker 7.02 MB
frontend/dist-report/posthog-app/_chunks/chunk 8.8 MB
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Action 25.1 kB
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Actions 1.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityScene 120 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 19.9 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 132 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityUsers 906 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.67 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 949 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.23 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 37.8 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.86 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillScene 963 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 980 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.34 kB
frontend/dist-report/posthog-app/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 19 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.71 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.09 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.09 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.85 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 26.6 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.11 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 61.7 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.68 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.22 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.9 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/DataWarehouseScene 1.81 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.25 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 26.7 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.17 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.34 kB
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.2 kB
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.28 kB
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointScene 40.7 kB
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointsScene 22.4 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.51 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 103 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 33.9 kB
frontend/dist-report/posthog-app/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.42 kB
frontend/dist-report/posthog-app/_parent/products/games/368Hedgehogs/368Hedgehogs 5.65 kB
frontend/dist-report/posthog-app/_parent/products/games/FlappyHog/FlappyHog 6.16 kB
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 60.5 kB
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 5.35 kB
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinkScene 25.2 kB
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinksScene 4.58 kB
frontend/dist-report/posthog-app/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/LogsScene 17.9 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.3 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsAlertNotificationDetailScene/LogsAlertNotificationDetailScene 8.53 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.34 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.29 kB
frontend/dist-report/posthog-app/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.6 kB
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.6 kB
frontend/dist-report/posthog-app/_parent/products/metrics/frontend/MetricsScene 16.2 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.35 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.18 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 8.51 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.45 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.64 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.38 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/observations/ReplayObservation 12.7 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 38.4 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 12.2 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.63 kB
frontend/dist-report/posthog-app/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.7 kB
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.09 kB
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.3 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/SlackTaskContextScene 8.91 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskDetailScene 23.9 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskTracker 14.7 kB
frontend/dist-report/posthog-app/_parent/products/tracing/frontend/TracingScene 67.3 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterview 9.41 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviewResponse 7.83 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviews 6.12 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.59 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.8 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.36 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.7 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/Workflows/WorkflowScene 104 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/WorkflowsScene 60.3 kB
frontend/dist-report/posthog-app/src/index 61.1 kB
frontend/dist-report/posthog-app/src/layout/panel-layout/ai-first/tabs/NavTabChat 7.26 kB
frontend/dist-report/posthog-app/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB
frontend/dist-report/posthog-app/src/lib/components/MonacoDiffEditor 471 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.29 kB
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 876 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/Link/Link 359 B
frontend/dist-report/posthog-app/src/lib/monaco/CodeEditorInline 866 B
frontend/dist-report/posthog-app/src/lib/monaco/vimMode 211 kB
frontend/dist-report/posthog-app/src/lib/ui/Button/ButtonPrimitives 426 B
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitals 7.55 kB
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.12 kB
frontend/dist-report/posthog-app/src/queries/schema 853 kB
frontend/dist-report/posthog-app/src/scenes/activity/explore/EventsScene 3.32 kB
frontend/dist-report/posthog-app/src/scenes/activity/explore/SessionsScene 4.72 kB
frontend/dist-report/posthog-app/src/scenes/activity/live/LiveEventsTable 5.62 kB
frontend/dist-report/posthog-app/src/scenes/agentic/AgenticAuthorize 5.87 kB
frontend/dist-report/posthog-app/src/scenes/approvals/ApprovalDetail 16.6 kB
frontend/dist-report/posthog-app/src/scenes/approvals/changeRequestsLogic 918 B
frontend/dist-report/posthog-app/src/scenes/audit-logs/AdvancedActivityLogsScene 42.1 kB
frontend/dist-report/posthog-app/src/scenes/AuthenticatedShell 173 kB
frontend/dist-report/posthog-app/src/scenes/authentication/AccountConnected 3.36 kB
frontend/dist-report/posthog-app/src/scenes/authentication/AgenticAccountMismatch 2.77 kB
frontend/dist-report/posthog-app/src/scenes/authentication/CLIAuthorize 11.8 kB
frontend/dist-report/posthog-app/src/scenes/authentication/CLILive 4.4 kB
frontend/dist-report/posthog-app/src/scenes/authentication/credential-review/CredentialReview 3.98 kB
frontend/dist-report/posthog-app/src/scenes/authentication/EmailMFAVerify 3.4 kB
frontend/dist-report/posthog-app/src/scenes/authentication/InviteSignup 15.4 kB
frontend/dist-report/posthog-app/src/scenes/authentication/Login 10.2 kB
frontend/dist-report/posthog-app/src/scenes/authentication/Login2FA 5.11 kB
frontend/dist-report/posthog-app/src/scenes/authentication/passkeyLogic 858 B
frontend/dist-report/posthog-app/src/scenes/authentication/PasswordReset 4.74 kB
frontend/dist-report/posthog-app/src/scenes/authentication/PasswordResetComplete 3.38 kB
frontend/dist-report/posthog-app/src/scenes/authentication/signup/SignupContainer 28.6 kB
frontend/dist-report/posthog-app/src/scenes/authentication/signup/verify-email/VerifyEmail 5.16 kB
frontend/dist-report/posthog-app/src/scenes/authentication/TwoFactorReset 4.41 kB
frontend/dist-report/posthog-app/src/scenes/authentication/VercelConnect 5.37 kB
frontend/dist-report/posthog-app/src/scenes/authentication/VercelLinkError 2.64 kB
frontend/dist-report/posthog-app/src/scenes/billing/AuthorizationStatus 1.1 kB
frontend/dist-report/posthog-app/src/scenes/billing/Billing 867 B
frontend/dist-report/posthog-app/src/scenes/billing/BillingSection 21.2 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohort 28.5 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/CohortCalculationHistory 6.61 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohorts 9.81 kB
frontend/dist-report/posthog-app/src/scenes/coupons/Coupons 1.1 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/Dashboard 1.68 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/Dashboards 19.9 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/templates/DashboardTemplateCopyScene 6.09 kB
frontend/dist-report/posthog-app/src/scenes/data-management/DataManagementScene 1.02 kB
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionEdit 17.3 kB
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionView 24.4 kB
frontend/dist-report/posthog-app/src/scenes/data-management/MaterializedColumns/MaterializedColumns 12 kB
frontend/dist-report/posthog-app/src/scenes/data-management/variables/SqlVariableEditScene 7.63 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/batch-exports/BatchExportScene 61 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DataPipelinesNewScene 2.76 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DestinationsScene 3.13 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.3 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene 21 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/TransformationsScene 2.37 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/WebScriptsScene 2.99 kB
frontend/dist-report/posthog-app/src/scenes/data-warehouse/DataWarehouseScene 1.75 kB
frontend/dist-report/posthog-app/src/scenes/data-warehouse/editor/EditorScene 1.52 kB
frontend/dist-report/posthog-app/src/scenes/debug/DebugScene 20.3 kB
frontend/dist-report/posthog-app/src/scenes/debug/hog/HogRepl 7.75 kB
frontend/dist-report/posthog-app/src/scenes/experiments/Experiment 211 kB
frontend/dist-report/posthog-app/src/scenes/experiments/Experiments 21.8 kB
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetric 6.45 kB
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetrics 923 B
frontend/dist-report/posthog-app/src/scenes/exports/ExportsScene 4.45 kB
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlag 144 kB
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlags 1.12 kB
frontend/dist-report/posthog-app/src/scenes/groups/Group 15.6 kB
frontend/dist-report/posthog-app/src/scenes/groups/Groups 4.29 kB
frontend/dist-report/posthog-app/src/scenes/groups/GroupsNew 7.73 kB
frontend/dist-report/posthog-app/src/scenes/health-alerts/HealthAlertsScene 4.17 kB
frontend/dist-report/posthog-app/src/scenes/health/categoryDetail/HealthCategoryDetailScene 7.64 kB
frontend/dist-report/posthog-app/src/scenes/health/HealthScene 12.8 kB
frontend/dist-report/posthog-app/src/scenes/health/pipelineStatus/PipelineStatusScene 11.5 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapNewScene 5.41 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapRecordingScene 4.31 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapScene 6.94 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmaps/HeatmapsScene 4.27 kB
frontend/dist-report/posthog-app/src/scenes/hog-functions/HogFunctionScene 55.3 kB
frontend/dist-report/posthog-app/src/scenes/inbox/InboxScene 63.4 kB
frontend/dist-report/posthog-app/src/scenes/insights/InsightQuickStart/InsightQuickStart 5.81 kB
frontend/dist-report/posthog-app/src/scenes/insights/InsightScene 34.8 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/BoxPlot/BoxPlot 5.43 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 4.87 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/WorldMap/WorldMap 5.16 kB
frontend/dist-report/posthog-app/src/scenes/instance/AsyncMigrations/AsyncMigrations 13.5 kB
frontend/dist-report/posthog-app/src/scenes/instance/DeadLetterQueue/DeadLetterQueue 5.77 kB
frontend/dist-report/posthog-app/src/scenes/instance/QueryPerformance/QueryPerformance 9 kB
frontend/dist-report/posthog-app/src/scenes/instance/SystemStatus/SystemStatus 17.4 kB
frontend/dist-report/posthog-app/src/scenes/IntegrationsRedirect/IntegrationsRedirect 1.11 kB
frontend/dist-report/posthog-app/src/scenes/marketing-analytics/MarketingAnalyticsScene 42.1 kB
frontend/dist-report/posthog-app/src/scenes/max/Max 1.06 kB
frontend/dist-report/posthog-app/src/scenes/models/ModelsScene 19.1 kB
frontend/dist-report/posthog-app/src/scenes/models/NodeDetailScene 17.1 kB
frontend/dist-report/posthog-app/src/scenes/moveToPostHogCloud/MoveToPostHogCloud 4.84 kB
frontend/dist-report/posthog-app/src/scenes/new-tab/NewTabScene 1.85 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookCanvasScene 3.98 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookPanel/NotebookPanel 6.01 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookScene 9.33 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebooksScene 8.01 kB
frontend/dist-report/posthog-app/src/scenes/oauth/OAuthAuthorize 1.01 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/coupon/OnboardingCouponRedemption 1.58 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/Onboarding 792 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/sdks/SdkDoctorScene 10.2 kB
frontend/dist-report/posthog-app/src/scenes/organization/ConfirmOrganization/ConfirmOrganization 4.91 kB
frontend/dist-report/posthog-app/src/scenes/organization/Create/Create 1.03 kB
frontend/dist-report/posthog-app/src/scenes/organization/Deactivated 1.51 kB
frontend/dist-report/posthog-app/src/scenes/organization/PendingDeletion 2.48 kB
frontend/dist-report/posthog-app/src/scenes/persons/PersonScene 20.4 kB
frontend/dist-report/posthog-app/src/scenes/persons/PersonsScene 6.12 kB
frontend/dist-report/posthog-app/src/scenes/PreflightCheck/PreflightCheck 5.95 kB
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTour 275 kB
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTours 5.06 kB
frontend/dist-report/posthog-app/src/scenes/project-homepage/ProjectHomepage 19.1 kB
frontend/dist-report/posthog-app/src/scenes/project/Create/Create 1.21 kB
frontend/dist-report/posthog-app/src/scenes/resource-transfer/ResourceTransfer 9.56 kB
frontend/dist-report/posthog-app/src/scenes/saved-insights/SavedInsights 1.04 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/detail/SessionRecordingDetail 2.14 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/file-playback/SessionRecordingFilePlaybackScene 4.85 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/kiosk/SessionRecordingsKiosk 10.3 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/player/snapshot-processing/DecompressionWorkerManager 329 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/playlist/SessionRecordingsPlaylistScene 5.49 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/SessionRecordings 1.15 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/settings/SessionRecordingsSettingsScene 2.35 kB
frontend/dist-report/posthog-app/src/scenes/sessions/SessionProfileScene 15.6 kB
frontend/dist-report/posthog-app/src/scenes/settings/SettingsScene 3.94 kB
frontend/dist-report/posthog-app/src/scenes/sites/Site 1.9 kB
frontend/dist-report/posthog-app/src/scenes/startups/StartupProgram 21.6 kB
frontend/dist-report/posthog-app/src/scenes/StripeConfirmInstall/StripeConfirmInstall 3.92 kB
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionScene 14.4 kB
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionsScene 5.23 kB
frontend/dist-report/posthog-app/src/scenes/surveys/forms/SurveyFormBuilder 1.93 kB
frontend/dist-report/posthog-app/src/scenes/surveys/Survey 1.39 kB
frontend/dist-report/posthog-app/src/scenes/surveys/Surveys 26.8 kB
frontend/dist-report/posthog-app/src/scenes/surveys/wizard/SurveyWizard 72.8 kB
frontend/dist-report/posthog-app/src/scenes/themes/CustomCssScene 3.94 kB
frontend/dist-report/posthog-app/src/scenes/toolbar-launch/ToolbarLaunch 2.85 kB
frontend/dist-report/posthog-app/src/scenes/Unsubscribe/Unsubscribe 2.04 kB
frontend/dist-report/posthog-app/src/scenes/web-analytics/SessionAttributionExplorer/SessionAttributionExplorerScene 7.01 kB
frontend/dist-report/posthog-app/src/scenes/web-analytics/WebAnalyticsScene 14.8 kB
frontend/dist-report/posthog-app/src/scenes/wizard/Wizard 4.83 kB
frontend/dist-report/posthog-app/src/sharedChunkAnchors 1.19 kB
frontend/dist-report/render-query/src/render-query/render-query 27.6 MB
frontend/dist-report/toolbar/src/toolbar/toolbar 15.9 MB

compressed-size-action

tests-posthog Bot and others added 4 commits June 1, 2026 19:02
Reject behavioral (event-based) cohort references in batch/schedule
workflow audiences via a serializer guard (mirrors the feature-flag
pattern), enforced for non-web callers even on drafts so MCP fails fast.
Expose hide_behavioral_cohorts on cohorts-list and clarify the batch
audience mechanics (properties = mixed person-condition + cohort-ref
list) in the workflow tool descriptions.
… harley/workflows-mcp-batch

# Conflicts:
#	products/workflows/mcp/tools.yaml
@mayteio mayteio marked this pull request as ready for review June 2, 2026 10:54
@mayteio mayteio requested a review from a team June 2, 2026 10:54
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team June 2, 2026 10:54
@posthog-project-board-bot posthog-project-board-bot Bot moved this to In Review in Feature Flags Jun 2, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 2, 2026

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
products/workflows/backend/api/hog_flow.py:210-234
Inconsistent draft enforcement for event/action filters vs. behavioral cohorts. Behavioral cohorts are already blocked for MCP/API drafts via `_should_enforce_audience_guard`, but the `events`/`actions` filter check only fires for non-drafts. An MCP caller can currently save a draft batch trigger that contains event or action filters without getting the error they'd expect. The PR description specifically calls out "non-web callers enforced even on drafts" — this check belongs under the same guard so the two save-time rejections stay in sync.

```suggestion
            elif data.get("config", {}).get("type") == "batch":
                filters = data.get("config", {}).get("filters", {})
                if not is_draft:
                    if not filters:
                        raise serializers.ValidationError({"filters": "Filters are required for batch triggers."})
                    if not isinstance(filters, dict):
                        raise serializers.ValidationError({"filters": "Filters must be a dictionary."})
                    properties = filters.get("properties", None)
                    if properties is not None and not isinstance(properties, list):
                        raise serializers.ValidationError({"filters": {"properties": "Properties must be an array."}})
                if self._should_enforce_audience_guard(is_draft) and isinstance(filters, dict):
                    # The audience targets who a person is (properties / cohort membership), not what they did.
                    # Event/action filters are silently dropped by the person-based blast radius (resolving to
                    # "everyone"), so reject them outright — mirrors the guard on conditional branches. The UI
                    # already prevents this; this closes the same gap for API/MCP callers.
                    if filters.get("events") or filters.get("actions"):
                        raise serializers.ValidationError(
                            {
                                "filters": (
                                    "Batch trigger audiences can't filter on event behavior. Target person "
                                    "properties or a cohort instead (create a cohort for 'users who did event X')."
                                )
                            }
                        )
                    self._reject_behavioral_cohorts_in_audience(filters.get("properties"))
```

### Issue 2 of 3
products/workflows/backend/api/test/test_hog_flow.py:853-888
Two pairs of near-identical tests could be collapsed into parameterized tests, per the team's stated preference. `test_hog_flow_batch_trigger_rejects_event_filters` and `test_hog_flow_batch_trigger_rejects_action_filters` differ only in which extra filter key is set; `test_hog_flow_batch_trigger_allows_static_cohort` and `test_hog_flow_batch_trigger_allows_property_cohort` differ only in cohort construction. Parameterizing removes duplication and makes it easier to extend coverage.

```suggestion
    @parameterized.expand(
        [
            ("events", {"events": [{"id": "$pageview", "type": "events"}]}),
            ("actions", {"actions": [{"id": "5", "type": "actions"}]}),
        ]
    )
    def test_hog_flow_batch_trigger_rejects_behavioral_filter(self, _name, extra_filters):
        trigger_action = {
            "id": "trigger_node",
            "name": "trigger_1",
            "type": "trigger",
            "config": {
                "type": "batch",
                "filters": {"properties": [], **extra_filters},
            },
        }
        hog_flow = {"name": "Test Batch Flow", "status": "active", "actions": [trigger_action]}

        response = self.client.post(f"/api/projects/{self.team.id}/hog_flows", hog_flow)
        assert response.status_code == 400, response.json()
```

### Issue 3 of 3
services/mcp/src/tools/workflows/batch.ts:9-11
Duplicated cap constant across service boundaries. `BATCH_WORKFLOW_MAX_AUDIENCE_SIZE = 5000` mirrors `CDP_BATCH_WORKFLOW_MAX_AUDIENCE_SIZE` in `nodejs/src/cdp/config.ts`, and the file comment asks to "Keep the two values in sync." If the batch consumer's cap is raised, only the Node.js file is likely to be updated, leaving the MCP guard at the old value — producing confusing over-cap rejections from an outdated threshold. Consider a shared config entry or a CI assertion that both constants match.

Reviews (1): Last reviewed commit: "Merge branch 'master' into harley/workfl..." | Re-trigger Greptile

Comment thread products/workflows/backend/api/hog_flow.py
Comment thread products/workflows/backend/api/test/test_hog_flow.py Outdated
Comment thread services/mcp/src/tools/workflows/batch.ts
Comment thread products/workflows/backend/api/hog_flow.py
@veria-ai
Copy link
Copy Markdown

veria-ai Bot commented Jun 2, 2026

PR overview

This PR adds MCP tooling for batch workflows, including operations around batch jobs and schedules for workflow execution. It also updates backend workflow API handling related to batch job and schedule mutation paths.

There are still two open security issues around batch workflow fan-out controls. Personal API keys may be able to create batch jobs or schedules without the same person-scope permission expected for audience fan-out, and schedule updates can modify active batch broadcasts without a fresh affected-count confirmation. Four issues have already been addressed, but the remaining gaps still allow attacker-initiated changes with meaningful impact on scheduled or audience-targeted workflow execution.

Open issues (2)

Fixed/addressed: 4 · PR risk: 6/10

mayteio added 3 commits June 2, 2026 13:43
Move the event/action audience rejection under the same draft
discriminator as the behavioral-cohort guard, so MCP/API drafts can't
slip an event-behavior audience through — the two save-time rejections
now stay in sync. Steer batch audience guidance toward re-evaluating
person-property conditions / dynamic cohorts over static frozen-list
cohorts, and parameterize the batch-audience validation tests.
The batch_jobs POST endpoint created a run for any workflow status — the
active check lived only in the UI (disabled trigger button) and the
scheduler, so a direct API/MCP call could mint a queued job + CDP request
for a draft that the consumer then drops. Mirror the scheduler's gate:
reject the run unless the workflow is active.
Comment thread products/workflows/mcp/tools.yaml
Comment thread posthog/api/cohort.py
list=extend_schema(
parameters=[
OpenApiParameter(
name="hide_behavioral_cohorts",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposed so MCP can list cohorts that are workflow-compatible.

scope_object_read_actions = ["list", "retrieve", "logs", "metrics", "metrics_totals"]
scope_object_write_actions = ["create", "update", "partial_update", "destroy", "invocations"]
scope_object_read_actions = ["list", "retrieve", "logs", "metrics", "metrics_totals", "user_blast_radius"]
scope_object_write_actions = [
Copy link
Copy Markdown
Contributor Author

@mayteio mayteio Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope_object_write_actions declares which workflow actions require hog_flow:write so personal-API-key (MCP) callers can reach them — it lists the custom write actions (invocations, schedule_detail, bulk_delete) plus the standard CRUD writes, which have to be re-listed because setting this attribute replaces the default CRUD list rather than extending it.

Comment thread services/mcp/src/tools/workflows/batch.ts Outdated
mayteio and others added 3 commits June 3, 2026 08:59
Active (enabled) workflows are read-only via MCP until revisions exist —
editing can break already-scheduled or in-flight runs with no rollback.
Enforced in the backend (perform_update), so workflows-update returns to
a plain generated tool (no acknowledge_live_edit opt-in).

Also deregisters workflows-disable from the MCP surface — exposing it
invited a disable->edit->enable workaround; the factory stays in
lifecycle.ts for easy re-enable. Strengthens the blast-radius /
run-batch copy to demand explicit user confirmation before broadcasting.
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 3, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

mayteio and others added 3 commits June 3, 2026 12:43
…p-batch

# Conflicts:
#	posthog/api/cohort.py
#	products/cohorts/frontend/generated/api.schemas.ts
#	services/mcp/src/api/generated.ts
#	services/mcp/src/generated/cohorts/api.ts
#	services/mcp/src/tools/generated/cohorts.ts
#	services/mcp/tests/unit/__snapshots__/tool-schemas/cohorts-list.json
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 3, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

Comment thread products/workflows/backend/api/hog_flow.py
mayteio added 2 commits June 3, 2026 13:53
The user_blast_radius endpoint counts persons/groups matching caller-
supplied filters, but was gated only on hog_flow:read — letting a
workflow-read PAT/OAuth token probe person counts (an existence oracle,
e.g. "does email X exist?") without person-data access.

Require person:read in addition to hog_flow:read on that action (via
dangerously_get_required_scopes; AND semantics). The web builder uses
session auth, so live audience sizing is unaffected. The MCP tools that
size audiences (workflows-blast-radius / -run-batch / -schedule-create)
gain person:read in their declared scopes accordingly.

Note: feature_flags has the identical pattern and is left to its owners
(tightening it is a breaking change for existing integrations).
@github-project-automation github-project-automation Bot moved this from In Review to Approved in Feature Flags Jun 3, 2026
Copy link
Copy Markdown
Contributor

@dmarchuk dmarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍 Left just one comment for a schedule trigger cleanup we should do before merging

Comment thread services/mcp/src/tools/workflows/batch.ts Outdated
…eate on active

Addresses two PR review comments:

- dmarchuk: remove the generic 'schedule' trigger type from the MCP
  surface (matches the UI hiding it from the trigger-type dropdown).
  workflows-create/-update/-get descriptions drop it, and
  workflows-schedule-create is now batch-only. Recurring batch
  scheduling (schedule-create / update-schedule) is untouched.

- veria-ai: close the draft-batch schedule-create audience bypass —
  ack a narrow audience on a draft, broaden the trigger, then enable,
  and the scheduled run would broadcast wider than acknowledged.
  schedule-create now requires the batch workflow to be active first
  (an active workflow's trigger can't be MCP-edited, so the
  acknowledged audience is locked); acknowledged_affected_count is now
  required.
@mayteio mayteio enabled auto-merge (squash) June 3, 2026 15:36
@tests-posthog tests-posthog Bot disabled auto-merge June 3, 2026 15:38
@mayteio mayteio enabled auto-merge (squash) June 3, 2026 15:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🎭 Playwright report · View test results →

⚠️ 1 flaky test:

  • Change date range and toggle comparison (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this comment? Help fix flakies and failures and it'll disappear!

@mayteio mayteio merged commit aaed68c into master Jun 3, 2026
210 checks passed
@mayteio mayteio deleted the harley/workflows-mcp-batch branch June 3, 2026 16:11
@github-project-automation github-project-automation Bot moved this from Approved to Done in Feature Flags Jun 3, 2026
promptless Bot added a commit to PostHog/posthog.com that referenced this pull request Jun 3, 2026
Documents the new batch workflow tools added in PostHog/posthog#61001:
- workflows-blast-radius: Size audience before batch operations
- workflows-run-batch: Trigger one-off broadcasts
- workflows-schedule-create: Create recurring schedules
- workflows-list-batch-jobs: List past batch runs
- workflows-update-schedule: Update schedule configuration

Also updates guardrails to reflect that:
- Active workflows are now read-only via MCP
- workflows-disable was removed
- Blast-radius confirmation is required for batch operations
# lists above can't distinguish GET (read) from POST (write) on the same action. Without
# this, these actions declare no scope and reject all personal-API-key (MCP) access.
if self.action in ("batch_jobs", "schedules"):
return ["hog_flow:read"] if request.method in ("GET", "HEAD", "OPTIONS") else ["hog_flow:write"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: Batch fan-out is exposed without person scope

This override makes mutating /batch_jobs and /schedules available to personal API keys that only have hog_flow:write. A token without person:read can now start an active batch workflow with caller-supplied person filters, or attach a recurring batch schedule, which is the same person-audience fan-out the MCP tools gate on person:read; require person:read for these mutating batch/schedule paths or enforce it after loading batch-trigger workflows.

- hog_flow:write
annotations:
readOnly: false
destructive: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: Schedule updates bypass batch confirmation

Enabling workflows-update-schedule as a non-destructive raw PATCH lets an MCP caller change the RRULE, start time, or variables on an active batch schedule without the acknowledged_affected_count guard used by workflows-schedule-create. A prompt-injected tool call can make an existing scheduled broadcast run hourly against the current audience; keep this generated tool disabled and add a wrapper that fetches the workflow, requires person:read plus a fresh blast-radius acknowledgment for active batch schedules, or only allows updates while paused.

@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented Jun 3, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-06-03 17:11 UTC Run
prod-us ✅ Deployed 2026-06-03 17:48 UTC Run
prod-eu ✅ Deployed 2026-06-03 17:52 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants