Actions11
Live Workstation
AI-generatedOverview
This node integrates with Google Cloud Workstations (IDX) to manage and interact with cloud-based development workstations. It supports operations such as starting, stopping, resetting, updating, and checking the live status of workstations, as well as running commands remotely via gcloud CLI or manual commands.
Common scenarios where this node is beneficial include:
- Automating workstation lifecycle management in CI/CD pipelines.
- Monitoring the status of multiple cloud workstations.
- Running remote commands on workstations for maintenance or deployment tasks.
- Generating access tokens for secure workstation access.
- Initializing and updating workstation configurations programmatically.
Practical example:
- A developer can use this node to start a workstation before beginning a coding session and stop it afterward to save costs.
- An admin can check which workstations are currently running or stopped across projects.
- Running custom shell commands remotely on a workstation containerized inside Docker using the gcloud CLI.
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 node-specific 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 by operation:
- liveWorkstation: Outputs status codes and states like
"running","stopped","accessToken-exp"(expired token), or"unknown"for each workstation. - startWorkstation, stopWorkstation, generateAccessToken, getWorkstation: Outputs the raw API response JSON from Google Cloud Workstations.
- resetWorkstation: Outputs a simple JSON confirming reset completion.
- updateWorkstation: Outputs parsed workstation details including project ID, location, cluster, and workspace.
- workstationInitialization: Outputs detailed workstation environment data including access tokens and metadata.
- getStatusWorkstation: Outputs categorized lists of workstations by their state (
STATE_STARTING,STATE_RUNNING,STATE_STOPPED). - manualWorkstation: Outputs action details per user and workspace, optionally including commands.
- runCommandWorkstation: Outputs command execution results including timestamps, access tokens, exit codes, stdout, and stderr.
If binary data were involved, it would represent files or streams related to workstation sessions, but this node primarily deals with JSON responses and command outputs.
Dependencies
- Requires an OAuth2 API credential for authenticating with Google Cloud Workstations API.
- Uses Google Cloud Workstations REST API endpoints.
- For some operations, requires the
gcloudCLI installed and accessible within a Docker container specified by the user. - Node depends on n8n's HTTP request helpers and OAuth2 authentication mechanisms.
- Environment must allow executing child processes (for running shell commands inside Docker).
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.
- 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 will be thrown if the format is incorrect or required parts are missing. - Expired access tokens: The node checks for token expiration and may return status
"accessToken-exp". Refresh credentials or re-authenticate if this occurs. - Docker or gcloud CLI errors: When running commands via Docker, ensure the container name and gcloud CLI are correctly specified and accessible. Errors during command execution will be surfaced with exit codes and stderr output.
- Unsupported operations: If an unsupported operation is requested, the node throws an error specifying the unsupported operation name.
- Network or permission issues: API calls may fail due to network problems or insufficient permissions; verify OAuth2 credentials and API access rights.