diff --git a/packages/node_modules/@node-red/runtime/lib/flows/index.js b/packages/node_modules/@node-red/runtime/lib/flows/index.js index 8d6fe1873..55d5b2dc5 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/index.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/index.js @@ -160,8 +160,15 @@ function setFlows(_config,_credentials,type,muteLog,forceStart,user) { var credsDirty; if (_credentials) { + credentials.clean(config); // A full set of credentials have been provided. Use those instead - configSavePromise = credentials.load(_credentials); + let credentialSavePromises = []; + for (let id in _credentials) { + if (_credentials.hasOwnProperty(id)) { + credentialSavePromises.push(credentials.add(id,_credentials[id])); + } + } + configSavePromise = Promise.all(credentialSavePromises); credsDirty = true; } else { // Allow the credential store to remove anything no longer needed