Jobs
Create and manage scheduled HTTP jobs with cron expressions, recurring intervals, or one-time triggers.
A job is a saved HTTP request definition with a schedule. When the schedule fires, TrigRun makes the HTTP request and records the result.
Job kinds
| Kind | Schedule | Use case |
|---|---|---|
recurring | Every N minutes (1–1440) | Periodic health checks, sync endpoints |
cron | 5-field cron expression with timezone | Nightly backups, weekly reports, complex schedules |
scheduled | One run at a future timestamp | Delayed actions, scheduled launches |
one_time | Immediate, single execution | Webhooks, one-shot triggers |
Creating a job
Recurring job
Runs every N minutes, starting from creation time:
Cron job
Uses standard 5-field cron syntax. Timezone defaults to UTC if not specified.
Cron field reference:
Common patterns:
| Expression | Meaning |
|---|---|
* * * * * | Every minute |
0 * * * * | Every hour |
0 2 * * * | Daily at 2:00 AM |
30 9 * * 1-5 | Weekdays at 9:30 AM |
0 0 1 * * | First day of every month at midnight |
One-time immediate
Creates a job and immediately queues an execution:
Job states
| State | Meaning |
|---|---|
active | Scheduled and will run at next_run_at |
paused | Schedule suspended, won't run until resumed |
draft | Created but not yet activated |
completed | Terminal state for one-time/scheduled jobs after execution |
Pause and resume
Resuming a job recomputes next_run_at from the current time.
Request configuration
| Field | Type | Default | Description |
|---|---|---|---|
url | string | (required) | Target URL. Must be publicly reachable HTTP/HTTPS. |
method | string | GET | HTTP method: GET, POST, PUT, PATCH, DELETE |
headers | object | {} | Key-value pairs. Supports secret://name syntax. |
body | any | null | Request body. Sent as-is. |
timeout_seconds | integer | 30 | Request timeout (1–300 seconds). |
success_statuses | integer[] | [200, 201, 202, 204] | Status codes considered successful. |
Retry policy
| Field | Type | Default | Description |
|---|---|---|---|
max_attempts | integer | 3 | Total attempts including the first (1–10). |
retry_on_statuses | integer[] | [429, 500, 502, 503, 504] | Status codes that trigger a retry. |
Retries use exponential backoff: 250ms * 2^attempt with jitter.
Secret references in headers
You can reference workspace secrets in job headers using secret://name:
At execution time, TrigRun resolves secret://stripe-key to the decrypted secret value. See the Secrets guide for how to create and manage secrets.
Updating a job
Use PATCH to update specific fields:
You can update the name, kind, schedule, request, retry policy, state, and concurrency limit in a single request. Only include the fields you want to change.
Triggering manually
Run a job immediately regardless of its schedule:
This creates a new execution with source: "manual". The job's regular schedule is unaffected.
Bulk import from crontab
Import jobs from standard crontab format:
Each line follows standard crontab format: <cron-expression> <url>. Lines starting with # are ignored. If a line doesn't contain a URL, the default_url is used.
Idempotent creation
To avoid duplicate jobs, pass an Idempotency-Key header:
If a job with the same idempotency key already exists in the workspace, the existing job is returned instead of creating a duplicate.
Deleting a job
Deleting a job also deletes its executions and notification rules.