Skip to content

Outbound webhooks #126

Open
Open

Description

@imshashank

Orbit has no outbound webhooks. Inbound works for GitHub and Slack (apps/web/src/app/api/webhooks/), but there is no way to have Orbit tell another system that something happened.

This is the most requested integration feature. The MCP server covers some of it, since an agent can read anything, but it does not cover "tell my system the moment an issue closes".

Wanted:

  • Per-workspace endpoint registration, admin only
  • A useful event set: issue created, updated, state changed, closed; comment created; project and sprint events
  • HMAC signatures, the way Orbit already verifies inbound GitHub and Slack
  • Retries with backoff, and a visible delivery log so failures are debuggable
  • Deliveries must respect scopes, so a webhook never carries a row its workspace may not read

The SyncAction published to Redis on every mutation is already the right event shape. See docs/architecture.md.

Worth agreeing the event names and payload shape on this thread first, because they are hard to change once anyone depends on them.

Activity

  1. added
    enhancement
    area: integrations
    roadmap
    p1 high
    dead code
    help wanted
    on Aug 7, 2026
  2. imshashank commented on Aug 8, 2026

    @imshashank
    ContributorAuthor

    Worth adding for anyone picking this up: the storage is already built.

    packages/db/src/schema/comms.ts defines two tables that no application code touches:

    • webhook: organisation, url, secret, an events JSONB array, an enabled flag, creator, sync_id, and an archived_at
    • webhook_log: webhook id, event, status, attempt number, request body, response status, response body, error and duration_ms, indexed on webhook and time

    That covers registration, the HMAC secret, the event subscription list and the delivery log with retry attempts, which is most of what this issue asks for. Grepping the repository outside packages/db/src/schema and packages/db/tests finds zero references to either table.

    So the schema decision has already been made and reviewed. What is missing is the dispatcher, the retry policy, the signing, the admin UI and the scope check on outbound payloads.

    Two things the existing schema does not answer, and which still need deciding on this thread:

    1. Where the dispatcher runs. Orbit deploys as one Next.js app with no worker process. Retries with backoff need somewhere to live. The recurring issues issue (Recurring issues #210) hits the same question, so whatever is chosen should serve both.
    2. The event names and payload shape, which this issue already flags as hard to change later.

    Context on the other dormant tables is in #192.

  3. added
    size: large
    points: 8
    on Aug 8, 2026
  4. moved this to Backlog in Orbit roadmapon Aug 8, 2026
  5. imshashank commented on Aug 8, 2026

    @imshashank
    ContributorAuthor

    Shared infrastructure question with #193 and #210.

    All three need somewhere for background work to run, and Orbit deploys as one Next.js app with no worker process:

    • This issue needs a dispatcher with retries and backoff
    • Recurring issues #210, recurring issues, needs a scheduler
    • writeCycleSnapshots in packages/core/src/analytics/snapshot.ts already exists and already needs something to call it

    Whatever mechanism is chosen here should serve all of them. Say what you propose on this thread, because three different answers to the same question would be the worst outcome.

    The storage for this issue specifically is already built, see the earlier comment.

  6. imshashank commented on Aug 15, 2026

    @imshashank
    ContributorAuthor

    Re-verified on 3ba32cb. Still entirely open, and worth recording what does and does not exist, because the table names make it look further along than it is.

    The schema is there. packages/db/src/schema/comms.ts defines webhook, webhook_log and webhook_delivery. That is a third table beyond the two named in #192.

    No code uses them. The only references outside the schema and its tests are organization-deletion-service.ts, which cascades them on workspace delete, and integrations-data.ts. Nothing registers an endpoint, nothing signs a payload, nothing delivers, nothing retries. Grepping for createHmac or a signature header in the integrations code returns nothing, so the HMAC requirement here has no starting point in the outbound direction. The inbound GitHub and Slack verification this issue points at as the model does exist and is still the right thing to copy.

    One thing that did land nearby and is easy to mistake for progress. #263, "scope a delivery to the workspace it belongs to", is about inbound GitHub webhook deliveries, not outbound ones. It does not move this issue.

    So the description is still accurate in full. The event set, HMAC signatures, retries with backoff, the delivery log and the scope requirement are all unbuilt.

    Two notes for whoever picks this up:

    The scope requirement is the interesting constraint and it is the one most likely to be got wrong:

    Deliveries must respect scopes, so a webhook never carries a row its workspace may not read

    SyncAction and the scope model in packages/shared/src/events already solve exactly this for the realtime fan-out, so the answer is to reuse that resolution rather than to re-derive who may see a row at delivery time.

    The request to agree event names and payload shape on this thread first still stands and nobody has. That is a comment, not a pull request, and it would unblock the rest.

  7. imshashank commented on Aug 15, 2026

    @imshashank
    ContributorAuthor

    Correcting two things in my comment above. I searched packages/core only, and the integrations code lives in packages/services.

    webhook_delivery is not dormant. It is actively written by the inbound GitHub webhook route, apps/web/src/app/api/webhooks/github/route.ts, which uses it to claim, deduplicate and record the status of each inbound delivery. Please do not group it with webhook and webhook_log or treat it as free to repurpose. It is an inbound delivery ledger, and an outbound one would be a separate table.

    Only webhook and webhook_log are dormant. webhook is referenced solely by organization-deletion-service.ts for cascade cleanup, and webhook_log only by the schema and its tests.

    HMAC signing does exist, for inbound. packages/services/src/github/index.ts and packages/services/src/slack/index.ts both verify inbound signatures with createHmac('sha256', ...) and timingSafeEqual. So the statement in my previous comment that grepping for createHmac returns nothing is wrong.

    That is better news for this issue than what I wrote. The signing and constant-time comparison pattern is already in the codebase, in the same package an outbound dispatcher would live in, so the outbound side is a matter of reusing it rather than establishing it.

    The rest of that comment stands: no endpoint registration, no outbound dispatch, no retries, no outbound delivery log, and the scope requirement is still the constraint worth designing around first.

  8. imshashank commented on Sep 6, 2026

    @imshashank
    ContributorAuthor

    The scheduler question is answered: apps/web/vercel.json already runs cron routes (/api/cron/notifications every minute, analytics snapshots, prune). Outbound delivery and retries should be one more cron-driven route reading a delivery table, not a worker process. Self-hosting needs the equivalent, which #392 already lists.

    The other open question, event names and payload shape, still needs agreeing before code. Proposal: mirror SyncAction (entity, action, row, syncId) with a type of <entity>.<action>, a per-delivery id, and an X-Orbit-Signature HMAC-SHA256 header computed the way inbound GitHub and Slack are verified. Scope filtering reuses the realtime scope resolution rather than re-deriving who may see a row.

    This is also the prerequisite for delegating work to agents (#403), which is why it is p1.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: integrationsdead codeenhancementhelp wantedp1 highpoints: 8roadmapsize: large

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions