preflight.art API

Hot Folder Integration

Prepress departments live in hot folders — drop a file in, get the result out. Our reference watcher script turns the v1 REST API into exactly that workflow. ~300 lines of Node, runs as a launchd / systemd / Windows service, handles every edge case we've seen.

How it works

You designate a base folder on a prepress workstation or shared server. Underneath, four IN/{profile} subfolders map to our four print profiles. Anyone on your team drops artwork into the matching subfolder; the watcher detects it, submits to /v1/preflight, polls until complete, then writes the rendered PDF report plus structured JSON findings into OUT/{verdict}/. The original artwork moves to processed/ on success or failed/ on error so you can see at a glance what's pending vs. done.

HotFolder/
  IN/
    digital-labels/      ← drops here run with profile=digital-labels
    flexo-labels/        ← …flexo-labels
    flexpack/            ← …flexpack
    cartons-folding/     ← …cartons-folding
  OUT/
    PASS/                ← {name}.{jobid}.preflight.pdf + .preflight.json
    CONDITIONAL_PASS/
    FAIL/                ← + {name}.error.txt when analysis errored
  processed/             ← source artwork moved here after analysis
  failed/                ← source artwork moved here if analysis errored
  state/                 ← internal — crash-recovery queue

All subfolders are auto-created on startup. You don't pre-build the tree — just point the watcher at a base path.

Install in two minutes

mkdir preflight-hotfolder && cd preflight-hotfolder
curl -O https://preflight.art/v1/hotfolder/watch.js
curl -O https://preflight.art/v1/hotfolder/package.json
curl -O https://preflight.art/v1/hotfolder/README.md
npm install

# Run it
node watch.js \
  --base   /Users/you/HotFolder \
  --api-key pf_yourkeygoeshere

Or set env vars instead of CLI flags:

export PREFLIGHT_BASE=/Users/you/HotFolder
export PREFLIGHT_API_KEY=pf_yourkeygoeshere
node watch.js

Run as a service

You almost certainly want this running unattended so files dropped overnight get processed. The full README at /v1/hotfolder/README.md has copy-paste configs for:

What the watcher handles correctly

Edge cases we've found bite real prepress shops:

Rate limits: the default per-key cap is 200 req/hr. With --max-concurrent 4 and ~90-second jobs you'll sustain about ~160 files/hr without issue. If your shop runs more than that, email hello@preflight.art and we'll raise your cap.

Common deployment patterns

PatternSetup
Designer drops to network share, prepress reviews the results Watcher runs on a shared file server. SMB share mounted to designers' workstations. They drop into \\prepress\HotFolder\IN\{profile}. Prepress reviews OUT/.
One watcher per print line Three separate watcher instances (each its own base + key), one per pressroom. Independent rate limits + audit logs per line.
Cloud-attached storage Mount S3 / Backblaze / Wasabi via rclone or s3fs at the base path. The watcher doesn't care that it's not local.
Designer self-service Wrap the IN folder in a Dropbox / OneDrive / Google Drive shared folder. Designers drag files in from anywhere; the watcher (running anywhere) processes them.

Configuration reference

FlagDefaultEnv varNotes
--base <path>requiredPREFLIGHT_BASERoot of your hot folder.
--api-key pf_…requiredPREFLIGHT_API_KEYIssued via /account/api-keys.
--api-base <url>https://preflight.artPREFLIGHT_API_BASEOverride for staging.
--poll-interval <sec>5PREFLIGHT_POLL_SECONDSStatus-check cadence.
--stable-time <sec>3PREFLIGHT_STABLE_SECONDSHow long file size must hold steady before we submit.
--max-concurrent <n>4PREFLIGHT_MAX_CONCURRENTSimultaneous in-flight jobs.
--job-description "…"(empty)PREFLIGHT_JOB_DESCRIPTIONFree-text passed as job notes to every analysis.

Customising

The script is plain Node — no compile step, no exotic deps (one: chokidar). Fork it into your internal tooling repo, add your own output routing (email designer on FAIL, push to your ERP, etc.), and run that instead. Common customisations we've seen:

Source

Inspect or download:

License: MIT. Fork it, ship it inside your own tooling. If you build something nice on top, we'd love to see it — hello@preflight.art.