I have a memory of a goldfish since I'm not recording all the discussion and questions I had.
What is the optimal number per anime/slave/village to each workstation?
Is there a thing called overcapacity? This is when you allocate too many NPCs to a workstation to have it function properly.
From what I read in this thread, it has a limit.
General rule is 3 workers per job site. (3 workers working simultaneously at the same time.) There are exceptions though. And depending on playstyle/base layout you might want a slight overcapacity anyway to cover for downtime and travel time.
But how does this work when assigning a NPC to work on the farm?
Farm (planters) is one of the exceptions. Planters can only have 1 worker working on them for every 4 plots they have, so 1 worker for the small wooden planter and 2 workers for the large stone one.
If you're talking about livestock farms instead then I think it's also another exception -- 1 worker per "breeding" pen. (more like a livestock pen, but eh.)
--
Some caveats:
1. NPCs don't respect their territory circles when picking job sites. So long as their territory circle is set to anything higher than the minimum, they will search for valid job sites in a huge 10m radius (10m = horizontal width of 4 stone platforms) whenever a "work check" occurs. This makes it hard to limit NPCs to specific job sites.
2. "Work checks" only happen in active cells. The whole map is divided into 400
square cuboidal cells (think they stretch the whole height ), each with their own map ID (visible using /mapID). Most of the time only the current cell the player is in plus the eight surrounding cells are active. (Additional cells will be loaded when a raid is ongoing.) In other words, NPCs will stop working when you're far away enough from them.
There is some sort of code running to compensate for lost work time in inactive cells when you return, but I think it only works properly for mining/logging/excavation.