
Instagram DM Generation Template
Description
Categories
🤖 AI & Machine Learning
Nodes Used
n8n-nodes-base.stickyNoten8n-nodes-base.httpRequestn8n-nodes-base.googleSheetsn8n-nodes-base.googleSheets@apify/n8n-nodes-apify.apify@apify/n8n-nodes-apify.apifyn8n-nodes-base.manualTriggern8n-nodes-base.splitInBatches@n8n/n8n-nodes-langchain.openAi@n8n/n8n-nodes-langchain.openAi
PriceKostenlos
Views0
Last Updated11/28/2025
workflow.json
{
"id": "3qMwe3NoMu4hbgS0",
"meta": {
"instanceId": "3d4f6f82ad714311bb383a0cddf651da8753530e5575f46d078b9a29d27557e0",
"templateCredsSetupCompleted": true
},
"name": "Instagram DM Generation Template",
"tags": [
{
"id": "8WkXubSlHCFtBXls",
"name": "template",
"createdAt": "2025-08-05T12:28:28.123Z",
"updatedAt": "2025-08-07T19:01:30.974Z"
}
],
"nodes": [
{
"id": "b88a86c0-c6e7-4404-9fb5-b02c864e4371",
"name": "When clicking ‘Execute workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "d65b05f5-7037-4933-8576-c0670c33712c",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
480,
0
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "9d7fd662-9b0b-4357-a3fe-fdd23d5b1780",
"name": "Analyze image",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1616,
0
],
"parameters": {
"text": "=Describe what is on the image in a short simple to understand paragraph. Also include text from the image in the description.",
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "GPT-4O"
},
"options": {},
"resource": "image",
"simplify": false,
"inputType": "base64",
"operation": "analyze"
},
"credentials": {
"openAiApi": {
"id": "j4314KXs7eD2lghV",
"name": "OpenAi account"
}
},
"typeVersion": 1.8
},
{
"id": "29be68c3-aaa5-4344-83ab-14a894ea5940",
"name": "Get Instagram accounts",
"type": "n8n-nodes-base.googleSheets",
"position": [
208,
0
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 842468139,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ATZijpA_kFQyO8afIA-EEx_dA6TSWlyvn8jzTp1eLqs/edit#gid=842468139",
"cachedResultName": "en_instagram"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1ATZijpA_kFQyO8afIA-EEx_dA6TSWlyvn8jzTp1eLqs",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ATZijpA_kFQyO8afIA-EEx_dA6TSWlyvn8jzTp1eLqs/edit?usp=drivesdk",
"cachedResultName": "Example Instagram Cold Call Batch Messaging"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "CEWCuoGMaP93jgCn",
"name": "GCP Service account"
}
},
"typeVersion": 4.6
},
{
"id": "7009a2f5-41ab-445a-87dc-972f56a8d9db",
"name": "Fetch Instagram Account Data",
"type": "@apify/n8n-nodes-apify.apify",
"position": [
816,
0
],
"parameters": {
"resource": "Actor tasks",
"operation": "Run task",
"customBody": "={\n \"resultsLimit\": 10,\n \"skipPinnedPosts\": false,\n \"username\": [\n \"{{ $json.Account }}\"\n ]\n}",
"actorTaskId": {
"__rl": true,
"mode": "list",
"value": "NjLsrdBc4eJThVCPd",
"cachedResultUrl": "https://console.apify.com/actors/tasks/NjLsrdBc4eJThVCPd/input",
"cachedResultName": "Instagram Post Scraper (Task)"
},
"useCustomBody": true,
"waitForFinish": 60
},
"credentials": {
"apifyApi": {
"id": "sn9TC2lAVwtoXYBj",
"name": "Apify Github Login"
}
},
"typeVersion": 1
},
{
"id": "97bb8f7e-d763-4072-94b7-8053887ce3f7",
"name": "Get Instagram Account Data",
"type": "@apify/n8n-nodes-apify.apify",
"position": [
1168,
0
],
"parameters": {
"offset": {},
"resource": "Datasets",
"datasetId": "={{ $json.defaultDatasetId }}",
"operation": "Get items"
},
"credentials": {
"apifyApi": {
"id": "sn9TC2lAVwtoXYBj",
"name": "Apify Github Login"
}
},
"typeVersion": 1
},
{
"id": "594d877e-92e1-4f97-95f7-8aa114d5bec2",
"name": "Fetch Image of latest post",
"type": "n8n-nodes-base.httpRequest",
"position": [
1392,
0
],
"parameters": {
"url": "={{ $json.displayUrl }}",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
},
{
"name": "Accept",
"value": "image/webp,image/apng,image/*,*/*;q=0.8"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "b1e24aad-8a19-4da4-842f-f1bbcaeed1be",
"name": "Generate Personalized DM",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1776,
0
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-5",
"cachedResultName": "GPT-5"
},
"options": {},
"messages": {
"values": [
{
"content": "=You need to conduct a 30-minute interview with a successful investors via Google Meet to understand their domain expertise and stock investment workflow. You gather insights to build products to make them even more successful.\n\nYour task: Write a Instagram DM to this person following this exact structure:\n- Message Structure (Single paragraph, 3 short sentences):\n-- Opening Connection (1 sentence): Reference something specific from their recent post that demonstrates you've researched them. Be genuine, not generic. Focus on the content, not the visual style of their post.\n-- Value Demonstration (1 sentence): Show domain expertise by sharing a short relevant insight from your stock investment expertise. Do not sound academic.\n-- Clear Ask (1 sentence): Request 30 minutes of their valuable time using this booking link.\n\nthe message should be a single \"message\" field in the returned json.\n\nRequired Elements:\n- Start the conversation with a greetling, like \"Hi\".\n- End the conversation with a goodbye and hope hearing back, your name is \"Herbert\"\n- Do not use \"-\" symbols in the text\n- Lead with their benefit, not your need\n- Include the exact booking link provided\n- Position as peer exchange, not favor request\n- Do not imply what problem they have, focus on understanding their desire to relentless research and drive for better stock market returns.\n- No apologies, hedging, or self-deprecating language\n- Do not imply that a product has already been built and will be shown or sold\n- Do not mention or advertise any KPIs to use in stock investing.\n\nContext for the person you write the message to:\n- Name: {{ $('Get Instagram accounts').item.json['Full Name'] }} (include name in the text, when it sounds like a person's name. Do not include when it sounds like something you would not also use in an e-mail)\n- Biography description:\n{{ $('Get Instagram accounts').item.json.Biography }}\n- Last post (maybe irrelevant, but could be used as a conversation starter):\n-- image content:\n{{ $json.choices[0].message.content }}\n-- caption:\n{{ $('Get Instagram Account Data').item.json.caption }}\n- comments:\n{{ $('Get Instagram Account Data').item.json.latestComments[0].text }}\n{{ $('Get Instagram Account Data').item.json.latestComments[1].text }}\n{{ $('Get Instagram Account Data').item.json.latestComments[2].text }}\n\nYou MUST choose ONE of these options based on what would most appeal to the specific investor:\n- Early access - First look at your product/service before launch. do not mention when this will happen\n- Small monetary incentive - $10 Amazon gift card\n\nDeliverable needed:\nInstagram DM optimized for maximum response rate while maintaining authenticity and respect for their time."
},
{
"role": "system",
"content": "You are a seasoned growth stock investor and business strategist with a track record of identifying high-potential opportunities before they become obvious to the market.\n\nYour communication style:\n- Value-first - you lead with what you can offer, not what you need\n- Human and authentic - you build genuine connections, not transactional relationships\n- Confident without arrogance - you know your worth but respect others' time\n- Results-focused - you think in terms of concrete outcomes and next steps\n\nYour methodology:\n- You make single, clear asks that remove cognitive load from others\n- You demonstrate domain expertise through precise observations\n- You position interactions as peer-to-peer value exchanges\n- You scale personal touch - mass personalization, not mass messaging\n- Every interaction should advance both parties' objectives\n- Preparation and research are non-negotiable investments\n- You never apologize for making contact when you've done the work to earn that contact.\n- You communicate like someone who belongs in the conversation."
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"id": "j4314KXs7eD2lghV",
"name": "OpenAi account"
}
},
"executeOnce": false,
"typeVersion": 1.8
},
{
"id": "4afd8206-d3b0-40aa-965c-3d7ca4d100a9",
"name": "Add message to Account",
"type": "n8n-nodes-base.googleSheets",
"position": [
2176,
0
],
"parameters": {
"columns": {
"value": {
"Account": "={{ $('Get Instagram accounts').item.json.Account }}",
"Message": "={{ $json.message.content.message }}"
},
"schema": [
{
"id": "Account",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Account",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Full Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Full Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Biography",
"type": "string",
"display": true,
"required": false,
"displayName": "Biography",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Message",
"type": "string",
"display": true,
"required": false,
"displayName": "Message",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Account"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 842468139,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dYpIHToOOsEAmgiXArqT3Qg24MKxbQKyG9Dg3IJJd70/edit#gid=842468139",
"cachedResultName": "en_instagram"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1ATZijpA_kFQyO8afIA-EEx_dA6TSWlyvn8jzTp1eLqs",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ATZijpA_kFQyO8afIA-EEx_dA6TSWlyvn8jzTp1eLqs/edit?usp=drivesdk",
"cachedResultName": "Example Instagram Cold Call Batch Messaging"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "CEWCuoGMaP93jgCn",
"name": "GCP Service account"
}
},
"typeVersion": 4.6
},
{
"id": "17c403c3-3726-4a18-9b1c-b7fe927fd2a5",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-624,
-256
],
"parameters": {
"width": 460,
"height": 816,
"content": "## Audience Problem Keyword Research Workflow\n### This n8n template fetches Instagram profile information with Apify and generates personalized DMs in Google Sheets. This is great for creator outreach, customer interviews, partnership prospecting, and streamlining your social Direct Messaging workflow. Saving hours per campaign or research study.\n\n### How it works\n* We read a list of Instagram accounts from a Google Sheet\n* We trigger the Apify Instagram Post Scraper task to fetch the latest post data per account\n* We pull the image URL of the newest post and analyze it with OpenAI Vision\n* We use the analysis plus account metadata to generate a personalized DM\n* We write the message back to the Google Sheet for easy sending and tracking\n### How to use\n* Make a copy of [this](https://docs.google.com/spreadsheets/d/1ATZijpA_kFQyO8afIA-EEx_dA6TSWlyvn8jzTp1eLqs/edit?gid=842468139#gid=842468139) Google Sheet and add it in all Google Sheet nodes\n* Make sure that n8n has read & write permissions for your Google sheet. For my self-hosted n8n instance I was using a [Google Service Account](https://docs.n8n.io/integrations/builtin/credentials/google/service-account/)\n* Add instagram account url's in the Google sheet\n* Add your OpenAI account ([API Key](https://docs.n8n.io/integrations/builtin/credentials/openai/#using-api-key)) in the LLM nodes\n* Add Apify credentials ([API Key](https://docs.apify.com/platform/integrations/n8n)) and link your [Instagram Post Scraper](https://apify.com/apify/instagram-post-scraper) task.\n* Execute workflow :)"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "7f0b2bb3-98c6-4d6c-b370-cd175f344942",
"connections": {
"Analyze image": {
"main": [
[
{
"node": "Generate Personalized DM",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Fetch Instagram Account Data",
"type": "main",
"index": 0
}
]
]
},
"Add message to Account": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Get Instagram accounts": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Generate Personalized DM": {
"main": [
[
{
"node": "Add message to Account",
"type": "main",
"index": 0
}
]
]
},
"Fetch Image of latest post": {
"main": [
[
{
"node": "Analyze image",
"type": "main",
"index": 0
}
]
]
},
"Get Instagram Account Data": {
"main": [
[
{
"node": "Fetch Image of latest post",
"type": "main",
"index": 0
}
]
]
},
"Fetch Instagram Account Data": {
"main": [
[
{
"node": "Get Instagram Account Data",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "Get Instagram accounts",
"type": "main",
"index": 0
}
]
]
}
}
}