n8n
n8n has no DocSlice node, but its HTTP Request node can call the API in a few settings.
Convert a file
Add an HTTP Request node after the step that provides the file (an email attachment, a file read from disk, a download) and set:
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.docslice.app/v1/convert |
| Authentication | Generic Credential Type → Header Auth |
| Credential | Name: Authorization, Value: Bearer <your API key> |
| Send Body | on, content type Form-Data |
| Body field 1 | Type n8n Binary File, name file, input data field name: the binary property of the previous node (usually data) |
| Body field 2 | Type Form Data, name format, value json (or markdown, html) |
Create the credential once and reuse it, so the key is stored by n8n and never written into the workflow.
Use the answer
The node returns the JSON of the answer. Read the result in the next nodes with an expression, for example:
{{ $json.data }}
and the number of pages with {{ $json.document.pages }}. For an extraction with a schema, add a third body field named schema whose value is your JSON Schema as text (see Schema extraction), and set format to json; the fields come back under data.
Long documents: asynchronous mode with a webhook
- Add a Webhook node (method
POST) and copy its production URL. - In the HTTP Request node add the fields
mode=asyncandwebhook_url= that URL. - DocSlice answers
202at once; when the job ends it sends the result to the Webhook node as adocument.completedevent (see Webhooks). Continue the workflow from the Webhook node and answer it quickly.
The n8n instance must be reachable from the internet for DocSlice to deliver the webhook, and DocSlice makes one attempt only, so keep a fallback that reads GET /v1/jobs/{job_id}.