# Example agent workflow

A full backup/restore run from an agent's point of view:

```bat
archivst auth status
archivst backup -s backupset.json -q
:: if exit code != 0:
archivst logs --errors
:: read + delete any *.json in %APPDATA%\ArchivstDesktop\notifications
archivst restore request -f Photos --code <code from email>
archivst restore poll -f Photos --interval 30 --timeout 60
archivst restore run -f Photos -d D:\restore -q
```

Notes:

- Every step is a fresh process that exits; react to exit codes, not interactive output.
- On failure, combine `archivst logs --errors` with the notification JSON files to build a report.
- Restores proceed in three stages: request a code, poll until ready, then run the download.

[Back to Agentic Usage](/agentic)
