Turn Heroku error logs into Todoist tasks
A Heroku + Todoist agent flow
Solo developers and small teams don't run a full incident pipeline; they run Todoist. So when a Heroku app starts throwing R14 memory errors or H12 timeouts, the right place for that to land is the same list where the rest of the day's work lives. This recipe wires that. The agent calls get_app_logs for an app, scans the recent lines for the error codes you care about, and for each new one creates a Todoist task with add-tasks: the error code and route in the content, the timestamp in the description, and a due date of today. Heroku returns the log buffer when asked rather than streaming it, so the agent runs on a cadence and remembers the last line it processed, so the same error doesn't reappear as a duplicate task every loop.
The flow
get_app_logsRetrieve an app's logs.
add-tasksCreates one or more tasks.
Step by step
- Pull the recent logs
The agent calls get_app_logs for the app, which returns the recent log buffer as text. It scans for platform error codes (R14, R15, H12, H10) and application stack traces, depending on what you tell it to watch for.
- Track what's already seen
Heroku's log endpoint returns a rolling window, so the same lines reappear across polls. The agent keeps a marker, the last timestamp or a hash of the line, and only lines past that marker are treated as new. One error, one task.
- Create the Todoist task
For each new error the agent calls add-tasks: content names the error code and the affected dyno or route, the description carries the timestamp and a log excerpt, and the due date is today so it surfaces in the inbox. Group several errors from one window into a single add-tasks call.
Tell your agent
Every five minutes, call Heroku get_app_logs for my api app, and for each new line containing R14, H12, or an unhandled exception, add a Todoist task to my Errors project with the error code and timestamp, due today.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- get_app_logs returns a rolling buffer, not an event feed, so the same lines repeat between polls; the dedupe marker is what stops one error from becoming a task on every run.
- Logs are plain text from every dyno and the router combined. The agent has to pattern-match the codes you want, so be specific or a chatty app fills the list with routine lines.
Questions
- Can one call create several tasks at once?
- Yes. add-tasks accepts multiple tasks, so when a single log window holds several distinct errors the agent batches them into one call instead of one request per error.
- How far back does the log read go?
- get_app_logs returns the recent buffer Heroku retains, which is a window of recent lines, not full history. Poll often enough that the window always overlaps the last run, or a burst between polls can scroll out before the agent reads it.