Install Libretto and run your first workflow end to end.
Fetch and follow https://libretto.sh/start.md to set up Libretto and create a new browser automation.
npx libretto from that package.1npm create libretto@latest
1npm create libretto@latest my-automations
12npm install libretto zod npx libretto setup
npx libretto run <path> --headless.src/workflows/scrape-page.ts in the package you set up:12345678910111213141516171819import { workflow } from "libretto"; import { z } from "zod"; export default workflow( "scrape-page", { input: z.object({}), output: z.object({ title: z.string(), }), startUrl: "https://example.com", }, async ({ page }) => { const title = await page.title(); console.log(`Page title: ${title}`); return { title }; }, );
1npx libretto run src/workflows/scrape-page.ts --headless