I have a trigger that runs on before insert and before update using trigger.new. I am sending data in batches, so the tirgger.new holds multiple records, some inserts, some updates. I also have some processes and flows that update these records as they are inserted/updated. I only want the trigger to run once for each inserted record and run once for each updated record.
What is happening now is that I insert the record, then the process gets called, so the update is run and then all my subsequent records that need to be don't run through trigger because I do a recursive check to make sure there is only 1 run. I could take that out, but then I am going to get multiple runs for each record.
Is there some condition or some way to flag my records that need to be inserts vs the ones that need to be updated?