Google Idx Live Trigger icon

Google Idx Live Trigger

Triggers the workflow on a given schedule

Overview

This node is a Google Idx Live Trigger designed to trigger workflows on a user-defined schedule. It integrates with Google Workstations API to monitor and manage live workstation instances, triggering workflow executions based on specified time intervals or cron expressions.

Common scenarios where this node is beneficial include:

  • Automatically monitoring the status of Google Workstations at regular intervals.
  • Restarting stopped workstations automatically when detected.
  • Refreshing access tokens for workstations whose tokens have expired.
  • Running batch operations on subsets of workstations according to scheduling rules.

Practical examples:

  • A DevOps team wants to ensure all their cloud workstations are running during business hours and automatically restart any that have stopped overnight.
  • An automation workflow that checks every 5 minutes for token expiration and refreshes tokens to maintain uninterrupted access.
  • Scheduled reporting on workstation statuses aggregated in batches for performance optimization.

Properties

Name Meaning
Batch Options Controls how many workstations to process per batch and from which position. Includes:
Batch Size: Number of workstations to process in one batch (default 50).
Start From: Index to start batching from (default 0).
Mode: Whether to batch from the start or end of the list (fromStart or fromEnd).
Trigger Rules Defines the schedule on which the trigger fires. Supports multiple rules with these options:
Trigger Interval: Choose unit of time (seconds, minutes, hours, days, weeks, months, or custom cron expression).
• Depending on interval, specify number of units between triggers (e.g., 5 minutes).
• For weeks, select weekdays to trigger.
• For months, specify day of month.
• For days/weeks/months, specify hour and minute of trigger.
• For cron expressions, provide a valid cron string.

Output

The node outputs an array of JSON objects representing the status of each monitored workstation in the current batch. Each output item includes:

  • email: The user email associated with the workstation.
  • statusCode: HTTP status code from the workstation check (e.g., 200, 401, 404).
  • status: Human-readable status such as "running", "stopped", "accessToken-exp" (token expired), or "unknown".
  • data: The workstation name.
  • accessToken: If a new access token was generated, it is included here.
  • expireTime: Expiration time of the access token if refreshed.
  • workspaceRestarted: Boolean indicating if the workstation was restarted during this trigger execution.
  • Additional metadata about the trigger time, including ISO timestamp, readable date/time, day of week, year, month, day, hour, minute, second, and timezone info.

No binary data is output by this node.

Dependencies

  • Requires an API key credential with OAuth2 authentication configured for Google Workstations API.
  • Uses Google Workstations API endpoints to query workstation states, generate access tokens, and start workstations.
  • Requires n8n environment to support OAuth2 credential usage and HTTP request helpers.
  • Relies on external libraries for cron parsing and timezone handling.

Troubleshooting

  • Invalid Cron Expression: If a custom cron expression is invalid, the node throws an error with a message pointing to https://crontab.guru/ for help. Verify the cron syntax carefully.
  • Failed to Generate Access Token: Errors generating access tokens usually indicate credential issues or insufficient permissions. Check that the OAuth2 credentials are valid and have required scopes.
  • Failed to Start Workstation: This can happen if the workstation is in an unexpected state or credentials lack permission. Ensure the workstation exists and credentials allow starting it.
  • No Workstations Found: If no workstations are returned, verify that the global static data contains expected workstation info and that batching parameters are correct.
  • Network or API Errors: General HTTP errors may occur due to network issues or API limits. Review logs and retry as needed.

Links and References

Discussion