Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Web Scraping & Research

Web Scraping & Research

Fetch and cache web pages with Bright Data and a Data Table

Reusable sub-workflow other workflows call with a URL; checks a timestamped Data Table cache first, otherwise fetches the page through Bright Data and returns markdown, HTML or JSON.

What it does

## One scraper your other workflows call, with a cache in front of it By the fifth workflow that fetches a page you have written the same Bright Data call, the same error check and the same fallback five times. This is that code, once, as a sub-workflow other workflows call with a URL. ### How it works It starts on an Execute Workflow Trigger - no schedule, no webhook. A caller passes url, optionally a format (markdown, html or json) and a max_age_minutes. First it looks in the cache. A Data Table keeps every result with a timestamp, so asking for the same URL inside your freshness window returns instantly and spends nothing. Five workflows checking the same page each morning become one request. On a miss it fetches through Bright Data, then checks the payload properly: Bright Data returns validation errors and blocks with HTTP 200 and an error body, and an empty body means the domain never resolved. If the result is empty or suspiciously thin it retries once with render: true, running the page in a real browser - which is what rescues single-page apps. It always returns the same fields, including ok, from_cache and error, so the caller can branch on the result instead of guessing. ### Setup 1. A Bright Data Header Auth credential and a Web Unlocker zone. 2. A Data Table called scrape_cache with columns url, content, status and fetched_at. It will not add missing ones. 3. In another workflow, add Execute Sub-workflow, pick this one, pass a url.

The steps

  1. A Workflow Asks For A Page
  2. Settings
  3. Read The Request
  4. Look In The Cache
  5. Is It Still Fresh?
  6. Serve From Cache?
  7. Straight From The Cache
  8. Fetch The Page
  9. Read What Came Back
  10. Does It Need A Browser?
  11. Try Again In A Browser
  12. Read The Rendered Page
  13. The First Fetch Was Fine
  14. Build The Answer

15 steps in total.

Similar automations