Taking There were a record of 28,000 runners, OP asks whether the verb (were) should agree with the nearest noun (singular "record"), or the most important (plural "runners"). Note that "runners" is most important noun, because the sentence cannot make any sense without it.
I prefer the plural, but grammatically it's significant that I would always discard the word "of".
Googling, for example, quotated "There were a record five" [million viewers for the big match/whatever], gets less than 5000 hits - compared to 240,000 for "There was a record five...". Thanks to @Peter Shor for checking these figures to show they are an extreme example of Google's unreliable guestimate About nnn results. In reality there are only about 80 hits for "were", and barely a dozen for "was". Not only are the original estimates out by orders of magnitude - they're even misleading in terms of which is the more common form.
I agree with other comments below that without "of", "record n" is an adjectival phrase modifying runners/viewers/whatever. Grammatically there's no doubt the plural is correct in this case.
The singular would be correct if "of" were present, but to be honest I find that construction so ungainly I would never use it in OP's example context. Nor would others, it seems - scanning the first hundred written instances of "was a record of" in NGrams, I don't see a single example reflecting OP's usage (effectively, they're all a recording of).