Skip to main content
Workflows are event-driven automations built on Corsair’s webhook hooks. When something happens in one service, you trigger actions in another. Pattern: event fires → webhook hook runs → you call any plugin API. No separate workflow engine needed. It’s just TypeScript.

How it works

Every webhook event in Corsair supports an after hook — a function that runs after the event is saved to your database. Inside it, you have full access to corsair and can call any plugin API.
corsair.ts
That’s a workflow: GitHub PR opened → Slack message sent.

Common patterns

Notify Slack when a PR is merged:
corsair.ts
Alert on new stars:
corsair.ts

Filter with before hooks

Use before to reject events before they hit your database or after handler:
corsair.ts
Throwing in before stops processing entirely — the event isn’t saved to your database.

Background jobs

For heavy processing (LLM calls, sending emails, generating reports), fire a background job instead of doing work inline:
corsair.ts
inngest/functions.ts
Webhook response stays fast. The work happens in the background.

What’s next

Webhooks Setup

Get ngrok running and register your first webhook endpoint.

GitHub Webhooks

All available GitHub events you can react to.

Slack Webhooks

All available Slack events you can react to.

Hooks Reference

Full before/after hook API and all available options.