https://serverless-stack.com/ logo
#random
Title
# random
s

Sam Hulick

01/05/2022, 11:14 PM
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

Brinsley

01/06/2022, 7:03 AM
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

Simon Reilly

01/06/2022, 8:35 AM
@Brinsley what did you do instead?
b

Brinsley

01/06/2022, 9:34 AM
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

Simon Reilly

01/06/2022, 1:25 PM
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

Brinsley

01/06/2022, 3:15 PM
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

Sam Hulick

01/06/2022, 3:24 PM
I don't think there's an
output
at all with a failure state. You pass
cause
and
error
instead
d

Dennis Dang

01/06/2022, 10:47 PM
Tangent but has anyone tried https://temporal.io to coordinate workflows, assuming your company has a micro service architecture already
s

Simon Reilly

01/07/2022, 7:56 AM
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