# A webhook is called

> Starts when another system calls your webhook address, with the data it sends.

Source: https://docs.go-lumen.ai/es/reference/triggers/webhook-received

## De un vistazo

| Propiedad | Valor |
| --- | --- |
| **Trigger name** | `webhook-received` |
| **Resource** | ClusterTrigger (`lumen.ai/v1alpha1`) |
| **Source** | event |
| **Needs a connection** | yes, one that provides `http-inbound` |
| **Produces** | `text`, `fields` |
| **Emits** | item |
| **Installation must provide** | nothing |

A flow using this trigger names a Connector in `connectorRef`. Connection types that provide `http-inbound`: \[Incoming webhook\](/reference/connections/webhook).

The trigger goes under `spec.triggers` of a Flow. Its outputs are referenced as `<triggerId>.<field>`. A trigger can also carry a `when` condition ("Start only when") and `disabled: true`.

## Salidas

More outputs are declared in the setting `mapping`.

## Ajustes

Se definen bajo `config:` en el disparador del flujo.

| Ajuste | Tipo | Valor por defecto | Descripción |
| --- | --- | --- | --- |
| `mapping` | list of object |  | Mapping names values of a JSON body as fields, each found by a path ($.order.total) and typed (string, number, date, money, boolean). The body's top-level text, number and yes/no values are fields of their own name besides, untyped by the catalog; map what a later step reads. |
| `mapping[].name` (obligatorio) | string |  | Name is the field the value becomes, for the steps after this one. (maxLength 64; pattern \`^\[A-Za-z\]\[A-Za-z0-9\_\]\*$\`) |
| `mapping[].type` | string | `"string"` | Type is what the value is. It decides how later steps compare it. (one of string, number, date, money, boolean) |
| `mapping[].jsonPath` (obligatorio) | string |  | JSONPath finds the value in the answer: $.invoice.total, $.items\[0\].id. (minLength 1) |

El JSON Schema completo de estos ajustes: [webhook-received.schema.json](https://docs.go-lumen.ai/schemas/triggers/webhook-received.schema.json).

## Úsalo en un flujo

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
  name: my-webhook
  namespace: tenant-acme
spec:
  classRef: {name: webhook}
  config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: webhook-received-example
  namespace: tenant-acme
spec:
  displayName: "A webhook is called"
  triggers:
    - id: start
      ref: {name: webhook-received}
      connectorRef: {name: my-webhook}
      next: [notify-in-app]
  nodes:
    - id: notify-in-app
      stepRef: {name: notify-in-app}
      config:
        body: 'Total: {total}'
        title: New invoice from {supplier}
        to: admins
```
