CDOGS Document Generator — Custom n8n Node
The CDOGS Document Generator node interacts with the Common Document Generation Service (CDOGS) API to generate documents from templates. It supports uploading templates, managing cached templates, loading supported conversions from CDOGS, custom TeleJSON formatters, and rendering binary documents.
Overview
| Property | Value |
|---|---|
| Node name | cdogs |
| Display name | CDOGS |
| Style | Programmatic (execute() method) |
| Version | 1 |
| Credential | cdogsOAuth2Api (extends n8n OAuth2 API) |
| Category | Utility |
| AI-tool capable | Yes (usableAsTool: true) |
| Operations | 6 (see Node Operations) |
Documentation Index
| Document | Description |
|---|---|
| Node Operations | Detailed guide to every operation and its parameters |
| Credentials | How to configure the OAuth2 credential for CDOGS |
Source Files
community-nodes/
├── credentials/
│ └── CDOGSOAuth2Api.credentials.ts # Dedicated OAuth2 credential
└── nodes/
│ └── CDOGSDocumentGenerator/
│ ├── CDOGSDocumentGenerator.node.ts # Main node logic
│ ├── CDOGSDocumentGenerator.node.json # Codex metadata
│ └── shared/
│ └── GenericFunctions.ts # HTTP helper functions
Quick Start
- Configure a CDOGS OAuth2 API credential (see Credentials)
- Drag the "CDOGS" node into your workflow
- Set the Base URL (defaults to
https://cdogs-dev.api.gov.bc.ca/api/v2) - Choose an Operation (e.g., "Generate from Inline Template")
- Provide template data and options as required by the operation
The Convert To choices are loaded from the authenticated GET /fileTypes endpoint for the selected Base URL. Changing environments or the text template file type refreshes the available choices.
Common Workflow Patterns
Generate a PDF from an HTML template
- Use "Generate from Inline Template" operation
- Set Template Source to "Text Content"
- Paste your HTML template with
{{variable}}placeholders in Template Content - Provide the data JSON (e.g.,
{"name": "John", "date": "2024-01-01"}) - Set Convert To = "PDF"
Upload and reuse a DOCX template
- Use "Upload Template" to store a
.docxtemplate → receive a template hash - Use "Generate from Existing Template" with that hash to render documents repeatedly
- The template stays cached on CDOGS, avoiding repeated uploads
Check if a template is still cached
- Use "Check Template Exists" with the template hash
- If not found, re-upload before rendering
Further Reading
- CDOGS Service Documentation — Full documentation for the Common Document Generation Service, including API reference, template syntax, and supported formats
- Carbone.js Template Syntax — CDOGS uses Carbone for template rendering
- BC Gov CSS (Common Single Sign-On) — Where to provision service account credentials