Process flow with odd number of products

Hello to all, I’m struggling with the process modelling and I’d appreciate your help.

I would need to create a process flow like this:

  1. Process feeder creates an exact amount of products, let’s say 31 like 1st order.
  2. Products are transported by conveyor to the next process point, where some process is done, for example, change color.
  3. Third process point is a place where AGV should pick parts up and transport them to the final destination.

But I’d need to take two parts at once by AGV and if the order has an odd number of products, the last one must be also transported.

Then new order is created and the whole process is repeated with only one difference, I have more final destinations, where whole order should be transported to.

Very appreciates your help or advice.
L.