feat: enrich GET /api/tasks with recent_runs and upcoming from Trigger.dev
Merged
SW
8mo ago+277+277+012345678901234567890123456789-146-146-012345678901234567890123456789
Summary
GET /api/tasks now returns recent_runs and upcoming for each task, sourced directly from the Trigger.dev API:
recent_runsā Last 5 runs fromruns.list({ filter: { schedule } })upcomingā Next scheduled times from the latest run's payload
New files:
lib/trigger/listScheduleRuns.tsā Fetches runs by schedule IDlib/tasks/enrichTaskWithTriggerInfo.tsā Enriches tasks with Trigger.dev data
Matches docs: https://developers.recoupable.com/api-reference/tasks/list
Test plan
-
GET /api/tasks?id=<uuid>returnsrecent_runsarray andupcomingarray - Tasks without
trigger_schedule_idreturn empty arrays - Trigger.dev API failures gracefully return empty arrays
š¤ Generated with Claude Code
Summary by CodeRabbit
- New Features
- Tasks now show recent run history (IDs, status, timestamps, durations) and upcoming schedule info from the external scheduling API.
- Reliability Improvements
- If schedule data or run details cannot be retrieved, tasks still load normally and show empty recent/upcoming lists instead of failing.