Detect idle device activity from Prey screenshots with Claude Vision

Go to Workflow
0 views
Built by Patricio Patricio
Created on September 17, 2026

Description

Quick Overview
This workflow detects device idleness by sampling recent Prey screenshot reports and analyzing them with Anthropic Claude Vision, returning a JSON verdict (idle true/false plus summary) while enforcing a configurable cooldown and minimum data window.

How it works
Receives a POST request via a webhook (or runs manually for testing) to start an idle-check execution.
Checks a workflow-level cooldown timer and stops early if an analysis ran too recently.
Fetches recent device reports from Prey and keeps only those with screenshots within the configured time window.
Stops with an idle: null result if there are not enough screenshots or the screenshots do not span the minimum required time.
Evenly samples up to the maximum number of screenshots, downloads each image from Prey, and packages them in chronological order.
Sends the screenshot set to the Anthropic Messages API (Claude Vision) to determine whether meaningful on-screen changes indicate activity.
Parses the model’s JSON response and outputs a final JSON verdict including idle status, a short summary, and the analyzed report metadata.

Setup
Add a Prey API credential and select the target device ID for fetching reports and downloading screenshots.
Add an Anthropic API credential for the Claude Vision HTTP request.
If using the webhook trigger, copy the webhook URL and configure Prey (or your source system) to POST to /prey-idle-check.
Review and adjust the window and control values (window_minutes, min_reports, min_span_minutes, max_images, cooldown_minutes) to match your monitoring needs.

Nodes Used (2)

Code
n8n-nodes-base.code
HTTP Request
n8n-nodes-base.httpRequest