Abstract The primitively eusocial wasp Ropalidia marginatashows an age-based division of labor in which workers allocate tasks according to their relative ages (age ranks). This age polyethism seems quite flexible because in colonies devoid of old workers, young individuals can perform the tasks normally performed by older workers. Social interactions appear to be a plausible mechanism by which workers can assess their relative ages. To explore possible proximate mechanisms that can potentially generate such a flexible, age-based task allocation, the activator-inhibitor model was adapted to the social biology of R. marginataand tested using computer simulations. The model generated a clear age polyethism including the phenomena of precocious foragers in colonies with only young individuals and reverted nurses in colonies consisting of only old individuals. A simple extension of the model to allow the brood:adult ratio to modulate the rates of social interactions, shows how increasing task demands can be met by a decrease in the ages of first performance of, and an increase in the proportions of individuals engaged in, various tasks. These results show how a pattern of division of labor based on relative age can be generated and modulated by social interactions.