1. Get Input Data - This is where you get an array of objects/data (or return a search)
2. Map -This runs for EACH item in the array returned by the get input data phase and you group them based on some criteria
3. Reduce - This runs for each grouping done in the map phase
4. Summarize - This runs once the script has finished all other phases
You don't have to have a map phase or reduce phase but you need 1 or the other. For example if you don't need to group anything, you don't need the map phase and reduce will one 1 time per item in array returned from get input data