Skip to main content
Argo Workflows is a Kubernetes-native workflow orchestration engine for running complex, containerized job sequences (data pipelines, automation, kubectl, Python, Bash, etc.). It is often compared with other CNCF projects — here’s a quick comparison to clarify roles:
This guide assumes Argo Workflows is already installed in your Kubernetes cluster. If you need installation instructions, refer to the official docs: Argo Workflows installation.
In this article we build progressively more advanced workflows to demonstrate common Argo constructs:
  • A simple container task
  • Steps (sequential and parallel), with parameters
  • DAG-based dependencies
  • Running kubectl from inside a workflow (with RBAC considerations)

1) Simple “hello” workflow

Create hello-workflow.yaml. Notice generateName gives each submission a unique suffix:
Submit and watch the run with the Argo CLI:
Or inspect pods and logs with kubectl:
When the workflow completes you’ll see a generated name, Succeeded status, and the steps that ran.
The image shows a terminal displaying the status of a Kubernetes job named "hello-world-8pttw." The job has successfully started, completed in 20 seconds, and is not currently running.
Example argo get output (abridged):
Example pod logs:

2) Steps: sequential and parallel steps, with parameters

Use steps when you want ordered or grouped tasks. Steps are an array of arrays:
  • Each inner array represents tasks that run in parallel.
  • Outer array elements run sequentially.
Create steps-workflow.yaml. This example defines a reusable print-message template that accepts a message parameter, and a pipeline entrypoint that runs two sequential steps:
Submit:
Notes:
  • With the YAML above, step-one runs first, then step-two.
  • To run step-one and step-two in parallel, place them in the same inner array (see the parallel example below).
Parallel example (only the pipeline.steps portion shown):
Argo will show progress while steps execute (e.g., 1/2, 2/2) and list completed steps when finished.

3) DAG (Directed Acyclic Graph) workflows

DAGs express explicit dependencies between tasks. Tasks with no dependencies start immediately; dependent tasks wait for their dependencies to succeed. Use DAGs for complex pipelines where dependency relationships matter (e.g., build → tests → deploy). Example dag-workflow.yaml models a build → tests → deploy pipeline. test-unit and test-integration both depend on build and run in parallel; deploy depends on both tests:
Submit the DAG:
Expected execution order:
  • build runs first.
  • test-unit and test-integration start once build completes (they run concurrently).
  • deploy runs after both tests succeed.
Example argo get summary when finished:

4) Running kubectl from a workflow (RBAC considerations)

Workflows can run images that include kubectl to query or modify cluster resources. To interact with the cluster, the workflow’s ServiceAccount must have the proper RBAC permissions. Example kubectl-workflow.yaml uses bitnami/kubectl to check a deployment rollout and then list pods in the argo namespace:
Submit and watch:
View combined logs from the latest workflow run:
Example argo logs output (abridged):
Do not run workflows with overly permissive credentials. Avoid using the cluster-admin default ServiceAccount in production. Create a dedicated ServiceAccount with only the RBAC rules it needs (Role/ClusterRole and RoleBinding/ClusterRoleBinding).

Key concepts and quick reference


Summary

  • Argo Workflows runs containerized tasks as Kubernetes pods to orchestrate automation, pipelines, and arbitrary job sequences.
  • Use templates to create reusable task definitions with parameters.
  • steps provide ordered and parallel grouping via arrays of arrays.
  • dag defines explicit dependency-based execution with dependencies.
  • For workflows that interact with the cluster, set serviceAccountName and grant only necessary RBAC permissions.
Further reading:

Watch Video

Practice Lab