Workflow tasks distributed across namespace-scoped controllers connected to a persistence database.
    Back to Blog
    DevOpsApril 3, 2026

    Scaling Argo Workflows to 10k Daily Jobs

    By Vishkar Platform Engineering Team

    When Argo Workflows Stops Keeping Up

    The sign is subtle at first. Workflow start latency climbs from 3 seconds to 8. Then 20. Then you're watching 400 workflows sit in Pending while your SLA clock is ticking. By the time the on-call engineer is paged, the single Argo Workflows controller has a reconciliation queue of several thousand items and no way to clear it faster than new work arrives.

    We hit this wall migrating a production data platform from ~500 to 10,000+ daily workflow executions across a multi-tenant Kubernetes cluster. None of the solutions were obvious from the documentation. This post maps what broke, why it broke, and the four architectural changes that fixed it.

    TL;DR: A single Argo Workflows controller saturates at ~2,000 concurrent jobs due to etcd write pressure and reconciliation loop throughput limits (Argo Workflows docs, 2024). We resolved this with namespace-sharded controllers, a PostgreSQL persistence backend, WorkflowTemplate caching, and accurate resource requests — cutting p99 workflow start latency from 45s to under 3s and sustaining 12k+ daily jobs.


    How Does the Argo Workflows Controller Become a Bottleneck?

    Kubernetes controllers reconcile desired state against actual state in a tight loop. At low throughput this is invisible, but at scale the loop has hard limits. Argo Workflows' controller processes every workflow event — creation, status update, pod completion, retry — as a reconciliation item. The CNCF's 2023 Kubernetes Scalability Special Interest Group noted that etcd write throughput becomes the primary constraint for high-event workloads above roughly 1,000 concurrent objects (CNCF Kubernetes SIG Scalability, 2023).

    For Argo, the bottleneck has a specific shape. Every workflow node's status update writes back to the workflow CRD in etcd. A complex workflow with 50 nodes generates 50+ etcd writes as it executes. At 2,000 concurrent workflows, each with 20–50 nodes, the etcd write rate saturates the single controller's ability to keep up — and the reconciliation queue starts growing faster than it drains.

    The failure mode looks like CPU trouble but isn't. Controller CPU stays moderate while the reconciliation queue depth climbs. The true constraint is etcd round-trip latency: each CRD write takes 5–15ms, and the controller processes them serially per workflow. You can't fix this by scaling up the controller pod's CPU limits. The architecture needs to change.

    The two proven paths out of this: reduce per-workflow etcd write volume (via nodeStatusOffLoad), or split the controller load across multiple independent controllers (sharding). We needed both.


    How Do You Shard the Argo Workflows Controller by Namespace?

    The Argo Workflows controller processes workflows cluster-wide by default. Sharding replaces this with multiple controller instances, each responsible for a dedicated namespace, using the instanceID label selector to scope processing.

    In practice, each namespace-scoped shard handles approximately 1,500 concurrent workflows before approaching its own throughput limit — a ceiling we measured empirically across three separate migration projects. Adding a new shard (namespace + controller) adds that capacity with no impact on existing shards. The architecture scales linearly.

    The Helm configuration to enable per-namespace sharding:

    # Per-namespace controller via Helm values
    controller:
      instanceID:
        enabled: true
        useReleaseName: true
    

    With instanceID enabled, the controller only reconciles workflows whose workflows.argoproj.io/controller-instanceid annotation matches its own instance ID. Workflows submitted to namespace A are invisible to the controller in namespace B.

    Upgrade and Operational Considerations

    Sharding adds operational surface area. Each shard is an independent controller deployment with its own leader election, its own Prometheus endpoint, and its own resource footprint. When upgrading Argo Workflows, you upgrade each shard's Helm release independently. We recommend automating this with a Helm umbrella chart that iterates over namespaces.

    The tradeoff is worth it: a fault in one shard's controller (crash, OOM, stuck reconciliation) affects only its namespace. In a single-controller setup, the same fault brings down all workflows across the cluster. Blast radius reduction is the real operational win beyond raw throughput.


    Should You Use In-Memory Storage or PostgreSQL for Workflow State?

    The default Argo Workflows persistence store is in-memory. This is fine for development. In production at scale, it causes two specific failure modes that are both damaging and non-obvious until they happen.

    Failure mode 1: Data loss on controller restart. When the controller pod restarts — during a node drain, an upgrade, or an OOM kill — all in-memory workflow state is gone. Running workflows that were mid-execution when the restart happened lose their node status history. They may complete correctly, but the audit trail is gone, and the controller's reconciliation on startup has to re-derive state from the cluster, which is expensive.

    Failure mode 2: Reconciliation storms on startup. Without an external store, the controller bootstraps its view of workflow state by querying every workflow CRD in the namespace on startup. At 10,000+ workflows, this triggers a read storm against the API server that can delay the controller's availability by several minutes — during which no new workflows start. We observed 8–12 minute blackout windows during controller restarts before switching to PostgreSQL.

    The configuration for PostgreSQL persistence with node status offloading:

    persistence:
      connectionPool:
        maxIdleConns: 100
        maxOpenConns: 0  # unlimited — let PostgreSQL manage connections
      nodeStatusOffLoad: true  # moves node status out of CRD into DB
      archive: true            # retains completed workflows for querying
      archiveTTL: 7d
      postgresql:
        host: argo-postgres.argo.svc
        port: 5432
        database: argo
        tableName: argo_workflows
        userNameSecret:
          name: argo-postgres-config
          key: username
        passwordSecret:
          name: argo-postgres-config
          key: password
    

    nodeStatusOffLoad: true is the critical setting. Without it, every node status update writes the entire workflow's node tree back to the CRD — a write that grows quadratically with workflow complexity. With offloading enabled, node status is written to a PostgreSQL row instead, and the CRD stores only a reference. The etcd write payload shrinks by 90%+ for complex workflows (Argo Workflows persistence documentation, 2024).

    Connection pool sizing: maxIdleConns: 100 with no maxOpenConns limit lets each controller shard maintain enough idle connections to handle burst reconciliation activity. Size this based on your expected concurrent workflow count per shard, not based on a default.

    For teams running database migrations alongside workflow automation, see our guide on zero-downtime database migrations — the expand-contract principles covered there apply equally to schema changes in the Argo archive database itself.


    Why Do Inline WorkflowTemplates Slow Down High-Throughput Pipelines?

    When a workflow definition embeds its templates inline rather than referencing external WorkflowTemplate resources, the Argo controller parses and validates those template definitions on every reconciliation cycle for that workflow. At 10k executions per day, this adds up to a significant and completely avoidable CPU cost on the controller.

    After converting our highest-volume workflows from inline templates to WorkflowTemplate resources referenced via templateRef, we observed a 35–40% reduction in controller CPU utilization during peak hours — with no change to workflow logic. The WorkflowTemplate resources are parsed once on first reference and cached for the lifetime of the controller instance.

    The pattern to adopt:

    # Instead of inline template definitions in every workflow...
    # Create a WorkflowTemplate resource once:
    apiVersion: argoproj.io/v1alpha1
    kind: WorkflowTemplate
    metadata:
      name: data-transform-templates
      namespace: data-platform
    spec:
      templates:
        - name: transform-step
          container:
            image: your-registry/transform:v2.1.0
            command: [python, transform.py]
            resources:
              requests:
                cpu: "500m"
                memory: "512Mi"
    
    # Then reference it in workflows:
    templates:
      - name: main
        steps:
          - - name: transform
              templateRef:
                name: data-transform-templates
                template: transform-step
    

    The cache invalidates when the WorkflowTemplate resource is updated. This means template version management becomes important: use explicit version tags in your image references, and increment the WorkflowTemplate when the template logic changes. Avoid latest tags — they make the cache semantics unpredictable.


    How Do Resource Requests and PodDisruptionBudgets Prevent Job Loss?

    At high workflow throughput, the Kubernetes scheduler becomes a secondary bottleneck. When pods have inaccurate resource requests — typically inflated defaults inherited from examples — the scheduler can't bin-pack nodes efficiently, pending pods queue up waiting for headroom that exists but isn't visible to the scheduler, and workflow start latency climbs for a completely different reason than controller throughput.

    Accurate resource requests let the scheduler see actual available capacity. We reduced average pod scheduling latency by 60% by auditing and correcting resource requests on our 10 highest-volume workflow step types, using VPA in Off mode to gather recommendations before applying them manually.

    PodDisruptionBudgets address a separate failure mode: node drains during rolling upgrades or cloud provider maintenance windows. Without a PDB, the Kubernetes drain controller can terminate all executor pods in a namespace simultaneously, abandoning every in-flight workflow step. With a PDB configured:

    apiVersion: policy/v1
    kind: PodDisruptionBudget
    metadata:
      name: argo-executor-pdb
      namespace: data-platform
    spec:
      minAvailable: "50%"   # at least half of executor pods must remain running
      selector:
        matchLabels:
          workflows.argoproj.io/workflow: ""  # matches all workflow executor pods
    

    This forces the drain to proceed gradually — one pod at a time — giving Argo's retry logic time to reschedule displaced steps on available nodes rather than failing them outright. Pair this with a retryStrategy on your workflow templates for defense in depth (Kubernetes PodDisruptionBudget documentation, 2024).


    What Prometheus Metrics Should You Alert On for Argo Workflows?

    Argo Workflows exposes Prometheus metrics on :9090/metrics by default. The metrics that matter for operations are different from the ones that seem important at first glance — workflow count alone tells you very little without phase context.

    The four alerts we've found most operationally valuable, based on running these clusters in production:

    MetricAlert ThresholdWhat It Means
    argo_workflows_count{phase="Running"}> 500 per shardController approaching throughput limit; consider adding a shard
    argo_workflows_count{phase="Pending"}> 100 for > 5 minScheduler bottleneck or controller reconciliation queue building
    argo_pod_missingAnyExecutor pod disappeared without completing — likely a node eviction
    Controller CPU> 80% for > 10 minTemplate cache miss storm or inline template overuse

    The argo_pod_missing alert is particularly important because it surfaces silent job failures. A pod that disappears mid-execution doesn't necessarily trigger a workflow-level failure if the retry budget hasn't been exhausted — but the missing pod metric fires immediately and gives you a window to investigate before a retry cascade begins.

    For Grafana dashboards, Argo Workflows ships a community-maintained dashboard (ID 14318 on grafana.com) that covers queue depth, workflow phase distribution, and pod throughput. Import it as a starting point and add per-namespace panels for shard visibility (Argo Workflows metrics documentation, 2024).


    Results After These Changes

    After deploying all four architectural changes across a four-week rollout:

    • p99 workflow start latency: 45s → under 3s
    • Controller restarts: Weekly (OOM or stuck reconciliation) → zero in three months
    • Daily job capacity: Stable at 12,000+ with 30% headroom before the next shard threshold
    • Reconciliation storm on startup: Eliminated — controller bootstraps from PostgreSQL in under 30 seconds

    The key architectural principle: Argo Workflows scales horizontally through namespace isolation, not vertical controller sizing. Throwing more CPU and memory at the controller doesn't change the etcd write pattern or the reconciliation loop architecture. Design for sharding from day one — retrofitting it onto a cluster with existing workflows is significantly more disruptive than building the namespace structure at the start.


    Frequently Asked Questions

    When does the single Argo Workflows controller become a bottleneck?

    Typically at 1,500–2,000 concurrent running workflows, though the exact threshold depends on workflow complexity (node count per workflow) and etcd performance. The early signal is p99 workflow start latency climbing above 10 seconds. If you're seeing that and your controller CPU is below 70%, etcd write pressure is the likely cause, not resource exhaustion (Argo Workflows GitHub, 2024).

    How do we decide how many namespaces (shards) to create?

    Start with your expected peak concurrent workflow count divided by 1,200 (conservative per-shard limit, accounting for headroom). If you expect 6,000 concurrent workflows at peak, provision 5 shards. Add shards when the argo_workflows_count{phase="Running"} metric for any shard consistently exceeds 500. Namespace boundaries should align with team ownership or pipeline type — don't create arbitrary shards that cross ownership lines.

    Does namespace sharding work with Argo Events?

    Yes. Argo Events sensors and eventsources are namespace-scoped resources. Each namespace's EventBus routes events to workflows in that namespace, which are picked up by that namespace's controller shard. The sharding is transparent to the Events layer — you configure your EventSources and Sensors in each namespace exactly as you would in a single-namespace setup.

    How do we handle Spot node interruption with running Argo workflows?

    Configure a retryStrategy with retryPolicy: OnError on your workflow templates and set a nodeSelector for karpenter.sh/capacity-type: spot on the executor pods. When a Spot node is preempted, the executor pod terminates with an error, Argo retries the affected step, and Karpenter provisions a replacement node. The retry adds latency (typically 30–90 seconds) but preserves job completion. See our cloud cost optimization guide for the full Karpenter NodePool configuration with Argo retry logic.

    Need help scaling your infrastructure?

    Vishkar delivers production-ready Cloud, DevOps & AI solutions for modern engineering teams.

    Schedule a Consultation