A fork of Trigger.dev with a native event system: define events, subscribe tasks, publish — with fan-out, DLQ, filtering, replay, and more built in.
Define an event:
import { event } from "@trigger.dev/sdk";
import { z } from "zod";
export const orderCreated = event({
id: "order.created",
schema: z.object({
orderId: z.string(),
amount: z.number(),
customerId: z.string(),
}),
});Subscribe tasks:
import { task } from "@trigger.dev/sdk";
import { orderCreated } from "./events";
export const sendReceipt = task({
id: "send-receipt",
on: orderCreated,
run: async (payload) => {
// payload is fully typed from the Zod schema
await sendEmail(payload.customerId, payload.orderId);
},
});Publish:
await orderCreated.publish({
orderId: "order-123",
amount: 500,
customerId: "cust-1",
});One event, N subscribers. Each gets its own durable run with retries, logging, and tracing.
- Fan-out — One event triggers N tasks automatically
- Dead letter queue — Failed events go to DLQ with dashboard retry/discard
- Event replay — Re-publish historical events from a time range
- Content-based filtering —
filter: { amount: [{ $gte: 1000 }] } - Ordering guarantees — Sequential processing per key with
orderingKey - Publish and wait — Scatter-gather with
publishAndWait() - Rate limiting — Per-event, Redis-backed sliding window
- Consumer groups — Kafka-style load balancing with
consumerGroup - Wildcard patterns —
events.match("order.*")for event families - Schema validation — Zod, Valibot, ArkType — validated at publish time
- Full persistence — ClickHouse event log with materialized analytics views
- Dashboard UI — Events list, event detail with charts, DLQ management
This is a fork of Trigger.dev (Apache 2.0). All the existing Trigger.dev features — durable execution, retries, queues, concurrency, realtime, schedules — are still here. Fanout.sh adds the event system on top.
For Trigger.dev docs and setup, see trigger.dev/docs.
Giovanni Borgogno
Apache 2.0 — see LICENSE.
Everything below is the original Trigger.dev README. Fanout.sh is a fork — all Trigger.dev features still work.
Trigger.dev is the open-source platform for building AI workflows in TypeScript. Long-running tasks with retries, queues, observability, and elastic scaling.
- JavaScript and TypeScript SDK - Build background tasks using familiar programming models
- Long-running tasks - Handle resource-heavy tasks without timeouts
- Durable cron schedules - Create and attach recurring schedules of up to a year
- Trigger.dev Realtime - Trigger, subscribe to, and get real-time updates for runs, with LLM streaming support
- Build extensions - Hook directly into the build system and customize the build process
- React hooks - Interact with the Trigger.dev API on your frontend
- Batch triggering - Initiate multiple runs of a task with custom payloads
- Concurrency & queues - Set concurrency rules to manage task execution
- Automatic retries - Automatic retry on uncaught errors
- Checkpointing - Durable tasks via checkpointing
- Observability & monitoring - Full tracing and logs for every run
For full docs, see trigger.dev/docs.
To setup and develop locally, follow the development guide.