Browser routine

A .ts routine that drives the embedded browser — automate any site.

Browser routine
Create in Cowork
Cowork Browser
https://status.example.com

System status

API — degraded performance
→ routine filed: "Investigate outage"

A routine that automates the Cowork desktop shell’s embedded browser through ctx.browser: navigate, read, click, fill — on the pages you are already signed into.

Use this shape for anything that needs a real page — checking a dashboard, scraping a table, filling a form on a cookie-authenticated site. In Cowork: Create → Routine → Browser routine.

Create it

This template is built into Cowork Studio's Create dialog. Open Manage Workspace, pick the matching tab, click its Add button and choose Browser routine — name it, and the files land in your workspace ready to edit.

Code

// Cowork/Routines/my-routine.ts
export default async (args, ctx) => {
  if (!ctx.browser) {
    return { ok: false, reason: 'run this from the Cowork desktop shell' }
  }
  await ctx.browser.navigate('https://example.com')
  const page = await ctx.browser.read()
  return { ok: true, title: page.title }
}