Overview
The Mi2u PDF node is designed to validate invoice statuses and fetch corresponding PDF documents from an external invoice service via a webhook interface. It supports two modes:
Self Validate: The node directly queries the external MY108 API to check the status of an invoice by polling at configurable intervals until the invoice is validated, invalid, or maximum attempts are reached. Upon successful validation, it fetches the invoice PDF.
Wait for Validation: The node waits for an external system (e.g., another HTTP node) to provide validated invoice data via the webhook. If the invoice status indicates validation, it fetches the PDF; otherwise, it skips fetching.
This node is useful in workflows where automated invoice verification and retrieval of official PDF documents are required, such as accounting automation, invoice processing, or compliance checks.
Practical Examples
- Automatically verify if an invoice has been validated by the external system before proceeding with payment.
- Poll invoice status periodically after submission and retrieve the official PDF once validated.
- Integrate with external validation systems that notify this node when an invoice is validated, triggering PDF download.
Properties
| Name | Meaning |
|---|---|
| Mode | Choose validation mode: - Self Validate: Validate invoice status directly using MY108 interface. - Wait for Validation: Wait for external validation (HTTP node) to provide validated invoice data. |
| Polling Interval (Seconds) | Interval in seconds between status checks during self-validation mode. |
| Max Polling Attempts | Maximum number of polling attempts before giving up during self-validation mode. |
Output
The node outputs JSON data containing invoice validation status and PDF document information when available.
In Self Validate mode, the output includes:
invoiceUuid: Unique identifier of the invoice.invoiceStatus: Status code of the invoice (e.g., "101" for validated).validated: Boolean indicating if the invoice is validated.maxAttemptsReached(optional): Indicates if polling stopped due to reaching max attempts.- When validated, detailed PDF data including:
mimeType: Always"application/pdf".filename: Generated filename likeinvoice-{uuid}.pdf.fileId: Internal file identifier.fileSize: Size of the PDF in bytes.chatId: Optional chat identifier if provided.binaryPropertyName: Property name holding base64 PDF data.pdfData: Base64 encoded PDF content.document: Object with filename, mimeType, and base64 data.
- Binary output contains the actual PDF file data under the property
data.
In Wait for Validation mode, the output is similar but triggered only when external validation confirms status "101".
Dependencies
Requires access to the external invoice service API endpoints:
- Login endpoint to obtain authentication cookie.
- MY108 interface for invoice status checking.
- Document endpoint for fetching PDF files.
Requires either:
- An authentication cookie provided in the incoming webhook request, or
- Credentials configured in the node to perform login and obtain the cookie automatically.
Network connectivity to
https://ics-uat.myinvoice2u.comis necessary.No additional environment variables are explicitly required beyond credential configuration.
Troubleshooting
Common Issues
Missing Required Data: The node expects
supplierTinanddocumentNumberfields in the incoming request for self-validation mode. Missing these will cause a 400 error.Authentication Failures: If no authentication cookie is provided and credentials are missing or incorrect, login will fail, resulting in a 401 error.
Polling Timeout: If the invoice does not reach a final validated or invalid status within the maximum polling attempts, the node returns a message indicating max attempts reached.
Invalid PDF Response: If the fetched PDF data does not start with the expected PDF header, the node throws an error indicating invalid PDF received.
Error Messages and Resolutions
| Error Message | Cause | Resolution |
|---|---|---|
| "Missing required data for self validation. Expected: supplierTin and documentNumber" | Input data missing required fields | Ensure the webhook POST data includes supplierTin and documentNumber. |
| "Login failed - could not obtain authentication cookie." | Failed to authenticate with external API | Verify credentials are configured correctly or provide a valid authentication cookie. |
| "Authentication failed. Please provide cookie in POST data or configure credentials." | No cookie and no valid credentials | Provide either a valid cookie in the request or configure node credentials properly. |
| "Max polling attempts reached. Last status: ..." | Invoice did not reach final status within attempts | Increase polling attempts or check invoice status externally. |
| "Invalid PDF file received - does not start with PDF header" | Server response is not a valid PDF | Confirm the invoice UUID is correct and the server is returning valid PDF data. |
| "Error fetching PDF data: ..." | Network or server error during PDF fetch | Check network connectivity and server availability. |
Links and References
- MY108 API Documentation (example endpoint used)
- Invoice Validation Concepts
- n8n Webhook Node Documentation
If you need further details on specific parts of the node or usage examples, feel free to ask!