cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AugustoEi
Helper I
Helper I

Power automate running ID

  • Hi,

 

I need to know the ID of the workflow running in Power Automate for every element in SharePoint Online.

 

Is this possible?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User II
Super User II

Hello @AugustoEi ,

Power Automate has an expression workflow() that will give you information about the running flow. You can access the elements by adding ?['key'] at the end, e.g. workflow()?['run']['id']. Example of the workflow() data is below:

{
  "id": "/workflows/59fed111111aa7c02a68b45ad0aa",
  "name": "2ef6c1be-9839-1111-8c69-55783da7f30e",
  "type": "Microsoft.Logic/workflows",
  "location": "westeurope",
  "tags": {
    "flowDisplayName": "JSON tests",
    "environmentName": "Default-111111-555b-44f6-9fbb-ecf0395f334b",
    "logicAppName": "211111-9839-4c58-8c69-55783da7f30e",
    "environmentFlowSuspensionReason": "Default:2Dc3adda97:111111:2D44f6:2D9fbb:2Decf0395f334b-None"
  },
  "run": {
    "id": "/workflows/59fedee01111111a7c02a68b45ad0aa/runs/0858588111111002812276151068CU131",
    "name": "0858588972180111111116151068CU131",
    "type": "Microsoft.Logic/workflows/runs"
  }
}

It can be used in another expression for example if you want to build a direct link to a running flow:

concat('https://flow.microsoft.com/manage/environments/', workflow()?['tags']['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

3 REPLIES 3
tom_riha
Super User II
Super User II

Hello @AugustoEi ,

Power Automate has an expression workflow() that will give you information about the running flow. You can access the elements by adding ?['key'] at the end, e.g. workflow()?['run']['id']. Example of the workflow() data is below:

{
  "id": "/workflows/59fed111111aa7c02a68b45ad0aa",
  "name": "2ef6c1be-9839-1111-8c69-55783da7f30e",
  "type": "Microsoft.Logic/workflows",
  "location": "westeurope",
  "tags": {
    "flowDisplayName": "JSON tests",
    "environmentName": "Default-111111-555b-44f6-9fbb-ecf0395f334b",
    "logicAppName": "211111-9839-4c58-8c69-55783da7f30e",
    "environmentFlowSuspensionReason": "Default:2Dc3adda97:111111:2D44f6:2D9fbb:2Decf0395f334b-None"
  },
  "run": {
    "id": "/workflows/59fedee01111111a7c02a68b45ad0aa/runs/0858588111111002812276151068CU131",
    "name": "0858588972180111111116151068CU131",
    "type": "Microsoft.Logic/workflows/runs"
  }
}

It can be used in another expression for example if you want to build a direct link to a running flow:

concat('https://flow.microsoft.com/manage/environments/', workflow()?['tags']['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

DamoBird365
Community Champion
Community Champion

Hi,  have a look at the following article

 

It builds the URL to the flow and run on your environment using the workflow function.  You could include this link in an email for any flows that fail and it will take you direct to that history run.

Great! you are my saivor!

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (35,413)