# pre_ and post_operations in Dataform

Here's a useful Dataform concept: pre\_operations and post\_operations. As the name implies, these represent a set of actions that run before and after the main operation (table, view, or SQL operations).

In practice it enables you to cleanly:

➡️ Declare and set a variable

➡️ Clean up before inserting into a table

➡️ Compute a watermark for your incremental model

➡️ Log run metadata after execution

➡️ Perform a maintenance task

What's the most interesting use case you've seen for pre\_operations / post\_operations (or pre\_hook / post\_hook if you're on dbt)?

![](https://cdn.hashnode.com/uploads/covers/641c1535429c76261884ecba/74912386-8b11-4713-b150-9fd30661ddcb.png align="center")
