Skip to content

Decisioning not firing

Diagnose why POST /api/v1/decide isn't returning a decision, or the decision funnel dashboard shows a gap.

Decisioning is not firing — POST /api/v1/decide returns no reward or decision, or the decision funnel dashboard shows no evaluations for a project or window you expect.

  1. The scheduled aggregation cron (computeDecisionFunnelDaily) has failed for several consecutive runs. The dashboard’s data-gap banner reflects cron_runs failures — it does not mean the underlying /api/v1/decide calls themselves failed.

    Console → Projects → Decision funnel — look for a data-gap banner on the affected date range.

  2. A manual backfill was run, but the dashboard still shows a gap. Backfill does not clear the gap indicator directly — it clears automatically only after the next scheduled cron run succeeds.

    This endpoint is SUPER_ADMIN-only (requireSuperAdmin) — a project ADMIN/OWNER session cookie is rejected; only a platform operator account can run it.

    bash
    curl -X POST https://retidal.com/api/projects/{projectId}/decision-funnel/backfill \
    -H "Content-Type: application/json" -H "Cookie: <super-admin session>" \
    -d '{"fromDate": "2026-06-01", "toDate": "2026-07-03"}'
    # a non-empty errors[] in the response means some project-days did not backfill — safe to rerun
  3. The requested date range is older than the 90-day retention window — source tables for dates that old have been purged and cannot be recomputed at all.

    Console → Projects → Decision funnel — the date-range picker shows no data for dates older than 90 days, by design, not as an error.

  4. The POST /api/v1/decide call itself is failing before a decision can be evaluated — the dashboard and backfill causes above only explain a gap in the aggregated funnel; check whether the call is erroring outright.

    bash
    curl -s -o /dev/null -w "%{http_code}\n" -X POST https://api.retidal.com/api/v1/decide \
    -H "X-API-Key: $RETIDAL_API_KEY" -H "Content-Type: application/json" \
    -d '{"projectId": "prj_123", "profileId": "uid_456", "event": {"name": "checkout_abandoned"}}'
    # 401 = bad/missing key, 403 = key missing the decide/decision:call scope,
    # 404 = projectId doesn't match the key's project, 429 = over 30 req/min per
    # (project, IP), 503 = the decision cache/service binding is unavailable

If the cron has run successfully and the gap remains, and POST /api/v1/decide itself returns 200, work through the health checklist.