Skip to main content
Argo Workflows is a Kubernetes-native workflow engine for orchestrating container-based tasks and complex job dependencies. It is commonly confused with other Argo projects and CI/CD tools — to clarify: In this lesson you will create example Argo Workflows that demonstrate core concepts:
  • Minimal container tasks
  • Step-based pipelines (sequential and parallel)
  • DAG-based dependencies
  • Running kubectl inside workflows with RBAC considerations
Prerequisite: Argo Workflows is already installed in your cluster and you can run both the Argo CLI and kubectl against that cluster.
Make sure you can run argo version and kubectl get pods -n argo before starting. If Argo isn’t installed, see the official docs: Argo Workflows Installation.

1) Minimal “Hello” workflow

Create a file named hello-workflow.yaml with a single template that prints a message. Using generateName ensures each run receives a unique name.
What to notice:
  • generateName lets Argo append random characters so each run is unique.
  • entrypoint points to the initial template (hello).
  • The hello template runs an Alpine container and executes echo.
Submit and watch the workflow:
You can also inspect pods and logs with kubectl:
Example output (abridged):
kubectl pod list and logs show the container output:

2) Steps workflow — parameters, sequential and parallel steps

Steps are the simplest way to compose pipelines. In Argo:
  • A steps template contains an array of step-groups.
  • Each outer list item is a step-group (groups execute sequentially).
  • Each step-group contains a list of steps that run in parallel.
The example below shows a reusable print-message template that accepts a parameter, and a pipeline that runs two steps in sequence (each placed in separate step-groups).
Key points:
  • print-message accepts a parameter message and echoes it.
  • In pipeline.steps, each outer - starts a step-group. Since each step-group above contains a single step, groups run sequentially.
  • To run both steps in parallel, place both step definitions in the same step-group (same outer list item), for example:
Submit and watch:
Example status after a successful run:

3) DAG workflows — expressing dependency graphs

When you need fine-grained dependency control, use a DAG (Directed Acyclic Graph). Each DAG task can declare dependencies. Tasks without dependencies start immediately; tasks that depend on others wait for their dependencies to complete. Tasks that share a dependency can run in parallel after that dependency finishes. Example pipeline: build → (test-unit, test-integration) → deploy
Submit and watch:
Expected behavior:
  • build runs first.
  • When build succeeds, both test-unit and test-integration start in parallel.
  • After both tests succeed, deploy runs.
Example run summary:

4) Running kubectl in workflows (RBAC considerations)

Workflows execute inside Kubernetes pods. If a workflow must interact with the cluster (for example, run kubectl rollout status), the workflow pod needs proper credentials and RBAC permissions. Bind a dedicated service account to the workflow using serviceAccountName in the workflow spec. Example workflow that runs kubectl rollout status and then lists pods in the argo namespace:
Never give workflows broad cluster-admin access in production. Create purpose-specific service accounts and grant only the RBAC permissions the workflow requires.
Submit and watch:
To fetch logs for the latest run:
Sample argo logs excerpt (abridged):

Quick reference


Summary

  • Argo Workflows is for orchestrating container-based workflows on Kubernetes.
  • Use templates with container tasks for individual jobs and inputs/parameters for reusability.
  • steps enables simple sequential and parallel pipelines; outer groups run sequentially and inner lists run in parallel.
  • dag enables expressive dependency graphs for complex orchestration.
  • When workflows interact with the cluster, use serviceAccountName and apply least-privilege RBAC.
Further reading and resources: Now head over to the GitOps with ArgoCD labs and start practicing.

Watch Video

Practice Lab