Overview
The node integrates with Docutray services to process documents, specifically supporting document conversion and identification operations. For the Document - Convert operation, it accepts an image or document input in various formats (binary data, Base64 string, or URL), sends it to the Docutray API to convert it into a specified document type format, and returns the processed document information.
This node is beneficial when automating workflows that require transforming images or scanned documents into structured document formats recognized by Docutray. For example, converting scanned invoices or receipts into standardized document types for further processing or storage.
Properties
| Name | Meaning |
|---|---|
| Input Method | Specifies how the input document/image is provided. Options: • Binary Data — Use binary data from a previous node. • Base64 — Provide Base64 encoded image data. • URL — Provide a URL pointing to the image. |
| Binary Property | (Shown if Input Method is Binary Data) The name of the binary property containing the image data in the input item. |
| Base64 Image | (Shown if Input Method is Base64) The Base64 encoded image data to be converted. |
| Image URL | (Shown if Input Method is URL) The URL of the image/document to process. |
| Document Type Code | The code specifying the expected output document format for conversion. This is required to tell the API what type of document to produce. |
| Image Content Type | (Shown if Input Method is Base64 or URL) The MIME content type of the input image/document. Options include BMP, GIF, JPEG, PDF, PNG, WebP. Defaults to JPEG. |
| Document Metadata | Additional metadata about the document in JSON format. This can include any extra information to accompany the document during conversion. Must be valid JSON. |
Output
- The node outputs a JSON object representing the response from the Docutray API after conversion.
- The exact structure depends on the API response but generally includes details about the converted document.
- If the input was binary data, the node uploads the file as multipart form data; otherwise, it sends JSON payloads.
- No direct binary output is produced by this node; the output is metadata and conversion results in JSON format.
Dependencies
- Requires an active connection to the Docutray API service.
- Needs an API authentication token configured in n8n credentials (referred generically as "an API key credential").
- Network access to
https://app.docutray.com/apiendpoints. - Proper configuration of the API credential in n8n to authorize requests.
Troubleshooting
- Invalid JSON in Document Metadata: If the
Document Metadatafield contains malformed JSON, the node will throw an error. Ensure the JSON is correctly formatted. - Missing or Incorrect Document Type Code: The
Document Type Codeis mandatory. Omitting it or providing an invalid code may cause API errors. - Binary Data Issues: When using binary input, ensure the binary property exists and contains valid base64-encoded data with correct MIME type.
- API Authentication Errors: If the API key credential is missing or invalid, requests will fail. Verify the credential setup.
- Network or API Endpoint Errors: Connectivity issues or changes in the Docutray API endpoint could cause failures. Check network access and API status.
Links and References
- Docutray API Documentation (for detailed API usage and document type codes)
- n8n Documentation on Working with Binary Data
- General info on Base64 Encoding