Skip to content

feat(connector): add Trigger.dev data-source connector (cognee#6197) - #464

Open
JakkulaVeerababu wants to merge 5 commits into
topoteretes:mainfrom
JakkulaVeerababu:feat/connector-triggerdev
Open

JakkulaVeerababu wants to merge 5 commits into
topoteretes:mainfrom
JakkulaVeerababu:feat/connector-triggerdev

Conversation

@JakkulaVeerababu

@JakkulaVeerababu JakkulaVeerababu commented Oct 22, 2026 •

Copy link
Copy Markdown

What this adds

A Trigger.dev data-source connector for cognee (related to topoteretes/cognee#6197). triggerdev_source(...) returns a dlt resource for cognee.remember() that syncs one Trigger.dev environment into memory:

  • Schedules: task, cron and its description, timezone, active or inactive.
  • Error groups: error type, status, first and last seen day, message.
  • Failed runs: status, version, times, duration, tags, attempts, and the run's error with the top frames of the task's own code.
  • Deployments: version, status, runtime, and the git branch, commit and pull request.

Each record is one document, tagged with the node set triggerdev:task:<task id>.

Never stored: run payloads, outputs and metadata (customer data), costs, and a deployment's git remoteUrl (it can carry a token). Volatile fields (next run, error counts, a live run's duration) are not rendered, so an unchanged record is never sent again.

Changes since the first version

The first version of this PR did not work against the real API. It called endpoints that don't exist, treated a failed listing as empty (which would have deleted everything already stored), and its tests replaced the whole HTTP client, so none of this showed. It is now rebuilt on the documented management API:

  • Schedules are listed in full. One missing from a complete listing is fetched by id, and only a 404 removes it from memory. A failed or partial listing fails the run and forgets nothing.
  • Errors, runs and deployments are history: each sync reads the last lookback_days (default 7) and keeps older records in memory.
  • On HTTP 429, a spent request budget or a key revoked mid-run, the sync stops cleanly and resumes on the next run. It never sleeps on a rate limit.
  • api_url must be an https origin, and the key never appears in logs or error messages.

Live test

I ran it against a Trigger.dev Cloud dev environment (SDK 4.8.1) with two schedules and three failing runs:

  • Every listing, filter and page parameter worked, and the API sent the rate-limit header.
  • A second sync sent nothing (everything skipped).
  • After I deleted a schedule, the next sync got a 404 when re-checking it and removed it from memory.
  • It found a bug the docs didn't show: GET /api/v3/runs/{id} returns the error at the top level with attemptCount, and attempts is empty, so failed-run documents had no error. Fixed in the second commit: the top-level error is read first, with attempts as a fallback. The same commit shows short durations in ms instead of 0.0s, and keeps only up to 5 stack frames from the task's own code with short file paths (the live trace was mostly runtime frames and carried the local folder path).

Not tested live: deployments, since a dev environment has none.

Tests

cd packages/connector/triggerdev
uv run --with pytest --with pytest-asyncio pytest tests/

83 tests pass, and ruff check and ruff format --check are clean. The tests run the real client against an HTTP-level fake that answers with the API's response shapes and rejects unknown query parameters, plus cognee.add() runs that check forget-on-delete, failed listings, rate-limit resume and two environments in one dataset.

I built this with help from Claude Code (the commits carry a Co-Authored-By trailer). I went through every part of it and ran the live test myself.

I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.

Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
…ctor

Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
JakkulaVeerababu and others added 3 commits October 29, 2026 09:45
The first version called endpoints that do not exist (/api/v1/tasks,
/api/v3/schedules, a runs list at /api/v3/runs with limit/cursor), and a
failed listing was treated as empty, which tombstoned every stored task and
schedule. Its tests replaced the whole client with a fake, so none of this
showed.

- Read schedules (page/perPage + totalPages), error groups, runs and
  deployments (page[size]/page[after]) as documented; retrieve a failed run
  once for its last attempt's error.
- Forget a schedule only after a complete listing and a 404 on GET by id;
  a failed or partial listing fails the run and forgets nothing.
- Errors, runs and deployments are history: read the last lookback_days,
  keep them in memory once they age out, drop their fingerprints from state.
- Stop cleanly on 429, a spent budget or a key revoked mid-run; never sleep
  on a rate limit. api_url must be an https origin.
- Never render payloads, outputs, costs or a deployment's git remoteUrl;
  nothing volatile (nextRun, occurrence counts, live durations).
- Per-row node sets (triggerdev:task:<id>) so search can stay in one task.
- Tests run the real client against an HTTP-level fake that refuses unknown
  query parameters, plus cognee.add() runs for forget-on-delete, failed
  listings, rate-limit resume and two environments in one dataset.
- Drop the committed test screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
…ns them

A live test against a Trigger.dev dev environment showed that GET /api/v3/runs/{id} returns the error at the top level with attemptCount, and an empty attempts list, so failed-run documents had no error. Read the top-level error first and fall back to attempts. Show short durations in ms instead of 0.0s, and keep only up to 5 frames of the task's own code from a stack trace, with short file paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
Resolve the README conflict: main moved connectors into the new
Data-Source Connectors table, so add the Trigger.dev row there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant