But what process are you automating? Levels? FX? Pan?
If you're talking about automating levels, then you'll more often than not want to compress first. Then you're automating the compressed instrument. If you automate your levels first, the you'll be applying compression to the automated signal with can wind up modifying some of the automation.
If you're automating FX, then you want to treat it like a normal signal chain. Do you want to compress the EQ or EQ the compression? That's your choice.
If you're automating pan, the order doesn't directly matter that much.
G.