That actually is a basic vector geometry stuff.
Considering you wan’t to move from A to B with speed X, the direction vector C would be B - A, then you normalize C (making it a vector with length of 1) and multiply it by X.
So something like D = B.substract(a).normalize().mult(X);
And then you set your node translation to A + D
In your case you will actually have to check if the result vector’s, say, D’s, length is greater than distance between B and A, and if it’s true then you just set the node translation to B