Social insects provide us with a powerful metaphor to create decentralized systems of simple interacting, and often mobile, agents. The emergent collective intelligence of social insects – swarm intelligence – resides not in complex individual abilities but rather in networks of interactions that exist among individuals and between individuals and their environment. In particular, a recently proposed model of division of labor in a colony of primitively eusocial wasps, based on a simple reinforcement of response thresholds, can be transformed into a decentralized adaptive algorithm of task allocation. An application of such an algorithm is proposed in the context of a mail company, but virtually any type of flexible task allocation can be described within the same framework.