Skip to content

Workflows first run: say who the first sends reach, and the own-domain line #264

Closed

Description

@Silthus

Map: Map: build the Workflows first run, from template gallery to first send
Spec: Spec: Workflows first run

Cast: Opus 5.5 (UI)

Question

Does the first run tell people who its first emails reach, and how to send from their own domain?

Delivers end to end. Spec section "Who the first sends reach (waits on #254)". Builds on Make it yours and the draft and sending banners. Implements the answer on Shared sender or members-only (option C).

Answer on #254 (Michael, 2026-10-05): C, members-only now. First sends reach verified members of the team's organization only, until the team sends from its own domain.

  • Show the numbers. The helper under "Enable workflow" and both banners name the sender address and say, as numbers, who the workflow reaches and who it does not:
    • reaches: the organization's verified members, as a count;
    • does not reach yet: the people in this project who have an email address, as a count.
    • Both counts come from the shared workflow email reach endpoint that the Workflows AI links and reach effort builds (agreed 2026-10-05). Do not add count queries here. The endpoint is feat(workflows): use site links and report email eligibility PostHog/posthog#111750: GET /api/projects/:team_id/hog_flows/email_reach/ returns verified_member_count, project_email_count and email_senders, with the generated EmailReach type. Stack on that PR, or build on master once it has merged.
    • Example shape, not final copy: "Sends to your 3 teammates. 1,240 people in this project get it once you send from your own domain."
  • One clear call to action. "Send from your own domain" is the main next step in both banners and under the switch, not a quiet line. It opens the email domain wizard (feat(workflows): open the email domain wizard from channels, configure and broadcasts PostHog/posthog#110088 and its stack) when that is on master. Until then it opens Channels. Keep the target in one place so switching to the wizard is a one-line change, and record the follow-up on this ticket.
  • Own-domain states: none, the call to action above; verifying, says it is verifying; verified, nothing, because the switch banner from #238 takes over.
  • Copy does not promise opens and clicks from the sandbox sender.
  • Copy through /writing-user-facing-copy. State the sender rule as a product rule.

Test seams. A kea logic test with the API mocked at the HTTP layer: both counts from the shared reach endpoint, the line for each own-domain state, and nothing while the workflow is already on an own sender. Stories for each state at full width and 520px.

Write scope. The first-run folder under products/workflows/frontend/, and tests and stories.
Overlap: #238 owns the switch banner; do not duplicate its switch. The email domain wizard (PostHog#110088 and its stack) owns domain setup; link to it, do not change it.

Acceptance criteria

  • The helper and the banners name the sender and show how many people the workflow reaches and how many it does not reach yet.
  • "Send from your own domain" is the main call to action and opens the email domain wizard, or Channels until the wizard is on master.
  • Each own-domain state shows its line, and a verified domain shows none beside the switch banner.
  • Screenshots on this ticket.

How to build (map #253)

  • /implement + /tdd red-green-refactor, outside-in, at the seams named above. The frontend mocks the API at the HTTP layer. Mock only what is external: the LLM and the PostHog analytics client.
  • Repo skills apply where the diff touches their area: /writing-tests, /improving-drf-endpoints, /writing-ui-components, /writing-kea-logics, /adopting-generated-api-types, /placing-product-frontend-code, /writing-user-facing-copy, /writing-code-comments.
  • Branch from upstream/master, push to the fork, open a draft PR on PostHog/posthog against master. A stacked PR carries its parent's commits and a "Stacked on" note.
  • Then /qa-swarm. Shipped means a draft PR it handed off. Never mark ready, enqueue or merge.
  • Public repo: state sender rules as product rules. Fixture addresses use example.com. The prototype is throwaway: read it for behavior, never copy or cherry-pick it.

Activity

  1. Silthus commented on Oct 5, 2026

    @Silthus
    OwnerAuthor

    Amended by the conductor after #254 resolved as option C (Michael, 2026-10-05, origin https://posthog.slack.com/archives/C06GG249PR6/p1791188180453239): reach shown as numbers, and the own-domain line becomes the main call to action through the email domain wizard.

  2. Silthus commented on Oct 5, 2026

    @Silthus
    OwnerAuthor

    Seam agreed with the Workflows AI links and reach effort (thread on devbox-michaelr-2): it owns a shared read-only workflow email reach endpoint and MCP tool. Reachable = active, email-verified members of the organization (the sandbox sender's rule). Not reached yet = persons in the project with an email, counted through HogQL. This ticket consumes it and adds no queries of its own. Waiting on its draft PR link here before dispatch.

  3. Silthus commented on Oct 5, 2026

    @Silthus
    OwnerAuthor

    Shared reach endpoint is in draft PostHog#111750 (GET /api/projects/:team_id/hog_flows/email_reach/, fields verified_member_count, project_email_count, email_senders, generated type EmailReach). Counts are eligibility totals, not a forecast of trigger events. This ticket builds on it.

  4. self-assigned this
    on Oct 5, 2026
  5. Silthus commented on Oct 5, 2026

    @Silthus
    OwnerAuthor

    Runtime: Claude Code background agent in conductor thread mcp:53aaf922-c8de-490b-8df2-687a523ef55f (devbox-michaelr-3)
    Worker: impl-264, Claude Opus 5.5
    Worktree: /home/coder/.t3/worktrees/posthog/fr-264, branch feat/workflows-first-run-reach from feat/workflows-first-run-banners at c90a96ea6a3 plus a merge of feat/workflows-ai-email-context (stacked on PostHog#112076 and PostHog#111750)
    Review: one cross-family review (Codex adversarial-review), per the map's updated rule; this replaces the body's qa-swarm line
    Cap: 4 hours from 18:31 UTC (deadline 22:35 UTC)
    CodeRabbit slot: 3 of 3 (the CLI is signed out, so expect a skip)

  6. Silthus commented on Oct 5, 2026

    @Silthus
    OwnerAuthor

    Resolution

    Draft PR: PostHog#112095, stacked on PostHog#112076 and PostHog#111750.
    Reviewed head: f1d6bfa2894b115190e9f3ebde86b0fe4c5dbbaf. Review base: 62f5c9a (the merge of feat/workflows-ai-email-context into the banners branch).

    What ships

    • The helper under "Enable workflow" and both first-run banners name the sandbox sender address.
    • The same line shows the verified member count and the project email count, both from GET /api/projects/:team_id/hog_flows/email_reach/. No new count queries.
    • Copy says people "can get these emails". It does not forecast sends or promise opens and clicks.
    • "Send from your own domain" is a button under the line. It opens Channels. The target is one function, ownDomainSetupUrl in FirstRunReachLine.tsx.
    • Own domain not verified yet: "Your domain is not verified yet", with a "Finish domain setup" button to the same target.
    • Verified own domain, or a workflow on an own sender: no line.

    Proof

    • Red, then green: firstRunReachLogic.test.ts (kea logic, API mocked at the HTTP layer) and firstRunReachCopy.test.ts. The red output is in the PR's "How did you test this code?" section.
    • Local gate on the final tree: all Jest tests in products/workflows/frontend/firstRun/ pass with none skipped, typescript:check clean, oxlint and oxfmt --check clean on the touched files. The merge-touched email.service.test.ts and utm.test.ts pass under flox.
    • Screenshots (Storybook, fake data), full width and 520px:
    State Full width 520px
    Make it yours, no own domain
    Draft banner, no own domain
    Sending banner, no own domain
    Draft banner, domain not verified yet
    Sending banner, domain verified (no line) Same as full width

    Review

    • Codex adversarial review (one run, base fr-264-base): one finding, fixed in f1d6bfa. Zero counts fell back to the copy for missing counts. They now show as numbers, and an empty project says no one has an email address yet.
    • /merge-risk: low. No danger area, so no qa-swarm.
    • CodeRabbit CLI: skipped, signed out.

    Decisions within scope

    • "Verifying" is any own email sender that is not verified. The line says "not verified yet" rather than "verifying", because a sender can sit unverified with no DNS records added. It offers "Finish domain setup".
    • The call to action is a secondary button. "Enable and open workflow" keeps the primary style on Make it yours.
    • When the reach line names the sender, the helper above it drops the sender name, so the address appears once.
    • A refused reach request (for example, a member who cannot read person emails) hides the counts and keeps the line and the button.
    • The merge of feat(workflows): use site links and report email eligibility PostHog/posthog#111750 conflicted in nodejs/.../email.service.ts, its test, and broadcastTestSendLogic.ts. The resolution tags UTMs on the delivered params, so sandbox sends keep both the tags and the identification footer.
    • The pre-push check required sorting two metrics flags in constants.tsx; master carries them unsorted.

    Follow-ups for the conductor

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions