Inspired by works of Casteras (Pacific J. Math., 2015), Li-Zhu (Calc. Var., 2019) and Sun-Zhu (Calc. Var., 2020), we propose a heat flow for the mean field equation on a connected finite graph $G=(V,E)$. Namely $$ left{begin{array}{lll} partial_tphi(u)=Delta u-Q+rho frac{e^u}{int_Ve^udmu}[1.5ex] u(cdot,0)=u_0, end{array}right. $$ where $Delta$ is the standard graph Laplacian, $rho$ is a real number, $Q:Vrightarrowmathbb{R}$ is a function satisfying $int_VQdmu=rho$, and $phi:mathbb{R}rightarrowmathbb{R}$ is one of certain smooth functions including $phi(s)=e^s$. We prove that for any initial data $u_0$ and any $rhoinmathbb{R}$, there exists a unique solution $u:Vtimes[0,+infty)rightarrowmathbb{R}$ of the above heat flow; moreover, $u(x,t)$ converges to some function $u_infty:Vrightarrowmathbb{R}$ uniformly in $xin V$ as $trightarrow+infty$, and $u_infty$ is a solution of the mean field equation $$Delta u_infty-Q+rhofrac{e^{u_infty}}{int_Ve^{u_infty}dmu}=0.$$ Though $G$ is a finite graph, this result is still unexpected, even in the special case $Qequiv 0$. Our approach reads as follows: the short time existence of the heat flow follows from the ODE theory; various integral estimates give its long time existence; moreover we establish a Lojasiewicz-Simon type inequality and use it to conclude the convergence of the heat flow.