How to keep parameter data type when passing parameter from a action-chain to ansible playbook?

Hi all,
I’m writing a action-chain, one step is running a playbook
some part of code is like this:

-
  name: 'run_playbook'
  ref: ansible.playbook
  parameters:
    playbook: ./os_user/main.yaml
    cwd: /opt/stackstorm/packs/ansible/actions/playbooks
    inventory_file: "../unstable/{{ inventory_name }}"  
    extra_vars:
      - os_user: "{{ os_user }}"
      - os_passwd: "{{ os_passwd }}"
      - operation: "{{ operation }}"
      - user_sudo: "{{ user_sudo }}"
      - user_groups: "{{ user_groups }}"
      - user_uid: "{{ user_uid }}"
  on-success: 'delete_inventory'
  on-failure: 'delete_inventory'

ansible always handle vars as a string, for example {{user_groups}}, it is should be a array in stackstorm action metadata yaml. {{user_sudo}} should be a boolean. It will be annoying when do a conditional judgments.
For example, I have to write my playbook like this:

- role: groups
  when: operation == "present" and user_groups != "['EmptyGroup']"
- role: sudo
  when: user_sudo != "False" and operation == "present"

What should I do?

Use a Jinja filter to convert the StackStorm array/boolean/object to a string. Check the StackStorm documentation for how to do this.

No, I want to keep Stackstorm array/boolean/object data type. But ansible treat them as string

Done by
https://docs.stackstorm.com/reference/jinja.html
and examples in st2/contrib/examples/actions/chains/

Use stackstorm filter from_yaml_string and use_none to sovle this issue
Thank you.