ansible.builtin.set_fact: one_fact: something other_fact: "{{ local_var * 2 }}" cacheable: yes
Directive set_fact is very useful for decomposing your tasks and sending proper input to them thus using handlers like functions with dynamic parameters. You can just register result of the set fact into reg-variable and then notify handler. It will be available at the handler like "{{ reg-variable.ansible_facts.one_fact }}".
This "register-notify" construct works for any task but not every task returns the output you wish to see at handlers.