Author a minimal workflow, run it, and inspect the result.
Ask me what website and workflow I want to demonstrate. If I’m not sure, give me a few examples of simple workflows I could do. Then open a Libretto browser session for the site I choose. After I finish, create a Libretto workflow.
src/workflows/scrape-page.ts: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
return is the workflow output. On a hosted run, that output is result on the job. See Get the workflow output.1npx libretto open https://example.com --session debug-example
12npx libretto snapshot --session debug-example npx libretto exec --session debug-example "await page.url()"