Skip to content
Notifications
Clear all

Just built a landing page generator with Botsonic. Here's the exact flow.

1 Posts
1 Users
0 Reactions
1 Views
(@integrations_ivan)
Estimable Member
Joined: 4 months ago
Posts: 125
Topic starter   [#8544]

I've been evaluating Botsonic as a potential middleware layer for content generation within our integration workflows, specifically to automate client-facing asset creation. The promise of a no-code chatbot that could be trained on our API documentation and brand guidelines was intriguing, but I wanted to push it beyond simple Q&A. This post documents a successful experiment to construct a structured landing page generator using Botsonic's native capabilities, treating it as a stateful API endpoint of sorts.

The core challenge was moving from conversational responses to a deterministic, structured JSON output that a downstream system could consume. Botsonic's "Train on your data" feature was key. I uploaded a folder containing:
* Our brand voice guide (PDF)
* Three dozen example landing pages in markdown format (txt files)
* A structured schema document outlining required sections (e.g., hero, features, testimonials, CTA)

The critical step was the custom prompt engineering within the Botsonic "Base Prompt" configuration. I instructed the model to act as a strict JSON API, suppressing all natural language fluff in its response. The prompt explicitly defined the expected JSON schema.

**Example of the Base Prompt configuration:**
```
You are a landing page generator API. The user will provide a product name, key features, and target audience. You MUST output ONLY a valid JSON object with the following structure:
{
"meta": { "title": "string", "description": "string" },
"sections": [
{ "type": "hero", "headline": "string", "subheadline": "string" },
{ "type": "features", "items": [ {"title": "string", "body": "string"} ] },
{ "type": "cta", "text": "string", "buttonLabel": "string" }
]
}
Do not include any explanatory text, markdown, or code fences. Output raw JSON only.
```

The operational flow is as follows:
1. A user interacts with the embedded Botsonic widget on our internal tool.
2. The user provides inputs in a constrained format: "Generate for: [Product], Features: [A, B, C], Audience: [X]".
3. Botsonic processes this against its trained data and the strict base prompt.
4. The response is pure JSON, caught by the widget's callback function.
5. This JSON payload is then POSTed via a webhook to a simple rendering service that applies our HTML/CSS template, producing a final landing page draft.

**Key observations and pitfalls:**
* **Data Consistency:** Training on a high volume of structured examples was crucial for consistent output. Initial runs without sufficient examples produced varying JSON field names.
* **Prompt Rigor:** The instruction "ONLY a valid JSON object" and "Do not include any explanatory text" had to be emphatically repeated in the base prompt. Earlier, less strict versions sometimes prefixed the JSON with conversational phrases, breaking the downstream parser.
* **Webhook Integration:** Botsonic's native webhook feature to forward the conversation is useful, but we had to parse the final message block for the JSON. A more elegant solution would be a direct API call to the Botsonic inference endpoint with the configured prompt, bypassing the chat widget for full automation.

This flow effectively turns Botsonic into a specialized content API. The next phase is to integrate this into our iPaaS (Zapier currently, moving to n8n) to trigger page generation from new product entries in our ERP, demonstrating a complete event-driven content pipeline.

-- Ivan


Single source of truth is a myth.


   
Quote