> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentova.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agentova Trigger

> Start a workflow the moment something happens in your workspace

## Choose the events

In **Events**, tick one or more: **Lead Created**, **Run Completed**, **Automation Status Changed**.

![The Agentova Trigger node in n8n, with the credential selected and the Events list open: Automation Status Changed, Lead Created and Run Completed](https://mintcdn.com/agentova-2c667f5d/Xl6jEAYNYyd4kO2m/images/n8n/trigger-events.jpg?fit=max\&auto=format\&n=Xl6jEAYNYyd4kO2m\&q=85\&s=a79220312f6245bf766e5b66df790596)

The three events offered by the trigger

| Event | Fires when | What you receive |
| - | - | - |
| **Lead created** (`lead.created`) | A new lead is captured in your workspace: your website chatbot's contact form, a Lead Ads form, your phone agent, a prospect who sent their contact details after commenting a post, or an incoming CRM contact. Only on creation: a lead that is updated later (for example a chat form submitted twice in the same conversation) doesn't fire again. | The lead: name, email, phone, source, agent, custom fields |
| **Run completed** (`run.completed`) | One of your automations has just done something: replied to a message, a comment or an email, handled a Lead Ads form, processed a CRM contact. | The run: which automation, what triggered it, each action with its result (`success` or `failed`), and the overall result of the run (`success`, `partial` or `failed`) |
| **Automation status changed** (`automation.status_changed`) | An automation's status really changes, whether the change comes from the Agentova app or from the API: it's paused or reactivated, a CRM source is activated, a failure puts it in `error`, or it comes back `active` once its account is reconnected. | The automation, with its new status |

When a failure takes an automation away — revoked access to the account, a mailbox that refuses the sign-in, a channel that can't be reconnected — the automation leaves the API and a last **Automation status changed** with the `error` status is sent: by the time it arrives, looking the automation up by its ID answers `automation_not_found`. Deleting an automation or turning it off in the Agentova app sends nothing.

The trigger fires for **the whole workspace**. To keep only some items (one source, one agent, only failures…), add an **If** or **Filter** node right after it — see [Example workflows](https://docs.agentova.ai/en/n8n/recipes.md).

## What each event contains

Every execution receives one item with the envelope of the event:

| Field | Content |
| - | - |
| `id` | The event's unique ID (`evt_…`) |
| `type` | `lead.created`, `run.completed` or `automation.status_changed` |
| `created_at` | When the event happened |
| `data` | The lead, the run or the automation |

### Lead created

A lead is created — and **Lead created** fires — from five places:

| Source | Where the lead comes from |
| - | - |
| `widget` | The contact form of your website chatbot, when a visitor fills it in. Leads created by hand in Agentova, where that option is available, also use `widget`. |
| `lead_ads` | A Facebook or Instagram Lead Ads form, handled by a Lead Ads automation — even while that automation is paused |
| `telephony` | A phone call qualified by your phone agent |
| `social` | A prospect who commented one of your Instagram or Facebook posts, then sent their contact details (email or phone) in a private message to your comment automation |
| `crm` | An incoming contact of a connected CRM (HubSpot, Monday, Customer.io…) for which one of your CRM automations ran |

A `social` or `crm` lead is created only when the prospect gave an email or a phone number, and only once per person and automation. Its `name` is what Agentova knows: the Instagram or Facebook username for `social`, the first and last name from the CRM for `crm`.

These **don't create leads**: the private messages and emails your agents reply to, and comments that don't lead to contact details. For CRM sources other than Customer.io, the partner service that relays their events doesn't yet tell Agentova which automation handled a contact: their leads are recorded only when the workspace has a single such CRM automation.

`phone` is the number as it was typed or captured — it isn't normalized. `custom_fields` holds the extra answers of the form; keys starting with `_` are internal to Agentova and are never exposed.

`data` contains: `id`, `source`, `agent_id`, `name`, `email`, `phone`, `custom_fields`, `created_at`.

### Run completed

| Automation | A run is recorded when… | Trigger (`trigger_type`) | Actions listed |
| - | - | - | - |
| Private messages (Facebook, Instagram, WhatsApp) | your agent actually sent a reply | `message` | the reply |
| Emails (Gmail, Outlook, IMAP) | an incoming email was handled | `email` | the reply sent, or the draft saved |
| Comments (Facebook, Instagram) | a comment was handled | `comment` | the public reply, the private message |
| Comments (Facebook, Instagram), after the prospect's reply | a prospect sent their contact details in a private message, and the automation's follow-up actions ran | `message` | add to CRM, message to the prospect |
| Stories (Instagram) | a story reply was handled | `story_reply` | the reply |
| Lead Ads | a form was received and the lead created | `lead_ads` | message to the prospect, add to CRM — the run also carries the lead's ID |
| CRM sources | an action ran for an incoming contact | `crm_event` | message (email, WhatsApp), add to CRM — the run also carries the lead's ID when a lead was created |

Good to know:

* **No run when nothing happened.** A message your agent finally didn't answer produces no run.
* **Several messages in a row, one run.** Messages that arrive together and are answered together make a single run.
* **A Lead Ads automation with no action configured** still records a run, with the `success` status and an empty list of actions. While it's paused, its leads are created but no action runs.
* **No runs for the website chatbot.**
* **CRM sources:** Customer.io records a run for each contact it acts on. The other CRM sources (HubSpot, Typeform, Close, Monday, ClickUp, Tally, Odoo…) are relayed by a partner service that doesn't yet tell Agentova which automation handled an event: their runs are recorded only when the workspace has a single such CRM automation. A CRM workflow records one run per action.
* On comments, an action you didn't configure can show as `success`. This is a known limitation.
* Runs are kept for **90 days**, then deleted.

`data` contains: `id`, `automation_id`, `status`, `trigger_type`, `occurred_at`, `actions` (each with its own `type`, and a `status` that is `success` or `failed` — only the run as a whole can be `partial`), `lead_id`.

### Automation status changed

`data` is the automation: `id`, `name`, `type`, `provider`, `agent_id`, `agent_name`, `status`, `updated_at`. Pausing an automation that's already paused changes nothing, so nothing fires; deleting an automation or turning it off in the Agentova app doesn't fire either.

## Activate the workflow

**Activating** the workflow registers the trigger with Agentova (a webhook subscription); **deactivating** it deletes that subscription. You never manage it by hand.

At each activation, the trigger also repairs its registration: if Agentova disabled the subscription after repeated failed deliveries, if n8n's webhook address changed, or if you changed the selected events, the old subscription is deleted and a new one is created. Leftovers of a failed activation are cleaned up the same way.

To try it before activating, click **Listen for test event** (or **Execute step**), then make the event happen in Agentova — for example pause and reactivate an automation.

![The Agentova Trigger node after a test event: the output shows the JSON envelope with id, type automation.status\_changed, created\_at and, in data, the automation now paused](https://mintcdn.com/agentova-2c667f5d/Xl6jEAYNYyd4kO2m/images/n8n/trigger-event-received.jpg?fit=max\&auto=format\&n=Xl6jEAYNYyd4kO2m\&q=85\&s=a3aff0c62600cfca11500fa4f0038995)

A real event received: an automation paused in the workspace

## Security, duplicates and order

* **Signature check.** Every notification from Agentova is signed. The trigger checks the signature and its age (5 minutes at most) before starting the workflow. Anything unsigned, forged or replayed is refused, never reaches your workflow, and n8n logs a warning with the reason — never the secret.
* **Duplicates.** After a network problem, Agentova can send the same event again. The trigger remembers the events it has already processed for 72 hours (up to 50,000 events) and starts the workflow only once per event — **within the same n8n process**: this memory is lost when n8n restarts, and isn't shared between instances in queue mode.
* **Order.** Events can arrive in any order. To know the latest status of an automation, compare `{{ $json.data.updated_at }}`, not the order of the executions.

> [!TIP]
>
> If an event must never be processed twice — a contact created in a CRM, a text message sent — add n8n's **Remove Duplicates** node right after the trigger, with the operation **Remove Items Processed in Previous Executions** and `{{ $json.id }}` as the value to dedupe on. Unlike the trigger's own memory, it survives restarts.

## After an outage

If your n8n was unreachable for a long time, Agentova makes up to 8 delivery attempts for each notification over about 27 and a half hours. Once three notifications in a row have been abandoned **and** deliveries have been failing for at least 72 hours, Agentova disables the subscription and notifies your workspace admins. **Deactivate, then activate the workflow**: the trigger deletes the disabled subscription and creates a new one. The same applies if the subscription was disabled at once because its URL no longer passes Agentova's address checks.

Agentova can also switch its API off for a while. The events that happen during such a break are never delivered: once the API answers again, catch up with the API's list endpoints (`GET /leads`, `GET /runs`, or **Agentova → List** for automations).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.