Toast walnuts then grind in a food processor until ground to a meal. Add dried cranberries and dates and process until well combined. Add sugar, cocoa, cinnamon, vanilla, star anise and cayenne and pulse to combine. Add water so a loose dough forms; if it doesn’t, add more water 1 tsp. at a time. Press dough into a 9x9 inch pan, flatten and cool until firm.
Cut into bite size squares.