Not sure if I understand the question, or even the problem.
Abilities can start montages by using the ability task fittingly called PlayMontageAndWait, and this is usually what you’re expected to use when dealing with montages in the context of an ability, such as for example a cast animation that plays prior to firing a projectile. Due to being an ability task, it has multiple outputs that help in tying functionality to the montage(4, namely On Completed, On Blend Out, On Interrupted and On Cancelled). The only annoying thing about doing it that way is that you can’t really set up an animation that triggers the rest of the ability’s effect halfway through without playing around with a separate delay task, but that can be solved by splitting the casting montage of choice into a pre-effect and a post-effect montage.
Tying abilities to a cast animation, so the other way around, is usually a suboptimal idea, because abilities should be designed to be as self-contained as you can make them. Having the montage and, by extension, its length be defined outside of the ability seems counterproductive to this goal. Moreover, due to the fact that abilities have access to tasks and can pretty much end themselves whenever they want, there is no real benefit from doing it the other way around than intended.
That being said, I would think that a cosmetic/purely visual animation as a result of a gameplay effect, such as a “flailing and panicking because on fire” animation or some such thing could probably be handled as part of a gameplay cue. Not sure actually. It would make sense to me because these are the kinds of things gameplay cues are used in general and ability systems can only play one montage this way at a time(for fairly obvious reasons), but I don’t know if there’s any important interactions to watch out for(you would probably have to check if you aren’t overwriting a montage a montage ability task before playing such an animation, though. The ability system keeps track of the montage that’s currently playing as a product of a task, but I don’t know the name of the getter function or if it’s evenr eadily available).
But yeah, if your animation isn’t 100% cosmetic, use the ability task. You could even make a child ability class for generic “Play Montage X and, when successful, follow through with effects defined in function Y” kinda abilities.