The stochastic field-driven depinning of a domain wall pinned at a notch in a magnetic nanowire is directly observed using magnetic x-ray microscopy with high lateral resolution down to 15 nm. The depinning-field distribution in Ni(80)Fe(20) nanowires considerably depends on the wire width and the notch depth. The difference in the multiplicity of domain-wall types generated in the vicinity of a notch is responsible for the observed dependence of the stochastic nature of the domain-wall depinning field on the wire width and the notch depth. Thus the random nature of the domain-wall depinning process is controllable by an appropriate design of the nanowire.