Geometry node procedural asset

I have a model of a rectangular box that contains products arranged in a 2×4 grid. Inside the box, there’s a foam insert with cutouts where each product is placed.

I want to make this setup procedural in Blender, so that the box automatically resizes when I change the number of products in the array. The box already has a rig that controls its size.

The idea is to use Geometry Nodes (and possibly a Boolean setup) so that:
• The number of products can be adjusted in both X and Y directions.
• The foam and box dimensions automatically adapt to fit the total array.
• The box rig’s scale or size is driven by the bounding box of the product array.

I’m looking for tutorials or guides that explain how to achieve this, ideally covering array setups, Boolean operations for foam cutouts, and using bounding box data to drive the rig parameters procedurally.

I’m not sure how to make the array part, but I can make a box that adapts to multiple objects’ dimensions. I haven’t seen your box setup, so this might not apply 1 to 1, I used a cube as the box and resize it in the nodes.

Here is a file. I have labelled the setup as well as I can. Hopefully it’s clear. The foam objects are part of a collection and placed manually, but you could replace the collection info node with some other array generating setup.

foams_box.blend (650.5 KB)