# Order of Transaction Hooks invocation

**URL:** <https://dmap-community.ductus.global/t/order-of-transaction-hooks-invocation/4815>\
**Category:** YANG\
**Created:** [October 25, 2024, 2:00am UTC](https://dmap-community.ductus.global/t/order-of-transaction-hooks-invocation/4815 "2024-10-25T02:00:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cannigia](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@Cannigia](https://dmap-community.ductus.global/u/Cannigia)\
**Post date:** [October 25, 2024, 2:00am UTC](https://dmap-community.ductus.global/t/order-of-transaction-hooks-invocation/4815/1 "2024-10-25T02:00:11Z")

</div>

Hello everyone,

Checking confd documentation it is not clear to me the order in which transaction hooks are invoked. Suppose the following yang:

```auto
container MyContainer {
    list myList {
        tailf:callpoint myListHook {
            tailf:transaction-hook object;
        }

        tailf:callpoint myListPerTransactionHook {
            tailf:transaction-hook object {
                tailf:invocation-mode per-transaction;
            }
        }
    }

    container MyInnerContainer {
        tailf:callpoint myInnerContainerHook {
            tailf:transaction-hook object;
        }
    }
}

```

Currently, what I can see is that all the necessary callbacks for **myListHook** are invoked first (create, remove, etc…). After that, the write\_all callback for **myListPerTransactionHook** is invoked and the last hook to have its callbacks invoked is the **myInnerContainerHook**

Based on the previous information I have a couple of questions:

1. Is this order always _guaranteed_?
2. Is there a way to, somehow, assign priorities for the hooks?
3. Can I trust that the hooks which implement write\_all will be called last?
4. Taking into consideration the **myListHook** , it would be possible to somehow ask for confd to invoke the remove callback first and the create callback last?

Thanks.
