tv1902
tv1902

Reputation: 231

Synchronous + Asynchronous steps in step function

I am very new to step function and still exploring the same. I have workflow something like this

--Steps A to C are synchronous.
Step A
 if(respose is X)
   Step B
 else
   Step C
--Need to return response to user here and need to follow two below steps asynchronously to unblock the caller of step function.
Step D
Step E

Is it possible to achieve the same? I believe, I will append .sync for step A, B and C. Will not append anything to D and E and it should work. Am I missing anything here?

Note that, all steps will be executed by activity workers only.

Upvotes: 2

Views: 1140

Answers (1)

Balu Vyamajala
Balu Vyamajala

Reputation: 10393

We can take two approaches.

  • Break the step function into two. First three steps will be in an express step function and last two steps will be a regular step function. OR
  • We can have just one step function, where ever we call this step function, we need to wait for first three steps to be completed before moving forward. This can be done by calling get-execution-history in a loop to grab the output of intermediate step. Here is an answer with this approach.

Upvotes: 1

Related Questions