So problem. Basically when you are trying to run a single machine to craft several recipes.
Examples - crusher on a space platform. There's 9 different recipes (3 basic crushing, 3 advanced and 3 for rerolling), more winth mods but you can get away with 1 crusher with some modules and a beacon. All that needs to be done is to have a circuit that reads what's available, what's missing and output the right recipe. For example if 75% of the asteroid sushi is ice asteroids - you need to start transmutting them. Low on copper - advanced metallic crushing, etc.
Second example - Maraxsis. There's two recipes - one takes sea water and a filter and spits out filtered water + dirty filter. Second one - takes dirty filter and clean water and spits out clean filter and more water. Problem is machine that does this comes with inherent 50% quality bonus, so to get this running you need 5 copies, one for each quality. To avoid - need a circut that reads what's available and produces the recipe.
Example circuit that would craft gears from iron of any available quality.
constant combinator with signals: 1 iron gear, 2 uncommon iron gears and up to 5 legendary gears. Quantities must be different, here - 1..5.
Decider combinator with groups:
Normal iron plate (from green input) > 0 AND EACH == 1 (from red input) OR
Uncommon iron plate (from green input) > 0 AND EACH == 2 (from red input) OR
...
Legendary iron plate (from green input) > 0 AND EACH == 5 (from red input) OR
Output EACH from red.
Connect constant combinator to red input, connect chest with gears to green input, connect output to the assembler and pick "set recipe".
Annoying part is to making sure every input is selected and clicked right.
Try making it yourself by hand, see how it works.