PTENES
MODULE 4.2

🚉 The pipeline in 4 stages

In the previous module, you learned why “running on your laptop” isn’t the same as “running 24/7.” Now comes the practical question: how does the code leave your machine and reach a server that never sleeps? The answer is a four-stop journey — and you don’t have to make any of the stops alone; you just need to know what happens at each one.

6
Topics
30
Minutes
Intermediate
Level
Theory + practice
Type
0 of 60%
1

🗺️ The 4 stages, seen from above

Think of a production line with four workstations. At each one, someone (or something) does part of the work and passes it along. Nobody at station 3 needs to know how to do the work at station 1—they just need to know how to receive what arrives and continue. That’s exactly how an automation goes from “it only works on my computer” to something that runs on its own, 24 hours a day.

New here? Pipeline it’s a fancy name for “pipeline”: a sequence of automatic steps, each feeding the next, like ordering bread at a bakery, where the dough goes through kneading, proofing, and baking without you touching anything along the way.

1. Claude Code write the TypeScript (you just describe the task) 2. git takes you to GitHub (the cloud repository) 3. Trigger.dev pulls and runs in the cloud (the server that never shuts down) 4. You read the log checks whether it worked (without needing to read code) You take part in stations 1 and 4. Stations 2 and 3 happen automatically.

Caption: notice that you only step in at the beginning (request the task) and at the end (read the result)—the two stations in the middle, git and Trigger.dev, work without you having to press any extra buttons.

💡 Main Concept

You don’t need to know TypeScript. You need to know how to read the log.

Keep this sentence in mind — it’s the through line for this entire module and comes up again in the next modules in the track.

2

✍️ Station 1 — Claude Code writes the code

It all starts with you describing, in Portuguese, what you want to happen automatically—“every day at 8 a.m., look up the dollar exchange rate and email it to me.” Claude Code translates that request into TypeScript. New here? TypeScript is a programming language—a way to write instructions the computer understands, like a detailed recipe, but in code. You don’t write this recipe. The agent does. Your part is to describe the dish you want, taste the result, and ask for adjustments if needed.

This completely changes what you need to learn. Professional programmers spend years studying the syntax of languages like TypeScript. You won't do that—and you don't need to. What you will develop is the ability to describe what you want clearly and recognize whether the final result (the automation's behavior, not the code behind it) is right.

✓ Your role in Station 1

  • ✓Describe the task clearly: what runs, when it runs, and what to do with the result
  • ✓Read the Portuguese summary the agent gives you after writing the code
  • ✓Test the behavior—not the syntax

✗ What is NOT your role

  • ✗Memorizing TypeScript syntax or the syntax of any programming language
  • ✗Open the code and “fix” a line by hand without understanding the rest
  • ✗Judging whether the code is “beautiful” — what matters is whether it works

💡 Practical Tip

Remember the plan mode from module 0.5 — ask the agent to show the step-by-step plan before acting? This matters more here than in any previous track. A bug in a local automation on your computer is annoying; a bug in a production automation can send a duplicate email to a customer or repeat a charge. It's worth reviewing the plan before letting it run on its own.

3

📦 Station 2 — git takes the code to the repository

New here? git is a program that keeps a history of every version of your code, as if each change were saved in a separate photo—you can go back in time if something breaks. When Claude Code finishes writing the automation, it uses git to “package” that version and send it to a central place: the repository. Repository it’s that cloud-hosted folder that centralizes the code and its history—in our case, hosted on GitHub, the world’s most widely used service for this.

Why does this station exist? Because your computer isn’t where the automation will live. GitHub works like a shared locker: the code leaves your laptop, goes into that locker, and is available for any authorized service — in our case, Trigger.dev — to retrieve.

✓ What gets pushed to the repository

  • ✓The automation code itself (the “recipe”)
  • ✓The configuration for how and when it should run
  • ✓The version history, so you can roll back if needed

✗ What NEVER gets uploaded

  • ✗Passwords and API keys — this is covered in module 4.4 (Secrets)
  • ✗Customers’ personal data or sensitive information
  • ✗Temporary or test files that only make sense on your computer

🔍 Inside

  • commit: a “snapshot” of a version of the code, with a short message explaining what changed.
  • push: the act of sending these photos from your computer to the repository on GitHub.
  • Claude Code commits and pushes for you when you approve the change — usually, you just confirm.
4

☁️ Station 3 — Trigger.dev pulls the code and runs it in the cloud

New here? Trigger.dev é a execution platform that we use in this course: a cloud service that “listens” to the repository, detects when new code arrives, takes that code, and runs it on a computer that never shuts down—it’s not your laptop, but a server from Trigger.dev that runs 24 hours a day. This change of location (from your laptop to an always-on server) is what makes the automation truly “automatic.”

It’s worth looking at this station’s step-by-step process in detail because it’s the most "magical" part of the pipeline — understanding the sequence takes away the mystery.

1

Trigger.dev notices that the repository has changed

As soon as the push from Station 2 reaches GitHub, Trigger.dev is notified—without you having to notify it manually.

2

It downloads and “assembles” this version of the code

Prepares the cloud environment so the code can run exactly as written.

3

The task is recorded and ready

From this point on, it can be triggered at the scheduled time (a cron, scheduling, the subject of Track 6) or an event—like a task already entered in a calendar.

4

The time has come, and it runs—even with your laptop turned off

This is the point of module 4.1 made concrete: the Trigger.dev server never shuts down, so the automation never stops.

🔍 Inside

Deploy is the term for the act of publishing a version of the code so it runs for real in an environment that isn't yours. When someone says "I deployed the automation," they mean it moved beyond the stage where it "only exists on my computer" and now exists in Trigger.dev, ready to run on its own.

5

📋 Station 4 — you read the log (and that’s all you need to know)

New here? Log it’s the list of events the automation recorded while it was running—like a logbook. “Started,” “looked up data X,” “succeeded,” “sent the email,” “finished”—or, if something went wrong, the exact line where it got stuck and why. Trigger.dev displays this log in a dashboard (also called dashboard) on the internet — a screen listing every time your automation ran, with a green signal (it worked) or red one (there was a problem) beside each run.

This is the heart of this module: you don't need to understand the TypeScript behind the automation to know whether it worked. You open the dashboard, look at the log in Portuguese (or simple English, like "task completed"), and check: did it run at the right time? Did it do what it was supposed to? If something went wrong, the log will usually tell you where—and in module 4.7 (Observability), you'll learn to read these signals carefully, including the more confusing cases.

💡 Main Concept

  • •Reading code = the programmer’s job. Reading the result = your job.
  • •A clean log with "success" in green confirms that your automation is up and running—without needing to open a line of code.

⚠️ Attention

Don’t confuse “ran without errors” with “did the right thing.” The log tells you whether the code crashed — but checking that the email arrived or the spreadsheet was filled out correctly is still up to you, at least for the first few weeks of a new automation.

6

🧪 Build: ask Claude Code for your first task

New here? task it’s what Trigger.dev calls each individual automation—a unit of work with a name, a trigger (when it runs), and code behind it. Now it’s time to see the whole pipeline in action with the simplest example possible: a task that does nothing risky, just proves that the pipeline works from end to end.

Objective: asking Claude Code to create a Trigger.dev test task that fetches the current time and prints a message to the log — without sending email or changing any real data. It’s the deploy “hello, world”: if the task appears successfully in the dashboard, all four stages of the pipeline are working.

Cria uma task simples do Trigger.dev pra mim, só pra eu testar o pipeline
de deploy. Ela deve:

1. Se chamar "teste-pipeline"
2. Não precisar de nenhum gatilho automático por enquanto — só rodar quando
   eu disparar manualmente pelo painel do Trigger.dev
3. Buscar a hora atual e imprimir no log uma mensagem tipo:
   "Task rodou às . Pipeline funcionando!"
4. Não mexer em nenhum arquivo, e-mail ou dado real — é só um teste

Depois de escrever o código, me explica em português o que você fez,
faz o commit e o push pro repositório, e me diz exatamente onde no painel
do Trigger.dev eu vou ver essa task pra poder disparar ela manualmente
e conferir o log.

(Se precisar de alguma chave de API pra configurar o projeto do
Trigger.dev, não escreve ela no código — me avisa que eu cadastro
separadamente. Minha chave de teste é SUA_CHAVE_AQUI, só como referência,
não deve aparecer em nenhum arquivo.)

How to verify: after the agent finishes, open the Trigger.dev dashboard in your browser. Find the "teste-pipeline" task in the list — it should be listed even if it hasn't run yet. Trigger it manually (usually with a "Run" or "Test" button) and follow the log in real time: if you see the line with the time and the message "Pipeline funcionando!" and the status turns green, all four stations passed the test. If it turns red, copy the error message from the log and paste it back to Claude Code — it reads its own log just as well as you'll learn to read it.

✓ Sign that it worked

  • ✓Task appears in the Trigger.dev dashboard
  • ✓Log shows the expected message and the correct time
  • ✓Execution status turns green/"Completed"

✗ Sign that something is stuck

  • ✗Task doesn’t appear in the dashboard — the push (Station 2) probably didn’t complete
  • ✗Red status/"Failed"—paste the error log for the agent to read
  • ✗Empty log — usually the platform hasn’t “recognized” the task; ask the agent to check the configuration

Quick check (optional): which of the 4 stations is where your work happens to confirm that the automation worked?

✅ Module Summary

✓
4 stations: Claude Code writes the code (TypeScript) → git takes it to the repository on GitHub → Trigger.dev pulls and runs it in the cloud → you read the log.
✓
You don’t write code: the agent writes, you describe the task and review the result.
✓
Reading the log is the core skill: know if it worked without needing to understand TypeScript.
✓
Deploy = actually publish: leaves your laptop, starts running on Trigger.dev, runs on its own.

Next module:

4.3 — Testing vs. production