I have an azure durable function wrote in python with an orchestrator and two activity functions
Orchestrator calls the first activity function and in return receive a list variable (List of names and this list can be dynamic everytime function gets executed)
The next step would be to call the second activity function for each one of those list items (sequential processing - due to API restriction that the second activity function calls)
#dynamically gets generated by the first activity function
payload=[1,2,3,4]
tasks = [context.call_activity("secondfunction",ps) for ps in payload]
output = yield context.task_all(tasks)
what I am using in fan out method which is not serial but I don’t seem to be able find an alternative for what I am trying to do.
Also in the host.json file I tried to enforce that only one activity function can run at a given time to avoid the parallel processing
"extensions": {
"durableTask": {
"maxConcurrentActivityFunctions": 1,
"maxConcurrentOrchestratorFunctions": 1
}
}
also it's worth noting that I can not pass the whole list to the activity function as if I do the activity function will take more than 5-10 mins which is the timeout limit for the azure function hence trying to iterate the list in orchestration function
But the result is not sequential
Would appreciate your feedback
You can try using below two approaches to achieve your requirement:-
Approach 1:-
My function_app.py:-
Output:-
Function URL:-
Approach 2:-
function_app.py:-