PTENES
TRACK 3

🟣 Hosting & Deploy

Take the automation from “run when I tell it to” to running on its own online—on a schedule or in response to an event—with retries, logs, and alerts. From GitHub and Trigger.dev to two real production builds.

2
Modules
16
Topics
~2h
Duration
Inter.
Level
Learning path progress 0% · 0 of 16
Banner: cloud hosting and deployment with cron and webhooks, in purple
GitHub cloud code deploy Trigger.dev retries · logs · alerts Cron (schedule) 0 7 * * * → 7 a.m. every day Webhook (event) URL listens for the payload

Learning path map

Detailed content

3.1 ~55 min

🛰️ From Local to Always-On: GitHub & Trigger.dev

The infrastructure for automations that run unattended: hosted automations, the "agentic gap," cron, GitHub as code storage, gh CLI & .gitignore, Trigger.dev, project setup, and secrets management.

Module progress 0% · 0 of 8
What it is:

Scripts that run on the internet on their own, on a schedule (cron), or triggered by an event (webhook), without a human present to start or monitor them.

Why learn:

Human-triggered automation only scales as fast as someone shows up to click; hosting is the leap to autonomy.

Key concepts:

Local → hosted; cron vs. webhook; Trigger.dev as the engine; GitHub as storage.

What it is:

The gap that appears when a task runs on its own: AI is no longer there to read the error and self-heal, so the system executes but does not adapt.

Why learn:

In production, a failure can go unnoticed; you need to close the gap with platform features and better prompts.

Key concepts:

End of the self-healing loop; fixed inputs, structured outputs; errors and logging built in from the start.

What it is:

A 5-field timing pattern (minute, hour, day of month, month, day of week). Example: 0 7 * * * = 7 a.m. every day.

Why learn:

It's the universal scheduling language; knowing how to read it keeps you in control of when the automation runs.

Key concepts:

Five fields; * = anything; recurring schedule; the keyword "runs on its own".

What it is:

GitHub is cloud code storage: deploy pulls from there (not from a local machine), with version history for rollback and troubleshooting.

Why learn:

It's the single source of truth for the code that goes to production, accessible from any computer.

Key concepts:

Repository = project folder; commit (snapshot) and push (send); private repo + README.

What it is:

The command-line tool (gh) authenticates and connects the local project to the repository; .gitignore lists what should never be pushed.

Why learn:

The golden rule: the file .env with the keys NEVER goes to GitHub.

Key concepts:

gh auth login; automatic .gitignore; secrets kept out of version control.

What it is:

The cloud execution engine: no timeouts, automatic retries, complete traces of every step, support for schedules and webhooks, and failure alerts.

Why learn:

It's what makes automation reliable — like a dependable assistant, not a note stuck to the fridge.

Key concepts:

TypeScript (the AI writes it); official MCP; dashboard as a window into production.

What it is:

Install the Trigger.dev MCP, run the init (creates trigger.config.ts and the tasks folder), start the dev worker, and learn the anatomy of the dashboard.

Why learn:

Without the project initialized and the worker running, tasks won’t register or execute.

Key concepts:

Project ID; interactive init; dev vs. production; runs, traces, payload, and output.

What it is:

Environment variables stored in the Trigger.dev dashboard and injected at runtime, with a .env.example safe to version-control.

Why learn:

Trigger.dev doesn’t read the local .env; without secrets in the cloud, the task breaks in production.

Key concepts:

Runtime injection; never paste the key into chat; check dev e prod separately.

3.2 ~65 min

⚙️ Agents in Production: Scheduled & Webhooks

Two real end-to-end builds, with error handling and production debugging: scheduled research agent, OAuth refresh token, debugging that only appears in prod, report via webhook, Bearer authentication, GitHub → Trigger.dev pipeline, layered error handling, and the human debugging loop.

Module progress 0% · 0 of 8
What it is:

A scheduled task that runs every morning: cron triggers, Firecrawl researches a fixed topic, AI synthesizes, and a row is written to Google Sheets.

Why learn:

It's the complete scheduled build, from prompt to deploy, running with no one watching.

Key concepts:

Unsupervised task; hard-coded topic; single file; test trigger in the dashboard.

What it is:

The one-time setup for Google's refresh token (OAuth); when the Playground fails ("access blocked"), the fallback is a terminal script that prints the URL and returns the token.

Why learn:

Without the refresh token, the task can’t write to Sheets autonomously.

Key concepts:

Client ID + secret; refresh token; OAuth (not a service account); .env + cloud environment variables.

What it is:

A real failure: the API returns an unexpected format (results in web, not in data); copy the trace so the AI can diagnose and fix the parsing.

Why learn:

Some errors only show up with real data in production — knowing how to read them and feed them back to the AI is the core skill.

Key concepts:

Different response shape; red trace; redeploy + retrigger; error as input.

What it is:

A task triggered by a webhook: a JSON payload with fields (company, industry, goal, challenge) generates a report .docx saved in Google Drive.

Why learn:

It's the event-driven build — the complement to the scheduled one, triggered by incoming data.

Key concepts:

Normalize form fields; folder ID optional; test locally before the form.

What it is:

A webhook is a URL that listens for incoming data and wakes up the task, passing the payload along — a "digital doorbell."

Why learn:

Without authentication, anyone can call your task; the header Authorization: Bearer protects the endpoint.

Key concepts:

URL with the task ID; JSON body; Bearer + API key; shareable URL.

What it is:

Iterating in the editor pushes the code to GitHub, which automatically deploys it to Trigger.dev—the latest files are always live.

Why learn:

Close the iteration loop: you make a change, push it, and production updates automatically.

Key concepts:

Repository Secret (TRIGGER_ACCESS_TOKEN); GitHub Actions; commit → push → deploy.

What it is:

A layered approach: meaningful logs at every step, try/catch around each external call, retries with backoff, and email/Slack alerts.

Why learn:

Without production self-healing, error handling is what closes the agentic gap.

Key concepts:

Specific logs (not "task failed"); retries for transient failures, not bugs; alerts configured.

What it is:

The production cycle: open the red trace in the dashboard, copy the error, paste it into the AI, and let it diagnose, fix, and redeploy.

Why learn:

The AI still debugs, but no longer on its own—a human needs to bring the error to it.

Key concepts:

Trace + AI = fast diagnosis; human as the bridge; iterate until it passes.

← Track 2: Agent Mastery Track 4: Frontends & Apps →