The decision that it is worth doing something rather than nothing is a core yet understudied feature of voluntary behaviour. Here we study "willingness to act", the probability of making a response given the context. Human volunteers encountered opportunities to make effortful actions in order to receive rewards, while watching a movie inside a 7 T MRI scanner. Reward and other context features determined willingness-to-act. Activity in the habenula tracked trial-by-trial variation in participants' willingness-to-act. The anterior insula encoded individual environment features that determined this willingness. We identify a multi-layered network in which contextual information is encoded in the anterior insula, converges on the habenula, and is then transmitted to the supplementary motor area, where the decision is made to either act or refrain from acting via the nigrostriatal pathway.