Hi Ayan, again thank you for keeping an eye in this problem.
I changed the recipe to add a scheduler to wait but still facing the same problem. It seems that the wait mechanism (from scheduler or from async functs) is a "long action" and because I need to trigger my main through an api request, it doesn't allows this long actions in the recipe. So I'm still not able to do the data processing in parallel.
------------------------------
Bernold Rodrigo Abarca Zuniga
Intel
------------------------------
Original Message:
Sent: 12-21-2022 11:39
From: Ayan Basu
Subject: It is possible to run in parallel recipe steps in a recipe triggered by a REST API?
You could use a scheduler action in the loop and check the lookup table and stop the loop when all data is populated.
------------------------------
Ayan Basu
Original Message:
Sent: 12-20-2022 17:09
From: Bernold Rodrigo Abarca Zuniga
Subject: It is possible to run in parallel recipe steps in a recipe triggered by a REST API?
Hi Ayan, thank you so much for your answer. Actually the recipe I developed, works a little bit like that. I have an aux recipe that process the data and stores it in a lookup table and it runs asynchronously. But the problem is with the main recipe and how to make it wait. I tried using the "Wait for an async call to complete" action but it throws the error I mentioned in my first post and I tried to search for documentation about while loops, flags or something else that allows the recipe to wait but I couldn't find anything.
------------------------------
Bernold Rodrigo Abarca Zuniga
Intel
Original Message:
Sent: 12-20-2022 14:50
From: Ayan Basu
Subject: It is possible to run in parallel recipe steps in a recipe triggered by a REST API?
Hi Bernold, one option is you can set up a recipe to pub/sub messages (or run asynchronously) and store processed data into lookup tables or other storage. The main recipe could wait for an outside flag that will be set once all data is processed.
------------------------------
Ayan Basu
Original Message:
Sent: 12-19-2022 18:25
From: Bernold Rodrigo Abarca Zuniga
Subject: It is possible to run in parallel recipe steps in a recipe triggered by a REST API?
Hello everyone,
I need to create a recipe that is trigger by an api request, it process a big amount of data and then return the result to the api request. My idea, to make the recipe faster, is to split the data in multiple chunks and use the async functionality to process each chunk in parallel using an aux recipe to do it.
I used the documentation about the Callable Recipes - Wait For Async Calls Action and followed all the advises I saw there and I managed to create a recipe. But I got a problem using the wait functionality, I received the next error: "Use of long actions is not allowed in callable recipes or bot recipes", and if I change the recipe to run each step synchronously (not using the async and wait), it works perfectly.
I understand this error is showing because the trigger of the recipe is the api request. So I want to know if anyone faced a similar situation and if you could find a solution or if someone knows a different method to run in parallel recipe steps that works for recipe triggered by an api request.
Thanks & Regards,
Bernold Abarca
------------------------------
Bernold Rodrigo Abarca Zuniga
Intel
------------------------------