Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

446
Vistas
Argo stop workflow early, mark complete

Imagine I have a workflow with 5 steps.

Step 2 may or may not create a file as its output (which is then used as input to subsequent steps).

  • If the file is created, I want to run the subsequent steps.
  • If no file gets created in step 2, I want to mark the workflow as completed and not execute steps 3 through to 5.

I'm sure there must be a simple way to do this yet I'm failing to figure out how.

I tried by making step 2 return non-zero exit code when no file is created and then using when: "{{steps.step2.outputs.exitCode}} == 0" on step 3, but that still executes step 4 and 5 (not to mention marks step 2 as "failed")

So I'm out of ideas, any suggestions are greatly appreciated.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

By default, a step that exits with a non-zero exit code fails the workflow.

I would suggest writing an output parameter to determine whether the workflow should continue.

- name: yourstep
  container:
    command: [sh, -c]
    args: ["yourcommand; if [ -f /tmp/yourfile ]; then echo continue > /tmp/continue; fi"]
  outputs:
    parameters:
    - name: continue
      valueFrom:
        default: "stop"
        path: /tmp/continue

Alternatively, you can override the fail-on-nonzero-exitcode behavior with continueOn.

continueOn:
  failed: true

I'd caution against continueOn.failed: true. If your command throws a non-zero exit code for an unexpected reason, the workflow won't fail like it should, and the bug might go un-noticed.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda