9. 5 .
Given a1a2⋯an=2007, we know that a1,a2,⋯,an are all odd numbers. Also, a1+a2+⋯+an=2007 is an odd number, so n is odd.
If n=3, i.e., a1+a2+a3=a1a2a3=2007, without loss of generality, assume a1⩾a2⩾a3, then
a1⩾3a1+a2+a3=669,a2a3⩽a12007⩽3.
If a1=669, then a2a3=3. Thus,
a2+a3⩽4,a1+a2+a3⩽673669, only a1=2007,a2a3=1 and a2+a3 =0, which is impossible.
Therefore, n⩾5.
Also, 2007+1+1+(−1)+(−1)=2007×1×1×(−1)×(−1)=2007,
Thus, the minimum value of n is 5.