> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Step 1: Get Source

<Note>
  **Internal Service** — This is not an HTTP endpoint. It's called by the create-ai-article orchestrator.
</Note>

## Purpose

Retrieves the AI site deployment URL and existing AI articles from the database.

## Function Signature

```python theme={null}
async def get_source_deployment(
    user_account_id: str,
    business_id: str,
    product_id: Optional[str] = None,
    product_name: Optional[str] = None
) -> dict
```

## Returns

```python theme={null}
{
    "status": "success",
    "deployment_url": "https://business.searchcompany.dev",
    "project_name": "business-abc123",
    "source_url": "https://customer-domain.com",
    "existing_posts": [
        {"title": "Existing Post 1", "slug": "existing-post-1"},
        {"title": "Existing Post 2", "slug": "existing-post-2"}
    ],
    "entity_id": "uuid-..."
}
```

## What It Does

1. **Query ai\_sites** - Find the AI site for this business/product
2. **Get deployment URL** - The Vercel deployment URL
3. **Get existing posts** - From ai\_articles table (for deduplication)
4. **Return entity\_id** - For later database updates

## Code Location

```
src/app/apis/cron/create_boosted_page/children/step_1_get_source.py
```
