Introduction
Use Cradl AI’s Webhook export to send extracted data to an n8n workflow. You can also fetch and download the original file inside n8n.A native n8n integration is coming soon. Until then, connect via Webhook.
Before you begin
- An n8n instance (Cloud or self‑hosted) with permission to create workflows
- A Cradl AI agent with at least one test document
- API client credentials (
client_id,client_secret) from your workspace settings
Connect Cradl AI to n8n
Create an n8n Webhook and point your agent’s Webhook export to it.1
Add a Webhook node in n8n
In n8n, add a Webhook node and set HTTP Method to POST. Copy the Test URL (you’ll paste it into Cradl AI).

2
Add a Webhook export in Cradl AI
In your agent, add a new export and choose Webhook. Paste the n8n Test URL into URL and set HTTP Method to POST. Click Test webhook and verify that the n8n Webhook node receives a request (2xx).
When you go live, switch the n8n Webhook to use its Production URL and update the export URL in Cradl AI.
Payload format
The Webhook body includes extracted fields and context such ascontext.documentId. See the Webhook → Payload format for a full example.
Download the file in n8n (optional)
Webhook payloads don’t include the original file. The steps below show how to get an access token, fetch the document metadata to obtainfileUrl, and then download the file.
1
Get an access token
Add an HTTP Request node with Parameters and Body Parameters as shown below.
Save
Parameters
Parameters
| Parameter | Value |
|---|---|
| Method | POST |
| URL | https://auth.cradl.ai/oauth2/token |
| Send Body | ✅ (checked) |
| Body Content Type | Form Urlencoded |
| Body Parameters | See table below |
Body Parameters
Body Parameters
| Parameter | Value |
|---|---|
| client_id | your client id here |
| client_secret | your client secret here |
| grant_type | client_credentials |
| audience | https://api.cradl.ai/v1 |

access_token from the response.2
Fetch document metadata (get fileUrl)
Add another HTTP Request node with the parameters below. The response includes

fileUrl.Parameters
Parameters
| Parameter | Value |
|---|---|
| Method | GET |
| URL | https://api.lucidtech.ai/v1/documents/{{ $('Webhook').item.json.body.context.documentId }} |
| Send Headers | ✅ (checked) |
Header Parameters
Header Parameters
| Header | Value (Expression) |
|---|---|
| Authorization | Bearer {{ $('HTTP Request').item.json.access_token }} |

3
Download the file
Add a final HTTP Request node with the parameters below. Configure the node to return binary if you want to store or pass the file downstream.

Parameters
Parameters
| Parameter | Value |
|---|---|
| Method | GET |
| URL | {{ $json.fileUrl }} |
| Send Headers | ✅ (checked) |
Header Parameters
Header Parameters
| Header | Value (Expression) |
|---|---|
| Authorization | Bearer {{ $('HTTP Request').item.json.access_token }} |

Best practices
- Keep node names stable (e.g.,
Webhook,HTTP Request) if you use expressions that reference them - Return a fast 2xx from the Webhook node; perform longer work asynchronously downstream
- Store secrets using n8n Credentials instead of hardcoding values
- Use the Webhook’s Production URL for live traffic
Troubleshooting
- No requests arriving in n8n: verify the export URL and click Test webhook in Cradl AI; ensure the Webhook node is active
- 401 from token or API calls: check
client_id/client_secret,grant_type=client_credentials, andaudience=https://api.cradl.ai/v1 - Expression resolves to
undefined: confirm node names match your expressions and inspect the incoming JSON with the Expression Editor to validate the path (e.g.,body.context.documentId) - Cannot download file: include the
Authorization: Bearer <ACCESS_TOKEN>header when requestingfileUrl