Internal Service β This is not an HTTP endpoint. Itβs called directly by the generate-all orchestrator.
Purpose
Generates 10 visibility prompts for each discovered product. These are product-specific search queries that potential customers might use.
Runs in GROUP 3a (starts immediately when GROUP 2b completes, runs in parallel with GROUP 3b).
Function Signature
async def run_product_prompts(
url: str,
org_slug: str,
discovered_products: list,
pages: list
) -> Optional[StepResult]
Parameters
| Parameter | Type | Description |
|---|
url | str | The business website URL |
org_slug | str | The Clerk organization slug |
discovered_products | list | Products from GROUP 2b |
pages | list | Pre-scraped pages from GROUP 1a |
Returns
{
"name": "product_prompts",
"status": "success",
"data": {
"products_processed": 3,
"total_prompts": 30
}
}
Prompt Count
| Entity Type | Prompts |
|---|
| Business | 50 (10 Exa + 40 Gemini) |
| Each Product | 10 |
Example: A business with 3 products gets 50 + 30 = 80 total prompts.
Execution Flow
Product-Specific Prompts
Uses Gemini with product context:
prompt = f"""
Generate 10 search queries for this specific product: {product_name}
The product is offered by {business_name} at {product_url}.
Requirements:
- Queries should be specific to this product
- Include feature-specific queries
- Include comparison queries with alternatives
- Do NOT include the product name or business name
"""
Database Storage
Prompts are linked to the product entity:
INSERT INTO entity_prompts_tracker (
entity_id, -- Product entity ID, not business
prompt
) VALUES (
'product-uuid-...',
'Best tool for X feature'
);
Code Location
src/app/apis/onboarding/generate_all/tasks/prompts.py
Contains both:
run_business_prompts() - GROUP 2a
run_product_prompts() - GROUP 3
Skipped Scenarios
Product prompts are skipped if:
- No products were discovered in GROUP 2b
- Product discovery failed
- Products donβt have valid entity IDs
{
"name": "product_prompts",
"status": "skipped",
"data": {
"products_processed": 0,
"total_prompts": 0
}
}