Skip to content
 
 

Latest commit

 

History

7,079 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fanout.sh

Durable pub/sub for background jobs

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.

License

Three concepts

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.

What's included

  • 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

Based on Trigger.dev

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.

Author

Giovanni Borgogno

License

Apache 2.0 — see LICENSE.


Trigger.dev (upstream)

Everything below is the original Trigger.dev README. Fanout.sh is a fork — all Trigger.dev features still work.

About Trigger.dev

Trigger.dev is the open-source platform for building AI workflows in TypeScript. Long-running tasks with retries, queues, observability, and elastic scaling.

Key features

For full docs, see trigger.dev/docs.

Self-hosting

Development

To setup and develop locally, follow the development guide.

About

Trigger.dev – build and deploy fully‑managed AI agents and workflows

Resources

Code of conduct

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages