TrigRun
Use Cases

Reliable GitHub Actions Scheduling

Replace GitHub Actions' unreliable cron with precise, on-time triggers via TrigRun and the workflow_dispatch API.

GitHub Actions' built-in cron scheduler is best-effort. Jobs are regularly delayed by 15-30 minutes, and under high load they can be silently dropped. TrigRun calls GitHub's workflow_dispatch API on an exact schedule so your workflows start when you need them to.

The problem

GitHub's own documentation warns:

The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. If the load is sufficiently high enough, some queued jobs may be dropped.

In practice this means:

  • 15-30 minute delays are common, especially at the top of every hour
  • Scheduled runs can be silently skipped under load
  • Self-hosted runners don't help — the queuing happens on GitHub's side
  • There is no workaround within GitHub Actions itself

If your workflow needs to run at a specific time — deployments, market-hours automation, report generation, data syncs — this unreliability is a real problem.

The TrigRun solution

Instead of relying on GitHub's cron trigger, use TrigRun to call GitHub's workflow_dispatch API at the exact time you need.

SettingValue
TemplateGitHub Actions Dispatch
MethodPOST
Targethttps://api.github.com/repos/{owner}/{repo}/actions/workflows/{workflow}.yml/dispatches
AuthGitHub PAT stored as a TrigRun secret
Response204 No Content on success

Step 1: Prepare your GitHub workflow

Add workflow_dispatch as a trigger in your workflow file:

.github/workflows/nightly.yml
name: Nightly Pipeline

on:
  workflow_dispatch:
    inputs:
      run_type:
        description: "Type of run"
        required: false
        default: "scheduled"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Triggered by ${{ github.event.inputs.run_type }}"
      # ... your build steps

Step 2: Create a GitHub PAT

  1. Go to GitHub Settings > Developer settings > Fine-grained tokens
  2. Create a token with Actions: Read and write permission on the target repo
  3. Store it as a TrigRun secret named github_pat
curl -X POST https://api.trigrun.com/v1/secrets \
  -H "Authorization: Bearer $TRIGRUN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "github_pat", "value": "github_pat_xxxxxxxxxxxx" }'

Step 3: Create the TrigRun job

Use the GitHub Actions Dispatch template or create directly via API:

curl -X POST https://api.trigrun.com/v1/jobs \
  -H "Authorization: Bearer $TRIGRUN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Nightly pipeline - exact midnight",
    "kind": "cron",
    "template_id": "github-actions-dispatch",
    "schedule": {
      "cron": "0 0 * * *"
    },
    "request": {
      "url": "https://api.github.com/repos/your-org/your-repo/actions/workflows/nightly.yml/dispatches",
      "method": "POST",
      "headers": {
        "Authorization": "secret://github_pat",
        "Accept": "application/vnd.github+json",
        "X-GitHub-Api-Version": "2022-11-28"
      },
      "body": {
        "ref": "main",
        "inputs": {
          "run_type": "scheduled"
        }
      },
      "timeout_seconds": 30
    },
    "retry_policy": {
      "max_attempts": 3,
      "retry_on_statuses": [429, 500, 502, 503]
    }
  }'

That's it. TrigRun fires at exactly midnight UTC. GitHub receives the dispatch and starts the workflow immediately.

Passing workflow inputs

The workflow_dispatch trigger supports custom inputs. Pass them in the request body:

{
  "ref": "main",
  "inputs": {
    "environment": "production",
    "deploy": "true",
    "run_type": "nightly"
  }
}

Your workflow accesses them via ${{ github.event.inputs.environment }}.

Common schedules

Use caseCron expressionDescription
Nightly build0 0 * * *Every day at midnight UTC
Weekday deploys0 9 * * 1-59 AM UTC, weekdays only
Hourly smoke tests0 * * * *Every hour on the hour
Market open trigger30 13 * * 1-51:30 PM UTC (US market open)
Weekly dependency audit0 3 * * 1Monday 3 AM UTC

Why not just use GitHub's cron?

GitHub Actions cronTrigRun + workflow_dispatch
Precision15-30 min delay typicalExact to the second
ReliabilityRuns can be silently droppedRetries with exponential backoff
VisibilityCheck Actions tab manuallyExecution history with status, latency, response
NotificationsNone for missed runsSlack, Discord, email, webhook on failure
SecretsGitHub secrets onlyTrigRun encrypted vault with secret:// syntax
Multiple reposConfigure each repo separatelyOne dashboard for all dispatches

Expected results

Successful trigger:

FieldValue
Status204 No Content
Duration~300 ms
Resultsucceeded

Rate limited (GitHub allows 1,000 API requests/hour):

FieldValue
Status429 Too Many Requests
ResultRetries with backoff, succeeds on attempt 2

On this page