In Once Upon a Time in the West, Frank says 'who are you?' before dying, revealing that he doesn't know who Harmonica is.
So if he didn't know Harmonica was coming, who sent the three gunmen to kill him in the opening scene?
Frank knew that Harmonica was coming. Because Harmonica told Frank he will come.
This shows that he announced himself prior to coming. Probably even saying on which train he will come. Frank was expecting him (perhaps not knowing who he really was, though.)
Frank is aware of Harmonica's existence and (later) his pursuit to kill him. He is just curious why. A better constructed, reversed "it was Tuesday" trope.
You see, not knowing who his opponent was and what were his motives left Frank without leverage. He mocked people, laughed at their weakness. Having this mysterious person who only says names of people Frank killed leaves him open as dead people don't have soft spots.
Harmonica had contacted in advance a man named Wobbles (interpreted by Marco Zuanelli) to arrange a meeting with Frank:
[Harmonica] You know, Wobbles... I'm kinda mad at you. Frank wasn't there.
[Harmonica] He sent three friends.
[Wobbles] I don't know nothing, I swear. I only arranged the meeting the way... the way you wanted it. I don't know why Frank wasn't there.
Given Frank did not know Harmonica, he probably found the meeting suspicious and decided to send the three gunmen to neutralize the potential threat.