Skip to main content

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:

  1. Retrieves the service account credentials from the vault
  2. Validates that credentials contain valid JSON content
  3. Extracts an OAuth2 access token from the credentials
  4. Validates that Project ID is provided and not empty
  5. Creates a unique connection ID
  6. Stores the token and project ID associated with the connection ID
  7. 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.predict permission
  • Service Account Key in JSON format stored in Robomotion vault
  • Project ID from your Google Cloud Console

Error Handling

Common errors and solutions:

ErrorCauseSolution
ErrInvalidArgsNo credential contentEnsure credentials are properly configured in vault
ErrGetTokenFromVaultInvalid credentials JSONVerify service account key JSON format
ErrGetTokenToken generation failedCheck service account permissions and validity
ErrInvalidArgEmpty Project IDProvide 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

  1. 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"
  2. Grant Vertex AI Permissions:

    • Select role: "Vertex AI User"
    • Or create custom role with specific permissions
    • Click "Continue"
  3. 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
  4. 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