Introducing Routines: You Can Now Write the Code Behind Your Deck Tasks

Most teams guide their agents with prompts and let Deck decide how the work gets done. Some want to own exactly how their agents navigate and perform their tasks, down to the code running them. As of today, they can.
Let’s review why routines are useful, how to build them, what’s different about Deck routines — and whether it’s the right approach for you.
Why routines
Every Deck task works like an API contract for a system that has no API. You define the input it takes and the output it returns, and your code gets the same JSON back from every website.
In agent mode, you describe the task in a prompt and Deck works out the steps behind that contract. Deck also keeps those steps working when a portal changes. For many teams, that’s all they need.
A routine opens those steps up. It’s a fixed set of steps that Deck runs the same way every time, and each step is code your team can read and change: the path the agent takes through the website, where it enters each input and what output it returns.
How to build routines
You can build routines within your Deck console, or with your own coding agent through the Deck CLI or API. Both end with a routine your team can read, change and run on Deck.
Let Deck build the first draft
Pick a task and a portal, and Deck writes the first version of the code your agent will run while you watch in the live view. It saves the code once it finishes the run. Your team can then review it, change what it needs to and save it, without leaving the console.
Write it yourself in Playwright
Run the task once, and Deck leaves the browser signed in. Your team writes the code against it, by hand or with a coding agent like Claude Code or Codex, and tests it until it returns the right output. Then you save it, and every run of that task on that portal uses it.

Both paths are covered step by step in our docs: Author routines.
What’s different about Deck routines
Deck is infrastructure built to help agents succeed inside systems made for people, and getting in and staying in is its specialty. That’s what changes when you run routines on Deck instead of on a remote browser alone.
On a remote browser, the browser is yours, and so is everything around it: the credentials, the MFA prompts, the bot defences.
With routines, Deck still handles authentication and keeps the session alive.
| You own the steps | Deck owns the session |
|---|---|
| The path the agent takes through the portal | Signing in with credentials stored in Deck Vault |
| Where it enters each input | Keeping the session alive for the whole run |
| What the routine returns | Handling interruptions mid-run, like MFA prompts and password notices |
| Which outcome it reports when something’s missing | Getting past bot defences with stealth mode |
Your routine doesn’t contain a line of login code. Deck signs in, handles MFA if the portal asks for it and hands your routine a signed-in page.
Who routines are for
Routines are for engineering teams that want to own exactly how the Deck agent navigates, and not just what it returns. These teams usually share three traits:
- A known set of sources. You connect to a defined list of websites, and each one matters enough to map page by page, including edge cases, with high accuracy. The workload on your team grows with the number of systems.
- Engineers who already build this way. Your team writes browser automation, or has a coding agent that does. Attaching to a remote browser and iterating on steps is nothing new.
- You want to own the fix. When a portal changes, your team sees which step is affected and why, and decides who fixes it and when.
Who routines aren’t for
Routines aren’t for teams that want the work done without managing exactly how it gets done. Three signs agent mode is the better fit:
- You cover a long tail of sources. If you fetch utility bills from hundreds of portals, a routine per portal means that many pieces of code to write, test and keep current. In agent mode, one task can run across all of them. Adding a portal takes a short round of test runs, not a new build.
- You’d rather not have to fine tune the engine. You want to describe a task and have it happen, the way you’d hand it to someone on your team. The more you roll out, the less you want to manage. When a portal changes, keeping the task working is Deck’s job, not yours.
- The work is less structured. Some tasks need judgment at every step, like exploring a portal for whatever is there, or reading a page and deciding what to do next. A routine follows the same path every time. That’s its strength, and it’s why a routine is the wrong tool for this kind of work.
Here’s a practical test: A routine is code, and code needs an owner. If you don’t plan to put an engineer on it, agent mode is the better fit.
You don’t have to choose
Routines offer an additional way to run your agents on Deck. And the good news is that you don’t have to choose one mode for all your integrations. You pick per task and portal, so a team can run agent mode across a long tail of portals and switch the three that matter most to routines.
Ready to run computer use agents in production?
Deck is the infrastructure platform for computer use agents. Backed by Infinity Ventures, Better Tomorrow Ventures, and others.
See how Deck works → Talk to our team →