In Inngest, any retriable block of code is wrapped inside a step.run block, each step can pass it's result to the next step.
const result = await step.run("get-api-data", async () => {
// Steps should return data used in other steps
return fetch("...").json();
});
In Trigger, It seems I can achieve the same either by making each steps a separate task and triggerAndWait them in a parent task or using the retry.onThrow function.
Is there a rule of thumb for when to use one over the other?
For example, I know if I need batchTrigger, I need to create a separate child Task then.