“I’d like to automatically resubmit an expired Power Automate flow, but what should I use as the ‘Trigger Name’ in the Resubmit Flow action?”
While each Power Automate flow is limited by the 29 and half days of runtime, sometimes it’s not enough. Especially if it’s an approval flow, where some tasks can take longer than expected. Users can ignore them despite reminders or need more time to make the decision, and the flow times out.
Luckily, Power Automate has an action that can resubmit a flow. Not so luckily, it’s another not-so-easily configurable action as it asks for ‘Trigger Name’. What value does it expect?
Get the trigger name from flow JSON
The ‘Trigger Name’ is not something you can get directly flow the flow as it’s hidden in the background, in the flow JSON. To get the name you’ll have to export the flow to .zip package.
Type in some name, it doesn’t matter what it’ll be, and click on the Export button at the bottom.
Extract the downloaded .zip file and navigate in the folder structure until you get to the definition.json file.
Open it in some text editor, e.g. in Visual Studio Code which is my favourite. Search for the text “triggers” to find the flow trigger in that JSON, the ‘Trigger Name’ is the first property of this object. In this example it’s the ‘When_an_item_is_created_or_modified’.
Copy the value in the ‘Resubmit Flow’ action and add an expression to extract the current flow run ID. The flow will resubmit itself once it reaches the step.
workflow()?['run']['name']
Summary
You can “extend” a Power Automate flow run duration if you resubmit the flow again before it times out, but you’ll need the ‘Trigger Name’ value it asks for. Once you extract it from the flow JSON the action itself is quite straightforward – pick the environment, pick the flow, type in the trigger name and use an expression to specific which run it should resubmit. The flow will restart using the same inputs as the original one.
It’s surely not something to use in all your flows, but it might be an extension to the restartable approval flows as proposed in the previous article that’ll give your users more time to process their tasks (if needed).
Greetings Tom,
I am attempting to extract information from the definition file to feed a custom sharepoint list of all my flows to serve as automated documentation and to track changes. I have referenced your other posts “How to automatically backup your Power Automate flows” and “Restore your Power Automate flow from a backup” which have been a huge help in getting to this point.
Would there happen to be another way to read the ‘Trigger Name’ value from the “triggers” object? Or a way to reference it in order to get to the “conditions” array below it?
Thanks so much!
-Micah
Hello Micah,
if you export the flows as explained in the articles, you can take the trigger name from those backups, it’s the same structure as in the exported JSON files. But it’s always in the property name, not as a value you could reference by the same key in all the flows automatically.