An official and verified n8n community node that integrates with DocuWriter.ai - the AI-powered platform for automated code documentation, testing, and optimization.
Full documentation here: n8n + DocuWriter.ai Generated using DocuWriter.ai - Full Tree generator
- Code Documentation Generation: Transform source code into comprehensive documentation
- Automated Test Creation: Generate test suites for your code
- UML Diagram Generation: Create visual representations of code architecture
- Code Optimization: Get AI-powered suggestions for improving code quality
- Generation Management: Access and retrieve previously generated content
- User Info: Check account status and credit balance
- Webhook Support: Real-time triggers when generations are created or updated
- CI/CD Integration: Automatically generate documentation on code commits
- Quality Assurance: Create test suites for new features
- Code Review Automation: Generate optimization suggestions and architectural diagrams
- Documentation Maintenance: Keep project documentation up-to-date automatically
- n8n version 0.198.0 or later (for official node support)
- DocuWriter.ai account and API token
DocuWriter.ai is now an official and verified n8n community node available directly in the n8n editor:
- In your n8n workflow editor, click Add first step or the + button
- In the search field, type "DocuWriter"
- Look for "DocuWriter.ai" under "More from the community"
- Click on the DocuWriter.ai node to add it to your workflow
Note: No prior NPM installation is required - the node is now available as an official community node directly in the n8n editor.
For older n8n instances or custom deployments:
# Install via npm (legacy method)
npm install n8n-nodes-docuwriter-ai
- Visit DocuWriter.ai
- Sign up or log in to your account
- Navigate to Settings > API Keys
- Generate a new API token
- Copy the token for use in n8n
- In n8n, go to Credentials
- Click Create New Credential
- Search for and select DocuWriter.ai API
- Fill in your credentials:
- API Token: Your DocuWriter.ai API token
- Base URL:
https://app.docuwriter.ai
(default)
- Click Save
The DocuWriter.ai n8n integration provides seamless automation for code documentation, testing, and optimization:
graph TB
subgraph "n8n Workflow"
TN[Trigger Nodes]
AN[Action Nodes]
ON[Other n8n Nodes]
end
subgraph "DocuWriter.ai Platform"
API[DocuWriter API]
AI[AI Processing Engine]
DB[(User Data & Generations)]
end
subgraph "External Systems"
GH[GitHub/GitLab]
GD[Google Drive]
SL[Slack/Discord]
EM[Email Services]
end
TN -->|Webhook Events| AN
AN -->|API Requests| API
API --> AI
AI --> DB
API -->|Generated Content| AN
AN --> ON
ON --> GH
ON --> GD
ON --> SL
ON --> EM
sequenceDiagram
participant W as n8n Workflow
participant DN as DocuWriter Node
participant API as DocuWriter API
participant AI as AI Engine
W->>DN: Source Code + Parameters
DN->>API: POST /n8n/code-documentation
Note over API: Authenticate with Bearer Token
API->>AI: Process Code
AI->>AI: Generate Documentation/Tests/UML
AI-->>API: Generated Content
API-->>DN: Response with Generated Data
DN-->>W: Formatted Output for Next Node
sequenceDiagram
participant DW as DocuWriter.ai
participant WH as Webhook System
participant TN as Trigger Node
participant W as n8n Workflow
Note over DW: User generates documentation
DW->>WH: generation.created event
WH->>TN: POST webhook with payload
TN->>TN: Filter by event type
TN->>TN: Process generation data
TN-->>W: Trigger workflow execution
W->>W: Process generation content
The DocuWriter.ai integration provides two main node types:
The DocuWriter.ai action node provides multiple resources and operations for generating content:
Generate comprehensive documentation from source code.
Parameters:
sourceCode
(required): The source code to analyzefilename
(required): Filename for context (Mode is always Accurate)outputLanguage
: Language for documentation (default: English)documentationType
: Type of documentation to generate
Generate automated test suites.
Parameters:
sourceCode
(required): The source code to testfilename
(required): Filename for contexttestFramework
: Testing framework to use (auto-detect available)testType
: Type of tests (unit tests, etc.)
Create visual diagrams from code structure.
Parameters:
sourceCode
(required): The source code to analyzefilename
(required): Filename for contextdiagramType
(required): Type of UML diagram (class, sequence, use_case, activity, component, state, object)
Get AI-powered code improvement suggestions.
Parameters:
sourceCode
(required): The source code to optimizefilename
(required): Filename for contextoptimizationFocus
: Focus area (all, performance, readability, maintainability, security)
Retrieve previously generated content.
Operations:
Get All
: List all generations with optional filtering by type and limitGet
: Retrieve a specific generation by ID
Get account information and remaining credits.
The DocuWriter.ai Trigger node allows you to create workflows that respond to events in DocuWriter.ai.
- Generation Created: Triggers when a new generation is created
- Generation Updated: Triggers when a generation is updated
- Filter by Generation Type: Optionally filter events by specific generation types
- Generation Types: Choose from available types including Documentation, Tests, Optimizer, Converter, Swagger API Docs, Comment, Diagrams, and Git-based generations
{
"event": "generation.created",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"filename": "example.js",
"generation_type": "[Basic] => Documentation",
"generated_by_user": "user@example.com",
"updated_at": "2024-01-15T10:30:00Z",
"tag": "project-alpha"
}
}
{
"resource": "codeDocumentation",
"operation": "generate",
"sourceCode": "function calculateTotal(items) {\n return items.reduce((sum, item) => sum + item.price, 0);\n}",
"filename": "calculator.js",
}
{
"resource": "codeTests",
"operation": "generate",
"sourceCode": "class User {\n constructor(name) {\n this.name = name;\n }\n}",
"filename": "User.js",
"testFramework": "auto-detect"
}
{
"resource": "umlDiagram",
"operation": "generate",
"sourceCode": "public class Vehicle {\n private String brand;\n public void start() {}\n}",
"filename": "Vehicle.java",
"diagramType": "class"
}
graph LR
FU[File Upload Trigger] --> RF[Read File]
RF --> DOC[Generate Documentation]
RF --> TEST[Generate Tests]
RF --> UML[Generate UML]
RF --> OPT[Optimize Code]
DOC --> REP[Create Quality Report]
TEST --> REP
UML --> REP
OPT --> REP
REP --> SAVE[Save Report]
REP --> CHECK{Quality Score > 70?}
CHECK -->|Yes| SLACK[✅ Success Notification]
CHECK -->|No| EMAIL[⚠️ Quality Alert]
SAVE --> GITHUB[Commit to Repository]
graph LR
DW[DocuWriter.ai] -->|generation.created| WH[Webhook Trigger]
WH --> FILTER{Filter Event Type}
FILTER -->|Documentation| DOCS[Fetch Generation]
FILTER -->|Tests| TESTS[Generate Additional Tests]
DOCS --> GD[Save to Google Drive]
TESTS --> GH[Commit to GitHub]
GD --> NOTIFY[Slack Notification]
GH --> NOTIFY
We provide complete example workflows in the /examples/workflows/
directory:
- Automated Testing Workflow: Generate tests, optimize code, and create UML diagrams
- Generation Created Webhook: Process new generations in real-time
All DocuWriter.ai API responses follow this format:
{
"success": true,
"data": {
// Generated content and metadata
}
}
When an error occurs, the response will include error information. The node supports n8n's built-in error handling and will return execution data even on failures when "Continue on Fail" is enabled.
Solution: Verify your API token in the credentials configuration and ensure it's valid.
Solution: Break down large files into smaller components or use the "Faster" mode.
Solution: Check your account status and upgrade your DocuWriter.ai subscription if needed.
Enable debug logging in n8n to troubleshoot issues:
- Check n8n execution logs for detailed error information
- Verify request/response data in the execution history
- Test credentials using the built-in test functionality
- Email: support@docuwriter.ai
- GitHub Issues: Report bugs
We welcome contributions! Please feel free to submit issues and pull requests.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- API Migration Complete: All endpoints now use the unified
- Added support for Swagger API generation
- Added support for Repository listing
- Enhanced error handling and validation
- Improved documentation and examples
- BREAKING CHANGE: Migrated to unified GenerationsController API endpoints
- Updated all endpoints to use the standardized
/api/generate-*
paths - Added support for code comments generation
- Updated UML diagram generation to use new API
- Updated generations listing and retrieval to use new API
- Updated user info endpoint to use new API
- Improved parameter handling and validation
- Better consistency with DocuWriter.ai platform API standards
- Fixed "Invalid URL" error by properly constructing full API URLs
- Improved error handling and URL validation
- Removed unnecessary requestDefaults configuration
- Fixed icons not displaying in n8n interface
- Updated build process to correctly copy SVG icon files to dist directory
- Added cross-platform copyfiles dependency for better build compatibility
- Updated documentation to reflect actual implemented features
- Removed unimplemented workflow examples
- Cleaned up README to accurately describe available functionality
- Fixed repository URL to point to correct GitHub organization
- Initial release
- Core documentation generation
- Test suite creation
- UML diagram generation
- Code optimization features
- Generation management
- User info retrieval
- Webhook trigger support
- Complete n8n integration
Built with ❤️ by the DocuWriter.ai team