Documentation Processing Workflow with n8n
Overview
This n8n workflow automates the technical documentation review and approval process. It integrates with GitHub and OpenAI to automatically process documentation updates, perform technical reviews, and manage the approval workflow.
flowchart TD
subgraph Input
A[Source Code] --> B[Existing Docs]
C[User Feedback] --> B
end
subgraph LangChain Processing
D[Document Loader] --> E[Text Splitter]
E --> F[Vector Store]
F --> G[Content Generator]
end
subgraph n8n Workflow
H[Git Webhook] --> I[Quality Check]
I --> J[AI Review]
J --> K{Review Pass?}
K -->|Yes| L[Update Docs]
K -->|No| M[Return for Edits]
M --> I
end
subgraph Output
N[Published Docs]
O[Interactive Guides]
P[API Reference]
end
B --> D
G --> H
L --> N
L --> O
L --> P
style Input fill:#e1f5fe
style LangChain Processing fill:#fff3e0
style n8n Workflow fill:#f3e5f5
style Output fill:#e8f5e9
Features
Automated triggering on GitHub repository changes
AI-powered technical content review
Automated issue creation for approved changes
Documentation quality assurance workflow
GitHub integration for version control
Prerequisites
Before setting up this workflow, ensure you have:
n8n instance (version 1.0.0 or higher)
GitHub account with repository access
OpenAI API key
Repository with documentation in markdown format
Installation
Import the Workflow
Open your n8n instance
Go to Workflows → Import from File
Upload the provided workflow JSON file
Save the workflow
Configure Credentials
GitHub Configuration
Navigate to n8n Credentials
Add new GitHub API credentials
Configure:
Access Token
Repository permissions
OpenAI Configuration
Add OpenAI API credentials in n8n Globals
Set the variable name as OPENAI_API_KEY
Input your OpenAI API key
Configure Webhook
In your GitHub repository:
Go to Settings → Webhooks
Add new webhook
Set payload URL to your n8n webhook URL
Select 'push' events
Enable the webhook
Node Configuration
1. GitHub Trigger Node
Monitors repository for push events
Configuration:
{
"authentication" : "githubApi" ,
"events" : [ "push" ] ,
"owner" : "{{$node.Webhook.json.repository.owner.name}}" ,
"repository" : "{{$node.Webhook.json.repository.name}}"
}
2. OpenAI Review Node
Performs technical review of documentation changes
Configuration:
{
"method" : "POST" ,
"url" : "https://api.openai.com/v1/completions" ,
"authentication" : "headerAuth" ,
"bodyParameters" : {
"model" : "gpt-4" ,
"max_tokens" : 500
}
}
3. Review Decision Node
4. Create Issue Node
Creates GitHub issues for approved documentation
Configuration:
{
"authentication" : "githubApi" ,
"owner" : "={{$node.Github Trigger.json.repository.owner.name}}" ,
"repository" : "={{$node.Github Trigger.json.repository.name}}" ,
"labels" : [ "documentation" , "approved" ]
}
Usage
Activate the Workflow
Click 'Active' toggle in n8n workflow editor
Verify webhook status in GitHub
Testing the Workflow
Make a documentation change in your repository
Commit and push the changes
Monitor the workflow execution in n8n
Check GitHub issues for review results
Monitoring
View execution history in n8n
Check workflow logs for errors
Monitor GitHub issues for approval status
Customization
Adjusting Review Criteria
Modify the OpenAI prompt in the HTTP Request node:
{
"prompt" : "Review technical accuracy of:\n{{$node.Github Trigger.json.commits[0].message}}" ,
"temperature" : 0.7
}
Adding Custom Labels
Modify the Create Issue node labels array:
{
"labels" : [ "documentation" , "approved" , "your-custom-label" ]
}
Troubleshooting
Common Issues
Webhook Not Triggering
Verify webhook URL in GitHub
Check webhook logs in GitHub
Ensure n8n is accessible from GitHub
OpenAI Review Failing
Verify API key in globals
Check API rate limits
Verify prompt formatting
GitHub Issues Not Creating
Check GitHub API credentials
Verify repository permissions
Check issue creation permissions
Best Practices
Documentation Standards
Use consistent commit message format
Include relevant documentation context
Follow repository documentation guidelines
Workflow Management
Regularly monitor execution logs
Update API keys before expiration
Maintain webhook security
Version Control
Keep workflow JSON backup
Document workflow modifications
Track configuration changes
Support
For issues and support:
Check n8n documentation: https://docs.n8n.io/
Review GitHub API documentation: https://docs.github.com/en/rest
Consult OpenAI API documentation: https://platform.openai.com/docs/api-reference