# Send a file on WhatsApp

> Sends one of the run's files, such as a PDF, as a document in the chat. The file is uploaded to WhatsApp. Works within 24 hours of the person's last message; after that, send a template.

Source: https://docs.go-lumen.ai/es/reference/steps/whatsapp-send-document

## De un vistazo

| Propiedad | Valor |
| --- | --- |
| **Nombre del paso** | `whatsapp-send-document` |
| **Recurso** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Grupo de la paleta, categoría** | notify, messages |
| **Créditos** | **1** crédito cada vez que tiene éxito |
| **Efectos externos** | sí: Cambia algo fuera de Lumen, así que un reintento pregunta antes y una prueba muestra lo que haría en lugar de hacerlo. |
| **La instalación debe aportar** | nada |

## Entradas

| Propiedad | Valor |
| --- | --- |
| **Necesita** | `file` |
| **Produce** | `fields` |
| **Trabaja sobre** | item: un documento cada vez |

Necesita y Produce son tipos de datos (file, text, fields, email). El editor ofrece un paso solo donde lo que necesita ya está en el camino. Consulta [Documentos y datos](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#documents-and-data).

## Salidas

Un nodo posterior se refiere a una salida como `{nodeId.field}` en un texto, o `nodeId.field` en una condición.

| Salida | Tipo |
| --- | --- |
| `whatsappMessageId` | string |
| `whatsappStatus` | string |

## Ajustes

Se definen bajo `config:` en el nodo del flujo. Los ajustes de texto pueden contener marcadores de posición como `{nodeId.field}`.

| Ajuste | Tipo | Valor por defecto | Descripción |
| --- | --- | --- | --- |
| `connectorRef` | string |  | Send from (minLength 1) |
| `to` | string |  | To (maxLength 200) |
| `toMember` | string |  | Their email. They must have joined this number with their phone (Profile, WhatsApp). (maxLength 320) |
| `file` | string |  | File names the run's file to send; empty is its first PDF, or its first file. (maxLength 255) |
| `caption` | string |  | Caption is written under the document. (maxLength 1024) |

El JSON Schema completo de estos ajustes: [whatsapp-send-document.schema.json](https://docs.go-lumen.ai/schemas/steps/whatsapp-send-document.schema.json).

## Ejemplo

```yaml title="config"
caption: הקבלה שלך מוכנה
```

## Úsalo en un flujo

Un nodo que ejecuta `whatsapp-send-document` va bajo `spec.nodes` de un [Flow](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#the-flow-as-yaml). Dale cualquier id y enumera en next los ids de los nodos siguientes.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
  name: my-whatsapp-cloud
  namespace: tenant-acme
spec:
  classRef: {name: whatsapp-cloud}
  config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: whatsapp-send-document-example
  namespace: tenant-acme
spec:
  displayName: "Send a file on WhatsApp"
  triggers:
    - id: start
      ref: {name: whatsapp-message-received}
      connectorRef: {name: my-whatsapp-cloud}
      next: [whatsapp-send-document]
  nodes:
    - id: whatsapp-send-document
      stepRef: {name: whatsapp-send-document}
      config:
        caption: הקבלה שלך מוכנה
```
