Skip to content

feat: delete Workflow CR from K8s upon successful archiving #15104

@qa-denis-huber

Description

@qa-denis-huber

Summary

Add a configuration option to automatically delete Workflow CRs from Kubernetes upon successful archiving to
the database.

Current mechanisms don't provide this:

  • archiveTTL - deletes from the database, not K8s
  • ttlStrategy - deletes from K8s based on time, not archive status
  • retentionPolicy - deletes from K8s based on count, not archive status

Using ttlStrategy with archiving is a time-based workaround, not an event-based guarantee. There's currently
no way to delete the K8s resource strictly upon successful archiving.

Use Case

  • Guaranteed cleanup after archival: Ensure workflows are only removed from K8s once safely persisted to the
    database
  • Reduce cluster resource usage: Automatically clean up CRs without relying on arbitrary time delays
  • Avoid data loss: Time-based TTL may delete workflows before archiving completes (or archive may fail
    silently)

Proposed Solution

Add a new configuration option in the workflow-controller-configmap:

persistence:
  archive: true
  deleteOnArchive: true  # New option: delete Workflow CR after successful archiving

Behavior:

  1. If archiving succeeds AND deleteOnArchive: true: delete the Workflow CR from K8s
  2. If archiving fails: retain the Workflow CR

Message from the maintainers:

Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions