Not sure if web3 syntax has changed, but if you encounter the error value.forEach is not a function you need to put the parameters in the function call into an array, such as aInst.setX([bInst.address])
– James CameronOct 8 '18 at 20:01

That's because it doesn't support the "async" keyword. Which Node version do you use? Anyway, you should be able to rewrite this as a chain of then-s, without async. The first async is not needed, you may start with removing it and see how the rest works.
– uluApr 23 '18 at 15:20

Thank you for help, I already reviewed documentatop you've pointed. Unfortunately it simply does not works. In your example I got error TypeError: A.setX is not a function.
– Alex G.P.Nov 13 '17 at 8:10