Pulse cranberries in a food processor until finely chopped.
Transfer to a large bowl and stir in sugar. Cover and refrigerate for at least 1 hour, or overnight.
Add drained crushed pineapple, mini marshmallows, and chopped walnuts (if using) to the cranberry mixture. Stir to combine.
Fold in Cool Whip until everything is well incorporated.
Chill for at least 2 hours before serving for best flavor and texture.