Dynamically generate a webpage from user request using OpenAI Structured Output

Nodes

2cf69bf8-d025-41db-983e-898d5f3acf5a3b9f1b78-6b80-4575-aa6c-966987000389eb4d7d31-2fbb-4c15-b894-0022be7a4ecfa97f27bd-6185-4b9b-bade-f7020a7a18859dd572aa-e531-4ffe-a66c-58ac7003ac5d

Created by

AgAgent Studio

Last edited 39 days ago

This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.

How it works:

  • Users add what they want to build as a query parameter
  • The OpenAI node generate an interface following a structured output defined in the body
  • The JSON output is then converted to HTML along with a title
  • The HTML is encapsulated in an HTML node (where the Tailwind css script is added)
  • The HTML is rendered to the user via the Webhook response.

Set up steps

  • Create an OpenAI API Key
  • Create the OpenAI credentials
  • Use the credentials for both nodes HTTP Request (as Predefined Credential type) and OpenAI
  • Activate your workflow
  • Once active, go to the production URL and add what you'd like to build as the parameter "query"
  • Example: https://production_url.com?query=a%20signup%20form

Example of generated page

New to n8n?

Need help building new n8n workflows? Process automation for you or your company will save you time and money, and it's completely free!