# Runtime setFlows interface does not match documentation

**URL:** https://discourse.nodered.org/t/runtime-setflows-interface-does-not-match-documentation/44909
**Category:** Core Development
**Created:** [29 April 2021 05:28 UTC](https://discourse.nodered.org/t/runtime-setflows-interface-does-not-match-documentation/44909 "2021-04-29T05:28:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![okm](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@okm](https://discourse.nodered.org/u/okm)
#### Post date: [29 April 2021 05:28 UTC](https://discourse.nodered.org/t/runtime-setflows-interface-does-not-match-documentation/44909/1 "2021-04-29T05:28:53Z")

</div>

Hello,

I want to reload the flows programmatically.  
Therefore I want to use the setFlows function of the node runtime.  
([DefinitelyTyped/index.d.ts at master · DefinitelyTyped/DefinitelyTyped · GitHub](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node-red__runtime/index.d.ts))  
/\*\*  
\* Sets the current flow configuration  
\* @param opts  
\* @param opts.flows - the flow configuration: `{flows: [..], credentials: {}}`  
\* @param opts.deploymentType - the type of deployment - "full", "nodes", "flows", "reload"  
\* @param opts.req - the request to log (optional)  
\*/  
setFlows: (opts: { flows: { flows: object; credentials: object; req?: object } }) =\> Promise\<{ rev: string }\>;

Documentation:  
[https://nodered.org/docs/api/modules/v/1.3/@node-red\_runtime\_flows.html#.setFlows](https://nodered.org/docs/api/modules/v/1.3/@node-red_runtime_flows.html#.setFlows)  
(has an additional user object)

So the docs mention this format {flows:{}, req?:{}, deploymentType: string},  
the coding accepts this format: {flows:[{},{}], credentials?:{}, req?:{}}

there is a mismatch of API Input parameters and docs, but my biggest issue is how can I set the **deploymentType**. I am using typeScript.  
Any suggestions?

Thank you  
okm

---

<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: [29 April 2021 08:39 UTC](https://discourse.nodered.org/t/runtime-setflows-interface-does-not-match-documentation/44909/2 "2021-04-29T08:39:11Z")

</div>

Hi @okm

the typescript definitions in the DefinitelyTyped repo are not maintained by the core Node-RED project - they never have been. You'll have to raise an issue against whoever maintains them.

You set the deployment type using `opt.deploymentType` just as the docs say.

---

<div class="post-metadata">

### Author: ![okm](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@okm](https://discourse.nodered.org/u/okm)
#### Post date: [29 April 2021 08:57 UTC](https://discourse.nodered.org/t/runtime-setflows-interface-does-not-match-documentation/44909/3 "2021-04-29T08:57:26Z")

</div>

Hi @knolleary ,

OK got it, I changed my coding to  
const opts = {  
flows:{  
flows:,  
credentials:{}  
},  
deploymentType:'reload'  
};  
runtime.flows.setFlows(opts);

and it worked.  
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: [13 May 2021 08:58 UTC](https://discourse.nodered.org/t/runtime-setflows-interface-does-not-match-documentation/44909/4 "2021-05-13T08:58:17Z")

</div>

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