# Mark Workflow as failed

**URL:** <https://community.temporal.io/t/mark-workflow-as-failed/15542>\
**Category:** Community Support\
**Tags:** java-sdk, springboot\
**Created:** [December 5, 2024, 10:06am UTC](https://community.temporal.io/t/mark-workflow-as-failed/15542 "2024-12-05T10:06:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramyabdelmoneam](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@ramyabdelmoneam](https://community.temporal.io/u/ramyabdelmoneam)\
**Post date:** [December 5, 2024, 10:06am UTC](https://community.temporal.io/t/mark-workflow-as-failed/15542/1 "2024-12-05T10:06:03Z")

</div>

How can i mark a workflow as a failed one by hard coded as per if condition inside my code. is some cases workflow executed successfully with all activities but i want to mark it as a failed workflow according if condition logic in my code, it could possible ?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [December 5, 2024, 2:07pm UTC](https://community.temporal.io/t/mark-workflow-as-failed/15542/2 "2024-12-05T14:07:03Z")

</div>

you can throw `ApplicationFailure` from workflow code to fail it, or a custom exception which you set in `WorkflowImplementationOptions->setFailWorkflowExceptionTypes`

also please dont ping people directly on questions if possible. thanks!

---

<div class="post-metadata">

**Author:** ![ramyabdelmoneam](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@ramyabdelmoneam](https://community.temporal.io/u/ramyabdelmoneam)\
**Post date:** [December 5, 2024, 2:13pm UTC](https://community.temporal.io/t/mark-workflow-as-failed/15542/3 "2024-12-05T14:13:17Z")

</div>

@tihomir Thanks.
