Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For recurring screenshots that run and finish on a schedule, use a Cloud Run job containing Chromium and browser automation code, trigger it with Cloud Scheduler, and save the files to Cloud Storage if they need to outlive the job. This guide builds that workflow, shows how to schedule it, and explains how to check executions and troubleshoot failures.

Choose a Cloud Run job for a finite capture task

A Cloud Run job runs containerized work to completion; it does not serve HTTP requests. That makes it a natural fit for a scheduled batch of screenshots. Cloud Scheduler can trigger a job directly with a cron schedule, time zone, and caller service account. Google documents a second pattern—Scheduler sends an authenticated HTTP request to a Cloud Run service—which is useful if you already have a request-driven handler, but is not required for a finite capture task.

Decision Cloud Run job Cloud Run service
Execution model Runs one or more tasks to completion. Receives HTTP requests at a service URL.
Scheduler trigger Calls the Cloud Run Jobs :run API. Sends an HTTP request to the service URL.
Authentication Scheduler uses a caller identity permitted to invoke the job; Google’s documented CLI pattern uses OAuth. Keep the service authenticated and give Scheduler a service account permitted to invoke it; Google’s guide says not to allow public access for this pattern.
Best fit here A finite screenshot run or batch. An existing request handler that should run when called.

Google’s Browser and OS automation in Cloud Run documentation describes headless Chrome automation, including screenshots, and names Playwright and Puppeteer as high-level options.

Build a screenshot container

The example below uses Node.js and Playwright. It reads the target URL from TARGET_URL, takes a full-page PNG screenshot, and writes a uniquely named file beneath OUTPUT_DIR. The unique filename helps prevent overlapping or retried executions from replacing the same capture. The readiness check waits for the page’s load event; for a site whose meaningful content appears later, use a selector or an appropriate delay instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Create the application

Save this as package.json:

{
  "name": "scheduled-site-screenshot",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "scripts": { "start": "node screenshot.js" },
  "dependencies": { "playwright": "^1.55.0" }
}

Save this as screenshot.js:

import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';
import path from 'node:path';

const targetUrl = process.env.TARGET_URL;
const outputDir = process.env.OUTPUT_DIR || '/captures';

if (!targetUrl) {
  throw new Error('Set TARGET_URL to the page to capture.');
}

const parsedUrl = new URL(targetUrl);
if (!['http:', 'https:'].includes(parsedUrl.protocol)) {
  throw new Error('TARGET_URL must use http or https.');
}

await mkdir(outputDir, { recursive: true });
const timestamp = new Date().toISOString().replaceAll(':', '-');
const filename = `${timestamp}-${crypto.randomUUID()}.png`;
const outputPath = path.join(outputDir, filename);
const browser = await chromium.launch({ headless: true });

try {
  const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
  const response = await page.goto(targetUrl, {
    waitUntil: 'load',
    timeout: 60000
  });

  if (!response || !response.ok()) {
    throw new Error(`Navigation failed: ${response?.status() ?? 'no HTTP response'}`);
  }

  await page.screenshot({ path: outputPath, fullPage: true, type: 'png' });
  console.log(`Saved ${outputPath}`);
} finally {
  await browser.close();
}

Save this as Dockerfile:

FROM node:22-bookworm
WORKDIR /app
COPY package.json ./
RUN npm install && npx playwright install --with-deps chromium
COPY screenshot.js ./
CMD ["npm", "start"]

Build and push the image to a container registry available to your Cloud Run job. Set TARGET_URL to the page you are authorized to capture. The default output path in the script is /captures; use that as the Cloud Storage mount path, or set OUTPUT_DIR to another mounted directory.

Run a local smoke test

Build the image and run it locally with a writable output directory:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
docker build -t scheduled-site-screenshot .
mkdir -p captures
docker run --rm 
  -e TARGET_URL=https://example.com 
  -e OUTPUT_DIR=/captures 
  -v "$PWD/captures:/captures" 
  scheduled-site-screenshot

On success, the container prints the output file path and the PNG appears in captures. Replace the example URL with your own target. Local success does not guarantee a site will load identically from Cloud Run; access controls, network behavior, and page content can differ.

Deploy the container as a Cloud Run job

  1. Build and push the image to your registry.
  2. Create a Cloud Run job in the region you choose, setting the image, environment variables, memory, task timeout, and any required volume mount. The Cloud Run console’s job creation flow or gcloud run jobs create can be used. Ensure the container writes to the mounted path.
  3. Use a dedicated job service identity for access to Cloud Storage. Grant that identity Storage Object User on the bucket when it needs to create screenshot objects.
  4. Configure task count and parallelism for the batch size. Start conservatively, then raise concurrency only after considering browser memory use and the target sites’ rate limits and access policies.
  5. Run the job once manually and confirm an image is written before adding the schedule.

Google’s Create jobs documentation lists a 10-minute default task timeout, a maximum of 168 hours (7 days), and three retries by default. These are documented product settings; check the current documentation and set values appropriate to your workload rather than assuming a browser capture will fit the defaults.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Keep screenshots after the job exits

Files in a job container’s local filesystem are not durable storage for later inspection. To retain captures, mount a Cloud Storage bucket as a Cloud Run job volume and write the screenshots into its mount directory. Google’s Cloud Storage volume mounts guide explains the configuration and required permissions.

  • Give the job’s service identity the storage permission it needs; for writes, the documented role is Storage Object User.
  • Write distinct object names for separate captures, executions, and retries. Cloud Storage FUSE does not provide file locking; concurrent writers replacing the same file can result in last-writer-wins behavior.
  • Account for memory use: Cloud Storage FUSE writes consume container memory, and volume mounts can affect startup.
  • Do not assume the mount provides every POSIX filesystem behavior. Review the documented limitations if the program relies on file locking or other filesystem semantics.

Schedule the job with Cloud Scheduler

  1. Enable the Cloud Scheduler API in the Google Cloud project.
  2. Create a Scheduler job using a Unix-cron expression, an explicit time zone, and a service account with permission to invoke the Cloud Run job. The Scheduler region does not have to match the job’s region.
  3. Set the target to the Cloud Run Jobs :run API endpoint for the project, job region, and job name. Configure an authenticated HTTP POST using OAuth credentials for the Scheduler caller identity.
  4. Save the schedule, then use Scheduler’s run-now action to verify that it starts a Cloud Run job execution.

Google’s Schedule jobs with Cloud Scheduler guide documents the direct job trigger and cron syntax. Its example schedule, 0 12 * * *, runs at noon according to the selected time zone. Choose the time zone deliberately: schedules tied to local civil time can shift in UTC when daylight-saving time changes.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Keep the identities separate: the Scheduler caller needs permission to invoke the job, while the job’s own service identity needs permission to write captures to the bucket. Avoid granting either identity broader access than it needs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you do not want to maintain Chromium in a container, ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return an image or PDF; this cURL example saves a WebP capture. See the ScreenshotNeo API documentation for available parameters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response includes X-Page-Verdict and X-Billed headers. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Verify executions and inspect failures

Cloud Run job executions send logs to Cloud Logging and monitoring data to Cloud Monitoring. In the Google Cloud console, open the job and inspect its executions, then open an execution to review task status and logs. The execution details pane covers the most recent 1,000 executions and executions from the previous seven days; older logs and metrics are subject to their respective retention policies. See Google’s Execute jobs documentation.

Common problems and fixes

Symptom Likely cause What to check
Execution fails before navigation Chromium is missing, cannot launch, or the container lacks required browser dependencies. Review startup logs; ensure the image installs Chromium and its dependencies, then reproduce with the same image locally.
Navigation times out The site is slow, unreachable from the job, or waiting for a page event that never occurs. Inspect logs and target access requirements; increase the task timeout if justified and use a readiness condition suited to the page rather than waiting indefinitely.
Screenshot is blank or incomplete The page rendered after the selected readiness event or requires interaction. Wait for a known selector or a bounded delay, and verify the page state in browser automation before capture.
Image is missing from the bucket The output path is not the mounted directory, the bucket mount is misconfigured, or the job identity lacks write permission. Confirm OUTPUT_DIR matches the mount path and check the job identity’s Storage Object User access.
Scheduler run is rejected The Scheduler caller lacks permission, or the target URI, region, or authentication configuration is wrong. Check the Scheduler execution status, the job endpoint parameters, OAuth configuration, and caller permissions.
Retries overwrite an image Executions use the same object name. Include a timestamp or unique identifier in each output name; do not have overlapping runs write the same file.
Memory exhaustion or slow startup Chromium and storage volume activity exceed allocated resources or incur startup overhead. Observe actual job metrics and logs, tune memory for the workload, and avoid unnecessarily high parallelism.

Performance, reliability, and cost considerations

  • Resource sizing: browser startup and memory use matter, especially for full-page captures, pages with heavy scripts, and multiple concurrent tasks. No single memory setting or runtime is established for all sites; measure the actual container workload.
  • Retries and idempotency: retries can repeat a capture. Make output names unique and consider whether repeated capture requests have side effects beyond writing another image.
  • Parallelism: Cloud Run jobs can run tasks in parallel, but that does not establish a safe request rate for any particular website. Respect the target’s access rules and rate limits.
  • Storage behavior: a mounted bucket is convenient for ordinary file operations, but FUSE writes consume memory and concurrent writes to one filename are unsafe.
  • Cost: this workflow uses Cloud Run, Cloud Scheduler, and potentially Cloud Storage. The supplied official documentation does not establish a total cost for a particular capture frequency, page complexity, region, resource allocation, or retention period; estimate those components using your configuration and current Google Cloud pricing.

Frequently Asked Questions

Can the job capture a page that requires authentication?

Potentially, if the page and application permit it. The example does not implement login; add a secure authentication flow and protect any credentials rather than embedding them in source code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can one scheduled execution capture several URLs?

Yes. Extend the container to process a finite URL list or configuration input, use distinct filenames per URL, and size task count and parallelism for the total work.

Can the screenshot be a PDF instead of a PNG?

Yes. Browser automation can generate PDFs, but this example and its filename handling are specifically for PNG output; adapt the capture code and storage naming for PDF.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.