I would not immediately consider using an enrichment rule for that. Enrichments are usually used to add, delete or update CI's. When updating a CI using the enrichment function of uCMDB one usually modifies an attribute directly, with a discrete value. I would consider modifying the host inventory script (by Shell or WMI) and fill your new attribute directly, counting the number of processes and returning the count variable.
The code below for example, when added to TTY_HR_Process_Lib.py (replacing the old addProcess routine) will update a custom Node CIT attribute called "number_processes":