Build log · December 4, 2026

freecreditguy on Trigger.dev: the migration prompt on a site with no jobs, and eight rounds of security review

The colin.chat post ended with a migration prompt and a promise to test it on another project. This is that test, on a small Next.js site that had no background jobs at all. The prompt's first step caught that, and we added the one job the site was missing: checking each company submission and telling me about it by email and Slack. The tasks are built, reviewed and tested end to end on my machine. They are not on Trigger.dev yet: the deploy waits on three dashboard steps that are mine to do. This post says so wherever it matters, and will be updated after the first real run.

Colin Lowenberg Agent: Claude Code (Fable 5.2, then Opus 5.5) Trigger.dev SDK 4.9.2 December 3 to 4, 2026
The Free Credit Guy home page: THE FREE CREDIT GUY in large letters, AI tools, on the house, with buttons to follow on Instagram and get the weekly drop
The Free Credit Guy: weekly drops of credits and promo codes for AI tools, and an intake form where AI companies submit codes, referral links or sponsorship offers.

For the Trigger.dev team

  1. The top ask from the first five posts looks shipped, and nothing told us. CLI 4.9.2 has tasks trigger <id> --env prod --wait, which prints the run's output. Our prompt still said the CLI can't start a run. We found it in --help. Not tried yet.
  2. The Vercel integration would copy the database owner's address into Trigger.dev. It syncs every non-sensitive Vercel variable, and Neon's Marketplace install sets DATABASE_URL as the owner login. We left the integration off.
  3. There's no way to raise an alert without failing a run. To be told about a lost submission we had to fail the hourly sweep, and four review rounds went into deciding when.

All feedback from this project · Feedback across all seven projects

Status, December 4, 8:46 AM: two tasks on a branch with an open pull request, tested locally against the real database with stand-in email and Slack servers. Not done: Resend's terms (they need a browser), the Slack webhook, the secrets in both dashboards, the deploy, a run on Trigger.dev, the alert, and the merge.

The project

The Free Credit Guy is a landing page and a company intake form, on Next.js 16 and Vercel. When this session started it had never been deployed, and the form wrote each submission to a JSON file in the project folder.

Most of the session was not about Trigger.dev. I asked for a code review, then to put the site on GitHub and Vercel, then to fix what the review found. Trigger.dev came in at the end, when I pasted the blog request below into this session by habit. I'd been pasting it into the sessions that had moved a project to Trigger.dev, and this one hadn't.

Every prompt I typed

All of my messages in this session, in order and unedited, apart from the project ref, which is masked. Three are answers to the agent's multiple-choice questions; I've given the choice I picked.

  1. review this project
  2. push it to github Sent while the review was still running.
  3. push it to vercel from github Also mid-review.
  4. Yes, fix it A button, answering “Fix the intake form so submissions are actually stored?”
  5. Neon Postgres (Recommended) Picked from the agent's question about which database to set up.
  6. The blog request, pasted. My first try failed, so I switched the model to Opus 5.5 with /model and sent it again after “Try again”:

    Show the request as pasted
    let's write a blog post with a step-by-step instructions that we followed converting the site to trigger.dev, showing the improvements, and including every prompt i've said to you, and document all the pitfalls and confusion and errors and mistakes, that way we can have good product feedback for the trigger.dev founders let's update our blog post with a step-by-step including every prompt i've said to you, and document all the pitfalls and confusion and errors and mistakes, that way we can have good product feedback for the trigger.dev founders let's add a prompt to the blog post that will help other setup their migration to trigger. i'll use it on another project to test it
    
    commit the blog post to this repo : https://github.com/opencolin/trigger-blog
    
    and publish it as a github page
  7. Migrate it, then write post Picked when the agent pointed out that nothing here had been converted to Trigger.dev, and asked whether to migrate first or stop.
  8. 1. email and slack
    2. no
    3. proj_…
    Answers to the plan's three questions: how to notify me, whether to give preview and local development their own database, and the project ref.
  9. The same blog request, pasted again, which is what produced this post.

The security reviews below were not prompts. They arrived on their own after each push, from an automated reviewer in Claude Code and from a review bot on the pull request.

Step by step

  1. Before Trigger.dev: review, GitHub, Vercel, a real database

    • The build failed on my machine: lightningcss's native binary folder was empty. A clean npm ci didn't fix it; deleting the .next cache did. Nothing was wrong in the repo.
    • A zero-byte .git/index.lock from August blocked every commit. No git process was running, so the agent removed it.
    • The repo had a deploy.sh that would have made it a public GitHub repo. The agent made it private instead and said so.
    • Connecting Vercel to GitHub didn't deploy anything until the next push, so the first deploy needed a commit.
    • The live intake form returned a 500 on every submission: ENOENT: mkdir '/var/task/data'. Vercel's filesystem is read-only. We moved submissions to Neon Postgres from the Vercel Marketplace, with input validation.
  2. The agent refused to write the post

    My blog request asked for “the step-by-step instructions that we followed converting the site to trigger.dev”. Nothing had been converted. The agent searched my other sessions and the blog repo, found the five earlier posts, and said that writing the steps, pitfalls and errors would mean inventing them. It asked whether to migrate first or stop. I picked migrate.

  3. Step 0 of the prompt: what's live

    • Data persists. Test rows written before a deploy were still there after it, so Neon isn't giving each deployment a fresh empty branch, the way Turso did on colin.chat.
    • Every environment shares one database. The agent compared hashes of DATABASE_URL across production, preview and local, without printing them: all the same. A preview build or npm run dev writes live data. I chose to leave it.
    • The table had 0 rows. There were no feature flags.
  4. Step 1: there were no jobs

    No crons, no workflows, no timers, no scripts run on a schedule. When a company submitted the form, a row was saved and nobody was told. The prompt says to stop and ask in that case, and the agent did. It proposed two tasks:

    TaskStarted byWhat it does
    process-submissionThe API route, after saving a submissionChecks the website and referral link respond, counts duplicate codes, emails and Slacks me, and records the results on the row
    sweep-unprocessedHourly scheduleHands off anything the route couldn't (Trigger.dev down, key missing)

    It also said which steps of the prompt didn't fit: three database logins and a copy of the data for a table with no rows, and a “switch over” with nothing to switch from. The Free plan fits: 10 schedules (this needs 1), $5 a month of credit, $0.000025 a run plus compute. Its catches: logs are kept for 1 day, and alerts go to 1 destination.

  5. Install the SDK

    npx trigger.dev@latest init --project-ref proj_… --yes

    It worked without a prompt, and it put the tasks in ./src/trigger, with an example task, in a project that has no src folder: the app router lives at the root. The agent moved the folder to ./trigger and deleted the example. init also added trigger.config.ts to tsconfig.json and .trigger to .gitignore, without a final newline.

    The SDK package ships its docs and agent skills (node_modules/@trigger.dev/sdk/docs and skills). The agent wrote the tasks from trigger-authoring-tasks/SKILL.md for the installed version, not from memory.

  6. Install Resend: stopped at the terms

    vercel install resend/resend-email returned action_required: Resend's terms have to be accepted in a browser first. That step is still mine.

  7. A database login that can only do this job

    A script creates a role, trigger_tasks, that can read submissions and set four processing columns, and writes its address straight to a gitignored .env.trigger. The agent then tried every other kind of write with it:

    SELECT rows: allowed
    UPDATE processed_at: allowed
    UPDATE company_name: denied (42501 permission denied for table company_submissions)
    INSERT: denied (42501 permission denied for table company_submissions)
    DELETE: denied (42501 permission denied for table company_submissions)
    CREATE TABLE: denied (42501 permission denied for schema public)
    ALTER TABLE: denied (42501 must be owner of table company_submissions)

    Every task checks on start that it is connected as that role and that CREATE TABLE is refused, and won't run otherwise.

  8. Write the tasks

    • The checks and notifications live in lib/process-submission.ts, with no Trigger.dev imports, so a local script can run them too.
    • Only the production environment sends or writes. That's decided in code from ctx.environment.type; dev and preview run dry.
    • Each channel is marked as sent before the next one goes out, so a retry after a failed email doesn't send Slack twice.
    • The API route triggers the task by id inside Next.js after(), once the response has gone, and doesn't import the task file. If triggering fails, the submission is still saved and the sweep picks it up.
    • .vercelignore keeps trigger/ and trigger.config.ts out of the website. The agent built the site with both removed, and the pull request's preview build passed.
  9. Prove it locally

    scripts/process-local.mts runs the same code, as the same login, against the real database, with stand-in Resend and Slack servers. The first try failed: tsx refused top-level await in a .ts file (“not supported with the cjs output format”); renaming it to .mts fixed that. Then it passed: a dry run sent nothing, a failed email failed the run and its retry sent Slack once, a third run was skipped, the guard refused the owner login, and promo codes never appeared in a message.

  10. Open a pull request, then stop for me

    The agent didn't deploy. The hourly schedule goes live the moment it does, and without its database login it would fail every hour. It gave me a table of five values for Trigger.dev's production environment and one for Vercel, with a command that copies the database address to the clipboard without printing it.

    It also read the docs for Trigger.dev's Vercel integration, which can sync variables between the two. Vercel to Trigger.dev, it syncs every variable that isn't marked sensitive. Here that includes DATABASE_URL, the database owner's login. The agent left the integration off.

  11. Eight rounds of security review

    Each push was reviewed automatically: seven rounds from the reviewer in Claude Code, and one from the review bot on the pull request. Every round found something real:

    1. The URL check could reach private addresses. It only looked at the hostname's text, so a public name that resolves to a private address, or a redirect to one, was fetched. Fixed: every resolved address is checked inside the connection's own DNS lookup, and each redirect is checked again.
    2. Form text could break the email and ping Slack. A company name with a line break could add a line to the email; <!channel> would ping everyone. Fixed: each field is flattened to one line and shortened, and Slack text is escaped. The form now rejects line breaks in one-line fields. The task also logged submitted URLs; now it logs outcomes only.
    3. Slack formatting. Form text could still use bold or code formatting to look like part of the alert. Fixed: sent with mrkdwn: false.
    4. The review bot on the pull request raised three: redirects (already fixed), a sweep that would re-trigger the same rows every hour forever, and transient database errors aborting the run instead of retrying. Fixed both, and the bot confirmed all three.
    5. A submission older than two days dropped out of the sweep silently. Fixed: the sweep failed while any remained.
    6. One unfixable submission would fail the sweep every hour forever, burying new failures. Fixed: it alerts once per lost submission, in the hour it crosses two days.
    7. The alert and the hand-off could swallow each other (two rounds): a failed hand-off skipped the lost-submission check, and then the alert skipped the hand-off's retry. Fixed, with an explicit retry policy.

    The last four rounds (items 5 to 7) were about one thing: how to be told about a lost submission. Each fix was right, and the next round flagged a consequence of it. Twice the agent declined a suggestion and said why: one assumed AbortTaskRunError hides a failure (the docs say the run is marked failed), and the other, a stored watermark, needed a new table and a wider login.

A bug the agent made, caught by its own test

The first fix for the URL check marked every website as private, example.com included. Node's BlockList also tests IPv4 addresses against its IPv6 rules, so the rule for IPv4-mapped IPv6 addresses (::ffff:0:0/96) matched every IPv4 address. The local test showed it at once; the agent split the IPv4 and IPv6 lists. It's in the prompt below now, because any task that checks URLs from a form will hit it.

What improved

BeforeAfter (on the branch)
A company submits the formA 500 on the live site, then a row nobody was told aboutSaved, then an email and a Slack message with the checks
Bad links and codesNot checkedWebsite and referral link checked; duplicate codes counted
If notifying failsNothing to failRetried up to 4 times; the hourly sweep tries again for two days, then alerts once
Database access for background workThe owner loginA login that can set four columns and nothing else
TestedNo testsAn end-to-end local script, including hostile input
Running on Trigger.devNoNot yet

Feedback for Trigger.dev

High tasks trigger --wait shipped, and nothing pointed us to it

Across the first five posts, the top problem was that an agent couldn't start a run, so every test waited for me to click Test. CLI 4.9.2 has tasks trigger <id> --env prod --payload '…' --wait, and its bundled docs page says it's meant for “coding agents testing a task”. We found it only because the agent ran --help before writing about it. The prompt we'd been passing between projects still told the agent the command doesn't exist. We haven't run it yet.

Ask: End deploy with the command to trigger each task, and put new CLI commands in the changelog that ships in the SDK. (The bundled changelog.mdx doesn't mention 4.9.)

High The Vercel integration copies the database owner's login into Trigger.dev

The integration page says variables sync from Vercel to Trigger.dev, except sensitive ones and Trigger.dev's own. On a Vercel project with Neon from the Marketplace, that includes DATABASE_URL and a dozen PG* and POSTGRES_* variables, all for the owner role. Every task gets them, whether it needs a database or not. The page warns about Neon branching, not about this. This is from the docs; we didn't connect the integration.

Ask: Leave database variables unselected by default in the sync step, and suggest a separate task login.

Medium No alert without a failed run

We wanted one alert when a submission had gone two days without a notification. The only alert is on failed runs, so the sweep had to fail. That took four review rounds: failing every hour buries real failures, failing once means working out “once” from payload.lastTimestamp, and a run that fails early skips its window. The docs describe lastTimestamp as “the time the task was last run”, and don't say whether a failed run counts.

Ask: A way to raise an alert from a successful run (logger.alert with a dedupe key), and a lastSuccessfulTimestamp on scheduled payloads.

Medium init assumes a src folder

init --yes created ./src/trigger/example.ts in a Next.js project whose app lives at the root, and set dirs: ["./src/trigger"]. An agent that doesn't look ends up with a src folder holding only an example task.

Ask: Detect where the app's code lives, or take --dir; with --yes, skip the example.

Medium One day of logs on the Free plan

This project's tasks run when someone submits a form, a few times a week. On Free, a failure's logs are gone the next day, so the run I'd want to read after an alert may already be empty.

Ask: Keep failed runs' logs longer than successful ones, or say in the alert email when they'll expire.

Low whoami prints the user ID and email

The prompt tells the agent never to repeat account IDs, but the first command it runs prints them into the transcript. The agent filtered them out of its output by hand.

Ask: A --json or quiet mode that only says whether you're logged in, and to which project.

What worked

Our own mistakes

Do it on your own project

This is the colin.chat prompt, revised with what this project taught us. It now handles work that runs after a request (not just scheduled jobs), tells the agent to check which CLI commands the installed version has, and adds rules for values from a public form. Paste it into Claude Code (or another coding agent) at the root of your project, with your project's name in place of [PROJECT]. It plans first and stops for your go-ahead before changing anything. Also as plain text.

Move [PROJECT]'s background and scheduled work to Trigger.dev (v4 SDK), without risking the live site.
Follow these steps in order, and stop where a step says to. I may be on my phone: put every question and its
choices in your message as plain text, and give every command I should paste in its own code block.

0. Find the right project and the real live data. Change nothing.
   - Confirm which repository and which deployed project I mean.
   - Find where production stores its data, and prove it persists (read row counts only). Check whether the
     hosting integration gives each deployment its own database branch, and whether production, preview and
     local development share one database. Report both; if live data doesn't persist, stop and tell me.
   - Check the settings that turn jobs on or off in production. Say what it would take to make a job produce
     real output, such as a dry-run mode.
   - Run `npx trigger.dev@latest --help` and read the CLI docs that ship in node_modules/@trigger.dev/sdk/docs.
     Use what the installed version can do, not what you remember: recent versions can start a run
     (`tasks trigger <id> --env prod --wait`) and manage variables (`env`).

1. Plan first; change nothing yet.
   - List every job: cron functions (`crons` in vercel.json), CI workflows that fetch or commit data, timers in
     the app, scripts run by hand, pages that fetch slow sources when a visitor loads them, and work done inside
     a request that the visitor doesn't need to wait for (sending notifications after a form is submitted).
   - For each: what it reads, what it writes (including emails or messages it sends), how often, how long it
     runs, and what happens today when it fails. Read the host's logs for the last day.
   - If there are no jobs, say so plainly and stop. Don't invent work to fit these steps. Suggest what would be
     worth running on Trigger.dev, and ask me.
   - Say which ones Trigger.dev should run and which stay where they are. Trigger.dev runs jobs, not the website.
   - Read Trigger.dev's current pricing. Say which plan the number of schedules needs, and what its log
     retention and alert destinations mean for this project.
   - Say which steps below don't fit this project, and why, instead of doing them anyway.
   - Stop and show me the plan.

2. Build the new version beside the old one, not instead of it. Work on a branch.
   - If there is an old pipeline, give the new one its own copy of the data (a database branch, a copy, or a
     separate schema). If the project shares one database across environments, say so and ask.
   - Give tasks their own database login with only the access they need (for example SELECT on one table and
     UPDATE on named columns). Write it straight into a gitignored .env file with quoted values; never print it.
     Prove each permission it shouldn't have (INSERT, DELETE, other columns, CREATE, ALTER) is refused, with
     real statements.
   - Every task checks its login before doing anything (the role name, and that CREATE TABLE is refused) and
     refuses to run with a missing or broader login.
   - Jobs that send email or messages: only production sends. Decide that in code from the run's environment,
     not from an env variable. Mark each channel as sent before sending the next, so a retry never sends twice.
   - Abort (no retry) only on setup problems that retrying can't fix: a missing login, no notifier configured.
     Rethrow database and network errors so the retry policy applies.
   - If a web request hands work to a task, the request must still succeed when Trigger.dev is unreachable.
     Add a scheduled sweep that picks up anything the hand-off missed, with an age limit, and make lost items
     visible: alert once per item, not on every run.
   - Treat every value from a public form as hostile:
     - URLs a task fetches: http(s) only, no IP literals, check every address the host resolves to (inside
       the connection's DNS lookup) and every redirect against private, loopback, link-local and metadata
       ranges. In Node, keep IPv4 and IPv6 ranges in separate BlockLists.
     - Text in notifications: one line per field, length-limited; escape &, < and > for Slack and send with
       mrkdwn off; never include secrets such as promo codes.
     - Logs and run output: outcomes and counts only, never submitted values.
   - Reuse existing job code; call it from tasks. Put shared logic in a module with no Trigger.dev imports so
     a local script can run it. Run Python with @trigger.dev/python (python.runScript plus pythonExtension).
   - Find code that runs CREATE or ALTER on every run, and make it skip setup when the schema already exists.
   - `trigger init` may put tasks in ./src/trigger and add an example task. Move the folder to match the
     project and delete the example.
   - Keep the Trigger.dev files out of the website build (for Vercel, .vercelignore). Trigger tasks from the
     website by id (`tasks.trigger("task-id", ...)`), with no import of the task file. Prove the site builds
     with those files removed.

3. Prove it locally before Trigger.dev is involved.
   - One script runs the same code as the tasks, as the same limited login, against the real data, with
     stand-in email and Slack servers. It covers: a dry run that sends nothing, a send that fails and its retry,
     a repeat run that is skipped, the login guard refusing the owner login, hostile input in every field, and
     the sweep's age limit. It removes its test rows.
   - Show me the output. Confirm nothing was sent and nothing changed on live, by reading the database.

4. Set up Trigger.dev.
   - I create the account and project. Run `npx trigger.dev whoami` first, then ask me for the project ref.
     Don't repeat the account details it prints.
   - Declarative schedules go live the moment you deploy. Don't deploy until the variables they need are set,
     and say when each will first fire.
   - Don't use the Vercel integration's variable sync if it would copy the database owner's address into
     Trigger.dev; if I want it, have me deselect database variables first.
   - Give me a table of every value: name, what to put in it, Secret or not, and the narrowest kind of token.
     I create tokens myself and add them in the dashboard. Never upload a token from the shell.
   - Open a pull request; check its preview build. Don't push to main or merge unless I say so.
   - Deploy with `npx trigger.dev deploy`.

5. Test it.
   - Start runs yourself with `npx trigger.dev tasks trigger <id> --env prod --payload '...' --wait` if the
     installed CLI has it; otherwise ask me to click Test. Include one run that should be refused (no login)
     to prove the guard.
   - Verify each run by reading what it wrote in the database, and use `runs list` and `runs get <id>`.
     Never read the CLI's stored token to call the API yourself.
   - Submit the real form once and follow it end to end: the row, the run, the email, the Slack message.

6. Switch over only when I say so (if there was an old pipeline).
   - The new pipeline writes live with a rows-only login. Prove it can change a row and can't CREATE or ALTER.
   - The old jobs keep running against a copy, with a login that can't write live.
   - A daily compare fails when live hasn't refreshed in 36 hours or drifts more than 5% from the old one.
   - Write down how to undo the switch.

7. Alerts.
   - Alerts are under Observability in the dashboard sidebar, per environment: pick Production first.
   - Create a runs alert that fires on any failed run (threshold > 0) and check the threshold after creating it.
     Make sure it has a channel.
   - New projects can't create a failed-deploy alert. Say so, and suggest a CI notification if deploys run
     from CI.

Throughout:
- Never print or commit secrets, database addresses, account or project IDs.
- Review your own diff for security problems before the first push. If an automated reviewer flags each fix
  in turn, stop, choose the design on purpose, and tell me which finding you're not taking and why.
- Don't describe dashboard screens you haven't seen as fact. If I can't find something, ask for a screenshot,
  and look for a CLI command that does the same thing.
- At each stop, say what you verified and what you didn't.

Steps 0 to 3 of this version ran on freecreditguy as described. Steps 4 to 7 haven't yet: the deploy, the CLI-started runs and the alert are untested here.

What's next