# hookdeck/outpost architecture

> Architecture diagram of the GitHub repository hookdeck/outpost, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hookdeck/outpost
- Repository: https://github.com/hookdeck/outpost

## Overview

Outpost is a multi-tenant outbound event-delivery service: producers publish events by API or queue; topic subscriptions fan them out into queued destination deliveries, which are retried and recorded for observability and customer support. Its API and portal manage tenants, destinations, retries, and delivery visibility. The graph combines explicit source calls with README-documented capabilities; queue-backed ingestion, storage implementations, and several integrations are not fully sampled, so unverified relationships are omitted.

Main entry points: [`internal/deliverymq/messagehandler.go`](https://github.com/hookdeck/outpost/blob/main/internal/deliverymq/messagehandler.go) (Delivery worker), [`internal/publishmq/eventhandler.go`](https://github.com/hookdeck/outpost/blob/main/internal/publishmq/eventhandler.go) (Event fanout), [`internal/apirouter/router.go`](https://github.com/hookdeck/outpost/blob/main/internal/apirouter/router.go) (HTTP API), [`internal/app/app.go`](https://github.com/hookdeck/outpost/blob/main/internal/app/app.go) (Application lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Product interfaces"]
  node_server["Outpost server<br/>[main.go]"]
  node_api["HTTP API<br/>[router.go]"]
  node_portal["Customer portal<br/>[app.tsx]"]
  node_sdk["SDK clients<br/>[outpost.go]"]
  node_mcp["MCP server<br/>[server.ts]"]
end

subgraph group_management["Tenant management"]
  node_tenant["Tenant and destination API"]
  node_tenantstore[("Tenant store<br/>[tenantstore.go]")]
end

subgraph group_delivery["Event delivery"]
  node_publisher["Publish API<br/>[publish_handler.go]"]
  node_publishmq["Event fanout<br/>[eventhandler.go]"]
  node_deliverymq["Delivery queue<br/>[deliverymq.go]"]
  node_handler["Delivery worker<br/>[messagehandler.go]"]
  node_registry["Destination providers<br/>[registry.go]"]
  node_webhook["Webhook provider<br/>[destwebhook.go]"]
  node_publishqueue["Publish queue input<br/>[publishmq.go]"]
end

subgraph group_platform["Runtime platform"]
  node_app["Application lifecycle<br/>[app.go]"]
  node_services["Service workers<br/>[builder.go]"]
end

subgraph group_observability["Operations and observability"]
  node_logmq["Delivery log queue<br/>[logmq.go]"]
  node_logstore[("Delivery log store<br/>[logstore.go]")]
  node_alerts["Failure alerts<br/>[evaluator.go]"]
  node_telemetry["OpenTelemetry<br/>[otel.go]"]
end

node_producer(("Event producers"))
node_destinations(("External destinations"))

node_producer -->|"publishes events"| node_api
node_sdk -.->|"calls API"| node_api
node_mcp -->|"uses client"| node_sdk
node_portal -.->|"manages destinations"| node_api
node_api -.->|"routes requests"| node_tenant
node_tenant -->|"reads and writes"| node_tenantstore
node_publisher -.->|"submits event"| node_publishmq
node_publishqueue -.->|"ingests events"| node_publishmq
node_publishmq -->|"matches destinations"| node_tenantstore
node_publishmq -->|"enqueues tasks"| node_deliverymq
node_deliverymq -.->|"dispatches tasks"| node_handler
node_handler -->|"loads destination"| node_tenantstore
node_handler -.->|"publishes event"| node_registry
node_registry -.->|"selects provider"| node_webhook
node_webhook -->|"delivers webhook"| node_destinations
node_handler -->|"records attempt"| node_logmq
node_logmq -.->|"stores delivery logs"| node_logstore
node_alerts -.->|"evaluates failures"| node_logstore
node_server -->|"starts runtime"| node_app
node_app -->|"builds workers"| node_services
node_app -->|"initializes telemetry"| node_telemetry
node_producer -.->|"publishes to queue"| node_publishqueue

click node_server "https://github.com/hookdeck/outpost/blob/main/cmd/outpost-server/main.go"
click node_api "https://github.com/hookdeck/outpost/blob/main/internal/apirouter/router.go"
click node_portal "https://github.com/hookdeck/outpost/blob/main/internal/portal/src/app.tsx"
click node_sdk "https://github.com/hookdeck/outpost/blob/main/sdks/outpost-go/outpost.go"
click node_mcp "https://github.com/hookdeck/outpost/blob/main/sdks/outpost-typescript/src/mcp-server/server.ts"
click node_tenant "https://github.com/hookdeck/outpost/blob/main/internal/apirouter/destination_handlers.go"
click node_tenantstore "https://github.com/hookdeck/outpost/blob/main/internal/tenantstore/tenantstore.go"
click node_publisher "https://github.com/hookdeck/outpost/blob/main/cmd/publish/publish_handler.go"
click node_publishmq "https://github.com/hookdeck/outpost/blob/main/internal/publishmq/eventhandler.go"
click node_deliverymq "https://github.com/hookdeck/outpost/blob/main/internal/deliverymq/deliverymq.go"
click node_handler "https://github.com/hookdeck/outpost/blob/main/internal/deliverymq/messagehandler.go"
click node_registry "https://github.com/hookdeck/outpost/blob/main/internal/destregistry/registry.go"
click node_webhook "https://github.com/hookdeck/outpost/blob/main/internal/destregistry/providers/destwebhook/destwebhook.go"
click node_publishqueue "https://github.com/hookdeck/outpost/blob/main/internal/publishmq/publishmq.go"
click node_logmq "https://github.com/hookdeck/outpost/blob/main/internal/logmq/logmq.go"
click node_logstore "https://github.com/hookdeck/outpost/blob/main/internal/logstore/logstore.go"
click node_alerts "https://github.com/hookdeck/outpost/blob/main/internal/alert/evaluator.go"
click node_app "https://github.com/hookdeck/outpost/blob/main/internal/app/app.go"
click node_services "https://github.com/hookdeck/outpost/blob/main/internal/services/builder.go"
click node_telemetry "https://github.com/hookdeck/outpost/blob/main/internal/otel/otel.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_api,node_portal,node_sdk,node_mcp toneBlue
class node_tenant,node_tenantstore toneAmber
class node_publisher,node_publishmq,node_deliverymq,node_handler,node_registry,node_webhook,node_publishqueue toneMint
class node_app,node_services toneRose
class node_logmq,node_logstore,node_alerts,node_telemetry,node_producer,node_destinations toneIndigo
```

## Components

### Product interfaces

- [Outpost server](https://github.com/hookdeck/outpost/blob/main/cmd/outpost-server/main.go): `cmd/outpost-server/main.go`
- [HTTP API](https://github.com/hookdeck/outpost/blob/main/internal/apirouter/router.go): `internal/apirouter/router.go`
- [Customer portal](https://github.com/hookdeck/outpost/blob/main/internal/portal/src/app.tsx): `internal/portal/src/app.tsx`
- [SDK clients](https://github.com/hookdeck/outpost/blob/main/sdks/outpost-go/outpost.go): `sdks/outpost-go/outpost.go`
- [MCP server](https://github.com/hookdeck/outpost/blob/main/sdks/outpost-typescript/src/mcp-server/server.ts): `sdks/outpost-typescript/src/mcp-server/server.ts`

### Tenant management

- [Tenant and destination API](https://github.com/hookdeck/outpost/blob/main/internal/apirouter/destination_handlers.go): `internal/apirouter/destination_handlers.go`
- [Tenant store](https://github.com/hookdeck/outpost/blob/main/internal/tenantstore/tenantstore.go): `internal/tenantstore/tenantstore.go`

### Event delivery

- [Publish API](https://github.com/hookdeck/outpost/blob/main/cmd/publish/publish_handler.go): `cmd/publish/publish_handler.go`
- [Event fanout](https://github.com/hookdeck/outpost/blob/main/internal/publishmq/eventhandler.go): `internal/publishmq/eventhandler.go`
- [Delivery queue](https://github.com/hookdeck/outpost/blob/main/internal/deliverymq/deliverymq.go): `internal/deliverymq/deliverymq.go`
- [Delivery worker](https://github.com/hookdeck/outpost/blob/main/internal/deliverymq/messagehandler.go): `internal/deliverymq/messagehandler.go`
- [Destination providers](https://github.com/hookdeck/outpost/blob/main/internal/destregistry/registry.go): `internal/destregistry/registry.go`
- [Webhook provider](https://github.com/hookdeck/outpost/blob/main/internal/destregistry/providers/destwebhook/destwebhook.go): `internal/destregistry/providers/destwebhook/destwebhook.go`
- [Publish queue input](https://github.com/hookdeck/outpost/blob/main/internal/publishmq/publishmq.go): `internal/publishmq/publishmq.go`

### Runtime platform

- [Application lifecycle](https://github.com/hookdeck/outpost/blob/main/internal/app/app.go): `internal/app/app.go`
- [Service workers](https://github.com/hookdeck/outpost/blob/main/internal/services/builder.go): `internal/services/builder.go`

### Operations and observability

- [Delivery log queue](https://github.com/hookdeck/outpost/blob/main/internal/logmq/logmq.go): `internal/logmq/logmq.go`
- [Delivery log store](https://github.com/hookdeck/outpost/blob/main/internal/logstore/logstore.go): `internal/logstore/logstore.go`
- [Failure alerts](https://github.com/hookdeck/outpost/blob/main/internal/alert/evaluator.go): `internal/alert/evaluator.go`
- [OpenTelemetry](https://github.com/hookdeck/outpost/blob/main/internal/otel/otel.go): `internal/otel/otel.go`

### Other components

- **Event producers**
- **External destinations**

## Connections

- Event producers → HTTP API: publishes events (evidence: `README.md`)
- SDK clients → HTTP API: calls API
- MCP server → SDK clients: uses client (evidence: `sdks/outpost-typescript/src/mcp-server/server.ts`)
- Customer portal → HTTP API: manages destinations
- HTTP API → Tenant and destination API: routes requests
- Tenant and destination API → Tenant store: reads and writes (evidence: `internal/apirouter/destination_handlers.go`)
- Publish API → Event fanout: submits event
- Publish queue input → Event fanout: ingests events
- Event fanout → Tenant store: matches destinations (evidence: `internal/publishmq/eventhandler.go`)
- Event fanout → Delivery queue: enqueues tasks (evidence: `internal/publishmq/eventhandler.go`)
- Delivery queue → Delivery worker: dispatches tasks
- Delivery worker → Tenant store: loads destination (evidence: `internal/deliverymq/messagehandler.go`)
- Delivery worker → Destination providers: publishes event
- Destination providers → Webhook provider: selects provider
- Webhook provider → External destinations: delivers webhook (evidence: `README.md`)
- Delivery worker → Delivery log queue: records attempt (evidence: `internal/deliverymq/messagehandler.go`)
- Delivery log queue → Delivery log store: stores delivery logs
- Failure alerts → Delivery log store: evaluates failures
- Outpost server → Application lifecycle: starts runtime (evidence: `cmd/outpost-server/main.go`)
- Application lifecycle → Service workers: builds workers (evidence: `internal/app/app.go`)
- Application lifecycle → OpenTelemetry: initializes telemetry (evidence: `internal/app/app.go`)
- Event producers → Publish queue input: publishes to queue (evidence: `README.md`)
