# JSON schema for a valid flow?

**URL:** <https://discourse.nodered.org/t/json-schema-for-a-valid-flow/72021>\
**Category:** Developing Nodes\
**Tags:** function-node\
**Created:** [11 December 2022 09:11 UTC](https://discourse.nodered.org/t/json-schema-for-a-valid-flow/72021 "2022-12-11T09:11:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [11 December 2022 09:11 UTC](https://discourse.nodered.org/t/json-schema-for-a-valid-flow/72021/1 "2022-12-11T09:11:46Z")

</div>

I'd love to validate a custom flow file against a JSON schema.  
I assume there is likely one for a generic flow already, right?  
If that's true, can anyone please point me where it is?  
Thanks!

---

<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:** [11 December 2022 10:56 UTC](https://discourse.nodered.org/t/json-schema-for-a-valid-flow/72021/2 "2022-12-11T10:56:28Z")

</div>

Not that I know of.

It is easy enough to generate a schema (manually or using online schema from json tools)

Note though: every node has a different set of properties so your schema will need to be quite relaxed or quite complex. In fact, the only absolutely required properties are `id` & `type` (both are strings)

e.g: The below is a perfectly valid flow...

```auto
[
  { "id": "n1", "type": "inject" },
  { "id": "n2", "type": "function" },
  { "id": "n3", "type": "debug" }
]

```

---

<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:** [25 December 2022 10:57 UTC](https://discourse.nodered.org/t/json-schema-for-a-valid-flow/72021/3 "2022-12-25T10:57:00Z")

</div>

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