Argo Cron Workflows API

Operations for managing scheduled cron workflows

OpenAPI Specification

argo-cron-workflows-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Argo CD Applications Cron Workflows API
  description: The Argo CD API provides REST endpoints for managing GitOps continuous delivery on Kubernetes. It enables creating and managing applications, projects, repositories, clusters, and certificates. The API supports syncing application state to match the desired state declared in Git, querying health and sync status, managing access control, and configuring notifications. All operations require authentication via bearer token obtained from the session endpoint.
  version: v2.x
  contact:
    name: Argo CD Community
    url: https://argo-cd.readthedocs.io/en/stable/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://localhost/api/v1
  description: Argo CD Server (default in-cluster address)
security:
- bearerAuth: []
tags:
- name: Cron Workflows
  description: Operations for managing scheduled cron workflows
paths:
  /cron-workflows/{namespace}:
    get:
      operationId: listCronWorkflows
      summary: Argo Workflows Argo List Cron Workflows
      description: Returns a list of cron workflows in the specified namespace.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      - name: listOptions.labelSelector
        in: query
        description: Label selector to filter cron workflows
        schema:
          type: string
      responses:
        '200':
          description: List of cron workflows
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronWorkflowList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: createCronWorkflow
      summary: Argo Workflows Argo Create a Cron Workflow
      description: Creates a new cron workflow in the specified namespace.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CronWorkflowCreateRequest'
      responses:
        '200':
          description: Cron workflow created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronWorkflow'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /cron-workflows/{namespace}/{name}:
    get:
      operationId: getCronWorkflow
      summary: Argo Workflows Argo Get a Cron Workflow
      description: Returns a specific cron workflow by name.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      - $ref: '#/components/parameters/CronWorkflowName'
      responses:
        '200':
          description: Cron workflow details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronWorkflow'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: updateCronWorkflow
      summary: Argo Workflows Argo Update a Cron Workflow
      description: Updates an existing cron workflow.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      - $ref: '#/components/parameters/CronWorkflowName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CronWorkflowUpdateRequest'
      responses:
        '200':
          description: Cron workflow updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronWorkflow'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteCronWorkflow
      summary: Argo Workflows Argo Delete a Cron Workflow
      description: Deletes a specific cron workflow by name.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      - $ref: '#/components/parameters/CronWorkflowName'
      responses:
        '200':
          description: Cron workflow deleted
          content:
            application/json:
              schema:
                type: object
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /cron-workflows/{namespace}/{name}/resume:
    put:
      operationId: resumeCronWorkflow
      summary: Argo Workflows Argo Resume a Cron Workflow
      description: Resumes a previously suspended cron workflow.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      - $ref: '#/components/parameters/CronWorkflowName'
      responses:
        '200':
          description: Cron workflow resumed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronWorkflow'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /cron-workflows/{namespace}/{name}/suspend:
    put:
      operationId: suspendCronWorkflow
      summary: Argo Workflows Argo Suspend a Cron Workflow
      description: Suspends an active cron workflow.
      tags:
      - Cron Workflows
      parameters:
      - $ref: '#/components/parameters/Namespace'
      - $ref: '#/components/parameters/CronWorkflowName'
      responses:
        '200':
          description: Cron workflow suspended
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronWorkflow'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    CronWorkflowUpdateRequest:
      type: object
      properties:
        namespace:
          type: string
        name:
          type: string
        cronWorkflow:
          $ref: '#/components/schemas/CronWorkflow'
    Arguments:
      type: object
      description: Arguments to pass to a template
      properties:
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/Parameter'
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
    CronWorkflowList:
      type: object
      properties:
        apiVersion:
          type: string
        metadata:
          type: object
        items:
          type: array
          items:
            $ref: '#/components/schemas/CronWorkflow'
    DAGTask:
      type: object
      description: A task in a DAG template
      properties:
        name:
          type: string
        template:
          type: string
        arguments:
          $ref: '#/components/schemas/Arguments'
        dependencies:
          type: array
          items:
            type: string
        when:
          type: string
          description: Conditional expression for task execution
        withItems:
          type: array
          items: {}
        withParam:
          type: string
        continueOn:
          type: object
          properties:
            error:
              type: boolean
            failed:
              type: boolean
    CronWorkflowSpec:
      type: object
      description: Specification of a cron workflow
      properties:
        schedule:
          type: string
          description: Cron schedule expression
        timezone:
          type: string
          description: Timezone for the cron schedule
        startingDeadlineSeconds:
          type: integer
          format: int64
        concurrencyPolicy:
          type: string
          enum:
          - Allow
          - Forbid
          - Replace
        suspend:
          type: boolean
          description: Whether the cron workflow is suspended
        successfulJobsHistoryLimit:
          type: integer
        failedJobsHistoryLimit:
          type: integer
        workflowSpec:
          $ref: '#/components/schemas/WorkflowSpec'
        workflowMetadata:
          type: object
    CronWorkflowStatus:
      type: object
      description: Status of a cron workflow
      properties:
        active:
          type: array
          items:
            type: object
        lastScheduledTime:
          type: string
          format: date-time
        conditions:
          type: array
          items:
            type: object
    RetryStrategy:
      type: object
      description: Strategy for retrying failed steps
      properties:
        limit:
          type: integer
          description: Maximum number of retries
        retryPolicy:
          type: string
          enum:
          - Always
          - OnFailure
          - OnError
          - OnTransientError
        backoff:
          type: object
          properties:
            duration:
              type: string
            factor:
              type: integer
            maxDuration:
              type: string
    Artifact:
      type: object
      description: A workflow artifact
      properties:
        name:
          type: string
        path:
          type: string
          description: Path in the container where artifact is placed
        from:
          type: string
          description: Source artifact reference
        s3:
          type: object
          properties:
            bucket:
              type: string
            key:
              type: string
            endpoint:
              type: string
        git:
          type: object
          properties:
            repo:
              type: string
            revision:
              type: string
            depth:
              type: integer
        http:
          type: object
          properties:
            url:
              type: string
            headers:
              type: array
              items:
                type: object
        archive:
          type: object
          properties:
            none:
              type: object
            tar:
              type: object
              properties:
                compressionLevel:
                  type: integer
            zip:
              type: object
    Outputs:
      type: object
      description: Outputs from a template
      properties:
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/Parameter'
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
        result:
          type: string
          description: Result output from a script template
        exitCode:
          type: string
          description: Exit code of the container
    WorkflowSpec:
      type: object
      description: Specification of a workflow
      properties:
        entrypoint:
          type: string
          description: The name of the entrypoint template
        arguments:
          $ref: '#/components/schemas/Arguments'
        templates:
          type: array
          description: List of workflow templates
          items:
            $ref: '#/components/schemas/Template'
        serviceAccountName:
          type: string
          description: Service account to run workflow pods
        volumes:
          type: array
          description: Volumes available to workflow steps
          items:
            type: object
        activeDeadlineSeconds:
          type: integer
          format: int64
          description: Duration in seconds before workflow times out
        nodeSelector:
          type: object
          additionalProperties:
            type: string
        tolerations:
          type: array
          items:
            type: object
        parallelism:
          type: integer
          description: Maximum number of parallel running pods
        ttlStrategy:
          type: object
          description: Strategy for cleaning up completed workflows
          properties:
            secondsAfterCompletion:
              type: integer
            secondsAfterSuccess:
              type: integer
            secondsAfterFailure:
              type: integer
        podGC:
          type: object
          description: Strategy for garbage collecting completed pods
          properties:
            strategy:
              type: string
              enum:
              - OnPodCompletion
              - OnPodSuccess
              - OnWorkflowCompletion
              - OnWorkflowSuccess
        workflowTemplateRef:
          type: object
          description: Reference to a WorkflowTemplate
          properties:
            name:
              type: string
            clusterScope:
              type: boolean
        archiveLogs:
          type: boolean
          description: Whether to archive workflow logs
        hooks:
          type: object
          description: Lifecycle hooks for the workflow
          additionalProperties:
            type: object
        onExit:
          type: string
          description: Template to execute on workflow exit
        retryStrategy:
          $ref: '#/components/schemas/RetryStrategy'
    Template:
      type: object
      description: A workflow template definition
      properties:
        name:
          type: string
          description: Name of the template
        inputs:
          $ref: '#/components/schemas/Inputs'
        outputs:
          $ref: '#/components/schemas/Outputs'
        container:
          type: object
          description: Container to run
          properties:
            image:
              type: string
            command:
              type: array
              items:
                type: string
            args:
              type: array
              items:
                type: string
            env:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  value:
                    type: string
            resources:
              type: object
              properties:
                limits:
                  type: object
                  additionalProperties:
                    type: string
                requests:
                  type: object
                  additionalProperties:
                    type: string
            volumeMounts:
              type: array
              items:
                type: object
        script:
          type: object
          description: Script to run in a container
          properties:
            image:
              type: string
            command:
              type: array
              items:
                type: string
            source:
              type: string
        resource:
          type: object
          description: Kubernetes resource to create/patch/delete
          properties:
            action:
              type: string
              enum:
              - get
              - create
              - apply
              - delete
              - replace
              - patch
            manifest:
              type: string
            successCondition:
              type: string
            failureCondition:
              type: string
        dag:
          type: object
          description: DAG template definition
          properties:
            tasks:
              type: array
              items:
                $ref: '#/components/schemas/DAGTask'
        steps:
          type: array
          description: Steps template definition (list of parallel step groups)
          items:
            type: array
            items:
              $ref: '#/components/schemas/WorkflowStep'
        suspend:
          type: object
          description: Suspend template for manual approval
          properties:
            duration:
              type: string
        activeDeadlineSeconds:
          type: integer
          format: int64
        retryStrategy:
          $ref: '#/components/schemas/RetryStrategy'
        nodeSelector:
          type: object
          additionalProperties:
            type: string
        metadata:
          type: object
          description: Metadata to set on step pods
          properties:
            labels:
              type: object
              additionalProperties:
                type: string
            annotations:
              type: object
              additionalProperties:
                type: string
    Parameter:
      type: object
      description: A workflow parameter
      properties:
        name:
          type: string
        value:
          type: string
        default:
          type: string
        enum:
          type: array
          items:
            type: string
        description:
          type: string
        globalName:
          type: string
    ObjectMeta:
      type: object
      description: Kubernetes object metadata
      properties:
        name:
          type: string
        generateName:
          type: string
        namespace:
          type: string
        uid:
          type: string
        resourceVersion:
          type: string
        generation:
          type: integer
          format: int64
        creationTimestamp:
          type: string
          format: date-time
        labels:
          type: object
          additionalProperties:
            type: string
        annotations:
          type: object
          additionalProperties:
            type: string
    Inputs:
      type: object
      description: Inputs for a template
      properties:
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/Parameter'
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
    CronWorkflowCreateRequest:
      type: object
      properties:
        namespace:
          type: string
        cronWorkflow:
          $ref: '#/components/schemas/CronWorkflow'
        createOptions:
          type: object
    CronWorkflow:
      type: object
      description: A scheduled workflow resource
      properties:
        apiVersion:
          type: string
          default: argoproj.io/v1alpha1
        kind:
          type: string
          default: CronWorkflow
        metadata:
          $ref: '#/components/schemas/ObjectMeta'
        spec:
          $ref: '#/components/schemas/CronWorkflowSpec'
        status:
          $ref: '#/components/schemas/CronWorkflowStatus'
    WorkflowStep:
      type: object
      description: A step in a steps template
      properties:
        name:
          type: string
        template:
          type: string
        arguments:
          $ref: '#/components/schemas/Arguments'
        when:
          type: string
        withItems:
          type: array
          items: {}
        withParam:
          type: string
        continueOn:
          type: object
          properties:
            error:
              type: boolean
            failed:
              type: boolean
  parameters:
    Namespace:
      name: namespace
      in: path
      required: true
      description: Kubernetes namespace
      schema:
        type: string
    CronWorkflowName:
      name: name
      in: path
      required: true
      description: Name of the cron workflow
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token obtained from the POST /session endpoint using username/password or from an external OIDC provider configured in Argo CD.
externalDocs:
  description: Argo CD API Documentation
  url: https://argo-cd.readthedocs.io/en/stable/developer-guide/api-docs/