> For the complete documentation index, see [llms.txt](https://docs.harmony.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.harmony.io/ai-agents/access-control/idp-group-membership-query-blocks.md).

# IdP Group Membership Query Blocks

You can now query group membership information directly inside your Custom Agent workflows for all supported identity providers. Whether you need to verify access rights, audit group assignments, or drive conditional logic based on team membership, these blocks let you work with group data without leaving your workflow.

The following identity providers are supported:

* Okta
* Microsoft Entra
* Google Workspace
* JumpCloud

### Available Blocks

Four workflow blocks are available for group membership queries. Three are new additions, and one existing block has been enhanced.

#### Check Group Membership

Use this block to verify whether a specific employee is a member of a given group. This is useful for conditional branching - for example, routing a request differently depending on whether the user belongs to an admin or standard-access group.

#### List User's Groups

Use this block to retrieve all groups that a specific employee belongs to. The block includes full pagination support, so you can handle employees with large numbers of group memberships without missing any results.

#### Get Group Details

Use this block to look up information about a specific group by its ID. The response includes details such as the group's member count, making it helpful for auditing or validating group size before taking downstream actions.

#### List Groups (Enhanced)

The existing **List Groups** block has been updated with a `search` parameter. You can now filter the list of groups returned by a search term, making it easier to locate specific groups in large directories without retrieving the full group list first.

### Using Group Membership Blocks in a Workflow

To add any of these blocks to a Custom Agent workflow:

1. Open the workflow editor for your Custom Agent.
2. Add a new block and search for the relevant group membership block by name.
3. Select your identity provider from the available options.
4. Configure the required inputs - such as the employee identifier or group ID - and connect the block's output to downstream steps as needed.

Because all four blocks work consistently across Okta, Microsoft Entra, Google Workspace, and JumpCloud, you can build identity-provider-agnostic workflows or target a specific provider depending on your organization's setup.

### Common Use Cases

* **Access verification** - Check whether an employee is in a specific security or access group before approving a request or granting a resource.
* **Onboarding automation** - List a new employee's current group memberships to confirm provisioning steps completed correctly.
* **Audit and compliance** - Retrieve group details and member counts to validate that groups stay within expected size thresholds.
* **Dynamic routing** - Use group membership checks as conditions to branch your workflow logic based on a user's role or team.


---

# 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.harmony.io/ai-agents/access-control/idp-group-membership-query-blocks.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.
