PDF extraction
How to send Discord notifications for PDF processing
Use Discord webhooks, Zapier, Make, n8n, or a small adapter to post okraPDF ready and failed events into a channel.
Discord is useful for communities, creator operations, small teams, and internal alert channels. Use it for human notifications: a PDF is ready, a parse failed, a document needs review, or a workflow produced a downloadable result.
This is API-feasible today. Discord’s webhook documentation describes incoming webhooks for posting messages into channels. The key implementation detail is that Discord expects a Discord-shaped payload with fields such as content or embeds. A raw okraPDF event should be transformed before posting to Discord.
Choose the Discord path
| Path | Best for | Notes |
|---|---|---|
| Discord incoming webhook plus adapter | Direct engineering setup | Most control |
| Zapier | Fast no-code setup | Good for simple messages |
| Make | Branching and formatting | Good for multiple channels |
| n8n | Self-hosted workflows | Good for custom logic |
Do not use Discord for sensitive financial data unless your workspace policies allow it. Post links and summaries, not full extracted payloads.
Create the Discord webhook
In Discord:
- Open the server settings or channel integrations.
- Create a webhook for the target channel.
- Copy the webhook URL.
- Store it as a secret.
Anyone with the webhook URL can post into the channel, so treat it like an API key.
Build the message
For document.processed, send a compact notification:
{
"content": "PDF ready: invoice-1042.pdf\nOpen: https://..."
}
For richer messages, use embeds:
{
"embeds": [
{
"title": "PDF ready: invoice-1042.pdf",
"url": "https://...",
"fields": [
{ "name": "Document ID", "value": "doc_...", "inline": true },
{ "name": "Status", "value": "ready", "inline": true }
]
}
]
}
Keep messages concise. If a PDF generated 200 extracted rows, link to the data table instead of pasting the rows.
Adapter endpoint setup
For a direct API setup:
- okraPDF sends
document.processedanddocument.failedto your endpoint. - Your endpoint verifies
X-Okra-Signature. - Your endpoint checks idempotency by event ID.
- Your endpoint maps okraPDF fields into Discord
contentorembeds. - Your endpoint POSTs to the Discord webhook URL.
- Your endpoint returns 2xx after Discord accepts the message.
This is usually less than a page of code, but it is worth doing correctly. Signature verification prevents strangers from using your okraPDF endpoint as a Discord posting proxy.
Zapier setup
- Trigger: okraPDF PDF Ready or Webhooks by Zapier Catch Hook.
- Action: Discord Send Channel Message.
- Map filename, status, hosted URL, and key extracted fields.
- Add a second Zap for
document.failed.
Use Zapier when non-engineers need to own the workflow.
Make or n8n setup
Make:
- Custom webhook receives okraPDF.
- Router splits
document.processedanddocument.failed. - Discord module or HTTP module sends the message.
n8n:
- Webhook node receives okraPDF.
- IF node checks
body.type. - Set node creates a Discord payload.
- HTTP Request node POSTs to Discord.
Channel strategy
Use separate channels for different signal levels:
#pdf-readyfor low-volume ready alerts#pdf-failuresfor operational exceptions#customer-docsfor customer-facing document updates
Avoid high-volume per-page alerts. Discord notifications should help a person decide what to do next.