Quick overview
This workflow uses an n8n Chat UI plus OpenRouter (Claude Sonnet) to generate and iteratively edit a single-page local business website, serve a live HTML preview, and publish the approved page to a Hostinger subdomain, while archiving versions to a Data Table, Google Drive, and Google Sheets.
How it works
- Receives a message in the n8n Chat UI and uses OpenRouter (Claude Sonnet) to extract a business brief and decide whether to reply, build a site, or publish.
- When building, loads the latest saved HTML version for the current chat session and asks OpenRouter (Claude Sonnet) to generate or apply edits to a complete
index.html.
- Cleans the model output into raw HTML, generates a preview URL, and saves a new version (with status) to an n8n Data Table.
- Archives the generated HTML to Google Drive and appends a run log (including preview URL and Drive link) to Google Sheets.
- Replies in chat with the preview link and instructions to request edits or approve publishing.
- Serves
GET /preview/:siteId by loading the latest HTML from the Data Table, injecting a fixed “Publish Live/Update Website” bar, and returning the page as text/html.
- Handles
POST /publish/:siteId by creating a Hostinger subdomain via API, uploading the HTML via FTP, updating the Data Table row to “deployed” with the live URL, and returning a JSON confirmation.
Setup
- Add an OpenRouter API credential (or swap to your preferred LLM provider) for both the intake and builder chat model nodes.
- Create an n8n Data Table for generated sites/versions (siteId, sessionId, businessName, subdomainSlug, html, brief_object, status, version, liveUrl) and select it in all Data Table steps.
- Add Google Drive OAuth and Google Sheets OAuth credentials, then set the target Drive folder ID and the Google Sheets document ID/sheet name used for logging.
- Add Hostinger credentials: an HTTP Bearer token for the Hostinger API subdomain endpoint and FTP credentials for uploading to
/public_html/<slug>/index.html.
- Update the hardcoded
PREVIEW_BASE and PUBLISH_BASE URLs inside the code steps to match your Preview and Publish webhook production URLs, and replace the domain used to build live URLs if you are not using dripranks.com.
Additional info
Read the main sticky it has complete details and setup guide.
Contact
Email: [email protected]
linkedin: https://www.linkedin.com/in/salman-mehboob-pro/