Does deleting an argo cron workflow delete all argo workflows started by it as well Does deleting an argo cron workflow delete all argo workflows started by it as well kubernetes kubernetes

Does deleting an argo cron workflow delete all argo workflows started by it as well


To add to Michael's answer:

CronWorkflows are owners of all the Workflows they spawn, so how their respective Workflows are deleted when the parent CronWorkflow is deleted is governed by Kubernetes' Garbage Collection policies. Argo does not delete the child Workflows of a CronWorkflow when the latter is deleted, Kuebrnetes does. You can see the Kubernetes doc for more options on how to manage this.

(Edit: adding more info)

For example, to delete a CronWorkflow while leaving its children Workflows intact, you can run:

kubectl delete cwf my-cwf --cascade=false

Source: I developed the CronWorkflow feature.


If you want to keep workflow data around for a while, you should persist them to a database using Argo's workflow archive tool.

Just to confirm your issue, I did a quick test using their "hello-world" cron workflow:

apiVersion: argoproj.io/v1alpha1kind: CronWorkflowmetadata:  name: hello-worldspec:  schedule: "* * * * *"  timezone: "America/Los_Angeles"   # Default to local machine timezone  startingDeadlineSeconds: 0  concurrencyPolicy: "Replace"      # Default to "Allow"  successfulJobsHistoryLimit: 4     # Default 3  failedJobsHistoryLimit: 4         # Default 1  suspend: false                    # Set to "true" to suspend scheduling  workflowSpec:    entrypoint: whalesay    templates:      - name: whalesay        container:          image: docker/whalesay:latest

Deleting the cron workflow does indeed delete the hello-world workflow kicked off by it. I'm especially confident because I have other workflows that have been sitting on my Minikube cluster for days without being deleted.

If you don't want to use the workflow archive, you can use kubectl edit cronworkflow <workflow name>. I just tested, and the update will not delete the child workflows.

If you're using something like Kustomize or Helm, it's possible your changes might delete/recreate the cron workflows rather than simply patching them. You'd have to check the docs of those projects.

I agree, the docs should be more clear. I'd recommend opening a PR against their argo cron delete page.