Repack with dynamic assemblies

We must track inventory of our customers. Goods could be stored as packed in bags, or as bulk in cylos. The problem I’m struggling with is if I have 1 pallet of 4 bags with 55kg of coffee in each and I have 10 such pallets on location A. And tomorrow I need to dispatch just one bag out of that location, how could I repack it? Feels like I must repack one pallet into 4 bags + 1 cp7 palet and then remove 1 bag out of it? does this mean all sub items should be predefined before repack? What if I need to assemble different items together in one pallet, i.e 2 bags of coffee and 1 bag of rice?