How to determine source of Elements save event
First, you'll want to check if what is being saved is a draft or revision, and if so, ignore it for your purposes. You can check via:

use craft\helpers\ElementHelper;


if (!ElementHelper::isDraftOrRevision($element)) {
}



Next if you want to avoid doing anything during "bulk saving events", on Craft 3.1.22 or later there is:

if (!$element-&gt;resaving) {
}



...which was added in Craft CMS 3.1.22

Some additional discussion that might be useful: Improve behaviour for automatic resaving of entries when saving an entry type