Any resolution to a story that does not pay due regard to the story's internal logic and that is so unlikely that it challenges suspension of disbelief, and presumably allows the author, director, or developer to end the story in the way that he or she desired
Oh, now I'm backed into a corner, and can't devise a way out. I could sure use a deus ex machina right about now!.
A contrived solution to a problem, relying on an agent external to the situation
We used a sale of the business at a ridiculously high multiple to make the numbers work, a deus ex machina.
{i} someone or something which unexpectedly comes to the rescue at the last moment (especially in a book or play)
Stage device in Greek and Roman drama in which a god appeared in the sky by means of a crane (Greek, mechane) to resolve the plot of a play. Plays by Sophocles and particularly Euripides sometimes require the device. The term now denotes something that appears suddenly and unexpectedly and provides an artificial solution to an apparently insoluble difficulty