Each contact may carry its own optional external_id — the stable identifier from your source ERP (for example, Clage's ASP_ID). The upsert priority within a parent is:
external_idwhen present on both sides — preferred because email and name can drift on the source system.emailfor contacts without anexternal_id.(name, phone)as a last resort for email-less contacts.
A row whose parent_type / parent_id cannot be resolved fails at the per-row level — the rest of the batch is unaffected.