Adding automation type to query