AI ad copy variations for every product
Run once and get four Arabic and English ad variations for every product in your sheet, ready to test.
How it works
- Read your Products sheet (product, price, benefits).
- AI writes 4 ads per product from different angles, 2 Arabic and 2 English.
- Save each ad as a row in the Ad copy sheet.
Diagram
Code
JavaScript used in the Code step — already included in the template below.
// Reads the AI's JSON for each product and turns every ad variation into its own row.
const out = [];
for (const item of $input.all()) {
const raw = item.json.text || "";
const data = JSON.parse(raw.slice(raw.indexOf("{"), raw.lastIndexOf("}") + 1));
(data.ads || []).forEach((ad, i) => out.push({
json: {
product: data.product,
variation: i + 1,
angle: ad.angle,
language: ad.language,
headline: ad.headline,
primary_text: ad.text,
status: "draft",
},
}));
}
return out;Build it
Pick your tool — same automation, step by step.
Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder. AI steps use a Claude model node — swap it for OpenAI, Gemini or Ollama if you prefer.
Show code (193 lines)
{
"name": "AI ad copy variations for every product (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## AI ad copy variations for every product\nRun once and get four Arabic and English ad variations for every product in your sheet, ready to test.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
"height": 260,
"width": 340
},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "Run manually",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
0,
0
]
},
{
"parameters": {
"operation": "read",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Products",
"mode": "name"
},
"options": {}
},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "Read products",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
300,
0
]
},
{
"parameters": {
"promptType": "define",
"text": "=You write Facebook and Instagram ads for YOUR_BRAND. Audience: YOUR_AUDIENCE.\nProduct: {{ $json.product }}\nPrice: {{ $json.price }}\nKey benefits: {{ $json.benefits }}\n\nWrite 4 ad variations, each from a different angle (problem, benefit, social proof, offer). Two in Arabic, two in English. Headline under 40 characters, text under 125 characters. Never invent discounts, reviews or claims that aren't above.\nReply ONLY with JSON: {\"product\": \"{{ $json.product }}\", \"ads\": [{\"angle\": \"\", \"language\": \"ar|en\", \"headline\": \"\", \"text\": \"\"}]}"
},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "Write ad variations",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.5,
"position": [
600,
0
]
},
{
"parameters": {
"model": {
"__rl": true,
"value": "claude-sonnet-5",
"mode": "list"
},
"options": {}
},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "Claude model",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"typeVersion": 1.3,
"position": [
600,
220
]
},
{
"parameters": {
"jsCode": "// Reads the AI's JSON for each product and turns every ad variation into its own row.\nconst out = [];\nfor (const item of $input.all()) {\n const raw = item.json.text || \"\";\n const data = JSON.parse(raw.slice(raw.indexOf(\"{\"), raw.lastIndexOf(\"}\") + 1));\n (data.ads || []).forEach((ad, i) => out.push({\n json: {\n product: data.product,\n variation: i + 1,\n angle: ad.angle,\n language: ad.language,\n headline: ad.headline,\n primary_text: ad.text,\n status: \"draft\",\n },\n }));\n}\nreturn out;"
},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "One row per ad",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
0
]
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Ad copy",
"mode": "name"
},
"columns": {
"mappingMode": "autoMapInputData",
"value": {}
},
"options": {}
},
"id": "292cf932-28a7-4af9-a243-d7e34e3e3b58",
"name": "Save to Ad copy sheet",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
1200,
0
]
}
],
"connections": {
"Run manually": {
"main": [
[
{
"node": "Read products",
"type": "main",
"index": 0
}
]
]
},
"Read products": {
"main": [
[
{
"node": "Write ad variations",
"type": "main",
"index": 0
}
]
]
},
"Write ad variations": {
"main": [
[
{
"node": "One row per ad",
"type": "main",
"index": 0
}
]
]
},
"One row per ad": {
"main": [
[
{
"node": "Save to Ad copy sheet",
"type": "main",
"index": 0
}
]
]
},
"Claude model": {
"ai_languageModel": [
[
{
"node": "Write ad variations",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- Run the scenario manually (Run once)
- Google Sheets › Search Rows
- Anthropic Claude › Create a Prompt (or OpenAI › Create a Completion)
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Google Sheets › Add a Row
- Every module run uses Make operations — the free plan includes a monthly quota.
- Make's built-in functions (map, sum, formatDate…) can replace most Code steps; for complex logic use a code module.
- Module and step names can differ slightly as Make and Zapier update their apps.
In Zapier, create a new Zap and add these steps in order:
- Google Sheets — New or Updated Spreadsheet Row (Zapier has no manual trigger)
- Google Sheets — Lookup Spreadsheet Rows (or Code by Zapier)
- Anthropic (Claude) — Send Message (or ChatGPT — Conversation)
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Google Sheets — Create Spreadsheet Row
- Zaps with more than two steps need a paid Zapier plan.
- Webhooks, Filters/Paths and Code by Zapier are premium features on some Zapier plans.
- Code by Zapier runs JavaScript: reuse the code shown above, reading inputs from inputData instead of $json.
- Module and step names can differ slightly as Make and Zapier update their apps.
Tips
- Write real benefits in the sheet; the AI is told never to invent claims.
Related flows
Competitor price change monitor
Check public product pages daily and get notified when a price changes.
Event signup → automatic calendar invite
People who register for your webinar or event get a Google Calendar invite instantly.
Automatic birthday emails
Customers or team members get a warm birthday email on their day.