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
Quickstart
Follow these steps to set up the Cradl AI node in n8n.Add the Cradl AI node to your workflow
Add a new node to your n8n workflow and search for “Cradl AI”.
Set up your credentials
Open the Cradl AI node in n8n and click Set up credential.
In your Cradl AI agent, add a new trigger and choose n8n. Copy the Client ID and Client Secret from the n8n trigger panel, then paste them into n8n.You can also add an n8n export to your Cradl AI agent at this stage. This is optional. If you skip it, the export is created automatically the first time you run the n8n workflow.
Configure the Cradl AI node
Once your credentials are set up, your Cradl AI agents should appear under Agent Name or ID. Select the agent you want to use.In the Document Binary Data field, specify the file you want Cradl AI to read. This is typically a binary PDF or image file. Enter the name of the binary variable in this field, as shown below:
Triggering n8n workflows from Cradl AI
Use the Cradl AI trigger to start an n8n workflow when results are available in Cradl AI. This is also useful for asynchronous workflows, so you do not need to wait for results in the middle of a workflow. Follow the same steps as in Quickstart to configure the trigger node.Response format
The n8n node returns extracted fields and context, such ascontext.documentId. See Webhook → Payload format for a full example.
Best practices
- Keep node names stable (e.g.,
Webhook,HTTP Request) if you use expressions that reference them - Return a fast 2xx response from the Webhook node; perform longer work asynchronously downstream
- Store secrets using n8n Credentials instead of hardcoding values
Troubleshooting
- No requests arriving in n8n: verify that the workflow is active and that the node is configured correctly
- 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