1. Read the shipment CSV. From a file drop, an inbox, an SFTP, or a portal export. The flow handles whatever lands.
2. Detect the country field. Some files put it in "Destination Country," some in "DEST_CTRY," some in a free-text address block. The AI step finds the right column on each file.
3. Resolve every variant through AI. "USA," "United States," "U.S.A.," "U S," and "America" all collapse to the same answer. Same for "England" and "Great Britain" rolling up under the UK, or "Czechia" matching "Czech Republic."
4. Map to ISO 3166-1 alpha-2. Two-letter code on every row. The reference table is built into the flow and updates when the ISO list changes.
5. Export the enriched file. Original columns preserved, new country code column appended, optional flag for any row the AI couldn't resolve so a human can review.