All Products
Search
Document Center

Container Service for Kubernetes:Configure artifacts

Last Updated:Mar 26, 2026

When one workflow step generates a file that the next step needs to process, you can use artifacts to pass the output of one step directly as the input of another. This topic shows how to configure Object Storage Service (OSS) as the artifact repository and pass an artifact between two steps in a workflow.

Prerequisites

Before you begin, ensure that you have:

Pass an artifact between steps

The following example defines a two-step workflow: the first step generates a text file and saves it as an artifact, and the second step retrieves that artifact and prints its contents.

  1. Create a file named artifact-passing.yaml with the following content:

    apiVersion: argoproj.io/v1alpha1
    kind: Workflow
    metadata:
      generateName: artifact-passing-
    spec:
      entrypoint: artifact-example
      templates:
      - name: artifact-example
        steps:
        - - name: generate-artifact
            template: whalesay
        - - name: consume-artifact
            template: print-message
            arguments:
              artifacts:
              # Bind the message artifact to the hello-art output
              # from the generate-artifact step.
              - name: message
                from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}"
    
      - name: whalesay
        container:
          image: docker/whalesay:latest
          command: [sh, -c]
          args: ["cowsay hello world | tee /tmp/hello_world.txt"]
        outputs:
          artifacts:
          # Save /tmp/hello_world.txt as the hello-art artifact.
          # The path can be a directory as well as a file.
          - name: hello-art
            path: /tmp/hello_world.txt
    
      - name: print-message
        inputs:
          artifacts:
          # Unpack the message artifact to /tmp/message.
          - name: message
            path: /tmp/message
        container:
          image: alpine:latest
          command: [sh, -c]
          args: ["cat /tmp/message"]

    The workflow uses three templates:

    TemplateRole
    artifact-exampleThe entrypoint template. Runs generate-artifact first, then passes its hello-art output artifact as the message input to consume-artifact.
    whalesayWrites text to /tmp/hello_world.txt and declares that file as an output artifact named hello-art. The path field can point to a directory as well as a single file.
    print-messageDeclares a message input artifact, unpacks it to /tmp/message, and prints the contents with cat.
    The from field in a steps template uses the {{steps.<step-name>.outputs.artifacts.<artifact-name>}} syntax. If you use a DAG template instead, replace steps with tasks.
  2. Submit the workflow:

    argo submit artifact-passing.yaml
  3. Check the workflow status:

    argo list

    A status of Succeeded confirms that the workflow completed and the artifact was passed successfully.