{ "meta": { "templateCredsSetupCompleted": false }, "name": "LGM — AI auto-reply to inbound messages", "nodes": [ { "parameters": { "content": "## LGM — AI auto-reply to inbound messages\n\n### How it works\n\nThis workflow automatically replies to inbound laGrowthMachine messages with an AI-generated response. It listens for new LGM messages, keeps only received inbound messages, enriches them with campaign context, drafts a response using OpenAI, and sends the reply through LGM.\n\n### Setup steps\n\n- Configure laGrowthMachine trigger credentials and select the message event that should start the workflow.\n- Set the inbound filter condition so only received messages pass through.\n- Update the campaign context fields such as campaignObjective, product, and tone in the Set node.\n- Configure OpenAI credentials and the prompt/model settings used to draft replies.\n- Configure laGrowthMachine send credentials and verify the send node maps the AI draft to the outgoing reply body.\n\n### Customization\n\nAdjust the campaign objective, product details, tone, and OpenAI prompt to match different campaigns or response styles. Add review, approval, or safety filtering before the send step if replies should not be sent automatically.", "width": 480, "height": 784 }, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -608, 96 ], "id": "d53ae8d0-c1ef-46fb-a30a-78df179fcb42", "name": "Sticky Note" }, { "parameters": { "content": "## Receive inbound messages\n\nStarts when laGrowthMachine reports a new message and filters the stream so only received inbound messages continue.", "width": 432, "height": 320, "color": 7 }, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -48, 96 ], "id": "ebae2663-245f-4a97-af09-1f7dac385d5e", "name": "Sticky Note1" }, { "parameters": { "content": "## Prepare AI draft\n\nAdds the campaign objective, product, and tone context, then uses OpenAI to draft an appropriate reply for the inbound message.", "width": 432, "height": 320, "color": 7 }, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 432, 96 ], "id": "f283da6e-f412-44b4-a5f4-e6ab1ee7aea3", "name": "Sticky Note2" }, { "parameters": { "content": "## Send LGM reply\n\nSends the AI-generated reply back through laGrowthMachine.", "width": 240, "height": 320, "color": 7 }, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 912, 96 ], "id": "d263d484-58de-433e-adea-b0b3a40fc41a", "name": "Sticky Note3" }, { "id": "lgm-trigger", "name": "When Message Received", "type": "@lagrowthmachine/n8n-nodes-lagrowthmachine.laGrowthMachineTrigger", "position": [ 0, 260 ], "parameters": {}, "credentials": { "laGrowthMachineApi": { "id": "REPLACE_ME", "name": "La Growth Machine account" } }, "typeVersion": 1 }, { "id": "filter-received", "name": "Filter Inbound Messages", "type": "n8n-nodes-base.filter", "position": [ 240, 260 ], "parameters": { "conditions": { "options": { "version": 2, "caseSensitive": true, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "id": "c1", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.received }}", "rightValue": true } ] } }, "typeVersion": 2 }, { "id": "set-context", "name": "Set Campaign Details", "type": "n8n-nodes-base.set", "position": [ 480, 260 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "a1", "name": "campaignObjective", "type": "string", "value": "Book a 20-min demo call with qualified prospects." }, { "id": "a2", "name": "product", "type": "string", "value": "La Growth Machine — multichannel sales-engagement platform." }, { "id": "a3", "name": "tone", "type": "string", "value": "Friendly, concise, human. No corporate fluff. Max 5 sentences." } ] } }, "typeVersion": 3.4 }, { "id": "ai-draft", "name": "OpenAI Draft Reply", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 720, 260 ], "parameters": { "modelId": { "__rl": true, "mode": "list", "value": "gpt-4o" }, "options": {}, "messages": { "values": [ { "role": "system", "content": "=You are the SDR replying in an ongoing outreach conversation for {{ $json.product }}. Objective: {{ $json.campaignObjective }}. Tone: {{ $json.tone }}. Reply as the next message in the thread. Return ONLY the reply text." }, { "role": "user", "content": "=Lead: {{ JSON.stringify($('When Message Received').item.json.lead) }}\nLast messages (newest first): {{ JSON.stringify($('When Message Received').item.json.messages) }}\n\nWrite the best reply to move toward the objective." } ] } }, "credentials": { "openAiApi": { "id": "REPLACE_ME", "name": "OpenAI account" } }, "typeVersion": 1.8 }, { "id": "lgm-send", "name": "Send Reply with LGM", "type": "@lagrowthmachine/n8n-nodes-lagrowthmachine.laGrowthMachine", "position": [ 960, 260 ], "parameters": { "target": { "leadId": "={{ $('When Message Received').item.json.leadId }}" }, "message": "={{ $json.message.content }}", "memberId": "REPLACE_WITH_MEMBER_ID", "resource": "message", "operation": "sendLinkedIn", "identityId": "={{ $('When Message Received').item.json.identityId }}", "additionalFields": { "source": "n8n" } }, "credentials": { "laGrowthMachineApi": { "id": "REPLACE_ME", "name": "La Growth Machine account" } }, "typeVersion": 1 } ], "settings": { "executionOrder": "v1" }, "connections": { "OpenAI Draft Reply": { "main": [ [ { "node": "Send Reply with LGM", "type": "main", "index": 0 } ] ] }, "Filter Inbound Messages": { "main": [ [ { "node": "Set Campaign Details", "type": "main", "index": 0 } ] ] }, "When Message Received": { "main": [ [ { "node": "Filter Inbound Messages", "type": "main", "index": 0 } ] ] }, "Set Campaign Details": { "main": [ [ { "node": "OpenAI Draft Reply", "type": "main", "index": 0 } ] ] } } }