Skip to content

Integration System

The Integration System enables external webhook delivery for platform events. Domain plugins expose their hooks as integration events, and provider plugins handle delivery to external systems (webhooks, Slack, Jira, etc.).

┌──────────────────────────────────────────────────────────────────────┐
│ Platform Hooks │
│ (incident-backend, maintenance-backend, healthcheck-backend, etc.) │
└─────────────────────────────────┬────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ Integration Event Registry │
│ (Registers hooks as external-facing events) │
└─────────────────────────────────┬────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ Hook Subscriber │
│ (Subscribes to hooks in work-queue mode) │
└─────────────────────────────────┬────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ Delivery Coordinator │
│ (Routes events through queue, manages retries) │
└─────────────────────────────────┬────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ Integration Providers │
│ (Webhook, Slack, Jira, custom implementations) │
└──────────────────────────────────────────────────────────────────────┘

An integration event is a platform hook exposed for external webhook subscriptions. Domain plugins register their hooks as events via the extension point.

A provider defines how to deliver events to specific external systems. Providers handle the actual HTTP calls, authentication, and error handling.

A subscription connects an event to a provider. When an event fires, all matching subscriptions trigger delivery attempts.

Each delivery attempt is logged with status (success/failed/retrying), response details, and retry information.

  1. Hook Emission: Domain plugin emits a hook (e.g., incident.created)
  2. Event Registry Lookup: Integration system finds registered events for that hook
  3. Subscription Matching: Queries subscriptions that listen for this event
  4. Queue Enqueue: Creates delivery jobs in the distributed queue
  5. Worker Processing: Queue workers pick up jobs and call providers
  6. Provider Delivery: Provider makes HTTP request to external endpoint
  7. Logging: Result logged to delivery_logs table
  8. Retry (if needed): Failed deliveries re-queued with exponential backoff
PackagePurpose
integration-commonShared types, schemas, RPC contract
integration-backendCore registries, delivery coordinator, router
integration-frontendAdmin UI for managing subscriptions
integration-webhook-backendGeneric HTTP webhook provider
// In your plugin's index.ts
import { integrationEventExtensionPoint } from "@checkstack/integration-backend";
import { myPluginHooks } from "./hooks";
import { z } from "zod";
// Define payload schema for the event
const incidentCreatedPayload = z.object({
incidentId: z.string(),
title: z.string(),
severity: z.string(),
systemIds: z.array(z.string()),
});
export default createBackendPlugin({
metadata: pluginMetadata,
register(env) {
// Get the integration extension point
const integrationEvents = env.getExtensionPoint(
integrationEventExtensionPoint
);
// Register hook as an integration event
integrationEvents.registerEvent(
{
hook: myPluginHooks.incidentCreated,
displayName: "Incident Created",
description: "Fires when a new incident is created",
category: "Incidents",
payloadSchema: incidentCreatedPayload,
},
pluginMetadata
);
},
});

See Provider Implementation Guide.