Retry Script Note This example is a replication of an Argo Workflow example in Hera. The upstream example can be found here. HeraYAML 1 2 3 4 5 6 7 8 9 10 11 12 13 14from hera.workflows import RetryStrategy, Workflow, script @script(image="python:alpine3.6", retry_strategy=RetryStrategy(limit="10"), add_cwd_to_sys_path=False) def retry_script(): import random import sys exit_code = random.choice([0, 1, 1]) sys.exit(exit_code) with Workflow(generate_name="retry-script-", entrypoint="retry-script") as w: retry_script() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: retry-script- spec: entrypoint: retry-script templates: - name: retry-script retryStrategy: limit: '10' script: image: python:alpine3.6 source: |- import random import sys exit_code = random.choice([0, 1, 1]) sys.exit(exit_code) command: - python Comments