NappAI CMS Webhook
NappAI CMS Webhook is a start component: it starts the flow every time NappAI CMS notifies an event, for example that someone sent a form on the website, that a translation is ready or failed, or that the daily metrics summary has arrived. Each event is one run of the flow.
The CMS signs every notification with a secret. The component checks that signature, so the flow only starts with notifications that really come from your CMS.
It isn’t needed for the flows the CMS launches itself (a translation, the weekly report…): those start with a chat input that holds the runId. See NappAI CMS Run.
When to use it
- Send every contact that comes in through a website form to the CRM or to Slack.
- Post the daily metrics summary to a channel.
- Warn the team when a translation fails.
- Review the weekly proposed improvements or what the AIs say about the brand.
Configuration
The CMS is the one that calls the flow. For the component to check the signature of every notification, create a NappAI-CMS Webhook credential with the Signing secret you type in the CMS webhook’s signature. See Credentials.
| Field | What it does |
|---|---|
| Events | The CMS events that start the flow. The rest are ignored. Default: form.submitted. They must also be ticked in the CMS webhook. |
| Credential / Signing Secret | Optional, but recommended. The NappAI-CMS Webhook credential fills in Signing Secret with the secret set in Firma of the CMS webhook. With it, anything not signed by the CMS is refused. With no secret, nothing is checked. |
| Signature Header (advanced) | The header the CMS signs with (in the webhook, Firma › Cabecera). Default: X-Signature. Change it only if the webhook uses another one. |
| Max Age (s) (advanced) | Refuses events that happened more than this many seconds ago, so nobody can resend an old delivery. It is measured with the event’s own date, because the CMS signs no timestamp. Default: 0, not checked. At most 604800 (7 days). |
| Skip Repeated Deliveries (advanced) | On by default. The CMS retries a failed delivery and can repeat an event; this way each event starts the flow only once. |
| Run On Tests (advanced) | Off by default. The Enviar prueba button of the CMS webhook sends the test event: it is accepted, but doesn’t run the flow unless you turn this on. |
| Data | Used to test the component in the editor: paste a sample event here and run the flow. When the flow runs through its webhook, it is filled with what was received. Leave it empty. |
These are the events you can choose in Events:
| Event | When it arrives |
|---|---|
form.submitted | Someone sends a website form. |
metrics.daily | The daily metrics summary arrives. |
ai.budget | A notice about the CMS’s AI budget. |
translation.ready | A translation is ready. |
translation.published | A translation is published. |
translation.failed | A translation fails. |
agent.draft | The AI leaves changes as a draft. |
content.published | Content is published. |
glossary.proposed | Glossary terms are proposed. |
seo.findings | There are SEO findings. |
improvements.proposed | Improvements are proposed (for example, the weekly ones). |
improvements.measured | The results of some improvements are measured. |
aiwatch.weekly | The weekly AI watch summary arrives: what the AIs say about the brand. |
The weekly report (report.weekly) doesn’t reach webhooks: only the CMS’s email notices.
Set it up in the CMS
- Deploy a version of the flow: calls to the webhook run the deployed version. See Versions and publishing.
- Open the API Access window, go to the Webhook tab, choose the API Key and copy the address. It looks like this:
<NappAI API address>/api/v1/webhook/<flow id>?x-api-key=<API key>. The key goes inside the address because the CMS can’t add that header; you can also put it in the CMS webhook’s own Cabeceras asx-api-key. See API keys. - In the CMS, an administrator creates the webhook in Webhooks with that address and the same events as in Events.
- In Formato de los datos, choose Evento completo en JSON.
- In Opciones avanzadas › Firma, turn on Firmar los envíos with a secret. Create a NappAI-CMS Webhook credential, paste that secret into its Signing secret field and choose the credential in the component.
- Click Enviar prueba in the CMS to check that the notification arrives.
Output
The Data output delivers the event with this data:
event: the event, for exampleform.submitted.event_id,delivery_idandidempotency_key: the event’s id, this delivery’s id and the delivery key.occurred_at: when it happened.site_nameandsite_url: the website that notifies.format:event-jsonwith the Evento completo en JSON format, orflatwith the others.- Shortcuts that depend on the event:
title,message,url,score,form_slug,form_title,email,name,page_url,referrer,consent,utm,day,visitors,pageviews,conversions,locale,statusandlevel. fields: what the person typed in a form.- The full blocks the event carries:
form,context,metrics,notice,report,translation,agent,published,glossary,seo,aiwatchandimprovements. is_test: whether it is an assistant test.
If an event arrives that isn’t ticked in Events, a test notification or a repeated delivery, the flow stops at this component without an error. If the signature is missing, doesn’t match or the event is too old, the notification is rejected.
Example
A company wants every contact that comes in through its website form to reach the CRM.
- Add NappAI CMS Webhook, keep
form.submittedin Events and choose the NappAI-CMS Webhook credential with the CMS webhook’s secret. - Connect Data to your CRM component, with the contact’s
email,nameandfields, andutmto know which campaign it comes from. - If you only want the contacts who gave their consent, add a Data Conditional Router on the
consentdata first.
Good practices
- Always use a NappAI-CMS Webhook credential. Without it the signature isn’t checked and anyone who has the flow’s address can start it.
- Tick only the events you are going to use, and the same ones in the CMS and in Events.
- If you turn on Max Age (s) and retries matter to you, don’t set it below 21600: the CMS retries for about 5 hours and a retry carries the event’s original date.
- A flow can only have one webhook component.
Security and limitations
- The CMS retries failed notifications, so the same event can arrive more than once. Skip Repeated Deliveries prevents the flow from running twice.
- If you change the secret in the CMS, edit the NappAI-CMS Webhook credential and put the new one in Signing secret: with the old one, notifications are rejected.
- When testing by pasting an event in Data, the signature isn’t checked and repeats aren’t skipped: only on real calls.
Related components
- NappAI CMS Run: the flows the CMS launches itself.
- NappAI CMS Content: read the content the event is about.
- Webhook Input: the generic webhook, for any other application.