Skip to content

[TRI-1081] Feature idea: Batch Event Trigger #348

Description

@ericallam

It would be useful to have a "batch" event trigger, where you could set the frequency that the batched events would be flushed:

batchEventTrigger({ name: "batched.event", schema: z.object({ id: z.string() }), flushEvery: 60 })

Then whenever you sent an event with an ID, instead of immediately triggering runs with the payload it will get added to a batch. If more events with the same ID are sent within the 60 seconds of the first one, those payloads will get appended.

Then, when the run is triggered the payload in the run function becomes an array of all the event payloads.

TRI-1081

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/serverIssues related to the Trigger.dev serverenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions