I don’t know if it is worth while. Instead of creating a new var it seems like Godot has a is_processing() function.
I did
if is_processing():
if "Goal" in body.get_groups():
complete_level(body.file_path)
if "Hazard" in body.get_groups():
crash_sequence()