I finally figured out (or better, was told) that if you make an unsiged tx, then sign it, then check the raw tx before broadcasting you can see what size it will be.
sounds like this is what I want to know.
Can you elaborate on this?
My point is that I would like to automate some payments, but I cannot know in advance how many unspend output will be used by the transaction.
As far as I understood, the outputs will be reused following the "first in, first out" policy, and I would like to deduce the transaction fees from the transaction.
so for a given amount, I should make an unsiged tx, sign it and check the raw tx size.
then, compute the amount of fee that I want to spend.
and make another transaction with the appropriate transaction fee.
right?