Grind the walnuts: Pulse them into coarse crumbs and place them in a mixing bowl.
Sauté the aromatics: Cook the onion and garlic in 1 tablespoon of olive oil until softened.
Process the beans: Blend the aromatics, beans, five ground spices, tomato paste, salt, and pepper until smooth.
Combine: Mix the purée with the walnuts and flour. Incorporate extra flour if excessively wet.
Shape: Dust a baking sheet with flour. Divide the mixture into quarters and flatten each portion using a parchment-covered glass base or round cutter. Flour the surfaces as needed.
Chill: Place the baking sheet in the freezer for 30 minutes.
Cook: Heat 2 tablespoons of olive oil until hot. Fry the patties for 5 minutes, turn once, then brush their upper surfaces and edges with barbecue sauce. Cook for another 5 minutes. Work in batches if necessary.
Serve: Assemble the burgers with buns, lettuce, pickles, tomato, guacamole, and red onion.