# Help with ansible.controller.controller\_api using return\_all=True

**URL:** <https://forum.ansible.com/t/help-with-ansible-controller-controller-api-using-return-all-true/45474>\
**Category:** Get Help\
**Created:** [March 3, 2026, 10:05pm UTC](https://forum.ansible.com/t/help-with-ansible-controller-controller-api-using-return-all-true/45474 "2026-03-03T22:05:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![derb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/derb/32/4385_2.png) [@derb](https://forum.ansible.com/u/derb)\
**Post date:** [March 3, 2026, 10:05pm UTC](https://forum.ansible.com/t/help-with-ansible-controller-controller-api-using-return-all-true/45474/1 "2026-03-03T22:05:29Z")

</div>

Hi all,  
I need some help with formatting this correctly. I had this all working fine, until one of the workflow\_jobs had more the 25 workflow\_nodes. In that case, I am not finding the erroring node because it comes in the later pages.

I saw the the controller\_api does have a return\_all parameter. I tried adding it as below, but the get the error shown.

Task:

```auto
- name: Query API for failed jobs
  ansible.builtin.set_fact:
    failed_job_wf_nodes: >-
      {{ query('ansible.controller.controller_api',
              'workflow_jobs/' ~ failed_job_wf_id ~ '/workflow_nodes/'),
                  return_all=True }}

```

Error:

```auto
msg: >-
  template error while templating string: expected token 'end of print
  statement', got '='. String: {{ query('ansible.controller.controller_api',
          'workflow_jobs/' ~ failed_job_wf_id ~ '/workflow_nodes/'),
              return_all=True }}. expected token 'end of print statement', got '='
_ansible_no_log: false

```

I am guessing from the error that I don’t have the return\_all=True in the correct location or format.

Any help greatly appreciated,  
Cheers!

---

<div class="post-metadata">

**Author:** ![derb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/derb/32/4385_2.png) [@derb](https://forum.ansible.com/u/derb)\
**Post date:** [March 4, 2026, 1:29pm UTC](https://forum.ansible.com/t/help-with-ansible-controller-controller-api-using-return-all-true/45474/2 "2026-03-04T13:29:31Z")

</div>

All, self answering here. I see that I placed the parameter outside of the (). Corrected code:

```auto
- name: Query API for failed jobs
  ansible.builtin.set_fact:
    failed_job_wf_nodes: >-
      {{ query('ansible.controller.controller_api',
              'workflow_jobs/' ~ failed_job_wf_id ~ '/workflow_nodes/',
                  return_all=True) }}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 3, 2026, 1:30pm UTC](https://forum.ansible.com/t/help-with-ansible-controller-controller-api-using-return-all-true/45474/3 "2026-04-03T13:30:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
