Cron Executions

Track execution history, view logs, and retry failed cron job executions.

Base URL

https://api.hookwatch.dev/v1/cron-executions

The Execution Object

Json

Properties

FieldTypeDescription
idstringUnique identifier for the execution
job_idstringID of the cron job that was executed
job_namestringName of the cron job
statusstringExecution status: pending, running, success, failed, timeout, canceled
exit_codenumber | nullExit code (0 = success, non-zero = error)
duration_msnumberExecution duration in milliseconds
triggered_bystringHow the execution was triggered: scheduled, manual, retry
outputstringStandard output from the execution
errorstring | nullError message if the execution failed
started_atstringISO 8601 timestamp when execution started
completed_atstring | nullISO 8601 timestamp when execution completed

Execution Statuses

pending

Waiting for a CLI agent to pick up and execute

running

Execution is currently in progress on a CLI agent

success

Completed with exit code 0

failed

Completed with non-zero exit code

timeout

Exceeded configured timeout

canceled

Manually canceled before completion

List Executions

Retrieve execution history with optional filtering.

GET /v1/cron-executions

Query Parameters

FieldTypeDescription
job_idstringFilter by cron job ID
statusstringFilter by status (pending, running, success, failed, timeout, canceled)
triggered_bystringFilter by trigger type (scheduled, manual, retry)
fromstringFilter executions after this ISO 8601 timestamp
tostringFilter executions before this ISO 8601 timestamp
limitnumberMaximum executions to return (default: 50, max: 100)
offsetnumberNumber of executions to skip for pagination

Example

curl

Response

Json

Get Execution

Retrieve a specific execution by ID, including full output and error logs.

GET /v1/cron-executions/:id

Full Logs

The list endpoint returns truncated output. Use the get endpoint to retrieve the full execution output and error logs.

Retry Execution

Retry a failed execution. Creates a new execution with the same job configuration.

POST /v1/cron-executions/:id/retry

Response

Json

Only Failed Executions

You can only retry executions with status failed or timeout. Retrying creates a new execution entry.

Error Codes

StatusErrorDescription
400Bad RequestInvalid query parameters
401UnauthorizedInvalid or missing access token
404Not FoundExecution not found
409ConflictCannot retry (execution not failed)

Related