Connect
Establishes a connection to Google Vertex AI service using Google Cloud credentials and project ID.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Options
- Credentials - Google Cloud service account credentials for Vertex AI access (JSON format).
- Project Id - Google Cloud Project ID where Vertex AI is enabled (required).
Output
- Connection Id - Unique identifier for the Vertex AI client session, used by other Vertex AI nodes.
How It Works
The Connect node establishes a connection to Google Vertex AI by authenticating with Google Cloud credentials. When executed:
- Retrieves the service account credentials from the vault
- Validates that credentials contain valid JSON content
- Extracts an OAuth2 access token from the credentials
- Validates that Project ID is provided and not empty
- Creates a unique connection ID
- Stores the token and project ID associated with the connection ID
- Returns the connection ID for use by other Vertex AI nodes
The connection ID can then be passed to other Vertex AI nodes (Generate Text, Generate Chat, Generate Code, Get Text Embeddings, Get Multimodal Embeddings) to authenticate API requests.
Requirements
- Google Cloud Project with Vertex AI API enabled
- Service Account with appropriate IAM permissions:
- Vertex AI User (
roles/aiplatform.user) or - Custom role with
aiplatform.endpoints.predictpermission
- Vertex AI User (
- Service Account Key in JSON format stored in Robomotion vault
- Project ID from your Google Cloud Console
Error Handling
Common errors and solutions:
| Error | Cause | Solution |
|---|---|---|
| ErrInvalidArgs | No credential content | Ensure credentials are properly configured in vault |
| ErrGetTokenFromVault | Invalid credentials JSON | Verify service account key JSON format |
| ErrGetToken | Token generation failed | Check service account permissions and validity |
| ErrInvalidArg | Empty Project ID | Provide a valid Google Cloud Project ID |
Example Use Cases
Basic Connection Setup
Flow:
1. Add Connect node
2. Select credentials from vault
3. Set Project Id: "my-gcp-project-123"
4. Connect Connection Id output to downstream Vertex AI nodes
Reusable Connection
Setup:
- Store connection ID in flow variable
- Use same connection ID across multiple Vertex AI operations
- Reduces authentication overhead
- Disconnect when all operations complete
Multi-Project Setup
Scenario: Different models in different projects
1. Connect to Project A → Connection ID A
2. Use Connection ID A for text generation
3. Connect to Project B → Connection ID B
4. Use Connection ID B for embeddings
Tips
- Store Credentials Securely: Always use Robomotion vault for service account keys
- Reuse Connections: Create one connection and reuse the Connection ID across multiple nodes
- Project Organization: Use different projects for dev/staging/prod environments
- Minimal Permissions: Grant service accounts only the permissions they need
- Connection Pooling: For high-throughput scenarios, maintain persistent connections
- Error Recovery: Implement error handling to reconnect on token expiration
- Monitoring: Track API usage in Google Cloud Console for cost management
Getting Google Cloud Credentials
-
Create a Service Account:
- Go to Google Cloud Console
- Navigate to IAM & Admin > Service Accounts
- Click "Create Service Account"
- Provide a name and description
- Click "Create and Continue"
-
Grant Vertex AI Permissions:
- Select role: "Vertex AI User"
- Or create custom role with specific permissions
- Click "Continue"
-
Create Key:
- Click on the created service account
- Go to "Keys" tab
- Click "Add Key" > "Create new key"
- Select "JSON" format
- Download the key file
-
Store in Robomotion Vault:
- Open Robomotion
- Go to Vault section
- Create new credential
- Paste the entire JSON content
- Reference this credential in Connect node
Best Practices
- Use service accounts instead of user accounts for automation
- Rotate service account keys regularly (every 90 days)
- Monitor credential usage through Google Cloud audit logs
- Use different service accounts for different environments
- Set up alerts for authentication failures
- Document which service account is used for which automation
- Test credentials in a development environment first
- Use connection ID validation before expensive operations