Render's links page. A Render Workflow reads the links from Notion, health-checks each link, and writes the result to Key Value. A web service reads the result from Key Value and serves one HTML page per profile.
grouplink/rebuild.py: Thegrouplink.rebuildWorkflow taskgrouplink/webhook.py: Web service that serves the pages and receives Notion's webhookgrouplink/page.py: Renders the HTML pagegrouplink/assets/: Fonts, icons, and logosscripts/: Local preview scriptstests/: Unit, golden-page, and live testsrender.yaml: Render Blueprint for the web service and the Key Value instance
- Someone edits a row in Notion.
- Notion sends a webhook to the web service. The web service waits for 60 seconds with no new edits, then starts one
grouplink.rebuildrun. - The run reads both Notion databases, health-checks each link, and writes a snapshot to Key Value under the
grouplink:sitekey. - The web service renders each page from the snapshot on request.
There is no schedule. The run logs the live URL and any dead links. If a run fails, the error shows in the run's logs in the Render Dashboard.
The links database has the following properties:
| Property | Type | Purpose |
|---|---|---|
Title |
title | Card text |
URL |
url | Where the card points |
Visible |
checkbox | Unchecked rows are not shown |
Everyone |
checkbox | Shows the link on every profile's page |
Profiles |
relation | The profiles whose pages show the link |
Icon |
select | A file name from grouplink/assets/link-icons/. one, two, and three draw a numbered box. Empty means arrow. |
Order |
number | Card position, lowest first. Required. |
Section |
select | The tab the link shows in. Empty means the Misc tab. |
The profiles database has the following properties:
| Property | Type | Purpose |
|---|---|---|
Name |
title | The heading on the profile's page |
Slug |
text | The URL path. shifra serves at /shifra. |
Tagline |
text | The page description in the metadata. The page also shows it under the name, except on the default page. |
The profile named by SITE_DEFAULT_SLUG is also served at /. The slugs assets, healthz, links, tasks, and webhooks are reserved.
A page with links in two or more sections shows a row of tabs above the links. The tabs are in the order of the Section options. To move a tab, drag its option in the property settings. Inside each tab, the links are in Order, and links with no Order go last. On a page where some links have a section, the links with no section show in a tab called Misc. Misc is the last tab, unless Section has a Misc option. A page with fewer than two tabs shows no tabs and shows all its links in Order. If the links database has no Section select property, every page shows no tabs.
A click on a tab shows its links without loading the page again.
Each tab has its own URL. The last path segment is the Section text in lowercase, with spaces and underscores changed to - and other characters removed. AI Agents becomes ai-agents, so /shifra/ai-agents opens that tab. /shifra opens the first tab, so /shifra/<first tab> redirects to /shifra. A path with uppercase letters redirects to the same path in lowercase. A section the page does not have returns a 404 page. Two values with the same segment, such as Startups and startups, are one tab.
The web service serves every page path with and without the /links prefix, because render.com removes the prefix and a direct visit to the onrender.com URL does not.
You need Python 3.12 or later, uv, the Render CLI, and Docker or a local Redis.
- Run
uv sync. - Copy
.env.exampleto.envand fill in the Notion and Redis values. - Run
render workflows dev -- uv run render-workflows grouplink.main:app. - In another terminal, start a dry run:
render workflows start grouplink.rebuild --local --input='[{"dryRun":true}]'- Start Redis with
docker run -p 6379:6379 redis. - Write a snapshot from Notion with
uv run python -m scripts.preview. To use the seed links instead of Notion, runuv run python -m scripts.placeholder. - Start the web service:
REDIS_URL=redis://localhost:6379 WORKFLOW_SLUG=local uv run python -m grouplink.webhook- Open
http://localhost:3000.
The preview scripts refuse to write to a Redis that is not on your machine.
Blueprints don't support Workflows yet, so you create the Workflow in the Dashboard. The web service fails its first deploy because WORKFLOW_SLUG is empty. Step 5 fixes it.
- Create a Notion connection at notion.so/profile/integrations with only the Read content capability. Copy its token, then connect it to both databases from each database's ⋯ > Connections menu. Creating an internal connection needs workspace owner rights. If you are not an owner, see Public Notion connection.
- Deploy the Blueprint. It creates the
grouplink-cacheKey Value instance and thegrouplink-webhook-pyweb service. LeaveWORKFLOW_SLUGblank and note the web service's URL. - Create a Workflow on the same repo:
- Build command:
uv sync --locked --no-dev --no-install-project - Start command:
uv run --no-sync python -m grouplink.main
- Build command:
- Set the Workflow's environment variables from Configuration. Set
DRY_RUN=truefor the first deploy. - Set
WORKFLOW_SLUGandRENDER_API_KEYon the web service and redeploy it. - Create the Notion webhook subscription. See Notion webhook.
- Remove
DRY_RUNfrom the Workflow and edit a row in Notion. The page returns 503 until the first run writes the snapshot.
- On the connection's Webhooks tab, create a subscription with the URL
https://<webhook-host>/webhooks/notion. - Subscribe to
page.created,page.deleted,page.undeleted,page.properties_updated,page.content_updated,data_source.content_updated, anddata_source.schema_updated. - Notion sends a verification token to the web service. Find
notion verification_token: ntn_...in the web service's logs. - Click Verify on the Webhooks tab and paste the token.
- Set the same token as
NOTION_WEBHOOK_SECRETon the web service and redeploy. Until you do this, the web service rejects all Notion events with 401 and starts no rebuilds.
The verification token stays in the web service's logs. If other people can read those logs, delete the subscription, remove NOTION_WEBHOOK_SECRET, and do these steps again.
- Create the connection with the type Public and the redirect URI
https://<webhook-host>/oauth. The web service has no route at that path, so the code stays in the address bar. - Open the Authorization URL from the Configuration tab, pick both databases, and approve.
- Copy the
codeparameter from the address bar. It expires after ten minutes. - Exchange the code for a token:
curl -X POST https://api.notion.com/v1/oauth/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d "{\"grant_type\": \"authorization_code\", \"code\": \"$CODE\", \"redirect_uri\": \"https://<webhook-host>/oauth\"}"Use the access_token from the response as NOTION_TOKEN.
curl -X POST https://<webhook-host>/tasks/grouplink.rebuild \
-H "Authorization: Bearer $DISPATCH_TOKEN" \
-H "Content-Type: application/json" \
-d '[{"dryRun":true}]'The Workflow reads the following variables:
| Variable | Default | Purpose |
|---|---|---|
NOTION_TOKEN |
— | Notion connection token |
NOTION_LINKS_DATABASE_ID |
— | The links database |
NOTION_PROFILES_DATABASE_ID |
— | The profiles database |
REDIS_URL |
— | Internal connection string of grouplink-cache |
SITE_URL |
— | Public URL, shown in the run log |
SITE_DEFAULT_SLUG |
— | Slug of the profile served at / |
DRY_RUN |
false |
Set to true to skip the snapshot write |
LINKS_LIMIT |
100 |
Notion rows to read per run |
The web service reads the following variables:
| Variable | Default | Purpose |
|---|---|---|
REDIS_URL |
— | Set by the Blueprint |
RENDER_API_KEY |
— | Starts Workflow runs |
WORKFLOW_SLUG |
— | Slug of the Workflow service |
NOTION_WEBHOOK_SECRET |
— | Verification token of the Notion subscription |
DISPATCH_TOKEN |
— | Bearer token for POST /tasks/:task |
REBUILD_TASK |
grouplink.rebuild |
Task the webhook starts |
DEBOUNCE_MS |
60000 |
Wait time after an edit before a run starts |
Run the following commands before you deploy:
uv run ruff check .uv run ruff format --check .uv run mypyuv run pytest
RUN_LIVE=1 uv run pytest tests/test_rebuild_live.py --enable-socket runs a dry run against real Notion, real sites, and a real Key Value instance.
After a change to page.py, regenerate the golden pages in tests/golden/ and review the diff.
MIT. See LICENSE.