The main problem with your tactic is the 4th step. Grafts require XP so mass-creating them may cause problems.

A fair point. I was thinking of making one of the Mind flayer cabal members be one of those master artisan artificers who can crank out stuff without XP cost.
I'm not sure whether you need Humanoids to be the target of Liquid Pain (reduces the amount of crafting XP needed when subsumed in making it!) but I believe it reduces the target's CON by 1 for every dose it takes. Correct me if I'm wrong, I'm AFB at the moment.

(I'm assuming you're thinking pure RAW, and trap cheese is okay)

Electricity spell trap (using shocking grasp, or a Elemental Substitutioned Ray of Frost?) + Pain Extractor + Shambling Mound = Infinite crafting XP, eventually. You'll just have to make it part of your factory.

Alternatively, you could just use a sequential Polymorph Any Object Trap to produce hapless commoners. Since Liquid Pain is based off of Con (I think.) it would be easiest to use Mongrelfolk.

Pebble -> Mongrelfolk
Mongrelfolk -> Mongrelfolk.

From out of the clay rises a grand harvest of pain! Then, when the mongrelfolk die, you recycle them through a dispel magic trap, and they come out good as new as new mongrelfolk. Of course, this is irredeemably evil and nasty and you should be ashamed of yourself, but since you're going for the thralls of mind flayers, mindless undead foetus dragon troll golems, I don't think this will be a problem.

Also, wow. Half Golem grafts are dang cheap.