I just sealed some large gaps on wood trim out side my house, with spray foam and pan to seal over the cured foam with caulking.
Should i prime the foam first or caulk directly over it?
I think you're talking about Great Stuff or the like. I've done both. The stuff doesn't like the UV so I don't think primer alone is gonna do much for you except maybe firm it up some for the caulking. The caulking is what's non-negotiable.
"Where all think alike, no one is thinking very much"