Skip to content

On a schedule

Keep your index in sync with your website

Every week new and edited pages are re-added, removed pages are deleted, and you get an email with the counts.

Runs
On a schedule
Apps
Pinecone
AI
Not needed
Access
API key

Send this to your assistant

Create a ClickRuntime automation: every Sunday at 2am, read the sitemap at example.com/sitemap.xml, add new or changed pages to my Pinecone index docs-search, delete pages that are gone, and email me how many were added, updated and removed.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A company that puts its website, help center or documentation into a Pinecone index for search or an assistant has a freshness problem. Pages are edited, new articles are published, and old ones are removed, yet the index still reflects the day it was first built. Answers then cite a retired pricing page or miss the latest guide, and nobody knows the index is stale until a customer complains.

Each week, the sitemap or content API is fetched and every page is hashed. The hashes are compared with those stored from the last run, and only pages that changed are split into chunks and upserted as text records using Pinecone's integrated embedding. Records for pages that no longer exist are deleted, and a summary email says what was added, updated and removed.

It suits teams running a support assistant, internal search or retrieval over public content.

What you get out of it

  • Answers reflect the current site

    Weekly refreshes mean the index catches up with edits, new pages and removals. A support assistant stops quoting last quarter's pricing or a feature that was renamed. Customers get correct answers instead of confidently stated outdated ones.

  • Only changed pages are processed

    Hashing each page lets the sync skip everything that did not change. That keeps runs quick and avoids re-embedding thousands of unchanged pages week after week. Lower processing also keeps embedding costs predictable as your site grows.

  • Deleted pages stop appearing

    Removing records for pages that are gone prevents the index from returning dead links. Customers are not sent to a retired page because of an old record that was never cleaned up.

  • Integrated embedding keeps setup simple

    Pinecone's integrated embedding turns text into vectors inside the index, so no separate embedding service is needed. That means fewer moving parts to maintain and fewer keys to manage. Teams without machine learning experience can still maintain it.

  • A summary you can read in a minute

    The email lists what changed in the week. If a run adds nothing for a month, or removes a surprising number of pages, you notice a problem with the source rather than silently serving stale data.

How it works

What happens, step by step

  1. On your chosen schedule, ClickRuntime reads your website's sitemap and fetches the text of every page.

  2. It compares each page with the version it saved last time and skips pages that haven't changed.

  3. New and edited pages are split into chunks and added to your Pinecone index.

  4. Pages that are no longer in the sitemap are removed from the index.

  5. You get an email with the number of pages added, updated and removed.

Before it runs live

  • Connect Pinecone

What you get

RunsOn a schedule
Keep your index in sync with your websitetoday, 9:00Succeeded
Email · Index syncPinecone docs-search sync: added 4, updated 11, removed 2 pages.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Pinecone steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
scheduled_sync_of_website_or_content_pages_into_an_index.pyexample
import hashlib, json, re
from clickruntime import on_trigger, credentials, notify, http, state

HOST = "https://docs-search-abc123.svc.us-east-1-aws.pinecone.io"  # index docs-search
SITEMAP = "https://example.com/sitemap.xml"

@on_trigger
def run(event):
    headers = {"Api-Key": credentials.secret("PINECONE_API_KEY"), "X-Pinecone-API-Version": "2025-04"}
    hashes = state.get("hashes") or {}
    urls = re.findall(r"<loc>(.*?)</loc>", http.get(SITEMAP).text)
    added = updated = 0
    for url in urls:
        text = re.sub(r"\s+", " ", re.sub(r"<[^>]+>", " ", http.get(url).text)).strip()
        digest = hashlib.sha256(text.encode()).hexdigest()
        if hashes.get(url) == digest:
            continue
        added, updated = (added + 1, updated) if url not in hashes else (added, updated + 1)
        chunks = [text[i:i + 2000] for i in range(0, len(text), 2000)][:50]
        body = "\n".join(json.dumps({"_id": f"{url}#{n}", "chunk_text": c, "url": url}) for n, c in enumerate(chunks))
        http.post(f"{HOST}/records/namespaces/docs/upsert", data=body,
                  headers={**headers, "Content-Type": "application/x-ndjson"}).raise_for_status()
        hashes[url] = digest
    removed = [u for u in hashes if u not in urls]
    if removed:
        http.post(f"{HOST}/vectors/delete", headers=headers,
                  json={"namespace": "docs", "filter": {"url": {"$in": removed}}}).raise_for_status()
        for u in removed:
            hashes.pop(u)
    state.set("hashes", hashes)
    notify.email_me("Pinecone docs-search sync", f"Added {added}, updated {updated}, removed {len(removed)} pages.")
    return {"added": added, "updated": updated, "removed": len(removed)}

FAQ

Common questions

How are long pages handled?
Each changed page is split into chunks of manageable size before upsert, so retrieval returns the relevant part rather than a whole long article. The chunks keep an identifier tied to their source page for later updates.
What if my site has no sitemap?
If you have a content API or a feed, that can be used instead. Your AI assistant can set the source up for you, and you will see the plan before it is used. Both work equally well.
Does it need a Pinecone index with integrated embedding?
Yes, the records are upserted as text, which relies on an index configured with a hosted embedding model. Your Pinecone API key is held as a secret in ClickRuntime and is used only for upserts and deletes.
What permissions does it need?
API key. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Keep your index in sync with your website” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.