Quick overview
This workflow accepts character details via webhook or manual trigger, uses OpenAI to generate psychology, backstory, and emotional arc drafts in parallel, then synthesizes them into a structured “Character Bible” JSON response and optionally appends a log row to Google Sheets.
How it works
- Receives a POST request on an n8n webhook (or runs manually) with character parameters like name, age, archetype, world setting, story role, traits, and constraints.
- Normalizes the incoming fields, validates the archetype, and derives genre tags from the world setting using Python logic.
- Sends the enriched character inputs to OpenAI three times in parallel to generate a psychology profile, a backstory, and an emotional arc document.
- Combines the three AI documents into a single context object and passes it to OpenAI again to synthesize a unified Character Bible with defined sections.
- Parses the Character Bible into structured JSON fields (identity snapshot, personality core, backstory highlights, emotional arc, voice, and story hooks) and adds metadata like request ID and timestamp.
- Returns the completed character profile as a JSON webhook response and optionally appends a summary row to a Google Sheets spreadsheet via the Google Sheets API.
Setup
- Add an OpenAI API credential and attach it to all OpenAI chat model connections used by the four AI generation steps.
- If you use the webhook trigger, copy the production webhook URL for the /character-development path and send a POST request with the expected fields in the request body.
- If you enable logging, create a Google Sheet with a “Characters” tab, replace YOUR_SHEET_ID in the Google Sheets request URL, and provide Google Sheets OAuth2 credentials (or an authorized Google API access method) for the Sheets API call.