Google IDX icon

Google IDX

Google IDX

Overview

This node integrates with Google Cloud Workstations via the Google IDX API, enabling management and control of cloud-based development workstations. It supports operations such as starting, stopping, resetting, retrieving status, generating access tokens, running commands on workstations, and initializing workstation data.

Common scenarios include:

  • Automating the lifecycle of cloud workstations for development or testing environments.
  • Running remote commands on workstations through secure SSH sessions.
  • Monitoring workstation statuses to integrate with CI/CD pipelines or alerting systems.
  • Managing multiple users' workspaces in a centralized manner.

For example, a developer team can use this node to programmatically start all required workstations before a sprint begins, run setup scripts remotely, and then stop them after work is done to save costs.

Properties

Name Meaning
Project ID Select or enter your Google Cloud project ID. Supports selecting from a list or entering an ID manually.

Note: The "Project ID" property is used when the operation is not one of the excluded ones (like updateWorkstation, liveWorkstation, etc.). It identifies the Google Cloud project under which the workstation operations are performed.

Output

The node outputs JSON objects whose structure depends on the selected operation:

  • startWorkstation / stopWorkstation / generateAccessToken: Outputs the raw response from the Google IDX API related to the requested action.
  • getWorkstation: Returns detailed information about the specified workstation.
  • resetWorkstation: Returns a simple confirmation JSON { status: "reset-complete" }.
  • workstationInitialization: Outputs aggregated data about all workstations grouped by user and workspace slug, including counts of total users and items.
  • getStatusWorkstation: Provides categorized lists of workstations by their state (STATE_STARTING, STATE_RUNNING, STATE_STOPPED).
  • manualWorkstation: Parses a custom command string and outputs corresponding actions for targeted workstations.
  • runCommandWorkstation: Executes a shell command on a workstation via gcloud CLI inside a Docker container, returning execution details including timestamps, exit codes, stdout, stderr, and access tokens.
  • liveWorkstation: Checks the live status of workstations by making HTTP requests to their VNC endpoints, returning status codes and interpreted states like "running", "stopped", or "accessToken-exp".

If binary data were involved (not evident here), it would typically represent files or streamed content, but this node primarily deals with JSON responses.

Dependencies

  • Requires an OAuth2 API credential configured for Google IDX API access.
  • Uses Google Cloud Workstations API endpoints.
  • Depends on the presence of the gcloud CLI tool and Docker for executing remote commands on workstations.
  • Utilizes Node.js child process execution to run shell commands inside Docker containers.
  • Relies on n8n's helper methods for OAuth2 authenticated HTTP requests.
  • Environment variables or static workflow data store user-specific workstation session info.

Troubleshooting

  • Missing or invalid Project ID: Operations that require a project ID will fail if it's not provided or invalid. Ensure the "Project ID" property is correctly set.
  • Authentication errors: If OAuth2 credentials are misconfigured or expired, API calls will fail. Refresh or reconfigure the API key credential.
  • Command execution failures: When running commands via Docker and gcloud CLI, errors may occur if Docker is not running, the container name is incorrect, or the gcloud CLI is not installed/configured properly.
  • Invalid manual command format: The manualWorkstation operation expects commands in a strict format; deviations will throw errors. Follow the documented input pattern carefully.
  • API rate limits or transient errors: The code retries certain HTTP 503/504 errors with exponential backoff, but persistent failures indicate service issues or quota exhaustion.
  • Access token expiration: Live workstation checks may return "accessToken-exp" status indicating the need to refresh tokens.

Links and References

Discussion