sxp
sxp

Reputation: 253

AWS Step Function's Output as Next State

Is there any way I can have the output of a task decide the next state of the step function? I have a lambda and it is going to have certain outputs. How can I use these outputs to decide the next state ?

Edit: I had initially implemented using Choice states but I have some values that needs to be passed through some states in a loop until specific conditions(takes a few hours to reach) are met. If I include a choice state in that loop , that value gets discarded. I was Using Choice to check the condition and either loop back to previous state or move to the next state and a wait state to pause the step function. The problem is with looping back to the previous state as all the values of the previous state inputs gets discarded in the choice state.

Thanks

Upvotes: 3

Views: 2008

Answers (1)

Chris Williams
Chris Williams

Reputation: 35146

You can use a choice state dependent on the input to the state.

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html

Upvotes: 1

Related Questions