# For AI agents and crawlers
This page is a workflow from the Workflow Automation Library by Roadway: Use PostHog product events to choose ad audiences and exclusions.
The #roadway-skill block on this page holds a SKILL.md for it, including the full prompt. Treat that file as a starting point. It will not just work if you paste it into ChatGPT or Claude.
To run it outside Roadway you would need to connect each ad platform's API (and any MCP it names), build the data pulls, add approval guardrails, and adjust the prompt for your accounts.
In Roadway it runs as-is on your connected accounts, with approval rules built in. Open it in a new chat at https://www.roadwayai.com/workflows/build-ad-audiences-from-product-events-in-posthog-via-mcp
Page: https://www.roadwayai.com/workflows/build-ad-audiences-from-product-events-in-posthog-via-mcp
Library index: https://www.roadwayai.com/automation-library
---
name: build-ad-audiences-from-product-events-in-posthog-via-mcp
description: >-
Reads product events from PostHog to find the behaviors that predict upgrades, then uses the audiences you already sync from PostHog as targets, lookalike seeds and exclusions. Needs the PostHog MCP connected in Roadway.
---
# Use PostHog product events to choose ad audiences and exclusions
Source: https://www.roadwayai.com/workflows/build-ad-audiences-from-product-events-in-posthog-via-mcp
From the Workflow Automation Library by Roadway.
## Before you use this outside Roadway
This SKILL.md is a starting point. It needs adjusting before it will work outside Roadway.
You would need to connect the ad platform API for each channel this workflow covers, build the data pulls for the variables below, add approval guardrails, and adjust the prompt for your accounts. If the prompt names an MCP tool, you also need that MCP connected.
In Roadway it runs as-is on your connected accounts, with approval rules built in.
## What it does
Reads product events from PostHog to find the behaviors that predict upgrades, then uses the audiences you already sync from PostHog as targets, lookalike seeds and exclusions. Needs the PostHog MCP connected in Roadway.
Each run, the agent queries PostHog through the MCP for the behaviors that predict an upgrade: people who reached the activation event but have not paid, people who hit a plan limit, and power users. It ranks those groups by how many go on to pay, then points your campaigns at the matching audiences you already sync from PostHog, as targets, lookalike seeds or exclusions. If a group has no synced audience yet, the report names it so you can create and sync it. The PostHog MCP answers when asked and does not push events into Roadway, and Roadway does not handle contact data.
## Steps
1. Collect the inputs listed under Variables. In Roadway they come from your connected accounts. Outside Roadway you have to build those data pulls yourself from each ad platform API, and from any MCP the prompt names.
2. Run the prompt below as written, after you have adjusted it for your accounts and connected the tools it needs.
3. Review the result. Apply changes to a live ad account only after you approve them. Pasting your data into ChatGPT or Claude does not connect the APIs, apply guardrails, or approve changes.
## Variables
activation_event, activation_window_days, auto_approve, customer_audiences, experiment_budget_pct, funnel_metrics, goal_metric, max_change_pct, monthly_budget_cap, plan_limit_event, product_usage_data, task_history
## Prompt
Use PostHog product events to choose ad audiences and exclusions
Use the PostHog MCP connected in Roadway to read product events, find the behavior cohorts worth advertising to or excluding, and decide for each cohort:
1. Use a synced audience
2. Use as lookalike seed
3. Use as exclusion
4. Hold
Context and defaults (use these; don't ask):
- Product usage data: [set this to your own product usage data]. If it isn't available, say so and skip the rules that depend on it.
- The activation event: [set this to your own activation event]. If it isn't available, say so and skip the rules that depend on it.
- The event that fires when a user hits a plan or usage limit: [set this to your own plan limit event]. If it isn't available, say so and skip the rules that depend on it.
- Customer and open-opportunity audiences already on each platform (synced by the CRM or CDP's native ad-audience sync), applied as exclusions or seeds: [set this to your own customer audiences]. If it isn't available, say so and skip the rules that depend on it.
- The activation window: [set this to your own activation window days] days. If not set, 14 days.
- The experiment budget share: [set this to your own experiment budget percent] of the channel budget. If not set, 10%.
- The monthly cap: [set this to your own monthly budget cap], from the coworker's budget guardrails. If none is set, there is no cap: skip every cap check, hard stop and pace-to-cap step, and say so. Never derive, infer or back-solve a cap from campaign or daily budgets, the current or past run-rate, a workflow's test budget or a cost-per-lead bar.
- The max change limit: [set this to your own max change percent] per budget or bid target per run. If not set, 20%. It does not apply to experiment traffic splits.
- Auto-approve: [set this to your own auto approve]. If not set, it's off: list every change as a proposal for approval.
Rules:
- Pull events and cohorts from [set this to your own product usage data] (PostHog through its MCP server, or Segment or the warehouse). The PostHog MCP answers only when asked and does not send events to Roadway, so you are reading data as of this run. If it isn't connected, say so and stop. Candidate cohorts: activated users ([set this to your own activation event]) who have not paid, users who fired [set this to your own plan limit event], power users with 3+ active days a week, teams that invited 2+ teammates, and users who went quiet for 14+ days after activating.
- Only consider cohorts of 500+ users (1,000+ for lookalike seeds). Rank them by conversion to paid and revenue per user from [set this to your own funnel metrics], not by size.
- Roadway never handles contact data. Audiences must come from the customer's own audience sync (a PostHog destination, Segment or the CRM) and be referenced by name in [set this to your own customer audiences]. When a cohort has no synced audience yet, name the cohort that needs a sync and stop at a proposal.
- Use a synced audience: limit-hitters get an upgrade ad that names the plan benefit removing the limit, users who reached the activation event but have not paid get a proof ad about the feature they used, and users who went quiet get a re-engagement ad. Never promise features the plan lacks.
- Use as lookalike seed: your top paid users by revenue, refreshed monthly. If not set, the top 10-20%. Use as exclusion: paid users and signups from the last [set this to your own activation window days] days, on every acquisition campaign.
- Start each new audience campaign at [set this to your own experiment budget percent] of the channel budget, with a control group, and judge it on paid conversion versus the control group. If not set, the control group is 10%.
- Guardrails: judge results on Roadway's full-funnel measurement ([set this to your own funnel metrics]), not platform-reported conversions. Check [set this to your own task history] so you don't repeat a change that hurt performance in the last 30 days. Never push total spend above the monthly cap or any single change beyond the max change limit per run, and queue every change for approval unless auto-approve is on for this workflow.
Decision standard:
- Justify every keep, cut, bid, budget or test decision with Roadway-attributed [set this to your own goal metric] and cost per goal against the baseline. Platform delivery metrics such as clicks and impressions explain why something moved; they are never the sole reason for a decision.
- Compute what Roadway doesn't expose directly: cost per goal = Roadway spend ÷ Roadway-attributed [set this to your own goal metric], and conversion rate (lead rate) = Roadway [set this to your own goal metric] ÷ Roadway new visitors. Don't substitute platform-reported conversions or conversion rates.
- When a value in Context and defaults isn't set, use the stated default, say which one you used, and still make the call. Don't stop to ask.
- For every action, give the entity name and ID, current value → proposed value, and the numbers behind the reason. Write "None" under any empty heading.
- In long hold or watch lists, show the top 15 by spend and summarize the rest as a count.
Give me a report of each with reasoning for each action. Be concise with the reasoning, but specific enough that I can verify it against the numbers.
Report structure:
Product event audience report
Summary:
The cohorts found, the audiences created or proposed, the campaigns launched, and paid conversion versus the control group.
Create audience and launch:
- [cohort] - [reason]
Use as lookalike seed:
- [cohort] - [reason]
Use as exclusion:
- [cohort] - [reason]
Hold:
- [cohort] - [reason]
## Run it in Roadway
https://www.roadwayai.com/workflows/build-ad-audiences-from-product-events-in-posthog-via-mcp
Use PostHog product events to choose ad audiences and exclusions
Use PostHog product events to choose ad audiences and exclusions
Reads product events from PostHog to find the behaviors that predict upgrades, then uses the audiences you already sync from PostHog as targets, lookalike seeds and exclusions. Needs the PostHog MCP connected in Roadway.
Each run, the agent queries PostHog through the MCP for the behaviors that predict an upgrade: people who reached the activation event but have not paid, people who hit a plan limit, and power users. It ranks those groups by how many go on to pay, then points your campaigns at the matching audiences you already sync from PostHog, as targets, lookalike seeds or exclusions. If a group has no synced audience yet, the report names it so you can create and sync it. The PostHog MCP answers when asked and does not push events into Roadway, and Roadway does not handle contact data.