# POST flow id is getting ignored

**URL:** <https://discourse.nodered.org/t/post-flow-id-is-getting-ignored/67811>\
**Category:** General\
**Created:** [16 September 2022 14:27 UTC](https://discourse.nodered.org/t/post-flow-id-is-getting-ignored/67811 "2022-09-16T14:27:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![guyluz11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/guyluz11/32/53620_2.png) [@guyluz11](https://discourse.nodered.org/u/guyluz11)\
**Post date:** [16 September 2022 14:27 UTC](https://discourse.nodered.org/t/post-flow-id-is-getting-ignored/67811/1 "2022-09-16T14:27:07Z")

</div>

I am trying to create new flow with pre define id that I have created.

But using Node-Red API setting the id in post flow it is getting ignored.

To reproduce (I use Postman) create `post` request to `http://localhost:1880/flow` with raw JSON body

```auto
{
  "id": "aabb",
  "label": "Flow 14",
  "nodes": [],
  "configs": []
}

```

After sending request the flow-id will be different than `aabb`, in my case it was `633ddecdd201819b`.

Is there a way to set the id of the flow when it is being created?, I don't think this is a bug since the [post flow API](https://nodered.org/docs/api/admin/methods/post/flow/) is stating

> The runtime will assign a new id for the flow. If the provided flow configuration object includes an `id` field it will be replaced and the `z` property of all nodes updated to match.

which I don't understand why so posting the reason is also welcomed.

---

<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:** [16 September 2022 14:41 UTC](https://discourse.nodered.org/t/post-flow-id-is-getting-ignored/67811/2 "2022-09-16T14:41:48Z")

</div>

> [@guyluz11](#):
>
> Is there a way to set the id of the flow when it is being created?

No. The current API does what it says - it generates a new id and doesn't provide an option to do otherwise.

The whole `/flow` api has needed some attention for a while - but as it isn't used by the core editor, it doesn't looked at much other than when people such as yourself asks questions about it.

The reason for its behaviour was the original use-case for being able to quickly add multiple copies of the same flow without having to modify all the ids manually.

---

<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:** [30 September 2022 14:41 UTC](https://discourse.nodered.org/t/post-flow-id-is-getting-ignored/67811/3 "2022-09-30T14:41:57Z")

</div>

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