The extension of on-board data processing capabilities is an attractive option to reduce telemetry for scientific instruments on deep space missions. The challenges that this presents, however, require a comprehensive software system, which operates on the limited resources a data processing unit in space allows. We implemented such a system for the Polarimetric and Helioseismic Imager (PHI) on-board the Solar Orbiter (SO) spacecraft. It ensures autonomous operation to handle long command-response times, easy changing of the processes after new lessons have been learned and meticulous book-keeping of all operations to ensure scientific accuracy. This contribution presents the requirements and main aspects of the software implementation, followed by an example of a task implemented in the software frame, and results from running it on SO/PHI. The presented example shows that the different parts of the software framework work well together, and that the system processes data as we expect. The flexibility of the framework makes it possible to use it as a baseline for future applications with similar needs and limitations as SO/PHI.