> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/documentation/automations/subworkflows/prod-task-duo-get-user-counts.md).

# \[PROD - TASK] Duo: Get User Counts

This workflow queries Duo Security to retrieve a comprehensive count of users across all client accounts, serving as a critical building block for MSPs to automate billing, license management, and security compliance reporting. It's particularly valuable for MSPs who bill per user, need to verify MFA deployment completeness, or must generate regular security compliance documentation for clients requiring multi-factor authentication. Technically, the workflow functions by first listing all Duo accounts, then retrieving all users from the Duo platform, and finally merging this data to generate accurate user counts that can feed into reporting systems, PSA tools, or client-facing dashboards.

This workflow contains 7 tasks.

### Inputs

This subworkflow has no inputs.

### Outputs

* **automation\_log**: Standardized Rewst automation log
* **duo\_user\_count**: List of DUO companies and their counts.

### Key tasks

* **build automation log**: Logging
* **get\_user\_count**: Data retrieval
* **duo\_list\_accounts**: Duo integration: List Accounts
* **duo\_list\_users**: Duo integration: List Users
* **BEGIN**: Core integration: noop

### Jinja examples

#### Example 1

```jinja
{{ CTX.accounts.response }}
```

Used in setting the duo\_accounts alias.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rewst.help/documentation/automations/subworkflows/prod-task-duo-get-user-counts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
