Example workflow
Below is a compact example showing a typical pattern: run a “develop” step, wait for manual approval, pause for a short duration, then run a “test” step.What each part does
- spec.entrypoint:
suspend— the workflow begins at thesuspendtemplate. - templates[0] (name: suspend): defines a steps-style workflow with four steps. In the example above these steps are defined in the same step group (inner list), which means they will be started concurrently. To make them run sequentially, see the note below.
develop— executes thecowsaytemplate.approval— runs theapprovaltemplate; this is a Suspend template.delay— runs thedelaytemplate, a Suspend template that uses a duration to pause the node.test— executes thecowsaytemplate again.- approval / suspend: — empty braces signal an indefinite suspend; the node is suspended until explicitly resumed.
- delay / suspend.duration: ”10s” — suspends the delay node for 10 seconds; after that the node completes and the workflow continues.
- cowsay container — a small container used for both
developandtest; it produces the same logs when each step runs.
Sequential vs. concurrent steps
If you want the steps to run strictly in sequence (develop → approval → delay → test), structure thesteps so each step group is a separate top-level list item, for example:
The suspend duration must be a valid time string (for example ”10s”, “1m”, ”30s”). Avoid ambiguous formats like plain integers (“10”) — include a time suffix.
Typical execution flow (sequential example)
- The
developstep runs thecowsaytemplate and completes. - The
approvalstep runs theapprovalSuspend template. Withsuspend: {}, the workflow enters a suspended state and waits for manual resume. - After the workflow is resumed (UI/CLI/API), the
delaystep starts and suspends itself for10susingsuspend.duration. - Once the 10-second pause finishes, the
teststep runs thecowsaytemplate.
Resume a suspended workflow
You can resume a suspended workflow using the UI, CLI, or API:- UI: Click the Resume button in the Argo UI for the suspended workflow and confirm.
- CLI: Use the Argo CLI:
- API: Call the Argo Server API or use automation that interacts with Argo to resume workflows.
Templates and use cases
| Template name | Type | Typical use case |
|---|---|---|
approval | Suspend (no duration) | Manual approval or external gating (indefinite pause until resume) |
delay | Suspend (with duration) | Short timed wait between steps (e.g., retries, cooldowns) |
cowsay | Container | Simple example container template for running commands / producing logs |
Notes on logs and the graph view
- Both
developandtestuse the samecowsaytemplate, so their logs will be identical when they run. - Use the Argo UI graph view to visualize the workflow execution, suspended nodes, and node timing. Toggle between graph and DAG views to better understand execution order and concurrency.