cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KoenJanssensPD
Advocate II
Advocate II

never ending flow..

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

 

5 REPLIES 5
Jcook
Super User
Super User

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


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





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"
                            }
                        ]
                    }
                }
            }

 

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/

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





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?!?

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)


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,305)