Google IDX icon

Google IDX

Google IDX

Start Workstation

AI-generated

Overview

This node integrates with Google Cloud Workstations via the Google IDX API, enabling users to manage and interact with their cloud-based development workstations programmatically. It supports operations such as starting, stopping, resetting, updating, and retrieving the status of workstations, as well as running commands inside them.

Common scenarios where this node is beneficial include automating workstation lifecycle management in CI/CD pipelines, monitoring workstation statuses for operational dashboards, or remotely executing commands/scripts on cloud workstations without manual intervention.

For example, a developer team can use this node to automatically start a workstation when a new feature branch is created, run initialization scripts, and stop the workstation after testing completes, optimizing resource usage and costs.

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.
Is Global Data Boolean flag indicating whether to use global workflow static data (true) or local node data (false).
Global Data JSON object containing global data to be used if "Is Global Data" is set to true.

Output

The node outputs an array of JSON objects, each representing the result of the requested operation. The structure varies depending on the operation:

  • For startWorkstation, stopWorkstation, and generateAccessToken: Outputs the response from the Google Workstations API, typically including access tokens or status confirmations.
  • For getWorkstation: Outputs detailed information about the specified workstation.
  • For resetWorkstation: Outputs a simple status message confirming reset completion.
  • For updateWorkstation: Outputs parsed metadata about the workstation extracted from URLs, such as project ID, location, cluster, and workspace.
  • For workstationInitialization: Outputs data about all configured IDX workspaces, including access tokens and environment details.
  • For getStatusWorkstation: Outputs categorized lists of workstations by their state (starting, running, stopped).
  • For liveWorkstation: Outputs status codes indicating if the workstation is running, stopped, or if the access token has expired.
  • For manualWorkstation: Outputs action details for manually specified commands on workstations.
  • For runCommandWorkstation: Outputs command execution results including stdout, stderr, exit code, and related metadata.

If binary data were involved (e.g., screenshots or logs), it would be summarized accordingly, but this node primarily deals with JSON responses.

Dependencies

  • Requires an OAuth2 API credential for authenticating with Google IDX services.
  • Uses Google Cloud Workstations API endpoints.
  • Depends on n8n's HTTP request helpers for making authenticated API calls.
  • Requires the Google Cloud project to have Workstations enabled and properly configured.
  • For running commands inside workstations, requires access to a Docker container running the Google Cloud SDK CLI (gcloud), referenced by a property (not shown in the provided properties but used internally).
  • Environment must allow execution of shell commands for SSH and Docker interactions.

Troubleshooting

  • Missing or invalid Project ID: Operations that require a project ID will fail if it's not provided or invalid. Ensure the correct project ID is selected or entered.
  • Authentication errors: If OAuth2 credentials are missing, expired, or misconfigured, API requests will fail. Refresh or reconfigure the API key credential.
  • Invalid input format for manual commands: The manualWorkstation operation expects commands in a specific format. Errors like "Invalid input format" indicate malformed commands; follow the expected syntax carefully.
  • Access token expiration: Status checks may return "accessToken-exp" indicating the token expired. Re-authenticate or refresh tokens as needed.
  • Docker or gcloud CLI issues: Running commands inside workstations depends on Docker and the Google Cloud SDK CLI being available and correctly configured. Errors during command execution may relate to these dependencies.
  • Unsupported operations: Attempting an operation not implemented by the node will throw an error specifying the unsupported operation.

Links and References

Discussion