datamagik

n8n nodes for DataMagik Manufacturing & Document Automation API

Package Information

Downloads: 0 weekly / 17 monthly
Latest Version: 2.1.0
Author: David Chupp

Documentation

n8n-nodes-datamagik

n8n.io - Workflow Automation

This is an n8n community node for the DataMagik Manufacturing & Document Automation API. It provides complete integration for document generation, traceability, lookup tables, printing, and label design in your n8n workflows.

Features

Document Resource

  • List Templates: Get available document templates from your DataMagik account
  • Smart Document Generation: Create PDF or HTML documents with automatic completion waiting
  • Automatic Polling: Built-in intelligent polling (up to 2 minutes for completion)
  • Binary Downloads: Automatically downloads binary data when using binary return type

Traceability Resource

  • Serial Number Series: Create, manage, and configure serial number formats
  • Generate Serials: Generate single or batch serial numbers with context data
  • Search Records: Query traceability history across your organization

Lookup Table Resource

  • Key-Value Storage: Create and manage lookup tables for production data
  • Bulk Operations: Import multiple entries at once
  • Fast Lookups: Retrieve values by key for real-time workflows

Printer Resource

  • Printer Management: Register and configure industrial printers
  • Print Jobs: Send ZPL, PDF, or raw data to printers
  • URL Data Sources: Fetch print data from external URLs

Label Resource

  • ZPL Processing: Process ZPL templates with dynamic data
  • Preview Generation: Generate PNG previews of ZPL labels

Installation

Follow the installation guide in the n8n community nodes documentation.

Option 1: Install via n8n

  1. Go to Settings → Community Nodes
  2. Enter n8n-nodes-datamagik
  3. Click Install

Option 2: Manual Installation

npm install n8n-nodes-datamagik

Restart your n8n instance for the node to be recognized.

Configuration

Credentials

  1. Create a new credential of type "DataMagik API"
  2. Enter your API Token (JWT Bearer token)

Test Credentials

The node includes a built-in credential test that verifies your API token by calling the /api/health endpoint against the DataMagik API at https://data-magik.com.

Operations

Document Resource

List Templates

Retrieves all available document templates for your account.

Generate Document

Creates a document from a template using provided data. Automatically waits for completion (up to 2 minutes).

Required Parameters:

  • Template ID: The ID of the template to use
  • Format: Output format (PDF or HTML)
  • Return Type: How to return the document (URL or Binary)
  • Template Data: JSON object with data to populate the template

Traceability Resource

List Series

Get all serial number series configured for your account.

Generate Serial

Generate a single serial number from a series with optional context data.

Batch Generate Serials

Generate multiple serial numbers at once (up to configured batch limits).

Search Records

Search traceability history with flexible query parameters.

Lookup Table Resource

Lookup

Retrieve a value from a lookup table by key.

Bulk Create Data

Import multiple key-value pairs into a lookup table.

Printer Resource

List Printers

Get all registered printers for your account.

Send Print Job

Send data to a printer with format options (ZPL, PDF, raw).

Label Resource

Process Template

Process a ZPL template with dynamic data substitution.

Preview ZPL

Generate a PNG preview image of ZPL label code.

Automatic Behavior:

  • Queued/Processing: Automatically polls every 5 seconds until complete
  • URL Return Type: Returns the completed status object with download URL
  • Binary Return Type: Automatically downloads and returns binary data
  • Error Handling: Throws error if generation fails or times out (2 minutes)

Example Template Data:

{
	"customer_name": "John Doe",
	"invoice_number": "INV-001",
	"amount": 1000.0,
	"items": [{ "description": "Service A", "quantity": 1, "price": 1000.0 }]
}

Usage Examples

Basic Document Generation (Auto-Complete)

{
	"operation": "generate",
	"templateId": "1097823044285431810",
	"format": "pdf",
	"returnType": "url",
	"templateData": {
		"customer_name": "{{ $json.customer_name }}",
		"amount": "{{ $json.total_amount }}"
	}
}

Note: This will automatically wait up to 2 minutes for the document to be ready and return the complete status object.

Generate with Binary Download (Auto-Complete)

{
	"operation": "generate",
	"templateId": "1097823044285431810",
	"format": "pdf",
	"returnType": "binary",
	"templateData": {
		"customer_name": "John Doe"
	}
}

Note: This will automatically wait for completion and return the document as binary data.

Custom Document Settings

{
	"operation": "generate",
	"templateId": "1097823044285431810",
	"format": "pdf",
	"returnType": "url",
	"documentSettings": {
		"page_size": "Letter",
		"orientation": "landscape",
		"margin_top": 0.5,
		"margin_right": 0.5,
		"margin_bottom": 0.5,
		"margin_left": 0.5
	}
}

Important Notes

Template ID Precision

Always provide template IDs as strings to avoid JavaScript number precision issues:

Correct: "templateId": "1097823044285431810"
Incorrect: "templateId": 1097823044285431810

Queue vs Direct Generation

  • URL Return Type: Uses queue-based generation (recommended for production)
  • Binary Return Type: Direct generation (faster but limited to smaller documents)

Rate Limiting

The API implements rate limiting and quota management. Monitor the metadata section in responses for quota information.

Error Handling

The node includes comprehensive error handling for common scenarios:

  • Invalid authentication
  • Template not found
  • Quota exceeded
  • Template rendering errors
  • Network timeouts

Enable "Continue on Fail" in node settings to handle errors gracefully in workflows.

Support

  • Documentation: DataMagik API Documentation
  • Issues: Report issues on the GitHub repository
  • Community: Join the n8n community for support and discussions

License

MIT

Version History

1.0.0

  • Initial release
  • Support for all core DataMagik API operations
  • Queue-based document generation with polling
  • Comprehensive error handling
  • Binary data support for downloads

Discussion