Skip to content

Guide agents to connect a number before building a Flow#7

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/flow-builder-connect-number-guidance
Draft

Guide agents to connect a number before building a Flow#7
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/flow-builder-connect-number-guidance

Conversation

@posthog

@posthog posthog Bot commented Jun 29, 2026

Copy link
Copy Markdown

Why

Users creating a WhatsApp Flow when they have no connected number hit a dead end: the Flow builder presents an empty, un-actionable "WhatsApp number" selection with no path to go connect one, and abandon. Two distinct users in separate projects hit this within a ~2-hour window (one retried three times before cancelling).

Scope note

The user-facing symptom is in the Kapso product frontend (/whatsapp_flows/new), which is not this repo — this PR does not change that screen, and the frontend fix (detect the empty state and route to /whatsapp/embedded_signup) is still needed there.

What this PR fixes is the same dead-end in the agent-driven path, which is in this repo. The integrate-whatsapp skill tells an agent to run create-flow.js --phone-number-id <id>, and with no number connected the script just threw Missing required flag --phone-number-id — the script-surface equivalent of the empty dropdown.

Changes

  • create-flow.js: when called without --phone-number-id, it now inspects the connected numbers — listing them to pick from, or, when none are connected, routing to embedded signup ("connect a WhatsApp number first") instead of a terse error. Falls back to plain guidance if the lookup can't run.
  • integrate-whatsapp/SKILL.md: adds a "Prerequisite: a connected number" step to the WhatsApp Flows section so agents verify connectivity and route to setup before entering the builder.

Created with PostHog Code from an inbox report.

When no WhatsApp number is connected, the Flow builder dead-ends on an
empty number selection. Mirror the product fix in the agent surface:

- create-flow.js: called without --phone-number-id, it now lists the
  connected numbers to choose from, or — when none are connected —
  routes to embedded signup ("connect a WhatsApp number first") instead
  of a terse "missing required flag" error.
- integrate-whatsapp SKILL.md: add a "Prerequisite: a connected number"
  step to the WhatsApp Flows section so agents verify connectivity and
  route to setup before entering the builder.

Generated-By: PostHog Code
Task-Id: d1e14ead-a755-409b-b84e-0c286b918552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants