Repository navigation
Description
Map: Map: send email from code with one PostHog call
Spec: Spec: email send API
Cast: Opus 5.5, high
Repository: PostHog/posthog (frontend)
Question
Can a person open one fixed link and land on their project's API sends?
Delivers end to end. A frontend route /project/{id}/workflows/api-sends, registered in the Workflows manifest. It lists flows with ?type=api_send and replaces the URL with that flow's Invocations tab. With no flow it shows "No emails sent through the API yet" and a link to the docs page; it never creates the flow. No other Workflows UI change. Spec section: "API sends redirect route".
Test seams. A kea logic test for the route's logic: with a flow it redirects to the Invocations URL; without one it reports the empty state and makes no write request.
Write scope. products/workflows/manifest.tsx, a small new scene and logic under products/workflows/frontend/, their test. Copy through /writing-user-facing-copy; components per /writing-ui-components.
Proof.
- Red: the logic test for the redirect fails (no route).
- Green: both cases pass.
- Local: open the link on a dev team before and after creating the flow from a Django shell; screenshots of the empty state and the landed Invocations tab go in the PR.
Acceptance criteria
- With a flow, the link lands on its Invocations tab and the back button does not loop.
- Without a flow, the empty state shows and no flow is created.
- The Workflows list is unchanged.
How to build (map #461)
/tddred-green-refactor, outside-in, at the seams named above. Real Postgres, Valkey and ClickHouse; mock only what the seam section allows.- Repo skills apply where the diff touches their area:
/writing-tests,/improving-drf-endpoints,/django-migrations,/adding-api-scopes,/writing-ui-components,/writing-kea-logics,/writing-user-facing-copy,/writing-code-comments. - Public repo: no usage numbers, customer names, internal metrics, Slack content or security reasoning in code, commits or the PR. Fixture addresses use
example.com. The private note the map points at is background only; never quote it. - Shipped means a draft PR handed off for review (see the map's Notes for remotes and branches). Never mark ready, enqueue or merge.
Activity
Silthus commentedon Oct 14, 2026
Runtime: Claude Code background Agent
Worker: implement-473-api-sends-redirect
Cast: Opus 5.5, high. Wall-time cap: 120 minutes.
Lands on integration branch
spec/email-send-api, in parallel with the other open ticket on it (scopes do not overlap).Silthus commentedon Oct 14, 2026
Claimed by conductor dispatch. Runtime: Claude Code background Agent, worker implement-473-api-sends-redirect, Opus 5.5 high. Integration branch: spec/email-send-api.
Silthus commentedon Oct 14, 2026
Landed on
spec/email-send-apias a fast-forward from38d8566764f.Landed commit:
64ab79c5a68(feat(workflows): open api sends from a fixed link)What landed
products/workflows/manifest.tsx: the sceneWorkflowsApiSends, the route/workflows/api-sendsandurls.workflowsApiSends(). The route sits before/workflows/:tab, because the scene router takes the first match. Without that order the link opens as a Workflows tab.frontend/src/products.tsxandproductScenes.tsxare regenerated.products/workflows/frontend/ApiSends/apiSendsSceneLogic.ts: on mount it calls the generatedhogFlowsListwithtype: 'api_send', limit: 1. With a flow, it callsrouter.actions.replace(urls.workflow(id, 'invocations')). The link leaves no history entry, so the back button does not loop. Aresolutionreducer holdsloading | redirecting | empty | error. The logic only reads.products/workflows/frontend/ApiSends/ApiSendsScene.tsx: a spinner while loading or redirecting.EmptyMessageshows "No emails sent through the API yet" with a "Read the docs" button tohttps://posthog.com/docs/workflows/email-api. An error banner has a "Try again" action.Proof
Artifacts are on branch
assets/email-api-473.PUSH, notREPLACE, so a back-button loop fails the test. red-wrong-type-filter.log lands on an ordinary workflow and skips the empty state.hogli ci:preflight --strictpassed with 0 failures on the push tospec/email-send-api. The frontendtsgo --noEmitreported no errors (typecheck.log). oxlint and oxfmt are clean on the new files.Appran in Storybook with MSW mocks, from a scratch story that is not in the commit. All data is mock data.Test seam
apiSendsSceneLogic, mounted after a push to/workflows/api-sends, with the hog flows list mocked through MSW. The mock answers?type=api_sendwith the API sends flow or nothing. It answers every other query with an ordinary workflow, so a missing filter fails the test./workflows/<id>/invocationsandrouter.lastMethodisREPLACE.resolutionisempty, the URL stays, and the POST and PATCH hog flow handlers get no calls.Calls I made
workflows-email-api. Without the flag a person sees the empty state.EmptyMessage, notProductEmptyState. This is a single-link landing page, not a product's first-run gate.Follow-ups
/docs/workflows/email-api, which the docs ticket ships.typescript:checkwith default checkers reaches the heavy slice's memory limit and stalls.tsgo --noEmit --checkers 1finishes in about 90 seconds.