What happens to contacts who have not yet gone through the entire automation, while the end date of a publication has passed?

When the end date of a publication has been reached, no new contacts will end up in the automatic campaign. The contacts that were already triggered still go through the full flow.