Add custom attributes to user

Is there a simple way to add custom attribute to users and access them from a process?
e.1. we would like to add age attribute to user and use this value in a gateway condition.
e.2. add number of days a user was absent and be able to access and change this value from a process.

is this the way to do it?

is it only available through rest API?
and how can we access such info it from a process?