This paper presents a novel mixed-integer linear programming (MILP) formulation for the Tank Farm Operation Problem (TFOP), which involves simultaneous scheduling of continuous multi-product processing lines and the assignment of dedicated storage tanks to finished products. These products are not allowed to mix in storage tanks. Therefore, once an assignment is made, it has to be maintained until the end of the operating horizon. Since all products processed by finishing lines have to go into the tank farm before being shipped, there is the potential to run out of storage, ultimately impacting the throughput of the finishing lines, a condition known as blocking. The objective of the problem is to minimize blocking of the finished lines by obtaining an optimal schedule and an optimal allocation of storage resources. The scheduling part of the model is based on the Multi-operation Sequencing (MOS) model by Mouret et al., (2011). The formulation is tested in three examples of different size and complexity. The possibility of incorporating the MILP model into a decision support system in combination a Discrete Event Simulation (DES) model of a tank farm is also discussed.