Distinguish Step Level Retries / Workflow Level Retries
iam trying to find a way when inside a step iam using retries how to distinguish the
- workflow level retries
- step level retries
according to the documentation runCount gets ovveridden when retries are used ( in a step )...
Basicalyl i need to distinguish this in order to know if only a step failed 3 times for example
or if the entire workflow failed 3 times. Because i want to apply some error logic when 3 workflow level retries fail not
Acces runcount in a step --> by default its the workflow level retries / if retries is set it is step level retries
looking at the error handling docs there is a workflow watch but which maybe could give me the final result / failure ??
but i was attempting to use this without that
just using the runcount
https://mastra.ai/en/docs/workflows/error-handling
5 Replies
@Tyler @Romain
Hey @Steffen ! I think you could leverage the
runtimeContext to store the info you need runtimeContext.set('your-key', 'your-value'). You can then update that value whenever you need.iam doing that already . but that still means i have to manually determine if the runcount is from a step or is from the workflow.
I was hoping there is some kind of metadata or something that tells me if runcount is currently from a step or from the workflow .
It would save me have to manuelly determine this for every step
basically i have funciton i pass this runcount to and by itself i cant determine if its step or workflow runcount š ...
@Romain
thanks though . i will keep my current setup in that case then š
š»
Hey @Steffen ! Unfortunately, I don't think that's possible with the current implementation of runCount. Could you open a feature request on GH? Thanks š
ok yes thanks made a request