MCPcopy
hub / github.com/triggerdotdev/trigger.dev / sendEvents

Method sendEvents

packages/trigger-sdk/src/io.ts:761–780  ·  view source on GitHub ↗

`io.sendEvents()` allows you to send multiple events from inside a Job run. The sent events will trigger any Jobs that are listening for those events (based on the name). * @param cacheKey Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentat

(cacheKey: string | any[], events: SendEvent[], options?: SendEventOptions)

Source from the content-addressed store, hash-verified

759 * @param options Options for sending the events.
760 */
761 async sendEvents(cacheKey: string | any[], events: SendEvent[], options?: SendEventOptions) {
762 return await this.runTask(
763 cacheKey,
764 async (task) => {
765 return await this._triggerClient.sendEvents(events, options);
766 },
767 {
768 name: "Send Multiple Events",
769 params: { events, options },
770 icon: "send",
771 properties: [
772 {
773 label: "Total Events",
774 text: String(events.length),
775 },
776 ...sendEventOptionsProperties(options),
777 ],
778 }
779 );
780 }
781
782 async getEvent(cacheKey: string | any[], id: string) {
783 return await this.runTask(

Callers 3

sendEventsFunction · 0.45
createWebhookSourceFunction · 0.45
built-ins.tsFile · 0.45

Calls 2

runTaskMethod · 0.95

Tested by

no test coverage detected