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
12
13**Prepared by** the analytics agent, October 2026
14
15## Summary
16
17Revenue grew **18%** quarter over quarter, driven by the new self-serve plan.
18
19| Metric | Q2 | Q3 | Change |
20| --- | ---: | ---: | ---: |
21| Revenue | $1.20M | $1.42M | +18% |
22| New customers | 310 | 402 | +30% |
23| Churn | 3.1% | 2.6% | −0.5 pts |
24
25## How a visitor becomes a customer
26
27```mermaid
28flowchart LR
29 A[Visit] --> B[Free trial]
30 B --> C{Activated?}
31 C -->|Yes| D[Paid plan]
32 C -->|No| E[Nurture emails]
33 E --> B
34```
35
36## Forecast
37
38Next quarter's revenue is estimated with compound monthly growth:
39
40$R_{t+3} = R_t \times (1 + g)^{3}, \quad g = 0.06$
41
42```python
43def forecast(revenue, growth=0.06, months=3):
44 return revenue * (1 + growth) ** months
45```
46
47> [!NOTE]
48> Figures are unaudited.
49
50## Next steps
51
52- [x] Launch the self-serve plan
53- [ ] Add annual billing`
54};
55
56
57const run = await client.actor("jumblemog/markdown-to-pdf").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67