Generate content from a URL
The goal is to transform the content of a URL into a concise summary and a representative image. The workflow uses AI to automatically generate both elements.
+2
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
Prompt-uq0mq[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt Propuesta de Imagen]
style Prompt-uq0mq stroke:#a170ff
Prompt-cf2w7[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt Resumen del artículo]
style Prompt-cf2w7 stroke:#a170ff
Prompt-8b4xy[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt Redactor de tweet]
style Prompt-8b4xy stroke:#a170ff
OpenAIModel-k3h4h[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-k3h4h stroke:#a170ff
URL-svy97[<div><img alt="logo" src="/_astro/layout-template.DBcxlmmt.svg" style="height: 20px !important;width: 20px !important"/></div>URL]
style URL-svy97 stroke:#a170ff
ChatOutput-5l8gy[<div><img alt="logo" src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-5l8gy stroke:#a170ff
DallEImageGenerator-jhlv0[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>DALL·E Image Generator]
style DallEImageGenerator-jhlv0 stroke:#a170ff
OpenAIModel-nx97c[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAIPropuesta de Imagen]
style OpenAIModel-nx97c stroke:#a170ff
Prompt-hse57[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt Generar Imagen]
style Prompt-hse57 stroke:#a170ff
JsCode-bst4b[JS Code]
style JsCode-bst4b stroke:#a170ff
CombineText-46th0[Combine Text]
style CombineText-46th0 stroke:#a170ff
ParseData-tpkkd[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data2]
style ParseData-tpkkd stroke:#a170ff
ParseData-4oihd[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data3]
style ParseData-4oihd stroke:#a170ff
OpenAIModel-52v7e[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAIPropuesta de Imagen]
style OpenAIModel-52v7e stroke:#a170ff
Prompt-8b4xy -.- OpenAIModel-k3h4h
linkStyle 0 stroke:#a170ff
Prompt-uq0mq -.- OpenAIModel-nx97c
linkStyle 1 stroke:#a170ff
OpenAIModel-nx97c -.- Prompt-hse57
linkStyle 2 stroke:#a170ff
Prompt-hse57 -.- DallEImageGenerator-jhlv0
linkStyle 3 stroke:#a170ff
DallEImageGenerator-jhlv0 -.- JsCode-bst4b
linkStyle 4 stroke:#a170ff
JsCode-bst4b -.- ParseData-tpkkd
linkStyle 5 stroke:#a170ff
ParseData-tpkkd -.- CombineText-46th0
linkStyle 6 stroke:#a170ff
CombineText-46th0 -.- ChatOutput-5l8gy
linkStyle 7 stroke:#a170ff
OpenAIModel-k3h4h -.- CombineText-46th0
linkStyle 8 stroke:#a170ff
URL-svy97 -.- ParseData-4oihd
linkStyle 9 stroke:#a170ff
ParseData-4oihd -.- Prompt-cf2w7
linkStyle 10 stroke:#a170ff
Prompt-cf2w7 -.- OpenAIModel-52v7e
linkStyle 11 stroke:#a170ff
OpenAIModel-52v7e -.- Prompt-8b4xy
linkStyle 12 stroke:#a170ff
OpenAIModel-52v7e -.- Prompt-uq0mq
linkStyle 13 stroke:#a170ff
Documentation – Generate content from a URL
🧩 Overview
The workflow automatically transforms the text of a web page into a concise article summary and a complementary image. It then produces a short, engaging tweet that incorporates the summary and the image, delivering both the textual content and the image in a single chat‑style output. This end‑to‑end pipeline saves time by replacing manual summarization, image creation, and tweet drafting with AI‑powered automation.
⚙️ Main Features
- Automatic web‑page extraction – fetches raw content from any supplied URL.
- Text parsing – converts the fetched data into clean, plain text.
- Dynamic summarization – generates a brief, key‑point summary of the article.
- Tweet composition – creates a concise, emoji‑rich tweet based on the summary.
- Image generation – produces a relevant illustration using a generative image model.
- Markdown conversion – turns the binary image into Markdown syntax for display.
- Content merging – concatenates the tweet and image description into a single message.
- Chat output – presents the final text and image in a chat‑friendly format.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| URL | Fetches web page content | URL (string) | Data (raw page content) |
| Parse Data | Extracts plain text from fetched data | Data (raw page content) | Text (article body) |
| Prompt (Resumen del artículo) | Builds a prompt to ask for a summary | Article text | Prompt message |
| OpenAI (Summarizer) | Generates a concise summary of the article | Prompt message | Text (article summary) |
| Prompt (Redactor de tweet) | Builds a tweet‑generation prompt using the summary | Article summary | Prompt message |
| OpenAI (Tweet) | Generates an engaging tweet with emojis | Prompt message | Text (tweet) |
| Prompt (Propuesta de Imagen) | Builds an image‑generation prompt using the summary | Article summary | Prompt message |
| DALL·E Image Generator | Creates an image that illustrates the article | Prompt message | Binary (image file) |
| JS Code | Converts the binary image into a Markdown‑formatted string | Binary image | Data (Markdown image link) |
| Parse Data | Extracts the Markdown string into plain text | Data (Markdown link) | Text (image description) |
| Combine Text | Concatenates the tweet and the image description | Tweet text, Image description | Text (combined message) |
| Chat Output | Displays the final combined message in a chat view | Combined text | Chat message (visible output) |
🧠 Notes
- Credential Management – The workflow relies on valid OpenAI and DALL·E API keys; these must be securely stored and referenced by the relevant model components.
- Prompt Length Constraints – Image‑generation prompts are limited to 4000 characters; ensure the summary stays within this limit.
- Rate‑Limiting – The image generator and text model each have request quotas; monitor usage to avoid exceeding limits.
- Data Privacy – The fetched page content is treated as transient data and is not stored beyond the scope of the workflow unless explicitly configured.
- Error Handling – If any component fails (e.g., network timeout, API error), the workflow will halt and report the failure; graceful degradation is not implemented by default.
- Output Formatting – The JS Code component assumes the image is returned as a base‑64 encoded binary; if the image format changes, the conversion logic may need adjustment.
- Scalability – While the current design processes a single URL at a time, the structure can be extended to batch URLs by adding a mapping mode to the Parse Data or Image Generator components.