NappAI CMS Run
NappAI CMS Run does the three steps every flow launched by NappAI CMS needs: read the task’s input (a translation, the AI watch, a report, improvements or the alt text of some images), save the result in the CMS and close the run with its status.
When the CMS launches a flow, it sends a JSON with the run’s id through the chat input: {"runId", "task", "contract"}. The component takes the runId from it, so connecting the chat input is enough.
When to use it
- At the start of any flow the CMS launches, to read what has to be done (
Get Run Input). - At the end, to save what the flow did (
Save Run Result) and mark the run as done (Set Run Statuswithdone). - In the error branch, to mark the run as failed with the reason (
Set Run Statuswithfailed).
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 | There is only one: Runs. |
| Operation | What you do. Default: Get Run Input. See Resources and operations. |
| Idempotency Key (advanced) | Optional. With the same key, sending again does not save twice. Empty: runId:result type is used, so a retry never saves twice. |
Every operation needs to know which run it is about. Fill in one of these two fields:
- Run ID: the
runIdthe CMS sends. Optional if you connect the chat input. - Chat Input: the flow’s input message, the JSON
{"runId", "task", "contract"}the CMS sends. TherunIdis taken from it (run_idor the bare id are accepted too).
Resources and operations
Runs
| Operation | What it does | Fields |
|---|---|---|
Get Run Input | Reads the run’s input: the task, its target and the task’s own input. | Run ID or Chat Input. |
Set Run Status | Changes the run’s status. | Run ID or Chat Input, Status. Optional: Message and Cost (USD). |
Save Run Result | Saves the task’s result in the CMS, after checking it against the CMS contract. | Run ID or Chat Input, Result Type, Result (JSON). |
- Status can be
running(when starting),done(when it went well) orfailed(when it failed). Withfailed, Message is required: the reason, in one sentence for people, up to 2000 characters. - Cost (USD) is what the run cost. It must be a number and can’t be negative.
- Result Type says what is saved and must match the run’s task:
translation,ai-watch-answers,ai-watch-questions,report,improvementoralt-suggestions. - Result (JSON) is a JSON object with the fields the CMS contract asks for that type:
| Result Type | Required fields | Optional fields |
|---|---|---|
translation | segments: a list of {"key", "text"}. | score (0 to 100), problems (a list of texts), backTranslation (a list of {"key", "text"}), proposedTerms (a list of {"source", "target", "note"}). |
ai-watch-answers | answers: a list of answers, each with questionId, provider (chatgpt, claude or gemini), answer and mentioned (true or false). | In each answer: position (from 1), sentiment (positivo, neutro or negativo), arguments, competitors (at most 12), citations (a list of {"url", "title", "domain", "own"}), searchQueries and model. |
ai-watch-questions | questions: a list of {"text", "reason"}, at most 30; each text 5 to 300 characters. | reason in each question. |
report | title, summary, body. | highlights (a list of texts), period ({"from", "to", "days"}). |
improvement | improvements: a list of at most 10, each with title and reason. | In each improvement: page, section, change, expectedImpact, metric and source (semanal or mcp). |
alt-suggestions | suggestions: a list of {"mediaId", "altSuggestion"}; altSuggestion 1 to 300 characters. | skipped in each proposal: the reason when the image is not described. |
Every type also accepts usage ({"inputTokens", "outputTokens"}).
If a field of the result is missing or wrong, the component names it and sends nothing. The CMS’s error messages come in Spanish and are shown as they arrive.
Output
The Data output returns:
- With
Get Run Input:runId,task,status,targetandinput(the task’s input). Each key ofinputis also repeated at the top level (for examplesegments,glossaryorquestions), so the next component can use it directly. - With
Save Run Result:run,saved(what was saved) andduplicate(whether an earlier send with the same key had already saved it). - With
Set Run Status: the CMS’s answer.
The component can be connected to an Agent as a tool. See Tools.
Example
A flow the CMS launches to write the website’s weekly report:
- The flow starts with Chat Input. Connect it to the Chat Input field of NappAI CMS Run with the
Get Run Inputoperation. - With what it returns, read the metrics with NappAI CMS Insights and ask a model or an agent to write the report.
- Add another NappAI CMS Run with
Save Run Result,reportin Result Type and the report in Result (JSON):{"title": "…", "summary": "…", "body": "…"}. - Finish with NappAI CMS Run and
Set Run Statusset todone. In the error branch,Set Run Statusset tofailedwith the reason in Message.
Good practices
- Always close the run: if it never gets
doneorfailed, it stays open in the CMS. - If the CMS rejects the result with a 4xx error, don’t just retry: fix the data (a 422 error says which field fails) and send it again.
- Today the CMS only keeps the message of
failed: the Message ofdonedoesn’t show in the CMS. - Through the API only the deployed version of the flow runs: deploy a new version after changing it. See Versions and publishing.
Security and limitations
- The CMS key never publishes: there is no publish operation.
- The CMS’s conversational assistant is the exception: the CMS calls it and waits for the answer, and the CMS itself closes its run.
Related components
- NappAI CMS Translations, NappAI CMS AI Watch, NappAI CMS Media and NappAI CMS Insights: save each type of result with their own fields.
- NappAI CMS Tools: all the CMS tools for an agent.
- NappAI CMS Webhook: starts the flow with what happens on the website.