Docs navigation(tap to expand)
Bots & chat experience
Chat page & web widget
Knowledge & data
Tools & integrations
Operations & monitoring
Security & compliance
Plans, billing & limits
Workflow triggers
Choose how runs begin: manual tests, scheduled cron jobs, secure webhooks, Jira issue events, ClickUp task events, inbound WhatsApp messages, or dedicated email addresses.
Add a Webhook trigger, save your workflow, and copy its Webhook URL. The URL includes a secret; give it only to the system sending your requests. Send a PDF as a multipart file field alongside ordinary fields such as the recipient phone number.
In the trigger's Request Schema, add to as a string so it appears in the @ picker for the recipient. The picker includes attachments[0].url and attachments[0].filename automatically for the first uploaded PDF. To reference a custom file field by name, describe that object and its fields in Request Schema.
This example uses curl.exe in PowerShell. Replace the URL with your workflow's copied URL and the phone number with your recipient's international number. Curl adds the multipart boundary automatically.
curl.exe --request POST "https://YOUR_RAIAN_HOST/api/workflows/WORKFLOW_ID/webhook?secret=WEBHOOK_SECRET" --form "to=96170123456" --form "file=@invoice.pdf;type=application/pdf"Raian stores the PDF and exposes it on the trigger output under the field name you sent. For a field named file, use file.url in the next action and file.name as the optional attachment filename. The file also includes its MIME type, size in bytes, and GCS path.
{
"to": "96170123456",
"file": {
"name": "invoice.pdf",
"type": "application/pdf",
"size": 12345,
"url": "https://storage.googleapis.com/...signed URL...",
"gcsPath": "..."
},
"attachments": [
{
"fieldName": "file",
"filename": "invoice.pdf",
"contentType": "application/pdf",
"size": 12345,
"url": "https://storage.googleapis.com/...signed URL...",
"gcsPath": "..."
}
]
}- The complete multipart request, including fields and encoding overhead, must fit within 4 MiB. Send at most five file parts.
- Uploaded PDFs must contain a PDF signature. Empty files or files without that signature are rejected. Other file types keep their name, type, and size metadata; their contents are not stored by this webhook.
- Signed file URLs expire after seven days. Complete downstream sends before expiry; replaying an old run does not renew its URL.
- All uploaded PDFs also appear in attachments. Repeated file field names become arrays. Do not send a text field named attachments with a PDF upload because that name is reserved for the PDF list.
A successful webhook response supplies an executionId. The run continues asynchronously; open its execution log to check the WhatsApp step's result.
If the sending system already hosts the PDF, send its direct download URL in JSON. This also avoids the webhook upload limit for larger documents. The URL must remain accessible to Meta without a login until the message has been sent. An unexpired signed URL works; a page that displays a PDF behind a login does not.
Add to, pdfUrl, and filename as string fields in the trigger's Request Schema so they appear in the @ picker for later steps.
Save this example as webhook.json:
{
"to": "96170123456",
"pdfUrl": "https://files.example.com/invoice.pdf",
"filename": "invoice.pdf"
}curl.exe --request POST "https://YOUR_RAIAN_HOST/api/workflows/WORKFLOW_ID/webhook?secret=WEBHOOK_SECRET" --header "Content-Type: application/json" --data-binary "@webhook.json"Use pdfUrl from the trigger as the WhatsApp Document header URL. JSON URLs pass through as supplied; Raian does not download them when receiving the webhook. Base64 JSON and a raw PDF request body do not create a stored PDF attachment. Use multipart or a direct URL for this workflow.
Connect the PDF to a WhatsApp templateEach trigger supplies the initial payload that downstream actions can reference. Validate inputs with inline schemas or replay run data for debugging.
Next up: actions & data handoff