we can get tensor measurements by writing something like:

qml.expval(qml.PauliZ(0) @ PauliZ(1))

but is there a way to automate this if I have a variable number of qubits?

Something which might work like:

qml.expval(TENSOR [qml.PauliZ(i) for i in (range(n_qubits))])

this is already possible for local measurements.

If this is something simple that is skipping me right now, I apologise!