does anyone know off the top of their head what ha...
# random
s
does anyone know off the top of their head what happens if you have a step function in a waiting state, and you do
SendTaskFailure
to it using the task token? I assume the step function just throws an error and ends in a failed state..?
b
SendTaskFailure will result in triggering a failed state, yes. However, you won’t be able to query the state of the
output
object from code - ran in to this a few months back - was a massive pain in the ass.
s
@Brinsley what did you do instead?
b
Create a new state that acts as an error handler, add a choice state, call SendTaskSuccess with some flag or switchable value. When checking the state of the execution I check values modified/added by the new state. Does that make sense? It’s a bit more involved than just checking the execution failed or succeeded.
It’s the only way I figured out to work around it.
s
Yeah, makes sense, so you have a kind of soft failure, where the resource returns the task tokens, as a success, but with a flag saying it actually failed. Then your choice statement decides based on that flag do X, y or z. Seems pretty neat actually
If I am understanding correctly
b
Yea. I only implement that kind of flow IF I need to access data in the execution’s output. In most of my cases I’m pumping output form one task directly in to the input of the next. If I can make do with the Error/Cause structure of the failure then I just use
SendTaskFailure
.
s
I don't think there's an
output
at all with a failure state. You pass
cause
and
error
instead
d
Tangent but has anyone tried https://temporal.io to coordinate workflows, assuming your company has a micro service architecture already
s
I would like to try temporal, but more to understand the market fit. I personally feel sometimes we have three modern deployment strategies. Kubernetes, Serverless, or Monololith on VM (like render.com). Since I host the temporal servers somewhere, it seems more a kubes, or VM. But I am sitting on the pinicle of ignorance atm