Nested steps
Heya 👋 quick question to confirm my understanding: do nested steps behave identical to non-nested ones with regards to cache usage after failures?
Specifically, if a nested step fails, would the cached results from all parent steps be reused? Or is the caching of parent steps tied to the success of the (most) inner step(s) somehow?
10 Replies
by nested steps, you mean this?
Yes
This is a pattern that I don't know if I would recommend to use 😅 - but I think that the caching of the parent steps are tied to the success of the inner ones
Hmm yeah it guess it's not super useful when the outer and inner steps' fates are tied (which actually makes sense to be the case).
for curiosity’s sake, why do you want to do nested steps?
The use case I have in mind is where you invoke an external API that returns a list, and then for each result or so you may need to invoke another API. Trying to think how to model that best and wondered if nesting would be helpful here or not.
then I would do something like this:
you also get concurrency (for I/O tasks) for free in this case 🙂
Nice, that looks elegant.
I suppose that would cache succeeded steps at the per-
val
level even if one of the many calls eventually failed?yes, exactly
Great, thanks LuÃs.