---
title: "Finally"
description: ""
category: "Actions"
subcategory: "Events"
last_updated: "2026-05-21"
source_url: "https://docs.xeox.com/actions/cA3GbGqPkitikUefevioxb/finally/7yD4B4gA48q3pg15XynyNF"
---

# Finally

![notion image](https://docs.xeox.com/media/2479f52fe5da9ff2.png)

Finally is always executed no matter what happens beforehand. For example if there is an if-loop it either executes if or else, then it executes finally, no matter the previous outcome.

A finally statement could be used, for example like this: Here we send an email when an error occurs, and creates and executes a file when it succeeds. Finally reboots the device, no matter if there occured an error or not.

![notion image](https://docs.xeox.com/media/5aee32dd08552d82.png)

The next example automation patches the devices. If a patch takes too long on a device and is therefore cancelled, finally makes sure the reboot is still being done afterwards. Finally always happens, even when the runtime is out.

![notion image](https://docs.xeox.com/media/3b609bea6d932a38.png)
