@node-red/runtime.flows

addFlow(opts) → {Promise.<String>}

Adds a flow configuration

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

flow Object

the flow to add

req Object

the request to log (optional)

Returns:
Type:
Promise.<String>
  • the id of the added flow

deleteFlow(opts) → {Promise}

Deletes a flow

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id Object

the id of the flow to delete

req Object

the request to log (optional)

Returns:
Type:
Promise
  • resolves if successful

getFlow(opts) → {Promise.<Flow>}

Gets an individual flow configuration

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id Object

the id of the flow to retrieve

req Object

the request to log (optional)

Returns:
Type:
Promise.<Flow>
  • the active flow configuration

getFlows(opts) → {Promise.<Flows>}

Gets the current flow configuration

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

req Object

the request to log (optional)

Returns:
Type:
Promise.<Flows>
  • the active flow configuration

getNodeCredentials(opts) → {Promise.<Object>}

Gets the safe credentials for a node

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

type String

the node type to return the credential information for

id String

the node id

req Object

the request to log (optional)

Returns:
Type:
Promise.<Object>
  • the safe credentials

setFlows(opts) → {Promise.<Flows>}

Sets the current flow configuration

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

flows Object

the flow configuration: {flows: [..], credentials: {}}

deploymentType Object

the type of deployment - "full", "nodes", "flows", "reload"

req Object

the request to log (optional)

Returns:
Type:
Promise.<Flows>
  • the active flow configuration

updateFlow(opts) → {Promise.<String>}

Updates an existing flow configuration

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id Object

the id of the flow to update

flow Object

the flow configuration

req Object

the request to log (optional)

Returns:
Type:
Promise.<String>
  • the id of the updated flow