First off: the very fact that you're thinking about workgroups as opposed to, say, food in general, is a big step in the right direction
Food production is still the most complicated part of the game, and even the most veteran players still have to experiment with every single town to find a setup that works. The reason is that so much of the work the townies have to do is
indirectly related, rather than obvious cause-and-effect. For example, the map itself is a massive factor in food production; but there's nothing to jump out and say "hey, the reason everyone is starving isn't because of a lack of crops, it's because your farmers have to walk the perimeter of the map to get to the farms".
Honestly, there are soooooooo many variables at play here that it's impossible to give a formula for stable food production; but I can give some guidelines. I use these myself and I developed them the hard way over my whole time playing the game - they're constantly being tested and adjusted even as I play now.
1. <FillPCT> is king. Most players would disagree, and this advice is going to cut against the grain of 80% of everything else I advocate, but in my experience it's always best to max out your food's fill value even if it means heaps of extra work producing the food. The reason is that more fill = more time between meals, which means a much greater chance for crops to ripen and a lot more time for your townies to do other things between food tasks (even your farmers need a chance to improve upon and increase the size of the farms; they can't do that if they're constantly harvesting to keep up with demand). Even though the Special Roast is insanely expensive as a food choice, it's also insanely effective once you get it stable - two days between meals, mixed happiness bonus and enough fill value to get your townies right down to the dungeon bottom and back again? Yes please!
2. There is no such thing as a "perfect fit" when it comes to food. Everything has a random element - the food itself will have a semi-random effect in terms of how much it fills, the townie has a semi-random time between meals, which townie gets the food is randomly determined... even if you have a perfect balance one minute, a series of unlucky rolls (low fill values, long growing times for crops, not-very-hungry townies eating the big meals while starving townies only get raw fruit) could see your town approaching a famine. You always have to have a wide margin of error and an "emergency stockpile" or ten - that doesn't literally mean having barrels of prepared food locked away (although that's a popular tactic), I like to have a forest of wild fruit trees which I can order to be harvested in the times that the automated harvesting runs thin.
3. Don't be afraid to get messy. Just as there's no perfect fit, there's no "clean" equation to how much food a townie eats. If your peons have to eat raw badger meat, they have to eat raw badger meat - starving townies only puts more strain on your food supply (even if 90% of your population starves, that leaves 10% to harvest and cook and haul ingredients and do everything else; and if you don't immediately get in and cancel the unneeded production tasks your townies could well starve themselves trying to feed the already-starved population). Butchering is by far the messiest food source - the animals need feeding, yields look low, there are heaps of steps and even more to consider, but you can avoid most of those by simply using up the animals as soon as they're bred. Contrary to what I said about "buffer zones", if you produce as few livestock as possible you can still get meat which is essentially free; especially early on.
4. Over-prepare, over-staff, under-work. Whenever you can, have more utils for foodmaking than you strictly need; have more food workers than you need; over-stock on raw ingredients etc. It ties in with points 2 and 3, but I can't stress enough how important it is to have that buffer zone so that your "emergency response" is ready to go when you notice your townies getting hungry. The other good thing about having under-worked food crews is that you can send them fishing; which massively boosts your average happiness. Whenever you have idle townies, put them in the farming group and have fishing tasks queued and you'll get very happy townfolk - the same is true for new immigrants, unless you're immediately putting them somewhere they're needed (e.g. guards or construction workers for your siege-proof wall) stick them in with the farmers. Speaking of immigrants, have their first few meals ready before they come to the town - it may seem obvious put like that, but "enough food for now" is not "enough food for the future when new people show up" - as I said before, even if your stocks are stable now it only takes a string of bad rolls for it to all come crashing down. If those bad rolls come when the system is already stressed by immigrants... well, that's just asking for a famine.
5. Keep your farms close and loose. By that, I mean make sure that your farms are within the same screen width as your food production buildings, and don't tightly squeeze the farms into small spaces. Most crops have a chance to drop multiple products when harvested, and even single-product crops like wheat will need somewhere for their product to be dropped. I like to leave 1 row between crops, or even 2 rows for fruit trees, to maximise the chances for extra drops and to give the townies somewhere to put the products after harvesting. Most players would say that it's best to put barrels around your farms so that townies will take the products straight to them, but I disagree - I prefer to have my raw food barrels
inside my kitchen and bakery (naturally the bakery one only accepts wheat and flour, though I'll usually also have a prepared food barrel full of fruit too), so that the food is carried straight from the fields into where it's going and thus eliminating the need for the chefs to walk out to the fields to get ingredients.
6. Layering and irrigation. You can grow food underground, inside mountains, even in "tiers" by mining out alternate layers of a hill. I don't like the feel of that, but that's a purely personal preference - if you want to turn your grassy hills into a layer-cake farm, more power to you. If that offends your sense of realism, consider terrace farming - IMO it looks amazing, and it means you can move your crops off the premium flat grassy areas and leave them free for animal farms.
All of that said, you will still need a big protion of your population in food production to keep everyone fed; I'd say 50% with a really good setup. Remember, work with your map rather than against it - if there's a snowcherry grove nearby then make snowcherry pie; if there's a jungle nearby but no room for wheat then look at jungle salad and mushroom soup. Never be afraid to fall back on foraging to supplement your farming, but always
always be active in your food supplies - don't rely on your backups, build in redundancies if you want "set and forget" production or else prepare to constantly monitor your food supplies.
It's not meant to be super-easy, but you can pick it up quickly with some experiments and some planning. I fall else fails, set everyone to food production and wait for a large buffer to build up before going on with new projects - sometimes you do just have to take the game one step at a time. Good luck

What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.