- PreSync — run before the main sync step.
- Sync — the normal synchronization of non-hooked resources.
- PostSync — run after a successful sync.
- SyncFail — run when a sync fails.
- PreDelete / PostDelete — run during deletion lifecycles.

- An Nginx Deployment
- A database migration Job
- A cleanup Job
When I created the Application, Argo CD started applying the manifests. Because none of the resources had hook annotations initially, Argo CD applied the three manifests concurrently. The result was that the cleanup Job, the migration Job, and the Nginx deployment were all created at the same time.

- Run the migration Job first.
- When the migration Job completes successfully, create the Nginx Deployment.
- After the Deployment is ready, run the cleanup Job.
- Mark the migration Job as PreSync:
- Leave the Nginx Deployment as a regular resource (applied during Sync).
- Mark the cleanup Job as PostSync:
By default, Argo CD applies resources concurrently. Use hook annotations (for example,
argocd.argoproj.io/hook: PreSync or PostSync) to enforce ordering for tasks like database migrations or cleanup. For full details and advanced hook lifecycle options, refer to the Argo CD Sync Hooks documentation: https://argo-cd.readthedocs.io/en/stable/user-guide/hooks/