n8n Integration
Connect Ocriva to n8n, the open-source workflow automation tool. When documents are processed, Ocriva sends an HTTP POST to your n8n Webhook node, triggering any downstream automation you build — from database inserts to API calls to Slack alerts. n8n can be self-hosted on your own infrastructure or run on n8n.cloud.
Prerequisites
- An n8n instance (self-hosted via Docker/npm, or n8n.cloud)
- An Ocriva organization with available webhook quota
How It Works
Ocriva uses standard HTTP webhooks. When an event fires (such as document.processed), Ocriva sends a JSON POST to the URL you configure. n8n's built-in Webhook node receives that request and makes the parsed JSON available to all downstream nodes in your workflow — no plugins or custom code required to receive the data.
Step 1: Create a Webhook Node in n8n
- Open your n8n instance and create a new workflow (or open an existing one)
- Click Add node and search for Webhook
- Add the Webhook node to the canvas
- In the node settings, set HTTP Method to
POST - Leave Path as the auto-generated value (or set a descriptive slug like
ocriva-events) - Note the two URLs shown at the bottom of the node panel:
- Test URL — active only while you are viewing the node in test mode
- Production URL — active only when the workflow is activated (toggled on)
- Copy the Production URL — it follows the pattern:
https://your-n8n-instance.com/webhook/your-pathNOTE
The Production URL is only reachable after you activate the workflow using the toggle in the top-right corner of the workflow editor. The Test URL is useful during development but stops accepting requests once you close the node panel.
Step 2: Configure in Ocriva
- In the Ocriva dashboard, navigate to Integrations in the left sidebar
- Find the n8n template card and click it
- Paste the Production URL from your n8n Webhook node into the URL field
- Under Events, select the events to deliver (default:
document.processed) - Leave the Payload field empty to receive the full raw JSON body — n8n parses it automatically
- Click Create Endpoint
The endpoint becomes active immediately. Ocriva will begin delivering events to your n8n workflow as soon as documents are processed.
Step 3: Build Your Workflow
With the Webhook node in place, add downstream nodes to act on the data:
- Click Execute workflow in n8n to put the Webhook node into listening mode (Test URL only)
- Use the Send Test Event button in Ocriva to fire a sample
document.processedpayload - n8n displays the received JSON in the node output panel — you can inspect every field
- Pin the test data so you can continue building the workflow without sending real events
- Add downstream nodes (database write, HTTP request, email, Slack, etc.) and wire them together
- When the workflow is ready, click Activate to enable the Production URL
Example Workflows
Extract & Store
Save AI-extracted data to a database after every document is processed.
Nodes: Webhook → Code → PostgreSQL (or MongoDB)
Use a Code node between the Webhook and database nodes to reshape the payload:
// Code node — runs in n8n's sandboxed JavaScript environment
const body = $input.first().json;
return [{
json: {
fileName: body.payload.fileName,
status: body.payload.status,
extractedData: body.payload.extractedData,
processedAt: body.timestamp,
}
}];Pass the output to a PostgreSQL node with an INSERT operation targeting your documents table.
Validate & Alert
Check the extraction confidence score and send a Slack alert if it falls below an acceptable threshold.
Nodes: Webhook → IF → Slack
Configure the IF node with the condition:
{{ $json.payload.confidence }} less than 0.8Wire the true branch to a Slack node that posts a message to your #ocriva-alerts channel. Wire the false branch to a No Operation node (or omit it entirely).
Transform & Forward
Reshape the extracted data and forward it to another internal API.
Nodes: Webhook → Code → HTTP Request
Use the Code node to map Ocriva's fields to the shape your API expects, then use an HTTP Request node with method POST and the target API URL to deliver the transformed payload.
Self-Hosted Considerations
If you run n8n on your own server, confirm the following before activating the workflow:
- HTTPS required — Ocriva only delivers webhooks to
https://URLs. Use a reverse proxy such as nginx or Caddy to terminate TLS in front of n8n - Public reachability — the n8n server must be accessible from the internet. Ocriva cannot deliver webhooks to
localhost,192.168.x.x, or other private network addresses - Firewall rules — allow inbound TCP connections on port 443 (HTTPS) from Ocriva's delivery servers
- DNS — point a domain or subdomain (e.g.,
n8n.example.com) to your server's public IP and include it in your TLS certificate
WARNING
If you self-host n8n, ensure your webhook URL is accessible from the internet. Ocriva cannot deliver webhooks to localhost or private network addresses.
Tips
- Error handling — add an Error Trigger node as a separate workflow to catch and log delivery failures; n8n's built-in error workflow feature lets you react to node failures automatically
- Pin test data — once you receive one real or test payload, pin the data in the Webhook node so you can iterate on downstream nodes without triggering new events from Ocriva
- Community edition — n8n's community (self-hosted) edition is free and has no node or workflow limits; the cloud edition offers managed hosting with a free tier
- Multiple events — create separate n8n workflows (each with its own Webhook node) for different event types if you want distinct processing logic per event
