Notion API Block Children Response Payload Slimming
Field-level Notion projection at the edge
Notion responses include fields Frontend / Web never renders. Map id, status, and UI columns at the edge after calling https://api.notion.com/v1/databases/{{query.databaseId}}/query.
Unmapped Notion fields waste bandwidth
Notion returns nested CRM, audit, and configuration objects. Frontend / Web parses them on the main thread even when the UI binds three fields.
- Large arrays kept in memory after navigation
- Analytics showing poor LCP on API-heavy screens
- Developers shipping defensive null checks for unused paths
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Create NOTION_API_KEY vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.
Configure upstream steps and output mapping
Use POST against https://api.notion.com/v1/databases/{{query.databaseId}}/query. Allowed origins on the client token should match post pipelines set cache ttl to 0 because realcomposer only stores get responses at the edge.
Call from Frontend / Web
Allowed origins on the token should list every Frontend / Web host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/slim-notion-block-children-payload', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_slim-not",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "slim-notion-block-children-payload"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"pageId": "sample",
"title": "sample"
}
Recipe Specs
- HTTP method
- POST
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 2
- Payload
- 253 B to 36 B (-86%)
curl -X POST "https://realcomposer.com/v1/workspace/slim-notion-block-children-payload" \
-H "Authorization: Bearer rc_live_client_token" \
-H "Content-Type: application/json" \
-d '{"model":"example"}'Developer Questions & Troubleshooting
Is it safe to log Notion responses in Frontend / Web?
Point Frontend / Web at /recipes/slim-notion-block-children-payload edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.
Will Anthropic or Linear prompt bodies be rewritten?
slim-notion-block-children-payload POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard.
How do I rotate upstream credentials?
Upstream steps in slim-notion-block-children-payload honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + Notion Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.