In this article, we attempt at developing a scenario for the self-organization of goal-directed systems out of networks of (chemical) reactions. Related scenarios have been proposed to explain the origin of life starting from autocatalytic sets, but these sets tend to be too unstable and dependent on their environment to maintain. We apply instead a framework called Chemical Organization Theory (COT), which shows mathematically under which conditions reaction networks are able to form self-maintaining, autopoietic organizations. We introduce the concepts of perturbation, action, and goal based on an operationalization of the notion of change developed within COT. Next, we incorporate the latter with notions native to the theory of cybernetics aimed to explain goal directedness: reference levels and negative feedback among others. To test and refine these theoretical results, we present some examples that illustrate our approach. We finally discuss how this could result in a realistic, step-by-step scenario for the evolution of goal directedness, thus providing a theoretical solution to the age-old question of the origins of purpose.