Skip to main content
Practitioner ⭐️
August 2, 2024

Dynamic Tasks processing in sequence

  • August 2, 2024
  • 39 replies
  • 645 views

 

I have created 1 workflow , in which I am creating dynamic tasks depending on input, it creates batch of ids and create tasks out of it. Below is workflow definition

WorkflowVersionUpsert(

   workflow_external_id="test_dynamic-0729",

   version="1",

   workflow_definition=WorkflowDefinitionUpsert(

       description="This workflow has two steps",

       tasks=[

           WorkflowTask(

                external_id="test_sub_tasks",

                parameters=FunctionTaskParameters(

                    external_id="test_sub_tasks",

                    data="${workflow.input}"

                ),

                retries=1,

                timeout=3600,

                depends_on=[],

                on_failure = "abortWorkflow",

            ),

           WorkflowTask(

                external_id="test_create_sub",

                parameters=DynamicTaskParameters(

                    tasks="${test_sub_tasks.output.response.tasks}"

                ),

                name="Dynamic Task",

                description="Executes a list of workflow tasks for subscription creation",

                retries=0,

                timeout=3600,

                depends_on=["test_sub_tasks"],

                on_failure = "abortWorkflow",

           )

       ]

   )

 As part of this workflow, I have some task that are needed to be executed in parallel and are expected to finish in around similar time if running parallel. However, dynamic tasks are not getting executed in parallel, I have 6 dynamic tasks, but they are finishing up sequentially. Sharing snapshot. If we can see time difference between first and last task is ~6m. Not able to take advantage of parallel execution with dynamic tasks.

Impact : Dynamic Execution taking sequential time to process tasks, further delaying completion of workflow

39 replies

Dag Brattli
Practitioner ⭐️⭐️⭐️
Practitioner ⭐️⭐️⭐️
April 24, 2025

@Aditya Kotiyal There should be no need to prewarm the function anymore. But scaling is not instant, and it will take some time for the function to scale up. We are currently working with Microsoft to enable Flex Consumption plan for Azure Functions which will enable faster and better scaling. It is hard to know if you are experiencing an error without any logging of when the function actually started executing. Would it be possible for you for each call of the function to log:

  • When the function is called
  • When the function actually starts to process
  • Duration of the function execution

That way we can see how quickly the function scales and how many instances you get.

Thanks
Dag Brattli

Aditya Kotiyal
MVP ⭐️⭐️⭐️⭐️⭐️
MVP ⭐️⭐️⭐️⭐️⭐️
May 14, 2025

Hi ​@Dag Brattli 

Aditya Kotiyal
Dag Brattli
Practitioner ⭐️⭐️⭐️
Practitioner ⭐️⭐️⭐️
May 16, 2025

@Aditya Kotiyal We are now ready to onboard to Flex Consumption plan that have better performance and scalability so if you are interested we could enable you there. But it will require redeployment of functions to get them on the Flex Consumption plan. Let me know what you think.

Aditya Kotiyal
MVP ⭐️⭐️⭐️⭐️⭐️
MVP ⭐️⭐️⭐️⭐️⭐️
May 16, 2025

@Dag Brattli Let me ask the team and then may be we can plan the switch.

Aditya Kotiyal
Seasoned ⭐️⭐️⭐️
May 16, 2025

@Dag Brattli Is there any impact to already running functions after we switch to flex consumption plan? we may test the sample function first before we touch the core functions redeployment. 

Dag Brattli
Practitioner ⭐️⭐️⭐️
Practitioner ⭐️⭐️⭐️
May 16, 2025

@Niranjan Madhukar Karvekar No, already running functions on the Consumption plan will continue to work as before. But any new function deployment will (if we toggle) then be deployed to the new Flex Consumption plan.

PS: Note that the Azure Consumption plan will be deprecated (by Microsoft) in ~3 years time so you will eventually have to move everything anyways. But it’s good to start with a few functions first.

Aditya Kotiyal
MVP ⭐️⭐️⭐️⭐️⭐️
MVP ⭐️⭐️⭐️⭐️⭐️
May 19, 2025

Thanks ​@Dag Brattli , also had a chat with Everton.

 

I am checking with the team when they can plan to redeploy the function. Once I get a date, we can switch the plan and ask to team to redeploy.

Thank you for your support.

 

Aditya Kotiyal
Dag Brattli
Practitioner ⭐️⭐️⭐️
Practitioner ⭐️⭐️⭐️
July 10, 2025

From our side, we consider this resolved. This should be fixed by Azure Flex Consumption, which has recently been rolled out. If you redeploy, the new function will appear on Flex. Please note that you cannot expect all calls to be processed perfectly in parallel. However, the sequential execution you have experienced before should not happen.

Aditya Kotiyal
MVP ⭐️⭐️⭐️⭐️⭐️
MVP ⭐️⭐️⭐️⭐️⭐️
July 10, 2025

Hi ​@Dag Brattli ,

 

@Niranjan Madhukar Karvekar  has observed some improvements.

He is trying it in a project named” slb-hackathon” in west European cluster.

But we want to replicate it for more concurrent execution.

 

Can you help us confirm if the concurrent function limit is set to 50 or 100 in this project?

If 50, can it be raised to 100, so that the team can replicate it in this environment?

 

 

Aditya Kotiyal