NappAI CMS Media
NappAI CMS Media works with the NappAI CMS media library: it lists the images (also only the ones without alt text), uploads images, SVGs or videos, reads a CMS image so a vision model can describe it, and saves the alt text proposals in the CMS.
The flow only proposes alt texts: the CMS never replaces the one a person wrote.
When to use it
- In the flow the CMS launches to describe images, to read each image (
Read Image Bytes) and save the descriptions (Save Alt Text Proposals). - To find the images that have no alt text (
List Mediawith Only Without Alt Text). - To upload to the library an image generated or downloaded in the flow (
Upload Media (Draft)).
Configuration
You need a NappAI-CMS credential with the address of your NappAI CMS (for example https://web.your-company.com) and a key that starts with ncms_. See Credentials.
A CMS administrator creates the key in Ajustes › IA › Conexión con NappAI › Claves NappAI-CMS, and the CMS shows it only once. It is a service key: it reads, prepares drafts and saves results, but never publishes. The address must start with https://; http:// is only accepted with localhost, in development.
| Field | What it does |
|---|---|
| Credential (required) | The NappAI-CMS credential. It fills in CMS Address and NappAI-CMS Key for you. |
| Resource | What you work with: Media, Images or Alt Text Proposals. Default: Media. |
| Operation | What you do. The list changes with the chosen Resource. See Resources and operations. |
| Idempotency Key (advanced) | Optional, for Save Alt Text Proposals. With the same key, sending again does not save twice. Empty: runId:alt-suggestions is used, so a retry never saves twice. |
The CMS’s error messages come in Spanish and are shown as they arrive.
Resources and operations
Media
| Operation | What it does | Fields |
|---|---|---|
List Media | Lists the media library, optionally only the images without alt text. | Optional: Limit, Page, Sort, Filter (JSON), Only Without Alt Text and Depth. |
Upload Media (Draft) | Uploads an image, SVG or video from a public URL or base64. | Public URL or Base64 Content. Optional: File Name, File Type and Alt Text. |
- Limit is how many media items to bring, 1 to 100. Empty: 10. Page is the results page (1 by default).
- Sort is the field to sort by; with
-in front, highest first, for example-createdAt. - Filter (JSON) is a Payload filter, for example
{"mimeType": {"contains": "image"}}. - Only Without Alt Text brings only the media items with no alt text. It is combined with the filter if there is one.
- Depth is the level of related items to resolve, 0 to 10. Empty: 0.
- Public URL is the file’s public address and must start with
http://orhttps://. Base64 Content is the file in base64 (adata:prefix is accepted). Use one of the two. - File Name is its name in the library. File Type is the type, for example
image/png,image/jpeg,image/webporimage/svg+xml; worked out if missing. - Alt Text describes the image. Leave it empty only if it is decorative.
Images
| Operation | What it does | Fields |
|---|---|---|
Read Image Bytes | Reads a CMS image and returns it as base64 with its type. | Image URL |
Image URL is the media item’s url (for example /api/media/file/photo.png) or its full address on the same CMS. The read is public: the key is not sent. An address on another server is refused.
Alt Text Proposals
| Operation | What it does | Fields |
|---|---|---|
Save Alt Text Proposals | Saves the alt text proposals for images, after checking them against the CMS contract. | Run ID or Chat Input, Proposals (JSON). |
- Run ID is the
runIdthe CMS sends. Optional if you connect to Chat Input the flow’s input message, the JSON{"runId", "task", "contract"}the CMS sends. - Proposals (JSON) is the JSON
{"suggestions": [{"mediaId", "altSuggestion", "skipped"}]}or just the list.altSuggestionis 1 to 300 characters;skippedis the reason when an image is not described.
If the data breaks the contract, the component names the field that fails and sends nothing.
Output
The Data output returns:
- With
List Media: one item per media item (id,filename,url,alt,mimeType…). With no results,{items: [], count: 0}. - With
Upload Media (Draft):id,urlandreused(the CMS reuses a file with the same name and size). - With
Read Image Bytes:base64,mimeType,bytesandurl. - With
Save Alt Text Proposals:run,saved(what was saved) andduplicate(whether an earlier send with the same key had already saved it).
The component can be connected to an Agent as a tool. See Tools.
Example
The flow the CMS launches to describe the website’s images:
- The flow starts with Chat Input and NappAI CMS Run with
Get Run Input, which returns the images to describe. - Add NappAI CMS Media with
ImagesandRead Image Bytes, with the image’surlin Image URL. - Pass the image to a vision model and ask it for a short alt text.
- Save the descriptions with
Save Alt Text Proposalsand finish with NappAI CMS Run andSet Run Statusset todone.
Good practices
- Don’t try to overwrite alt texts: the flow only proposes and the CMS keeps what a person wrote.
- Give
Read Image Bytesthe media item’surlthe CMS returns, not addresses from other websites.
Security and limitations
- Uploaded files stay as drafts and the CMS key never publishes.
Read Image Bytesonly reads files of the credential’s CMS, doesn’t follow redirects and refuses files larger than 20 MB.
Related components
- NappAI CMS Run: read the run’s input and close it.
- NappAI CMS Content: read and prepare the website’s content.
- NappAI CMS Tools: all the CMS tools for an agent.