You might need to access your Flow’s name when building complex Flows for various reasons. You may create a custom logging system, want to include the Flow name in email notifications, or need to use it for conditional logic. Whatever the reason, getting the current Flow’s name isn’t immediately evident in the Power Automate interface. The wrong way would be to define it manually or copy and paste it from the header. If you change the name and forget to change the flow,, you will have an invalid value.
I’ll show you how to use the “workflow” function to get this information in a structured way.
Before we start, you’ll see in the examples that a “name” exists in the function’s return, but that’s not the one we’re looking for. We’ll use the “display name” that contains the name we defined, while the “name” contains an internal random number to identify the Flow. You’ll see this in the article, but I wanted to highlight it immediately.
Using the “workflow” function
The easiest and most reliable way to get your Flow’s name is by using the “workflow” function. This function returns information about your current Flow, including its name.
Let’s add a “Compose” action to see it in action:

In the Compose action, we’ll use the following formula:
workflow()
When you run your Flow, you’ll get a JSON object with details about your workflow, like this:
{
"id": "/workflows/,
"name": "...",
"type": "Microsoft.Logic/workflows",
"location": "westeurope",
"tags": {
"flowDisplayName": "Article: How to Get Your Flow's Name",
"environmentName": "...",
"logicAppName": "...",
"environmentWorkflowId": "...",
"xrmWorkflowId": "...",
"environmentFlowSuspensionReason": "...",
"sharingType": "CommonDataService",
"state": "Enabled",
"createdTime": "4/23/2025 3:52:39 PM",
"lastModifiedTime": "4/23/2025 3:56:23 PM",
"createdBy": "...",
"triggerType": "Instant"
},
"run": {
"id": "/workflows/.../runs/...",
"name": "...",
"type": "Microsoft.Logic/workflows/runs"
}
}
Now, let’s extract just the name using another Compose action:
workflow()?['tags']?['flowDisplayName']

That’s it. You have the name of the flow in a format that you can use.
Examples
Now that we know how to get the Flow’s name, let’s look at some practical examples. Note that these examples only demonstrate the functionality, so please learn from them and adapt them to your needs.
Including the Flow name in email notifications
This is extremely useful for support teams. When a Flow fails, you can email the Flow name in the subject. You can use a “concat” function like this:
concat('Flow Error: ', workflow()?['tags']?['flowDisplayName'])
Using Flow name in conditional logic
You might have multiple Flows using a common template where certain actions only run based on the Flow name:
if(contains(workflow()?['tags']?['flowDisplayName'], 'Production'), 'Run production steps', 'Skip production steps')
Here’s the result:

Consider this an example of how logic can change based on the name. There are better ways to do this, and having the production logic in the name is dangerous since any change could result in the Flow behaving differently.
Common issues and solutions
Unexpected null values
If you’re getting null values when trying to access tags or other properties, try using the optional chaining operator (?
):
Instead of:
workflow()['tags']['flowDisplayName']
Use:
workflow()?['tags']?['flowDisplayName']
Usually, this won’t return a null value since the flowDisplayName always exists, but it’s better to write the expression on the safe side so that it works all the time.
Flow name vs. Display name differences
Remember that the name
property and the flowDisplayName
under tags will be different. The name
is the internal name (what was originally used when creating the Flow and usually is a random string), while flowDisplayName
is what you see in the Power Automate portal.
Final Thoughts
I go into a lot of detail about the “workflow” function and provide you with a lot of use-cases and best practices so please feel free to check it out.
You can follow me on Mastodon (new account), Twitter (I’m getting out, but there are still a few people who are worth following) or LinkedIn. Or email works fine as well 🙂
Photo by Martina Jorden on Unsplash