Skip to content

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 Status with done).
  • In the error branch, to mark the run as failed with the reason (Set Run Status with failed).

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.

FieldWhat it does
Credential (required)The NappAI-CMS credential. It fills in CMS Address and NappAI-CMS Key for you.
ResourceThere is only one: Runs.
OperationWhat 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 runId the CMS sends. Optional if you connect the chat input.
  • Chat Input: the flow’s input message, the JSON {"runId", "task", "contract"} the CMS sends. The runId is taken from it (run_id or the bare id are accepted too).

Resources and operations

Runs

OperationWhat it doesFields
Get Run InputReads the run’s input: the task, its target and the task’s own input.Run ID or Chat Input.
Set Run StatusChanges the run’s status.Run ID or Chat Input, Status. Optional: Message and Cost (USD).
Save Run ResultSaves 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) or failed (when it failed). With failed, 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, improvement or alt-suggestions.
  • Result (JSON) is a JSON object with the fields the CMS contract asks for that type:
Result TypeRequired fieldsOptional fields
translationsegments: 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-answersanswers: 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-questionsquestions: a list of {"text", "reason"}, at most 30; each text 5 to 300 characters.reason in each question.
reporttitle, summary, body.highlights (a list of texts), period ({"from", "to", "days"}).
improvementimprovements: 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-suggestionssuggestions: 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, target and input (the task’s input). Each key of input is also repeated at the top level (for example segments, glossary or questions), so the next component can use it directly.
  • With Save Run Result: run, saved (what was saved) and duplicate (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:

  1. The flow starts with Chat Input. Connect it to the Chat Input field of NappAI CMS Run with the Get Run Input operation.
  2. With what it returns, read the metrics with NappAI CMS Insights and ask a model or an agent to write the report.
  3. Add another NappAI CMS Run with Save Run Result, report in Result Type and the report in Result (JSON): {"title": "…", "summary": "…", "body": "…"}.
  4. Finish with NappAI CMS Run and Set Run Status set to done. In the error branch, Set Run Status set to failed with the reason in Message.

Good practices

  • Always close the run: if it never gets done or failed, 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 of done doesn’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.