When triggering having a callbackUrl that would get called on success/failure
The ability to pass in a callbackUrl when using trigger/batchTrigger. That URLs would get called with the result of the run.
//your backend
const batchHandle = await tasks.batchTrigger<typeof emailSequence>(
"email-sequence",
data.users.map((u) => ({ payload: { to: u.email, name: u.name } })),
{ callbackUrl: `https://mysite.com/tasks/completed` }
);This would simplify some workflows, like performing an action when a batch is completed. Currently to do this, you need to create an extra task that receives the data for all items in the batch, trigger it and then use batchTriggerAndWait inside that task.
No comments yet
Be the first to share your thoughts.