We propose a drastically new method for generating single photons in a deterministic way by interaction of electron beams with optical waveguides. We find a single swift electron to produce a guided photon with large probability. The change in energy and propagation direction of the electron reveals the creation of a photon, with the photon energy directly read from the energy-loss spectrum or the beam displacement. Our study demonstrates the viability of deterministically creating single guided photons using electron beams with better than picosecond time uncertainty, thus opening a new avenue for making room temperature, heralded frequency-tunable sources affordable for scientific and commercial developments.