Google IDX icon

Google IDX

Google IDX

Reset Cache Workstation

AI-generated

Overview

This node integrates with Google Cloud Workstations via the Google IDX API, enabling management and control of workstation environments programmatically within n8n workflows. It supports various operations such as resetting cached workstation data, starting or stopping workstations, generating access tokens, retrieving status, running commands remotely, and initializing workstation configurations.

A common use case is automating development environment setups or maintenance tasks in Google Cloud Workstations, for example:

  • Resetting cached workstation data to clear stale session information.
  • Starting or stopping workstations on demand based on workflow triggers.
  • Running custom shell commands inside a workstation container using gcloud CLI.
  • Fetching real-time status of multiple workstations for monitoring purposes.

This node is beneficial for DevOps teams or developers who want to integrate Google Cloud Workstations management into automated pipelines without manual intervention.

Properties

Name Meaning
Project ID Select or enter your Google Cloud project ID. Can be chosen from a list of projects or entered manually as a string. Used to specify which Google Cloud project the operation targets.
Is Global Data Boolean flag indicating whether to use global static data storage instead of workflow-specific static data.
Global Data JSON object representing global static data to be used if "Is Global Data" is set to true. This can store cached workstation info or tokens shared across executions.

Output

The node outputs an array of JSON objects, each corresponding to the result of the requested operation per input item. The structure varies by operation:

  • For reset cache workstation, output is { status: "reset-complete" } indicating the cache was cleared.
  • For live workstation status checks, outputs include status codes like "running", "stopped", or "accessToken-exp" along with workstation names.
  • For start/stop/generateAccessToken/getWorkstation operations, outputs contain the raw API response JSON from Google Cloud Workstations.
  • For workstation initialization, outputs include detailed workstation configuration and access token info.
  • For getStatusWorkstation, outputs categorize workstations by their state (starting, running, stopped).
  • For manualWorkstation commands, outputs reflect the action performed, user, workspace, and optional command details.
  • For runCommandWorkstation, outputs include execution metadata such as timestamp, access token, project info, exit code, stdout, and stderr from the command run inside the workstation container.

The node does not output binary data.

Dependencies

  • Requires an OAuth2 API credential configured for Google IDX API access with appropriate scopes to manage Google Cloud Workstations.
  • Uses Google Cloud Workstations REST API endpoints.
  • For running commands inside workstations, requires gcloud CLI installed and accessible, and optionally Docker if running commands inside a containerized environment.
  • Node depends on n8n's HTTP request helpers and OAuth2 authentication mechanisms.
  • Environment must allow execution of child processes for running shell commands (child_process.exec).

Troubleshooting

  • Missing or invalid Project ID: Some operations require a valid Google Cloud project ID. Ensure it is provided either from the list or manually.
  • Authentication errors: If OAuth2 credentials are misconfigured or expired, requests will fail. Refresh or reconfigure the API key credential.
  • Invalid input format for manual commands: Manual workstation commands must follow the pattern /[run|start|stop|status|token] -a USER -ws SLUG[,SLUG2] [-c COMMAND]. Errors here indicate malformed input.
  • Command execution failures: When running commands inside workstations, errors may arise from missing gcloud CLI, incorrect Docker container name, or invalid command syntax.
  • Unsupported operation error: If an unsupported operation name is passed, the node throws an error specifying the operation is not supported.
  • Cache reset issues: If global or workflow static data is corrupted or inaccessible, resetting cache might not behave as expected.

Links and References

Discussion