"to be to" is hard to explain because it can have many different meanings, but in each case, usually only one meaning is correct. These meanings can include:
"I am to"
=I should or I am supposed to
=I must
=I will or I am going to
In the past tense, "I was to", it often means something that should have happened but did not. "I was (going/supposed) to fly to London this morning, but the weather was too bad."