- SDK Reference
- sendEvent
SDK Reference
sendEvent
Send a custom event to Trigger, from inside or outside of a workflow.
See our sendEvent guide for more info.
Parameters
A unique key for the event in the context of a workflow run. Please see the Keys and Resumability guide for more info.
An optional unique ID for the event. If not provided, one will be
generated automatically (using clid
). Set this field to perform event
deduplication.
The name of the event. This is the name you set when creating the
customEvent
trigger.
The payload of the event.
An optional timestamp for the event. If not provided, one will be generated. Must be in ISO 8601 format (e.g. new Date().toISOString()
)
An optional context object for the event. This can be used to pass additional information about the event, such as the user who triggered it. Note that this is not currently exposed to the workflow (coming soon).
An optional delay object for the event. This can be used to delay the event by a certain amount of time. Use one of the following options:
{ seconds: number }
- delay the event by a certain number of seconds{ minutes: number }
- delay the event by a certain number of minutes{ hours: number }
- delay the event by a certain number of hours{ days: number }
- delay the event by a certain number of days{ until: Date }
- delay the event until a certain date
See the Delaying Event Delivery docs for more info.