Current density inhomogeneities on electrodes (of physical, chemical, or optical origin) induce long-range electrohydrodynamic fluid motion directed toward the regions of higher current density. Here, we analyze the flow and its implications for the orderly arrangement of colloidal particles as effected by this flow on patterned electrodes. A scaling analysis indicates that the flow velocity is proportional to the product of the applied voltage and the difference in current density between adjacent regions on the electrode. Exact analytical solutions for the streamlines are derived for the case of a spatially periodic perturbation in current density along the electrode. Particularly simple asymptotic expressions are obtained in the limits of thin double layers and either large or small perturbation wavelengths. Calculations of the streamlines are in good agreement with particle velocimetry experiments near a mechanically generated inhomogeneity (a "scratch") that generates a current density larger than that of the unmodified electrode. We demonstrate that proper placement of scratches on an electrode yields desired patterns of colloidal particles.