# SET\_STATS NOT WORKING

**URL:** <https://forum.ansible.com/t/set-stats-not-working/36495>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 29, 2022, 4:55pm UTC](https://forum.ansible.com/t/set-stats-not-working/36495 "2022-03-29T16:55:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Falour](https://avatars.discourse-cdn.com/v4/letter/f/6a8cbe/32.png) [@Federico\_Falour](https://forum.ansible.com/u/Federico_Falour)\
**Post date:** [March 29, 2022, 4:55pm UTC](https://forum.ansible.com/t/set-stats-not-working/36495/1 "2022-03-29T16:55:55Z")

</div>

Hey everyone!

I’m currently running a brand new AWX installation. Everything is working fine, and I thought of giving workflows a chance. Everything is working as expected, but the `set_stats` command is not generating a variable that can be consumend by another step of the workflow.

This is how I’m using it:

_- name: Sanitize deployment version_  
_ansible.builtin.set\_stats:_  
_data:_  
_sanitized\_version: “{{ version | regex\_replace(‘[^-\_0-9a-zA-Z]’, ‘-’)}}”_

In the second playbook, I try doing:

_- name: Add number to version_  
_set\_fact:_  
_numbered\_version: “{{ sanitized\_version }}-1”_

That’s not working. The playbook complains about `sanitized_version` not being defined.

What I’m doing wrong? Is there a special configuration for the jobs templates that I need? Any special configuration for the workflow?

I’d really appreaciate the help, as if we can’t make this happen, I don’t see the point in using workflows :S

F.

---

<div class="post-metadata">

**Author:** ![Seth\_Foster](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Seth\_Foster](https://forum.ansible.com/u/Seth_Foster)\
**Post date:** [March 30, 2022, 8:18pm UTC](https://forum.ansible.com/t/set-stats-not-working/36495/2 "2022-03-30T20:18:19Z")

</div>

Hi!

After running the workflow, you should be able to go to the details page of the first job that runs in the workflow, and see that “sanitized\_version” is listed in the “Artifacts” box. Likewise, you should be able to see “sanitized\_version” listed in the “Variables” box in the detail page of the second job.

set\_stats behavior gets tricky for some types of workflow configurations, do you mind sharing what your workflow structure looked like while testing this? e.g. Job1 → Job2

Seth
