Instance State
Count the number of instances per state in an entity. This will only work if there is a state/workflow defined on an entity.
Example for extensions.query:
#/data/extensions/query/query
{
"join" : "instance_state",
"group_by" : "instance_state.name",
"select" : ["instance_state.name",{"count":"me.id"}],
"as" : ["name" ,"count"]
}