# Access flow ID in node HTML file

**URL:** https://discourse.nodered.org/t/access-flow-id-in-node-html-file/93959
**Category:** Developing Nodes
**Created:** [17 December 2024 13:38 UTC](https://discourse.nodered.org/t/access-flow-id-in-node-html-file/93959 "2024-12-17T13:38:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RomainPoltronieri](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/romainpoltronieri/32/97155_2.png) [@RomainPoltronieri](https://discourse.nodered.org/u/RomainPoltronieri)
#### Post date: [17 December 2024 13:38 UTC](https://discourse.nodered.org/t/access-flow-id-in-node-html-file/93959/1 "2024-12-17T13:38:09Z")

</div>

When the oneditsave function of my custom node is called, I need some code to be executed, and within that code I need the ID of the flow the node belongs to. Is this something that is possible ?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [17 December 2024 14:01 UTC](https://discourse.nodered.org/t/access-flow-id-in-node-html-file/93959/2 "2024-12-17T14:01:26Z")

</div>

I cant remember if your node has access to `z` but that would be where I would start.

Otherwise:

```auto
RED.workspaces.active()

```

```auto
RED.view.selection().nodes[0].z

```

Though assumptions are made!

---

<div class="post-metadata">

### Author: ![RomainPoltronieri](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/romainpoltronieri/32/97155_2.png) [@RomainPoltronieri](https://discourse.nodered.org/u/RomainPoltronieri)
#### Post date: [17 December 2024 14:07 UTC](https://discourse.nodered.org/t/access-flow-id-in-node-html-file/93959/3 "2024-12-17T14:07:55Z")

</div>

They both work, fantastic, many thanks for your help !

---

<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: [31 December 2024 14:08 UTC](https://discourse.nodered.org/t/access-flow-id-in-node-html-file/93959/4 "2024-12-31T14:08:10Z")

</div>

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