Actions102
- Account Actions
- Built-In Variable Actions
- Client Actions
- Container Actions
- Destination Actions
- Environment Actions
- Folder Actions
- Google Tag Configuration Actions
- Tag Actions
- Template Actions
- Transformation Actions
- Trigger Actions
- User Permission Actions
- Variable Actions
- Version Actions
- Workspace Actions
- Zone Actions
Overview
This node integrates with the Google Tag Manager (GTM) API, allowing users to manage various GTM resources programmatically. Specifically, for the Workspace resource and the List Workspaces operation, it lists all workspaces that belong to a specified GTM Container within a GTM Account.
This functionality is useful when you want to retrieve all workspaces available in a container to monitor or automate workspace-related tasks such as synchronization, versioning, or conflict resolution.
Practical example:
You have multiple workspaces in a GTM container for different development stages or teams. Using this node operation, you can fetch all these workspaces to display their details, check their status, or trigger further automation workflows based on workspace data.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account containing the container. |
| Container ID | The unique identifier of the GTM Container whose workspaces you want to list. |
| Optional Query Parameters | Additional optional parameters to customize the request. For this operation, typically empty. |
Note: For the List Workspaces operation, only Account ID and Container ID are required. Other properties are not used in this context.
Output
The output is a JSON array where each item represents a workspace object belonging to the specified GTM Container. Each workspace object contains details such as its ID, name, description, and other metadata defined by the GTM API.
Example structure of one workspace item (simplified):
{
"name": "accounts/{accountId}/containers/{containerId}/workspaces/{workspaceId}",
"workspaceId": "string",
"displayName": "string",
"description": "string",
"path": "string",
"fingerprint": "string"
}
The exact fields depend on the GTM API response but generally include identifiers and descriptive information about each workspace.
Dependencies
- Requires an active connection to the Google Tag Manager API via OAuth2 authentication.
- The user must provide valid credentials with sufficient permissions to access the specified GTM Account and Container.
- No additional external dependencies beyond the configured OAuth2 credential for Google Tag Manager.
Troubleshooting
Missing Credentials Error:
If the node throws an error about missing credentials, ensure that the Google Tag Manager OAuth2 API credentials are properly set up and connected in n8n.Required Parameter Errors:
The node requires bothAccount IDandContainer ID. Omitting either will cause an error indicating the missing parameter. Make sure to provide valid IDs.API Permission Issues:
If the API returns permission errors, verify that the authenticated user has access rights to the specified account and container.Unknown Operation Error:
This should not occur if the operation is correctly set to "List Workspaces". If it does, confirm the operation value is correct.