1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "markdown": "# Quarterly Report: Q3 2026\n\n**Prepared by** the analytics agent, October 2026\n\n## Summary\n\nRevenue grew **18%** quarter over quarter, driven by the new self-serve plan.\n\n| Metric | Q2 | Q3 | Change |\n| --- | ---: | ---: | ---: |\n| Revenue | $1.20M | $1.42M | +18% |\n| New customers | 310 | 402 | +30% |\n| Churn | 3.1% | 2.6% | −0.5 pts |\n\n## How a visitor becomes a customer\n\n```mermaid\nflowchart LR\n A[Visit] --> B[Free trial]\n B --> C{Activated?}\n C -->|Yes| D[Paid plan]\n C -->|No| E[Nurture emails]\n E --> B\n```\n\n## Forecast\n\nNext quarter's revenue is estimated with compound monthly growth:\n\n$$R_{t+3} = R_t \\times (1 + g)^{3}, \\quad g = 0.06$$\n\n```python\ndef forecast(revenue, growth=0.06, months=3):\n return revenue * (1 + growth) ** months\n```\n\n> [!NOTE]\n> Figures are unaudited.\n\n## Next steps\n\n- [x] Launch the self-serve plan\n- [ ] Add annual billing\n"
12};
13
14
15const run = await client.actor("jumblemog/markdown-to-pdf").call(input);
16
17
18console.log('Results from dataset');
19console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
20const { items } = await client.dataset(run.defaultDatasetId).listItems();
21items.forEach((item) => {
22 console.dir(item);
23});
24
25