Generate structured drama scripts from webhook requests using OpenAI and Google Sheets
Needs changesWhat this workflow does
This AI workflow has 17 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model. It also calls sheets.googleapis.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Set - Prepare Script Parameters (Edit Fields (Set)): sets 7 fields: topic, genre, numberOfActs…
- Wait: pauses before continuing
- Code: runs custom JavaScript code
- Filter: keeps only the items that match a condition
- AI - Generate Outline & Characters (AI Agent): runs an AI agent, with model: OpenAI Chat Model
- Code: runs custom JavaScript code
- AI - Generate Full Script (AI Agent): runs an AI agent, with model: OpenAI Chat Model
- Code: runs custom JavaScript code
- AI - Generate Production Notes (AI Agent): runs an AI agent, with model: OpenAI Chat Model
- Code: runs custom JavaScript code
…plus 3 more steps. See the full node list below.
Services it uses
HTTP calls to: sheets.googleapis.com
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI - Generate Outline & Characters (v1.6), AI - Generate Full Script (v1.6), AI - Generate Production Notes (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI - Generate Outline & Characters (v1.6), AI - Generate Full Script (v1.6), AI - Generate Production Notes (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Filter
n8n-nodes-base.filter - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Wait
n8n-nodes-base.wait - HTTP Request
n8n-nodes-base.httpRequest - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Quick overview This workflow accepts a webhook request with a drama topic, genre, tone, and size constraints, uses Python-based genre classification plus OpenAI GPT‑4.1 to generate a full script as structured JSON, then returns the script to the caller and…