Actions5
Run Command Workstation
AI-generatedOverview
This node, named "Google IDX Action," is designed to perform operations on Google Cloud Workstations using a selected Google OAuth2 credential. It allows users to run commands or manage workstations (start, stop, get status, generate access token) within specified Google Cloud projects and clusters.
Common scenarios where this node is beneficial include:
- Automating management of Google Cloud Workstations in CI/CD pipelines.
- Running custom shell commands remotely on developer workstations hosted in Google Cloud.
- Integrating workstation lifecycle control into broader workflows for cloud resource orchestration.
For example, a user can run a specific command on a workstation associated with a project or start/stop a workstation programmatically as part of an automated deployment process.
Properties
| Name | Meaning |
|---|---|
| Is List | Boolean flag indicating whether the input is a list of commands or a single command string. |
| Credentinals Name | Select or enter the Google Cloud account credential to use. Options: select from list or enter name manually. |
| Project ID | Select or enter the Google Cloud project ID. Only shown if "Is List" is false. Options: select from list. |
| Commnad | The command string to run on the workstation. Only shown when operation is "Run Command Workstation" and "Is List" is false. |
Output
The node outputs JSON data representing the result of the executed command or workstation operation. The output structure is an array containing objects with a json field holding the response data from the Google IDX API call. Each item corresponds to the result of running the command or performing the operation on a particular workstation.
If multiple workstations are targeted (when "Is List" is true), the node processes each and returns the first result from each execution wrapped in the output array.
No binary data output is indicated by the code.
Dependencies
- Requires a valid Google OAuth2 credential configured in n8n to authenticate API requests.
- Uses an internal helper function to fetch credentials and make authenticated HTTP requests to Google IDX APIs.
- Relies on a sub-workflow template (
subWorkflowTemplate.json) that defines how to execute the workstation commands. - Needs proper configuration of Google Cloud projects, workstations, and clusters accessible via the provided credentials.
Troubleshooting
- Invalid Input Format Error: If the command string does not match the expected pattern
/[run|start|stop|status|token] -a USER -ws SLUG[,SLUG2] [-c COMMAND], the node throws an error. Ensure the command follows this format exactly. - Missing Workspace Error: If no matching workspace is found for the given slug(s), the node throws an error indicating it cannot find the workspace. Verify that the workspace slugs and project IDs are correct.
- Credential Issues: Errors related to authentication or missing credentials may occur if the Google OAuth2 credential is not properly set up or lacks required permissions.
- Empty Command or Parameters: When "Is List" is false but the command or project ID is missing or invalid, the node will throw errors. Make sure all required parameters are provided.