﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>---
url: https://docs.puppetflow.com/guide/artifacts.md
---
# Artifacts

Artifacts are files produced during a flow run. They give you tangible proof of what the automation did.

## Artifact types

### Screenshots

PNG files captured with `$screenshot()`:

```js
await $screenshot('after-login');
await $screenshot('invoice-page');
```

Screenshots are auto-numbered if you don't provide a name (`screenshot_00`, `screenshot_01`, …).

By default, all screenshots are included in the run artifacts. Pass `{ output: false }` to capture a screenshot for internal use without exporting it:

```js
await $screenshot('debug', { output: false });
```

### Downloads

Files downloaded during the run:

```js
// Direct HTTP download using the page's cookies
await $download('https://app.example.com/export.csv', 'report.csv');

// Browser-initiated download (click a download link)
await $downloadFromBrowser('https://app.example.com/invoice.pdf', 'invoice.pdf');

// Wait for a browser-initiated download to complete
await $clickElement('#download-btn');
const file = await $waitForFile();
```

Downloaded files support the same `{ output: false }` option.

### Video recording

An MP4 video of the entire browser session. See [Video Recording](/guide/video-recording) for details.

## Accessing artifacts

### In the UI

Open a run's detail view. The artifacts section shows:

* Thumbnail grid for screenshots.
* File list for downloads.
* Video player for recordings.

### Via the REST API

List artifacts:

```
GET /api/v1/flows/{id}/runs/{runId}/artifacts/screenshots
GET /api/v1/flows/{id}/runs/{runId}/artifacts/downloads
```

Download a specific file:

```
GET /api/v1/flows/{id}/runs/{runId}/artifacts/screenshots/after-login.png
GET /api/v1/flows/{id}/runs/{runId}/artifacts/downloads/report.csv
```

Get the recording:

```
GET /api/v1/flows/{id}/runs/{runId}/recording
```

## Export control

Under **Output & artifacts**, each flow has three export toggles:

* **Screenshots in output** - Include PNG files.
* **Downloads in output** - Include downloaded files.
* **Recording in output** - Include the MP4 video.

Webhook actions can override these settings per action, so you can send different artifacts to different endpoints.

## File utilities

Puppetflow provides several helper methods for working with files during a run:

```js
// Unzip a downloaded file
const files = await $unzipFile('archive.zip', 'extracted');

// List files in a directory
const csvFiles = await $scanDirectory('extracted', '.csv');

// Move a downloaded file
$moveDownloadedFile('old-name.csv', 'renamed.csv');

// Get the full path to a downloaded file
const path = $getDownloadsPathFile('report.csv');
```

See [Working with Downloaded Files](/guide/downloaded-files) for PDF and archive