# How to get the flowId in the flow?

**URL:** <https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453>\
**Category:** General\
**Created:** [11 May 2020 01:09 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453 "2020-05-11T01:09:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jack](https://discourse.nodered.org/u/Jack)\
**Post date:** [11 May 2020 01:09 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/1 "2020-05-11T01:09:46Z")

</div>

I want to get flowId in my flow, which are used as key to store process error information into the database. Is there any way to do it, such as flow.get("flowId") or?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [11 May 2020 08:45 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/2 "2020-05-11T08:45:14Z")

</div>

You could stick a change node near the start of every flow that would put the name of the flow in a msg variable

---

<div class="post-metadata">

**Author:** ![Jack](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jack](https://discourse.nodered.org/u/Jack)\
**Post date:** [11 May 2020 10:52 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/3 "2020-05-11T10:52:02Z")

</div>

I hope to get this id in my flow's node.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/5772ea506bb745e2ae2b11dea63d8dc2260bf706.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 May 2020 10:56 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/4 "2020-05-11T10:56:52Z")

</div>

Hi @Jack, the flow id isn't exposed to the nodes. As @zenofmud suggests, you would need to hard code an identifier on each flow - which could be written to flow context by an Inject node on start up.

---

<div class="post-metadata">

**Author:** ![Jack](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jack](https://discourse.nodered.org/u/Jack)\
**Post date:** [11 May 2020 10:58 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/5 "2020-05-11T10:58:02Z")

</div>

thank you

---

<div class="post-metadata">

**Author:** ![Jack](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jack](https://discourse.nodered.org/u/Jack)\
**Post date:** [11 May 2020 10:58 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/6 "2020-05-11T10:58:47Z")

</div>

thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 July 2020 11:12 UTC](https://discourse.nodered.org/t/how-to-get-the-flowid-in-the-flow/26453/7 "2020-07-10T11:12:47Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
