> 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-rewst-get-all-integration-ids.md).

# \[PROD - TASK] Rewst: Get All Integration Ids

This utility workflow collects all integration IDs from your Rewst instance, mapping organizations to their connected systems and Microsoft tenant IDs, serving as a fundamental building block for other automation workflows that need to interact with your integrated PSA, RMM, or Microsoft 365 environments. It's particularly valuable for MSPs when creating cross-platform automation workflows, conducting integration audits, or troubleshooting connection issues where accurate integration identifiers are required. Technically, the workflow retrieves all organizations in your Rewst instance, lists the integrations for each organization, collects relevant organization variables, and specifically identifies Microsoft tenant IDs—creating a comprehensive integration mapping that other workflows can reference when executing actions against specific client environments.

This workflow contains 6 tasks.

### Inputs

This subworkflow has no inputs.

### Outputs

* **all\_integration\_ids**: Outputs a list of organizations, the organization object includes org info and their integration mappings.

### Key tasks

* **rewst\_list\_organizations**: Rewst integration: List Organizations
* **rewst\_list\_integrations\_for\_organization**: Rewst integration: List Integrations For Organization
* **rewst\_list\_organization\_variables**: Rewst integration: List Organization Variables
* **BEGIN**: Core integration: noop
* **workflows\_get\_ms\_tenant\_ids**: Data retrieval

### Jinja examples

#### Example 1

```jinja
{{ [org.id for org in CTX.all_orgs if org.is_enabled == true] + [ORG.ATTRIBUTES.id] }}
```

This expression creates a list of all enabled organization IDs across your MSP environment, plus the current organization's ID. It accesses the `CTX.all_orgs` collection to gather all enabled organizations (`org.is_enabled == true`) and adds the current organization ID (`ORG.ATTRIBUTES.id`) to ensure it's included regardless of its enabled status.

### Expression 2

#### Example 2

```jinja
{{ [ config.id for pack in CTX.packs for config in pack.pack_configs if config.default == true and \"csp\" in pack.name|lower ] | first or None }}
```

This expression finds the first default configuration ID for any integration pack containing "csp" in its name (cloud service provider), returning None if none exists. It performs a nested loop through integration packs and their configurations, filtering for default configurations within CSP-related integration packs.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rewst.help/documentation/automations/subworkflows/prod-task-rewst-get-all-integration-ids.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
