Configure qibb Nodes and Subflows
Introduction
qibb is offering a variety of specialized API nodes to help you automate your media-centric workflows.
Furthermore, our Flows Catalog provides a selection of small workflows that can be combined together to create more complete and tailor-made workflows.
Both the API nodes and the flows are requiring for the user to fill out a couple of configuration parameters, that need to be set beforehand.
Instructions
There are two ways to configure both the API Nodes and the Flows:
double-click on the node/sub-flow and fill out the required parameters in the Edit dialogue box
or they can pass them programmatically using a Change Node or a Function Node in Node-Red.
Edit Dialogue Box Configuration
The first option is straightforward. You just need to double-click over the node or the sub-flow and fill out the required configuration parameters directly there as shown on the screenshot below.
![](../../__attachments/67070263316/Screenshot%20from%202023-01-24%2011-41-22.png?inst-v=c88e4cea-82a3-40f5-a048-5ec6afec77a6)
Sub-flow Edit Dialogue Box
Programmatic Delivery of Configuration Parameters
Sometimes it makes more sense to pass the configuration parameters programmatically. This can be done either using a Change Node or a Function Node in Node-Red.
For example, the mimir Auth Node requires that the email and password are pre-configured. Normally, the path and the parameter name are shown on the Node/Sub-flow documentation page, as shown below.
![](../../__attachments/67070263316/mimir_auth.png?inst-v=c88e4cea-82a3-40f5-a048-5ec6afec77a6)
mimir Auth Node Documentation
So you need to define them either by using a Change Node:
![](../../__attachments/67070263316/Screenshot%20from%202023-01-24%2011-42-52.png?inst-v=c88e4cea-82a3-40f5-a048-5ec6afec77a6)
Set-Up Configuration Parameters Using Change Node
This would create a path in Node-Red with the following format:
msg.auth = {
"MIMIR_USERNAME": "username",
"MIMIR_PASSWORD": "password"
}
Alternatively, you can also use a function node to achieve the same and define the structure of the JSON path yourself:
![](../../__attachments/67070263316/Screenshot%20from%202023-01-24%2011-49-08.png?inst-v=c88e4cea-82a3-40f5-a048-5ec6afec77a6)
Set-Up Configuration Parameters Using Function Node
Path, Query, Headers and Body Parameters
You can use the same ways to set-up API path, query, headers and body parameters. For example imagine we have the following API request we want to send: POST /api/teams/{teamId}?{query_param}={query_value}
and pass an X-API-Key value in the headers and pass a JSON body.
path parameter should be passed at
msg.parameters.path.teamId = "team ID"
query parameter should be passed at
msg.parameters.query.query_param = "query_value"
API Key headers
msg.headers.X-API-Key = "<jwt_token>"
JSON body needs to be passed to
msg.parameters.body.XXXX = "value"
, etc.
Alternatively, for the JSON body, you can use a function node where you need to define it yourself:JSONmsg.parameters.body = { "param_name1": "value1", "param_name2": "value2", ... };
Function Node Disclaimer
It is important to note that when using a function node, you cannot simply set msg.auth.MIMIR_USERNAME = "username"
as this would throw a Type Error: “ "TypeError: Cannot set properties of undefined (setting ‘username')"
as the msg.auth
path won’t be initialized. In that case you should use:
- JSON
msg.auth = { "MIMIR_USERNAME": "username", "MIMIR_PASSWORD": "password" ... };
or:
JSONmsg.auth = {}; msg.auth.MIMIR_USERNAME = "username"; msg.auth.MIMIR_PASSWORD = "password";