<p>The simplest way to do this would probably be to add a <code>retry</code> option to the pipeline.</p>
<p>See <a href="https://www.jenkins.io/doc/book/pipeline/syntax/#options" rel="nofollow noreferrer">https://www.jenkins.io/doc/book/pipeline/syntax/#options</a></p>

CC BY-SA 4.0
2021-09-12T13:26:52.327Z
As @Bruce Becker mentioned, you can use `retry` steps in your jenkinsfile. optionally you can set how many time the stage tries attempting or set `timeout` See, https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/#timeouts-retries-and-more
Chachatonel Hashimotto
CC BY-SA 4.0
2021-09-12T11:52:33.583Z
2021-09-12T11:52:33.583Z
Bruce Becker
<p>I've heard about the Naginator plugin, but unfortunately it's only for freestyle job type.</p>
<p>Is there any solution for pipeline jobs to be triggered if they failed? I thought about creating a command in the syntax or maybe triggering a freestyle job on the pipeline.</p>

CC BY-SA 4.0
2021-09-13T15:11:49.380Z
Does this answer your question? [How to retrigger a Jenkins build after failure using declarative syntax?](https://devops.stackexchange.com/questions/5173/how-to-retrigger-a-jenkins-build-after-failure-using-declarative-syntax)
jayhendren
<jenkins><jenkins-pipeline><jenkins-plugins>
Re-running a pipeline job if failed
Lev Meshorer
# Re-running a pipeline job if failed

(Asked by: username_0 on 2021-09-12)

I've heard about the Naginator plugin, but unfortunately it's only for freestyle job type.

Is there any solution for pipeline jobs to be triggered if they failed? I thought about creating a command in the syntax or maybe triggering a freestyle job on the pipeline.

**Tags:** jenkins, jenkins-pipeline, jenkins-plugins

> **Comments:**
> **username_1**: Does this answer your question? [How to retrigger a Jenkins build after failure using declarative syntax?](https://devops.stackexchange.com/questions/5173/how-to-retrigger-a-jenkins-build-after-failure-using-declarative-syntax)  

---

## 1 answers

### Answer by username_2 on 2021-09-12. Score: 1

The simplest way to do this would probably be to add a `retry` option to the pipeline.

See <https://www.jenkins.io/doc/book/pipeline/syntax/#options>

> **Comments:**
> **username_3**: As @username_2 mentioned, you can use `retry` steps in your jenkinsfile. optionally you can set how many time the stage tries attempting or set `timeout` See, https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/#timeouts-retries-and-more  

---

