At what rate and what length would you do a CD?

I am seeing online savings account at around 3.2%. I’m seeing CDs between 3.5-4.5% for 8-12 months. And what amount and length would you consider a CD? Best to forgo the higher interest rate with a CD and just do an online savings account for the flexibility of not being tied to a particular time period?