Flow example
In order to provide an example related with IoT services, in this section it will be described a flow that subscribes to an Orion entity, obtains data from this Orion subscription, translates the data from Orion's data model to INTER-IoT's data model and inserts it into a common database, which is an InfluxDB database.
Each node of the flow will be described following the order of execution.
1. FIWARE Orion subscription
This node subscribes automatically to the Orion's entity attributes that the user has configured previously. When the condition is accomplished, the node will obtain the data from Orion and this data will be returned as a JSON string through the payload of the message (msg.payload).
- Source: https://www.npmjs.com/package/node-red-contrib-fiware-orion
2. JSON node
This node converts the payload from a JSON string to its JavaScript object representation.
3. Function node
Prepares the data that will be inserted to the next node: a mwtranslator node, which needs the property translate of the message.
msg.translate = msg.payload[0];
return msg;
4. Middleware translator from FIWARE
This node translates the data (msg.translate), which is in JSON format, from Orion's data model to INTER-IoT's data model. This data will be returned as a JSON string through the payload of the message.
- Source: https://git.inter-iot.eu/ravagar2/mwtranslator
5. JSON node
This node converts the payload from a JSON string to its JavaScript object representation.
6. Insert into InfluxDB
This node inserts a register that contains the data INTER-IoT's data model into the InfluxDB database.
- Source: https://git.inter-iot.eu/ravagar2/influxdb-api
7. JSON node
This node converts the payload from a JSON string to its JavaScript object representation.
8. Debug node
This node displays the payload of the message, which is the final result of the insertion process to the database.
Complete flow architecture

Complete flow in JSON format
[
{
"id": "47458bc1.3db61c",
"type": "comment",
"z": "e7ddf5d8.59af8",
"name": "From Orion subscription to common database",
"info": "",
"x": 250,
"y": 40,
"wires": []
},
{
"id": "762e5cf3.1dc8f4",
"type": "translator-from",
"z": "e7ddf5d8.59af8",
"name": "",
"server": "4f5e571c.0b1ae8",
"data": "",
"iotplatform": "fiware",
"setdata": false,
"x": 610,
"y": 180,
"wires": [
[
"a8270a72.33001"
]
]
},
{
"id": "22b0de54.8cfe32",
"type": "insert-influxdb",
"z": "e7ddf5d8.59af8",
"name": "",
"db": "fiware",
"table": "test",
"platformId": "FIWARE",
"device": "termometro",
"server": "2a803e73.d0775a",
"observation": "",
"setobservation": false,
"x": 970,
"y": 100,
"wires": [
[
"6175d115.58cd68"
]
]
},
{
"id": "16e82a43.75367e",
"type": "debug",
"z": "e7ddf5d8.59af8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1290,
"y": 200,
"wires": []
},
{
"id": "a8270a72.33001",
"type": "json",
"z": "e7ddf5d8.59af8",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 790,
"y": 100,
"wires": [
[
"22b0de54.8cfe32"
]
]
},
{
"id": "6175d115.58cd68",
"type": "json",
"z": "e7ddf5d8.59af8",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 1150,
"y": 140,
"wires": [
[
"16e82a43.75367e"
]
]
},
{
"id": "f7f7e64.60f5c18",
"type": "fiware orion in",
"z": "e7ddf5d8.59af8",
"name": "",
"service": "a874c3c4.af1ce",
"throttle": "PT5S",
"entype": "Room",
"enid": "Room1",
"ispattern": false,
"duration": "P1D",
"attributes": "temperature",
"condvalues": "temperature",
"includeattr": true,
"noderedhost": "",
"noderedhostauto": true,
"x": 90,
"y": 120,
"wires": [
[
"dd800b00.4b8be8"
]
]
},
{
"id": "634fd3ba.b5a764",
"type": "function",
"z": "e7ddf5d8.59af8",
"name": "",
"func": "msg.translate = msg.payload[0];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 410,
"y": 140,
"wires": [
[
"762e5cf3.1dc8f4"
]
]
},
{
"id": "dd800b00.4b8be8",
"type": "json",
"z": "e7ddf5d8.59af8",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 270,
"y": 140,
"wires": [
[
"634fd3ba.b5a764"
]
]
},
{
"id": "4f5e571c.0b1ae8",
"type": "translator-server",
"z": "",
"host": "localhost",
"port": "4568"
},
{
"id": "2a803e73.d0775a",
"type": "influxdb-server",
"z": "",
"host": "localhost",
"port": "4567"
},
{
"id": "a874c3c4.af1ce",
"type": "orion-service",
"z": "",
"name": "",
"url": "localhost",
"port": "1026"
}
]