Build your first automation

In this tutorial, you build an onboarding automation that welcomes new signups, waits for their first upload, and nudges the people who don't upload. You learn how triggers, conversion goals, and Wait until steps work together, and how to test an automation without emailing anyone.

Before you start

Build the automation

Pick how you want to learn. Both paths build the same automation.

Connect your agent

Run npx @posthog/wizard mcp add to connect the PostHog MCP to Claude Code, Cursor, Codex, or another agent. Then copy this prompt into your agent:

Guided tutorial promptbuilding-workflows
“Walk me step by step through building a draft onboarding automation in PostHog: trigger on signed_up (once ever), set conversion goal uploaded_file with exit on goal, send a welcome email, wait up to 2 days for uploaded_file, and nudge anyone who didn't upload. Before creating each part, explain why it matters and pause after saving the draft so we can mock-test the welcome email step and review the Wait until branch and goal exit together. Leave the automation as a draft, and do not enable it until I review.”

The agent explains each part before it builds it, and saves its work as a draft. Check what you see at each checkpoint before you tell it to continue.

Checkpoint 1: The trigger and the goal

What the agent builds: a trigger on signed_up, with a frequency of one time ever, so each person goes through the automation only once. A conversion goal on uploaded_file, with Exit when conversion goal is met.

Why it matters: with exit on goal, a person who uploads a file leaves the automation at once. Nobody gets a nudge for something they already did.

What you should see: the agent names the trigger event, the frequency, the goal event, and the exit condition, and asks you to confirm them.

Checkpoint 2: The welcome email and the wait

What the agent builds: a welcome email after the trigger, then a Wait until step for uploaded_file, with a max time of 2 days. The step has two paths:

  • Event received – the person uploaded a file. This path goes to the exit.
  • No match within 2d – the person didn't upload. This path sends the nudge email.

What you should see: the agent saves the automation as a draft, and gives you a link to it. It pauses before it tests anything.

Checkpoint 3: A mocked step test

What the agent does: it runs a mocked test on one step at a time with a sample person, with real HTTP requests turned off. A single-step test verifies the welcome email (rendering, subject, and recipient) without sending anything. It does not simulate a later uploaded_file event or advance the two-day wait.

What you should see:

  • The welcome email step succeeds for the test person, with no real email sent.
  • You confirm the Wait until edges (Event received to exit, No match within 2d to the nudge email) and the uploaded_file exit-on-goal setting on the draft canvas.

Checkpoint 4: Review and publish

Open the draft in Workflows. Check the trigger, the goal, both emails, and both paths on the canvas. Read each email in the editor.

What you should see: the automation is still a draft. When it looks right, click Enable. Your agent never turns it on for you.

What you learned

  • A trigger with a frequency of one time ever starts the automation once for each person.
  • A conversion goal with exit on goal stops messages to people who already did the thing you want.
  • A Wait until step splits people into two paths: those who act within the max time, and those who don't.
  • A test with real HTTP requests turned off shows what each step does, and sends nothing.

Next steps

Still have questions?

Was this page useful?