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 within n8n workflows. Specifically, the "Delete Workspace" operation under the "Workspace" resource enables users to delete a specified workspace within a GTM container.
Common scenarios for this operation include:
- Automating cleanup of unused or obsolete workspaces in GTM containers.
- Managing GTM environments as part of deployment pipelines.
- Integrating GTM workspace management into broader marketing or analytics automation workflows.
For example, after creating and publishing changes in a GTM workspace, you might want to automatically delete that workspace to keep your GTM account organized.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account containing the workspace to delete. |
| Container ID | The unique identifier of the GTM Container within the account where the workspace exists. |
| Workspace ID | The unique identifier of the GTM Workspace to be deleted. |
| Optional Query Parameters | Additional optional parameters to customize the request; includes various flags and filters. |
Details on Optional Query Parameters
The optional query parameters collection supports multiple fields, but for the "Delete Workspace" operation, typically no additional parameters are required. However, the node supports passing any relevant optional parameters if needed by the API.
Output
The output is a JSON array containing the response from the Google Tag Manager API after attempting to delete the workspace. Typically, deleting a workspace returns an empty response or confirmation of deletion.
The json output field will contain the parsed JSON response from the API call. Since this is a delete operation, the response may be minimal or empty, indicating success.
No binary data output is involved in this operation.
Dependencies
- Requires valid Google Tag Manager API credentials configured in n8n using OAuth2 authentication.
- The node uses the Google Tag Manager v2 REST API endpoint:
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account are necessary to perform workspace deletions.
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 in n8n.
- Required Parameter Errors: The node validates that
Account ID,Container ID, andWorkspace IDare provided. Missing any of these will cause an error. Double-check that these IDs are correctly entered. - API Permission Denied: If the API returns permission errors, verify that the authenticated user has sufficient rights to delete workspaces in the specified GTM account and container.
- Unknown Operation Error: This should not occur if the operation is correctly set to "Delete Workspace". If it does, confirm the node configuration.
- Network or API Errors: General API errors will be wrapped and reported with the message prefix "Error calling GTM API". Check network connectivity and API quota limits.
Links and References
- Google Tag Manager API Documentation - Workspaces
- Google Tag Manager API Overview
- n8n OAuth2 Credential Setup
This summary focuses solely on the "Delete Workspace" operation of the "Workspace" resource as requested, based on static analysis of the provided source code and property definitions.