|
| 1 | +<ParamField body="events" type="array" required> |
| 2 | + <Expandable title="event properties" defaultOpen> |
| 3 | + <ParamField body="name" type="string" required> |
| 4 | + The `name` property must exactly match any subscriptions you want to |
| 5 | + trigger. |
| 6 | + </ParamField> |
| 7 | + <ParamField body="payload" type="any"> |
| 8 | + The `payload` property will be sent to any matching Jobs and will appear |
| 9 | + as the `payload` param of the `run()` function. You can leave this |
| 10 | + parameter out if you just want to trigger a Job without any input data. |
| 11 | + </ParamField> |
| 12 | + <ParamField body="context" type="any"> |
| 13 | + The optional `context` property will be sent to any matching Jobs and will |
| 14 | + be passed through as the `context.event.context` param of the `run()` |
| 15 | + function. This is optional but can be useful if you want to pass through |
| 16 | + some additional context to the Job. |
| 17 | + </ParamField> |
| 18 | + <ParamField body="id" type="string"> |
| 19 | + The `id` property uniquely identify this particular event. If unset it |
| 20 | + will be set automatically using `ulid`. |
| 21 | + </ParamField> |
| 22 | + <ParamField body="timestamp" type="Date"> |
| 23 | + This is optional, it defaults to the current timestamp. Usually you would |
| 24 | + only set this if you have a timestamp that you wish to pass through, e.g. |
| 25 | + you receive a timestamp from a service and you want the same timestamp to |
| 26 | + be used in your Job. |
| 27 | + </ParamField> |
| 28 | + <ParamField body="source" type="string"> |
| 29 | + This is optional, it defaults to "trigger.dev". It can be useful to set |
| 30 | + this as you can filter events using this in the `eventTrigger()`. |
| 31 | + </ParamField> |
| 32 | + </Expandable> |
| 33 | +</ParamField> |
| 34 | + |
| 35 | +<ParamField body="options" type="object"> |
| 36 | + <Expandable title="properties" defaultOpen> |
| 37 | + <ParamField body="deliverAt" type="Date"> |
| 38 | + An optional Date when you want the event to Trigger Jobs. The event will |
| 39 | + be sent to the platform immediately but won't be acted upon until the |
| 40 | + specified time. |
| 41 | + </ParamField> |
| 42 | + <ParamField body="deliverAfter" type="number"> |
| 43 | + An optional number of seconds you want to wait for the event to Trigger |
| 44 | + any relevant Jobs. The event will be sent to the platform immediately but |
| 45 | + won't be acted upon until the specified time. |
| 46 | + </ParamField> |
| 47 | + <ParamField body="accountId" type="string"> |
| 48 | + This optional param will be used by the Trigger.dev Connect feature, which |
| 49 | + is coming soon. |
| 50 | + </ParamField> |
| 51 | + </Expandable> |
| 52 | +</ParamField> |
0 commit comments