Use Workflows over PostHog MCP
The PostHog MCP server gives your coding agent access to Workflows. From your editor, your agent can write emails, send them from your code, build broadcasts and automations, and tell you how each email did.
It works in any MCP client, such as Claude Code, Cursor, Codex, and VS Code. The Workflows agent skills teach your agent how to use these tools well, such as how to build an automation as a draft and test it before it goes live.
Before you start
- Set up Workflows: install the PostHog SDK and set up your domain.
- Connect the MCP server: run the PostHog Wizard, and give the server access to your project. To set up a client by hand, see get started with MCP.
What you can ask
- Send email from your code: "Add a password reset email to our app, sent with PostHog."
- Write and edit emails: "Change the button on our welcome email to say Get started."
- Send a broadcast: "Email everyone who signed up this week about our webinar on Thursday."
- Build an automation: "Email new signups who haven't created a dashboard after 2 days."
- Start from a suggestion: "Suggest an automation from our events, and build it as a draft."
- See how an email did: "Which of our automations had the most unsubscribes last month, and why?"
- Debug a send: "Why did the welcome email bounce for ada@example.com?"
- Move from another provider: "Move our email from Customer.io to PostHog."
Your agent creates broadcasts and automations as drafts. A broadcast sends only after you launch it in PostHog. An automation runs only after it's enabled, and your agent asks you before it enables one. The send tools, and the tool that lets your code send a template, each take two calls: a prepare call that checks the request, and an execute call that runs only after you reply confirm.
Some tools are still rolling out, so your project might not have all of them yet.
Email tools
| Tool | Description |
|---|---|
workflows-send-email-template-prepare, workflows-send-email-template-execute | Send an email template to one person, such as a password reset. |
workflows-send-email-prepare, workflows-send-email-execute | Send one email with content that you pass, such as a receipt. |
workflows-make-email-template-transactional-prepare, workflows-make-email-template-transactional-execute | Make a template sendable from your code. |
workflows-create-email-template | Save an email template to the library. |
workflows-list-email-templates | List the email templates in the library. |
workflows-get-email-template | Get an email template, with its content. |
workflows-patch-email-template | Make a small edit to a template, such as a heading or a button. |
workflows-update-email-template | Replace a template's content. |
workflows-show-email-template | Show a preview of a template. |
Broadcast and automation tools
| Tool | Description |
|---|---|
broadcasts-create | Create a broadcast as a draft, which you review and launch in PostHog. |
workflows-convert-to-broadcast | Move an automation that sends one email to an audience over to broadcasts. |
workflows-create | Create an automation as a draft. |
workflows-data-suggestions-list | Suggest automations from your project's events, such as a welcome email on sign-up. |
workflows-data-suggestions-get | Check on suggestions that are still being generated. |
workflows-data-suggestions-create | Build a suggested automation as a draft. |
workflows-list | List the automations in the project. |
workflows-get | Get an automation. |
workflows-patch-graph | Add, remove, or change steps. |
workflows-patch-action-email | Edit the email in one step. |
workflows-update | Change an automation's name, description, exit condition, conversion goal, or variables. |
workflows-update-schedule | Change when a scheduled automation runs. |
workflows-test-run | Test one step. Sends are mocked unless you turn that off. |
workflows-publish | Make the draft live. |
workflows-discard-draft | Throw away the draft. |
workflows-enable | Turn on an automation. |
workflows-suggest | Suggest a change for a person to review. |
workflows-list-proposals | List the suggested changes on an automation. |
workflows-list-revisions | List an automation's history. |
workflows-get-revision | Get one version of an automation. |
workflows-restore-revision | Roll an automation back to an earlier version, as a draft. |
Results tools
| Tool | Description |
|---|---|
workflows-global-stats | See how every automation is doing. |
workflows-stats | Get the stats for one automation. |
workflows-version-stats | Get the stats for one published version. |
workflows-list-versions | List an automation's published versions, with when each went live. |
workflows-emails-list | List the emails that a broadcast or automation sent. |
workflows-email-get | Get one email that an automation sent, with its timeline. |
workflows-email-activity | See what the recipient did before and after an email. |
workflows-transactional-emails-list | List the transactional emails from the last 30 days. |
workflows-transactional-email-get | Get one transactional email, with its timeline. |
workflows-transactional-email-stats | Count transactional emails by outcome. |
workflows-transactional-email-results | Count the recipients who did an event after an email. |
workflows-transactional-email-activity | See what the recipient did before and after a transactional email. |
workflows-list-invocations | List an automation's runs. |
workflows-get-invocation | Get one run, with the event that started it. |
workflows-logs | Read an automation's logs. |
workflows-list-batch-jobs | List the batch runs of a broadcast or scheduled automation. |
Sending rules tools
| Tool | Description |
|---|---|
workflows-setup-status | Check which setup steps the project has done, such as a verified domain. |
workflows-sending-rules-get | Get the frequency cap and other sending rules. |
workflows-sending-rules-update | Change the sending rules. |
workflows-reputation-get | Get your bounce and spam rates, and your sending allowance. |
message-categories-list, message-categories-get, message-categories-create, message-categories-update | Manage the message categories that people opt out of. |
opt-outs-list, opt-outs-add, opt-outs-remove | List, add, or remove opt-outs, up to 1,000 at a time. |
suppressions-list, suppressions-add, suppressions-remove | List, add, or remove addresses on the suppression list. |
Import tools
| Tool | Description |
|---|---|
provider-imports-providers | List the email tools that you can import from, and what each brings over. |
provider-imports-create | Start an import from a tool such as Resend, Postmark, SendGrid, Mailgun, or Mailchimp. |
provider-imports-list, provider-imports-get | Check on an import. |
workflows-import-customerio | Turn Customer.io automations into draft automations. |
workflows-import-notes | See what an import from Customer.io changed or left out. |
supabase-auth-emails-settings-get, supabase-auth-emails-settings-update, supabase-auth-emails-starter-templates-create | Send a Supabase project's auth emails with PostHog templates. |
Other ways to use Workflows
For the triggers, steps, Liquid variables, and limits that these tools work with, see the Workflows reference.





