Generate and audit original revenge stories with OpenAI

Go to Workflow
0 views
Built by WORKFLOW EXPERT WORKFLOW EXPERT
Created on August 28, 2026

Description

Quick overview
This workflow uses OpenAI in n8n to turn a short inspiration text into an original first-person story, generating a new premise from abstract “story DNA” and enforcing originality, structural integrity, and quality through automated audits, rewrites, and limited retries.

How it works
Runs when you manually execute the workflow.
Sets story parameters (language, genre, style, target word count) and captures an inspiration text snippet.
Uses OpenAI to extract abstract “story DNA” (theme, conflict type, stakes, and elements to avoid) from the inspiration without reusing specific details.
Uses OpenAI to generate a fully new story premise as structured JSON, then normalizes the output into a consistent internal schema.
Audits the premise for required fields and forbidden similarity patterns, and if it fails, rebuilds the premise with OpenAI up to three times before marking it for manual review.
Uses OpenAI to write the full first-person narration from the approved premise, then audits the story for originality, source similarity risk, premise adherence, and overall quality.
If the story fails, it either rewrites the story (quality/adherence issues) or regenerates a new premise (similarity/originality issues) up to three attempts, and outputs an approved story package with the final text, premise, and audit results.

Setup
Add an OpenAI API credential (or an OpenAI-compatible provider) and select it in each OpenAI Chat Model node.
Update the “Story Config” values (language, genre, creative style, target word count, and thresholds) to match your desired output.
Replace the sample text in the inspiration input with your own short inspiration, avoiding copyrighted passages unless you have permission to use them.

Nodes Used (5)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured