Prefer resourceId over eventOccurredAt; it's harder to misuse.
If an event triggered your workflow and it doesn't have a unique ID, you may decide to use its
occurrence timestamp. For example, if you have a daily CRON job, use the date it ran.
Use .toISOString().
OptionalresourceId
resourceId?:string
If a resource triggered your workflow, include its unique ID.
Note: workflowKey, recipients, and workplaceId (if it exists in the trigger body) are
included in the idempotency key automatically.
Example
1.Fora"meeting starts in one hour"notification, setresourceIdtothemeetingID. 2.Forapayoutnotification, setresourceIdtothepaymentID.
Prefer
resourceId
overeventOccurredAt
; it's harder to misuse.If an event triggered your workflow and it doesn't have a unique ID, you may decide to use its occurrence timestamp. For example, if you have a daily CRON job, use the date it ran.
Use
.toISOString()
.