TrigRun
Use Cases

Scheduled Exchange Rate Sync

Automate currency exchange rate updates on a cron schedule. Keep your pricing, invoicing, and financial data accurate with TrigRun.

Pull fresh exchange rates from a provider API every 2 hours during business days. Your backend updates pricing tables, invoice calculations, and reporting — automatically.

The problem

Your SaaS bills customers in multiple currencies, or your e-commerce store displays prices in local currencies. Stale exchange rates mean inaccurate pricing, incorrect invoices, and accounting discrepancies. You need rates refreshed frequently during business hours, but not necessarily overnight or on weekends.

The TrigRun solution

SettingValue
Schedule0 */2 * * 1-5 (every 2 hours, weekdays only)
MethodPOST
Timeout30 seconds
Retries3 attempts

Create via API

curl -X POST https://api.trigrun.com/v1/jobs \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Exchange rate sync - weekday business hours",
    "kind": "cron",
    "schedule": {
      "cron": "0 */2 * * 1-5"
    },
    "request": {
      "url": "https://api.yourapp.com/finance/sync-exchange-rates",
      "method": "POST",
      "headers": {
        "Authorization": "secret://finance-api-key",
        "Content-Type": "application/json"
      },
      "body": {
        "base": "USD",
        "currencies": ["EUR", "GBP", "JPY", "CAD", "AUD", "INR", "BRL"]
      },
      "timeout_seconds": 30
    },
    "retry_policy": {
      "max_attempts": 3,
      "retry_on_statuses": [500, 502, 503, 429]
    }
  }'

Expected results

Successful sync:

FieldExample value
Status200 OK
Duration1,240 ms
Response{"base": "USD", "rates_updated": 7, "source": "ecb", "timestamp": "2026-03-16T14:00:00Z", "sample": {"EUR": 0.9215, "GBP": 0.7890}}

Rate provider down:

FieldExample value
Status503 Service Unavailable
Attempts3 of 3
Resultfailed — Slack alert sent
ImpactPrevious rates remain in use (stale but not missing)

Your sync endpoint

# FastAPI example
@app.post('/finance/sync-exchange-rates')
async def sync_rates(request: RatesSyncRequest):
    # Fetch from provider (Open Exchange Rates, Fixer, ECB)
    rates = await exchange_client.get_rates(
        base=request.base,
        symbols=request.currencies,
    )

    # Update database
    updated = await db.exchange_rates.upsert_many(
        [{"currency": k, "rate": v, "updated_at": now()} for k, v in rates.items()]
    )

    return {
        "base": request.base,
        "rates_updated": len(updated),
        "source": exchange_client.source,
        "timestamp": now().isoformat(),
        "sample": dict(list(rates.items())[:2]),
    }

Common schedules

PatternExpressionUse case
Every 2h weekdays0 */2 * * 1-5SaaS multi-currency pricing
Hourly all week0 * * * *Trading platforms
Daily at market open0 9 * * 1-5Invoice generation
Every 15 min weekdays*/15 * * * 1-5Real-time forex dashboards

On this page