anythingmcp icon indicating copy to clipboard operation
anythingmcp copied to clipboard

Webhook ingestion: Cloud plan limits and a dashboard UI

Open helpcodeai opened this issue 1 month ago • 8 comments

Follow-up to #988 and #1372 (inbound webhook ingestion, Stripe first), which is merged on main and API-only.

Open points on our side:

  1. Plan limits on Cloud. Today any connector can turn on webhookEnabled. Decide which plans get it and how many stored events (per-connector cap is 500, retention WEBHOOK_EVENT_RETENTION_DAYS, default 7).
  2. Dashboard UI. A switch on the connector page to turn webhooks on, the endpoint URL to copy, the secret field, and a short list of the last events.
  3. Cloud deploy. The migration 20261031170654_add_webhook_ingestion has to ship with the Cloud build that first includes #1372.

Self-hosted: same behaviour, no plan limits.

helpcodeai avatar Nov 01 '26 10:11 helpcodeai

Hi @helpcodeai Looked into the existing codebase to help frame these:

1. Plan limits. There's no generic plan-limit table today — LicenseGuardService is the only gating mechanism, and its stated policy elsewhere (code-mode tool caps) is trial = hard block, paid tiers = advisory only, never blocked. The plan→number mapping also isn't hardcoded in-repo; it's read off license.features on the external license object. If webhooks follow that same precedent, the number itself (event cap/retention per plan) would come from the license service, not a constant here.

  • Advantage: consistent with how every other paid-tier limit already works, cheap to wire at the webhookEnabled toggle point.
  • Disadvantage: this is a pricing call, not an engineering one — needs someone who owns billing to pick plans/numbers before any code gets written. Also: the webhook service currently has zero Cloud/self-hosted branching ("same code path" per the docs) — this would be the first one, worth weighing as an ongoing maintenance cost, not just a one-time feature.

2. Dashboard UI. Cheaper than it looks — the connector settings page already has the masked-secret pattern, the boolean-toggle pattern, and a list-editor component; none of that needs inventing. The endpoint URL to copy has a direct precedent too: oauthRedirectUri() already computes a URL server-side from SERVER_URL for the same reason (so it's never hand-typed wrong) — the webhook URL would follow the same approach. The one real gap: there's no REST endpoint for "recent events" yet (recentEvents() is only wired to the MCP tool, for a model to call) — a small new controller endpoint wrapping that same service method is the actual missing piece.

  • Advantage: mostly reusable, independently valuable regardless of how point 1 resolves (self-hosted gets it either way), and makes the feature trustworthy (right now there's no way to see "did my webhook arrive" without an AI client).
  • Disadvantage: the settings page is already 2500+ lines of conditional UI; another inline section keeps growing it rather than addressing that.

3. Cloud deploy sequencing. This looks like a non-issue already — release.sh's blue/green model ships migrations in the same image as the code, applied at backend startup, and the expand/contract rule it documents is satisfied here (only nullable/defaulted columns + a new table, confirmed additive in the migration's own header comment). Deploying the tag that includes PR #1372 is sufficient; no separate sequencing step needed.

Suggested order, if useful: UI first (doesn't block on a pricing decision), plan-gating as a smaller follow-on once numbers are picked, point 3 closes itself on next deploy.

rangarajan19 avatar Nov 07 '26 05:11 rangarajan19

Thanks @rangarajan19, this is a useful summary.

Point 3 is done. The migration shipped to Cloud on 3 November with the first build from main, and the webhook tables are in use there.

Point 1 is a pricing decision, so we will make it on our side. Please don't wait for it.

Point 2 is welcome as a PR if you'd like to build it. A few notes so it stays easy to review:

  1. Add the REST endpoint for recent events next to the existing service method. Scope every query by organizationId and keep it to admins, like the other connector settings.
  2. Put the webhook section in its own component and render it from the connector page, so the page itself doesn't grow much.
  3. Build the endpoint URL on the server from SERVER_URL, as you suggest.
  4. Leave plan limits out for now. They can be added later at the toggle.

If you start on it, tell us here and we'll assign the issue to you.

helpcodeai avatar Nov 07 '26 08:11 helpcodeai

Hi @helpcodeai , I will start working on it, please assign to me

rangarajan19 avatar Nov 07 '26 08:11 rangarajan19

Done, it's assigned to you @rangarajan19. Thanks! Open a draft PR early if you want feedback on the endpoint before the UI.

helpcodeai avatar Nov 07 '26 08:11 helpcodeai

Hi @helpcodeai, opened a draft PR for the endpoint: #1571. It covers the three backend notes (recent-events endpoint reusing the existing service method, scoped by organizationId; the delivery URL built server-side from SERVER_URL; no plan limits). One open question I flagged in the PR description: whether "keep it to admins" should be the same owner-or-admin gating the rest of connector settings use, or something stricter — happy to adjust either way.

Holding off on the UI component until I hear back on the endpoint, as you suggested.

rangarajan19 avatar Nov 07 '26 11:11 rangarajan19

Decision on point 1 (plan limits on Cloud):

  • Webhooks are available on every paid plan and during the trial.
  • The limit is the number of connectors with webhookEnabled in a workspace:
    • Starter: 1
    • Team and the trial: 5
    • Business and Enterprise: no limit
  • Same for every plan: 500 stored events per connector, retention WEBHOOK_EVENT_RETENTION_DAYS (7 days), payloads up to 256 KB.
  • The cap goes into the plan limits work (#1601) as one more axis, behind the same PLAN_CAPS_ENFORCE flag. Turning on a webhook beyond the cap is refused once enforcement is on. No Prisma change.
  • Self-hosted: no limits, as before.

#1571 can merge once its requested changes are done. It does not need the cap itself.

helpcodeai avatar Nov 09 '26 15:11 helpcodeai

@helpcodeai i have updated the PR at my end, please check and let me know if anything need adjust, thank you

rangarajan19 avatar Nov 09 '26 15:11 rangarajan19

Closing as completed: #1571 merged the dashboard card and recent-events/delivery-URL endpoints, and #1612 merged the agreed Cloud webhook-connector caps behind PLAN_CAPS_ENFORCE. Both merged on 10 November. Self-hosted remains uncapped.

The original migration/deploy point was already confirmed complete in https://github.com/HelpCode-ai/anythingmcp/issues/1393#issuecomment-6704302554. This records implementation completion, not confirmation that enforcement is enabled in production. Thanks for the work on both parts.

Coding-Professional avatar Nov 10 '26 12:11 Coding-Professional