async def _process_standalone_pages(
        self, client: httpx.AsyncClient, all_pages: List[dict]
    ) -> AsyncGenerator[ChunkEntity, None]:
        """Process pages that are not in databases with full content aggregation."""
        logger.info("Phase 4: Processing standalone pages with aggregation")

        for page in all_pages:
            page_id = page["id"]
            if page_id in self._processed_pages:
                continue

            parent = page.get("parent", {})
            parent_type = parent.get("type", "")

            # Skip database pages (already processed)
            if parent_type == "database_id":
                continue

            try:
                # Get full page details
                full_page = await self._get_with_auth(
                    client, f"https://api.notion.com/v1/pages/{page_id}"
                )

                # Build breadcrumbs for standalone pages
                breadcrumbs = await self._build_page_breadcrumbs(client, full_page)

                # Always use lazy loading for better performance
                page_entity = await self._create_lazy_page_entity(full_page, breadcrumbs)
                yield page_entity

                # Don't yield files separately - they'll be handled during materialization
                self._processed_pages.add(page_id)

            except Exception as e:
                logger.error(f"Error processing standalone page {page_id}: {str(e)}")
                continue
Process pages that are not in databases with full content aggregation.
backend/airweave/platform/sources/notion.py