add metadata to state and event (for flags ;) )
add metadata filter and criteria