Be going to expresses intention to do something in the relatively near future and there is a notion of some preparations made in advace to perform the future activity (I'm going to do that).
Will expresses only intention to do something in the future, near or remote one, without that notion of preparations for the action intended. Will can also emphasise deter