> For the complete documentation index, see [llms.txt](https://docs.siit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.siit.io/guides/workflows/google-group-management.md).

# Add or remove Google group members with n8n

Add or remove users from Google Workspace groups automatically by calling an n8n webhook from a Siit workflow, including Google Cloud OAuth and Admin SDK API setup

{% hint style="info" %}
This guide shows how to use n8n with Siit so users are automatically added to Google Workspace groups via a webhook.
{% endhint %}

#### 1. Prerequisites

* An **n8n instance** (cloud or self-hosted)
* A **Google Workspace Admin account** with API access
* **Header Auth credentials** in n8n (for secure webhook calls)
* Access to **Siit workflows**

#### 2. Create Google Workspace Credentials

1. Go to [\*\*Google Cloud Console](https://console.cloud.google.com/) → New Project\*\*
   * Name it (e.g., *n8n Google Integration*).
2. **Enable APIs**
   * **Admin SDK API**
   * *(Optional)* **Groups Settings API**
3. **OAuth Consent Screen**
   * Type: **Internal**
   * Fill in name, support email, domain → Save
4. **Create OAuth Client ID**
   * Type: **Web application**
   * Add redirect URI
     * Local: `http://localhost:5678/rest/oauth2-credential/callback`
     * Cloud: `https://<your-n8n-domain>/rest/oauth2-credential/callback`
       * you can find your `<your-n8n-domain>` in your N8N url

         <figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-355328779e3415c3059b14900cbcd27c23091a7b%2FScreenshot-2025-09-24-at-14.00.07.png?alt=media" alt="Screenshot 2025-09-24 at 14.00.07"><figcaption></figcaption></figure>
   * Copy **Client ID** and **Client Secret**
5. **In n8n**
   * Go to **Credentials → Google Workspace Admin OAuth2**
   * Paste Client ID + Secret → complete OAuth flow

#### 3. Import the Workflow

1. In n8n: **Create Workflow → ‘…’ → Import from file**

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-5a136008465a4e5154e5c1fdbdc138500f8f7aa0%2FScreenshot-2025-09-24-at-14.02.34.png?alt=media" alt="Screenshot 2025-09-24 at 14.02.34"><figcaption></figcaption></figure>

2. Import the JSON file:
3. 1. For adding a user to a group

      [Google\_workspace\_\_\_add\_user\_to\_a\_group.json](https://github.com/siitapp/siit-product-documentation/tree/main/guides/help-center/.gitbook/assets/Google_workspace___add_user_to_a_group.json)
   2. For removing a user from a group

      [Google\_workspace\_\_\_remove\_user\_to\_a\_group.json](https://github.com/siitapp/siit-product-documentation/tree/main/guides/help-center/.gitbook/assets/Google_workspace___remove_user_to_a_group.json)

> ⚠️ Credentials are not included. You’ll link them in the next step.

***

#### 4. Connect Credentials in n8n

* **Webhook node** → attach your **Header Auth**

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-4afedc5efee720122e11c1646612eca848853d45%2FCredentials-Siit-N8N.gif?alt=media" alt="Credentials Siit N8N"><figcaption></figcaption></figure>

* **Google nodes (List Groups, Add User to Group)** → attach **Google Workspace Admin OAuth2**
  * You’ll find your client ID and Client secret in your google project you created at step 2

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-85113a49d1073d6934d3a985c4724469e7c1426a%2FScreenshot-2025-09-24-at-14.45.28.png?alt=media" alt="Screenshot 2025-09-24 at 14.45.28"><figcaption></figcaption></figure>

#### 5. Workflow Overview

| Node                  | Purpose                                              | Customization                                                                         |
| --------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **Webhook (Siit)**    | Receives `requesterEmail`, `userToAdd`, `groupToAdd` | Decide who should get success/failure notifications (requester, app owner, etc.)      |
| **List groups**       | Fetches all Google Groups                            | Add filters if you want to limit scope or reduce load with many groups                |
| **Find group ID**     | Matches `groupToAdd` with the correct group ID       | Adjust logic if your naming conventions differ                                        |
| **Add user to group** | Adds user to the selected Google Group               | Duplicate this step to add a user to multiple groups                                  |
| **Check success**     | Confirms the operation worked                        | Define what should happen on success or failure (e.g. send email, log, stop workflow) |

***

#### 6. Configure Webhook in Siit

1. Create **Webhook action** in Siit
2. Paste the **Webhook URL** from n8n (use the **production URL**)

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-c38d18ff40bfe4eda9f922f942a37d184fe169ad%2FScreenshot-2025-09-24-at-14.52.24.png?alt=media" alt="Screenshot 2025-09-24 at 14.52.24"><figcaption></figcaption></figure>

3. Add **Authorization header** with your token:

```
Authorization: Bearer <your-token>
```

4. Add JSON body:

```
{
  "requesterEmail": "requester@example.com",
  "userToAdd": "newuser@example.com",
  "groupToAdd": "Engineering Team"
}
```

*⚠️ when copy pasting the script, make sure to replace **Requester*** ***Email** with the corresponding Siit requester variable clicking on **"+ Add variable"** as per the screenshot below:*

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-54f212cbe474882445875184aefe76ea54744ca2%2FCleanShot-2026-01-18-at-14-35-27-2x-png.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 7. Test & Go Live

1. Activate workflow in n8n
2. Send test request from Siit
3. Check execution log:
   * Groups listed
   * Correct group ID found
   * User added successfully
4. ⚠️ Switch to **production Webhook URL** in Siit

***

#### 8. Optional

* **Error handling** → notify if group not found
* **Escalation** → use Siit API to create a request in case it failed (see [Utiliser l’API de SIIT à l’aide de N8N](https://www.notion.so/Utiliser-l-API-de-SIIT-l-aide-de-N8N-25d6d95a573b8023b3f1cc3acedf24ca?pvs=21) or <https://developer.siit.io/>)
* **Multiple groups** → extend workflow to add user to several groups

***

✅ Done! Siit now adds users automatically to Google Groups through n8n.


---

# 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.siit.io/guides/workflows/google-group-management.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.
