i have two instances of node red running, i would like to copy a given flow from instance one to instance two.
flow_id = '8429e42d5be21f50'
handler.get_flow(flow_id)
print(json.dumps(flow, indent=4))
provides:
{'disabled': False,
'env': [],
'id': '8429e42d5be21f50',
'info': '',
'label': 'Simple-Export',
'nodes': [{'crontab': '',
'id': '5f74a245600e657d',
'name': '',
'once': False,
'onceDelay': 0.1,
'payload': '',
'payloadType': 'date',
'props': [{'p': 'payload'}, {'p': 'topic', 'vt': 'str'}],
'repeat': '',
'topic': '',
'type': 'inject',
'wires': [['a009c29205ae3027']],
'x': 500,
'y': 260,
'z': '8429e42d5be21f50'},
{'action': '',
'from': '',
'id': 'a009c29205ae3027',
'name': '',
'property': '',
'reg': False,
'rules': [{'p': 'payload',
'pt': 'msg',
't': 'set',
'to': 'set',
'tot': 'str'}],
'to': '',
'type': 'change',
'wires': [['aef6a32098eda1e8']],
'x': 750,
'y': 260,
'z': '8429e42d5be21f50'},
{'active': True,
'complete': 'payload',
'console': False,
'id': 'aef6a32098eda1e8',
'name': '',
'statusType': 'auto',
'statusVal': 'payload',
'targetType': 'msg',
'tosidebar': True,
'tostatus': True,
'type': 'debug',
'wires': [],
'x': 1010,
'y': 260,
'z': '8429e42d5be21f50'}]}
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "set",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 750,
"y": 260,
"wires": [
[
"aef6a32098eda1e8"
]
]
},
{
"id": "aef6a32098eda1e8",
"type": "debug",
"z": "8429e42d5be21f50",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1010,
"y": 260,
"wires": []
}
]
}
after copying that one to the second instance using:
handler.copy_flow(flow_id)
i get:
200
{'id': '435a67050951dc8a'}
the code used for sending the flow was:
r = requests.post('https://{destination}/flow'.format(destination=self.destination), data=flow, headers=self.headers)
in the node-red log i see:
25 Jan 09:52:12 - [info] Waiting for missing types to be registered:
25 Jan 09:52:12 - [info] - undefined
25 Jan 09:52:12 - [info] Adding flow: Simple-Export [435a67050951dc8a]
if i reload the flows in the destination installation of node red i get following error:
Cannot read properties of undefined (reading 'substring')
i don't have an idea where this undefined is comming from.
thanks for help!