Skip to main content

Cron Job Execution

Cron Job Executions are historical records of each time a cron job runs. They capture the execution status, console logs, return values, timing information, and any errors that occurred.

At a Glance

  • Records every scheduled and manual execution
  • Captures console output and script return values
  • Tracks execution duration and status
  • Supports filtering by status and trigger type
  • Useful for debugging and monitoring

Data Shape

Execution Status

Trigger Types

Logs and Output

Console Logs: All console.log(), console.error(), etc. calls are captured:
Return Value: The script’s return value is stored in output:

Execution Statistics

The parent CronJob includes aggregated statistics from executions:

Security & Permissions

  • View: Any organization member can view execution history
  • Create: System only (via scheduler or manual trigger)
  • Delete: Not supported (audit trail preserved)

API Notes

  • cronJob.listExecutions: Paginated list with filtering by status and trigger type
  • cronJob.getExecution: Full execution details including logs and output
  • cronJob.get: Includes recent executions and aggregated statistics

Monitoring Best Practices

  1. Check failure patterns: Look for recurring errors at specific times
  2. Monitor execution duration: Sudden increases may indicate issues
  3. Review logs regularly: Catch warnings before they become failures
  4. Set up alerts: Use the output to trigger external monitoring
  5. Track success rates: Calculate successCount / totalExecutions

Example: Debugging a Failed Execution

  • CronJob - Parent scheduled automation job
  • CronJobVariable - Environment variables and secrets