web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

never ending flow..

(0) ShareShare
ReportReport
Posted on by 601

I have two custom entities in CDS: Project and ProjectDelivery (with a one-to-many relation).
I have created a flow to calculate the total amount for all deliveries for each project: I first fetch all Projects, and for each Project I fetch all ProjectDeliveries. I loop over all ProjectDeliveries and sum the total amount of each delivery; after the loop I assign the sum to a field in Project.

 

KoenJanssensPD_0-1600969663722.png

KoenJanssensPD_0-1600970087096.png

 

This runs every 4 hours. Initially the flow ran fine, but after a while (after one day) all the initiated runs never end... they keep on running for days. Now I get a warning that the flow is disabled ("Your flow's performance may be slow because it's been running more actions than expected since 9/20/2020 5:38:49 PM (4 days ago). Your flow will be turned off if it doesn't use fewer actions").

I have to cancel all running flows manually one by one, and it seems I cannot see any reason why these flows keep on running... any ideas?

 

Thanks,

Koen

 

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hello @KoenJanssensPD 

     

    Which License do you have?

     

    Also how many records are being returned from CDS actions?

     

    Could you share a screenshot with the actions opened up as much as possible from a Previous Run

  • KoJaPD Profile Picture
    601 on at

    Hi @Jcook ,

     

    There are around 30 projects; In total there are 4000 deliveries, going from 1 delivery for a project, to 1400 deliveries for the largest project...

     

    These are the licenses:

    KoenJanssensPD_0-1601280701726.png

     

    These are the actions:

     

     "actions": {
     "List_records": {
     "runAfter": {},
     "type": "OpenApiConnection",
     "inputs": {
     "host": {
     "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
     "connectionName": "shared_commondataserviceforapps",
     "operationId": "ListRecords"
     },
     "parameters": {
     "entityName": "pdc_projects",
     "$filter": "statecode eq 0"
     },
     "authentication": "@parameters('$authentication')"
     }
     },
     "Initialize_variable": {
     "runAfter": {
     "List_records": [
     "Succeeded"
     ]
     },
     "type": "InitializeVariable",
     "inputs": {
     "variables": [
     {
     "name": "sumProduct",
     "type": "float"
     }
     ]
     }
     },
     "Apply_to_each": {
     "foreach": "@outputs('List_records')?['body/value']",
     "actions": {
     "Set_variable": {
     "runAfter": {},
     "type": "SetVariable",
     "inputs": {
     "name": "sumProduct",
     "value": 0
     }
     },
     "List_records_2": {
     "runAfter": {
     "Set_variable_2": [
     "Succeeded"
     ]
     },
     "type": "OpenApiConnection",
     "inputs": {
     "host": {
     "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
     "connectionName": "shared_commondataserviceforapps",
     "operationId": "ListRecords"
     },
     "parameters": {
     "entityName": "pdc_productforprojects",
     "$filter": "_pdc_project_value eq @{items('Apply_to_each')?['pdc_projectid']}"
     },
     "authentication": "@parameters('$authentication')"
     }
     },
     "Apply_to_each_2": {
     "foreach": "@outputs('List_records_2')?['body/value']",
     "actions": {
     "Increment_variable": {
     "runAfter": {},
     "type": "IncrementVariable",
     "inputs": {
     "name": "sumProduct",
     "value": "@items('Apply_to_each_2')?['cr6ea_productkostprijs']"
     }
     },
     "Increment_variable_2": {
     "runAfter": {
     "Increment_variable": [
     "Succeeded"
     ]
     },
     "type": "IncrementVariable",
     "inputs": {
     "name": "sumLoon",
     "value": "@items('Apply_to_each_2')?['cr6ea_loonkostprijs']"
     }
     }
     },
     "runAfter": {
     "List_records_2": [
     "Succeeded"
     ]
     },
     "type": "Foreach"
     },
     "Update_a_record": {
     "runAfter": {
     "Apply_to_each_2": [
     "Succeeded"
     ]
     },
     "type": "OpenApiConnection",
     "inputs": {
     "host": {
     "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
     "connectionName": "shared_commondataserviceforapps",
     "operationId": "UpdateRecord"
     },
     "parameters": {
     "entityName": "pdc_projects",
     "recordId": "@items('Apply_to_each')?['pdc_projectid']",
     "item/cr6ea_kostprijsloon": "@variables('sumLoon')",
     "item/cr6ea_kostprijsproducten": "@variables('sumProduct')"
     },
     "authentication": "@parameters('$authentication')"
     }
     },
     "Set_variable_2": {
     "runAfter": {
     "Set_variable": [
     "Succeeded"
     ]
     },
     "type": "SetVariable",
     "inputs": {
     "name": "sumLoon",
     "value": 0
     }
     }
     },
     "runAfter": {
     "Initialize_variable_2": [
     "Succeeded"
     ]
     },
     "type": "Foreach",
     "runtimeConfiguration": {
     "concurrency": {
     "repetitions": 1
     }
     }
     },
     "Initialize_variable_2": {
     "runAfter": {
     "Initialize_variable": [
     "Succeeded"
     ]
     },
     "type": "InitializeVariable",
     "inputs": {
     "variables": [
     {
     "name": "sumLoon",
     "type": "float"
     }
     ]
     }
     }
     }

     

  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hi @KoenJanssensPD 

     

    Can you check here:

    https://docs.microsoft.com/en-us/power-automate/billing-questions#how-do-i-know-how-much-ive-used

    This sounds like a throttling issue from too many runs per your license.

     

    Contact Microsoft support for details on your license:

    https://flow.microsoft.com/en-us/support/

     

  • KoJaPD Profile Picture
    601 on at

    Hi @Jcook , I also think it has something to do with limits, but I am unable to find *any* clue on what/why/where/when... 

    the link you sent about checking usage, doesn't help me: I don't see any information when opening the gear icon menu... 

     

    in the mean time, multiple flow runs are running (for over more than 48 hours now) and the flow is tagged as "Slow performance"...

    I am now looking at the following blogpost: 

    https://sharepains.com/2018/10/15/microsoft-flow-improve-your-flows-performance-in-a-few-easy-steps/

     

    this is giving me a real headache... I thought a simple like a SQL-alike "sum aggregate using group by" would not be so difficult... am I using the wrong toolset to do this?!?

  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hi @KoenJanssensPD 

     

    I know this must be frustrating. I really do think this has something to do with your license. Its hard for me or you to troubleshoot this. It seems like Microsoft has hidden the usage stats away. This is why I am suggesting to create a ticket with Microsoft. They will be able to tell you if its your license or not.

     

    Usually if its the connectors throttling in Power Automate, you see a 429 error inside the Flow itself. This is what pushes me to believe there is something else going on that we cant see (License limits)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 535

Last 30 days Overall leaderboard