Skip to main content

Send a file on WhatsApp

Stepwhatsapp-send-documentnotifyside effects

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.

At a glance​

PropertyValue
Step namewhatsapp-send-document
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categorynotify, messages
Credits1 credit each time it succeeds
Side effectsyes It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it.
Installation must providenothing

Inputs​

PropertyValue
Needsfile
Producesfields
Works onitem one document at a time

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See Documents and data.

Outputs​

A later node references an output as {nodeId.field} in text, or nodeId.field in a condition.

OutputType
whatsappMessageIdstring
whatsappStatusstring

Settings​

Set under config: on the flow node. Text settings may contain {nodeId.field} placeholders.

SettingTypeDefaultDescription
connectorRefstring-Send fromminLength 1
tostring-TomaxLength 200
toMemberstring-Their email. They must have joined this number with their phone (Profile, WhatsApp).maxLength 320
filestring-File names the run's file to send; empty is its first PDF, or its first file.maxLength 255
captionstring-Caption is written under the document.maxLength 1024

The full JSON Schema of these settings: whatsapp-send-document.schema.json.

Example​

Send the receipt as a PDF

config
caption: הקבלה שלך מוכנה

Use it in a flow​

A node that runs whatsapp-send-document goes under spec.nodes of a Flow. Give it any id, and list the next node ids in next.

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: הקבלה שלך מוכנה