KEEP LEARNING
Build the bigger picture.
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
Tips > AI & LLM Integration
Never publish AI-generated content directly without a moderation step.
Never publish AI-generated content without a moderation step, because LLMs can hallucinate, produce inappropriate text, or violate brand guidelines. Run a cheap classification call such as gpt-4o-mini before publishing that returns approval, a list of issues, a confidence score, and an optional suggested edit, then route the result to auto-publish, human review, or rejection based on that verdict.
Never publish AI-generated content directly without a moderation step. LLMs can hallucinate, generate inappropriate content, or produce text that violates your brand guidelines. A classification call before publishing catches these issues before they reach your audience.
Real-world example: A workflow generates social media posts from blog articles. Before posting to LinkedIn, the content passes through a moderation check.
Workflow structure:
[Generate Post: GPT-4o] → [Moderate: gpt-4o-mini] → [IF: approved] →── yes ──→ [Post to LinkedIn]
└── no ──→ [Send to Human Review Queue]
Moderation prompt (gpt-4o-mini):
Review the following social media post for publication. Check for:
1. Factual claims that cannot be verified from the source material
2. Inappropriate language, tone, or controversial statements
3. Brand guideline violations (no competitor mentions, no political topics)
4. Grammar and spelling errors
5. Links or references that appear fabricated
Source article summary: {{ $json.article_summary }}
Generated post: {{ $json.generated_post }}
Return JSON:
{
"approved": true | false,
"issues": ["list of issues found, empty if approved"],
"confidence": 0.0 to 1.0,
"suggested_edit": "corrected version if issues are minor, null otherwise"
}
Downstream routing logic:
const moderation = JSON.parse($json.message.content);
if (moderation.approved && moderation.confidence > 0.85) {
// Auto-publish
return [{ json: { action: 'publish', post: $json.generated_post } }];
} else if (moderation.suggested_edit && moderation.confidence > 0.7) {
// Use the corrected version but still flag for review
return [{ json: { action: 'review', post: moderation.suggested_edit, issues: moderation.issues } }];
} else {
// Send to human review
return [{ json: { action: 'reject', post: $json.generated_post, issues: moderation.issues } }];
}
Automated moderation adds seconds to your workflow but prevents costly brand-damaging incidents.
Note: Defense in Depth
Combine LLM-based moderation with rule-based checks (regex for prohibited words, length validation, URL verification). No single layer catches everything.
Related: Use Manual Trigger During Development Instead of Webhook or Schedule · Flatten Deeply Nested API Responses
KEEP LEARNING
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
APPLY IT TO YOUR SYSTEM
Bring the process, the tools involved and an example of where the current workflow gets stuck.