Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "nodes": [
- {
- "parameters": {
- "trigger": [
- "app_mention"
- ],
- "channelId": {
- "__rl": true,
- "value": "C08KJFF8D7W",
- "mode": "id"
- },
- "options": {}
- },
- "type": "n8n-nodes-base.slackTrigger",
- "typeVersion": 1,
- "position": [
- 780,
- 1060
- ],
- "id": "7384920f-37c4-4311-91bd-5d623fb457ce",
- "name": "Slack Trigger",
- "webhookId": "8889245d-5e39-4d1e-ae89-f52417e6199a",
- "credentials": {
- "slackApi": {
- "id": "EIQTI5m00hw2aRIJ",
- "name": "Slack account"
- }
- }
- },
- {
- "parameters": {
- "model": {
- "__rl": true,
- "mode": "list",
- "value": "gpt-4o-mini"
- },
- "options": {}
- },
- "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
- "typeVersion": 1.2,
- "position": [
- 1160,
- 1320
- ],
- "id": "2f2e0f9a-840c-4e68-aee2-7042df058f58",
- "name": "OpenAI Chat Model",
- "credentials": {
- "openAiApi": {
- "id": "IlK7ncOVZORhyWf5",
- "name": "OpenAi account"
- }
- }
- },
- {
- "parameters": {
- "promptType": "define",
- "text": "=This is the user message. They want to submit a new idea to our Notion database.\n\nHere's what they said:\n\"{{ $('Slack Trigger').item.json.blocks[0].elements[0].elements[1].text }}\"\n\nPlease acknowledge and ask the following three questions in one reply to gather more context about the idea.\n",
- "options": {
- "systemMessage": "=You are asking the user initial questions to help collect an idea for Notion. This is Step 1 of the workflow. \n\nYour goal is to ask three clear questions to gather insight into the idea. Keep the tone friendly, and ask all questions in a single message.\n\nAsk the following:\n\n1. What is your idea?\n2. How important do you think it is, on a scale of 1 to 10?\n3. What is the estimated return on investment (ROI) for this idea?\n\nWait for the user's response before continuing to the next step.\n"
- }
- },
- "type": "@n8n/n8n-nodes-langchain.agent",
- "typeVersion": 1.8,
- "position": [
- 1260,
- 1060
- ],
- "id": "526092c6-9612-4493-8b86-fcd7474f16d3",
- "name": "AI Agent3"
- },
- {
- "parameters": {
- "conditions": {
- "options": {
- "caseSensitive": true,
- "leftValue": "",
- "typeValidation": "strict",
- "version": 2
- },
- "conditions": [
- {
- "id": "0134a63c-3085-44e0-8033-12e8b41069f5",
- "leftValue": "={{ $json.data[0].reply_count }}",
- "rightValue": 0,
- "operator": {
- "type": "number",
- "operation": "gt"
- }
- },
- {
- "id": "e320395b-5a59-413d-9b9c-537dc2178271",
- "leftValue": "",
- "rightValue": "",
- "operator": {
- "type": "string",
- "operation": "equals",
- "name": "filter.operator.equals"
- }
- }
- ],
- "combinator": "and"
- },
- "options": {}
- },
- "type": "n8n-nodes-base.if",
- "typeVersion": 2.2,
- "position": [
- 2380,
- 1080
- ],
- "id": "8aacca57-2fb6-431a-8d48-d98d166e8168",
- "name": "If"
- },
- {
- "parameters": {
- "assignments": {
- "assignments": [
- {
- "id": "8c64255e-15cd-4433-a779-761bbb6cdc13",
- "name": "message ",
- "value": "={{ $json.blocks[0].elements[0].elements[1].text }}",
- "type": "string"
- },
- {
- "id": "b9adbcb9-b04c-4f55-a3e9-c12af90a0ead",
- "name": "firstemail",
- "value": true,
- "type": "boolean"
- },
- {
- "id": "0ecbc18f-2333-46fd-b4bd-8d307b81afe6",
- "name": "2nd mail",
- "value": false,
- "type": "boolean"
- }
- ]
- },
- "options": {}
- },
- "type": "n8n-nodes-base.set",
- "typeVersion": 3.4,
- "position": [
- 1060,
- 1060
- ],
- "id": "1644885f-00ae-4745-b2ef-74f2f25120cc",
- "name": "Edit Fields"
- },
- {
- "parameters": {
- "select": "channel",
- "channelId": {
- "__rl": true,
- "value": "C08KJFF8D7W",
- "mode": "id"
- },
- "text": "={{ $json.output }}",
- "otherOptions": {
- "includeLinkToWorkflow": false
- }
- },
- "type": "n8n-nodes-base.slack",
- "typeVersion": 2.3,
- "position": [
- 1620,
- 1060
- ],
- "id": "f3e00b96-1df8-48e1-87ab-0fee8a8c9103",
- "name": "Slack1",
- "webhookId": "da236d52-4e20-4205-9432-b9814689a7be",
- "credentials": {
- "slackApi": {
- "id": "EIQTI5m00hw2aRIJ",
- "name": "Slack account"
- }
- }
- },
- {
- "parameters": {
- "select": "channel",
- "channelId": {
- "__rl": true,
- "value": "C08KJFF8D7W",
- "mode": "id"
- },
- "text": "={{ $json.output }}",
- "otherOptions": {
- "includeLinkToWorkflow": false,
- "thread_ts": {
- "replyValues": {
- "thread_ts": "={{ $('Aggregate').item.json.data[1].ts }}",
- "reply_broadcast": true
- }
- }
- }
- },
- "type": "n8n-nodes-base.slack",
- "typeVersion": 2.3,
- "position": [
- 3360,
- 1060
- ],
- "id": "f15b9f36-2a74-4005-838f-266a1798762c",
- "name": "Slack2",
- "webhookId": "da236d52-4e20-4205-9432-b9814689a7be",
- "credentials": {
- "slackApi": {
- "id": "EIQTI5m00hw2aRIJ",
- "name": "Slack account"
- }
- }
- },
- {
- "parameters": {
- "resource": "channel",
- "operation": "replies",
- "channelId": {
- "__rl": true,
- "value": "C08KJFF8D7W",
- "mode": "id"
- },
- "ts": "={{ $('Slack1').item.json.message.ts }}",
- "returnAll": true,
- "filters": {}
- },
- "type": "n8n-nodes-base.slack",
- "typeVersion": 2.3,
- "position": [
- 1940,
- 1060
- ],
- "id": "3d50fa59-6dfe-4bc1-b202-5eaa3de97902",
- "name": "Slack",
- "webhookId": "f1f018c7-19fb-4da6-a57f-0b1d2380ab98",
- "executeOnce": false,
- "credentials": {
- "slackApi": {
- "id": "EIQTI5m00hw2aRIJ",
- "name": "Slack account"
- }
- }
- },
- {
- "parameters": {
- "amount": 1
- },
- "type": "n8n-nodes-base.wait",
- "typeVersion": 1.1,
- "position": [
- 2540,
- 1180
- ],
- "id": "cecf134d-f587-4734-b716-382a28e443db",
- "name": "Wait",
- "webhookId": "576e83b9-89b4-4739-8904-10a4830d47b2"
- },
- {
- "parameters": {
- "promptType": "define",
- "text": "=a users has replied to question 1, we need to ask another question now to gain further insight, help ask questions to expand the first agents questions \n\nhere is first message from user {{ $('Slack Trigger').item.json.blocks[0].elements[0].elements }}\n\nhere is what we sent {{ $('AI Agent3').item.json.output }}\n\nnow the user has replied, with answers from the first questions, we need to ask next questions. {{ JSON.stringify($json.data[1]) }}\n",
- "options": {
- "systemMessage": "You are a helpful assistant, this is question two based of question 1 inputs"
- }
- },
- "type": "@n8n/n8n-nodes-langchain.agent",
- "typeVersion": 1.9,
- "position": [
- 2960,
- 1060
- ],
- "id": "a13d0166-c3b7-4e13-b6a8-761499669f4f",
- "name": "AI Agent"
- },
- {
- "parameters": {
- "aggregate": "aggregateAllItemData",
- "options": {}
- },
- "type": "n8n-nodes-base.aggregate",
- "typeVersion": 1,
- "position": [
- 2160,
- 1060
- ],
- "id": "305ae426-e983-454c-985a-d2d6f76f6bf8",
- "name": "Aggregate"
- },
- {
- "parameters": {
- "model": {
- "__rl": true,
- "mode": "list",
- "value": "gpt-4o-mini"
- },
- "options": {}
- },
- "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
- "typeVersion": 1.2,
- "position": [
- 2900,
- 1260
- ],
- "id": "71835cad-b307-4e8e-b7ab-347deff8cb33",
- "name": "OpenAI Chat Model1",
- "credentials": {
- "openAiApi": {
- "id": "IlK7ncOVZORhyWf5",
- "name": "OpenAi account"
- }
- }
- },
- {
- "parameters": {
- "conditions": {
- "options": {
- "caseSensitive": true,
- "leftValue": "",
- "typeValidation": "strict",
- "version": 2
- },
- "conditions": [
- {
- "id": "0134a63c-3085-44e0-8033-12e8b41069f5",
- "leftValue": "={{ $json.data[0].reply_count }}",
- "rightValue": 2,
- "operator": {
- "type": "number",
- "operation": "gt"
- }
- },
- {
- "id": "e320395b-5a59-413d-9b9c-537dc2178271",
- "leftValue": "",
- "rightValue": "",
- "operator": {
- "type": "string",
- "operation": "equals",
- "name": "filter.operator.equals"
- }
- }
- ],
- "combinator": "and"
- },
- "options": {}
- },
- "type": "n8n-nodes-base.if",
- "typeVersion": 2.2,
- "position": [
- 4120,
- 1060
- ],
- "id": "39426d53-33b3-4c04-a050-eb10d1e555e7",
- "name": "If1"
- },
- {
- "parameters": {
- "resource": "channel",
- "operation": "replies",
- "channelId": {
- "__rl": true,
- "value": "C08KJFF8D7W",
- "mode": "id"
- },
- "ts": "={{ $('Slack1').item.json.message.ts }}",
- "returnAll": true,
- "filters": {}
- },
- "type": "n8n-nodes-base.slack",
- "typeVersion": 2.3,
- "position": [
- 3660,
- 1060
- ],
- "id": "9efe6bd3-c1f2-4ed9-9982-c95a91c74e23",
- "name": "Slack3",
- "webhookId": "f1f018c7-19fb-4da6-a57f-0b1d2380ab98",
- "executeOnce": false,
- "credentials": {
- "slackApi": {
- "id": "EIQTI5m00hw2aRIJ",
- "name": "Slack account"
- }
- }
- },
- {
- "parameters": {
- "amount": 1
- },
- "type": "n8n-nodes-base.wait",
- "typeVersion": 1.1,
- "position": [
- 4300,
- 1180
- ],
- "id": "a54e8791-c12f-4ee4-b10f-301ebe82e860",
- "name": "Wait1",
- "webhookId": "576e83b9-89b4-4739-8904-10a4830d47b2"
- },
- {
- "parameters": {
- "aggregate": "aggregateAllItemData",
- "options": {}
- },
- "type": "n8n-nodes-base.aggregate",
- "typeVersion": 1,
- "position": [
- 3920,
- 1060
- ],
- "id": "294ccbca-1f9b-423e-9418-b205d2bdf9eb",
- "name": "Aggregate1"
- },
- {
- "parameters": {
- "promptType": "define",
- "text": "={{ JSON.stringify($json.data) }} he are all the key details summerise this so we can store it into notion \n",
- "options": {}
- },
- "type": "@n8n/n8n-nodes-langchain.agent",
- "typeVersion": 1.9,
- "position": [
- 4580,
- 1080
- ],
- "id": "7ccd724d-1d55-4575-9f53-ea0adeb1ae05",
- "name": "summerise and format for storage"
- },
- {
- "parameters": {
- "model": {
- "__rl": true,
- "mode": "list",
- "value": "gpt-4o-mini"
- },
- "options": {}
- },
- "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
- "typeVersion": 1.2,
- "position": [
- 4660,
- 1300
- ],
- "id": "404ad8c5-b514-4add-9487-8db48ecb14c8",
- "name": "OpenAI Chat Model2",
- "credentials": {
- "openAiApi": {
- "id": "IlK7ncOVZORhyWf5",
- "name": "OpenAi account"
- }
- }
- },
- {
- "parameters": {},
- "type": "n8n-nodes-base.noOp",
- "typeVersion": 1,
- "position": [
- 5100,
- 1080
- ],
- "id": "87d70d18-c652-471d-be7f-2745d23f231b",
- "name": "No Operation, do nothing"
- },
- {
- "parameters": {
- "select": "channel",
- "channelId": {
- "__rl": true,
- "value": "C08KJFF8D7W",
- "mode": "id"
- },
- "text": "={{ $json.output }}",
- "otherOptions": {
- "includeLinkToWorkflow": false,
- "thread_ts": {
- "replyValues": {
- "thread_ts": "={{ $('Aggregate').item.json.data[1].ts }}",
- "reply_broadcast": true
- }
- }
- }
- },
- "type": "n8n-nodes-base.slack",
- "typeVersion": 2.3,
- "position": [
- 4920,
- 1080
- ],
- "id": "2cdeb62f-d4a8-4c21-a081-cd97f3936d95",
- "name": "Slack4",
- "webhookId": "da236d52-4e20-4205-9432-b9814689a7be",
- "credentials": {
- "slackApi": {
- "id": "EIQTI5m00hw2aRIJ",
- "name": "Slack account"
- }
- }
- }
- ],
- "connections": {
- "Slack Trigger": {
- "main": [
- [
- {
- "node": "Edit Fields",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OpenAI Chat Model": {
- "ai_languageModel": [
- [
- {
- "node": "AI Agent3",
- "type": "ai_languageModel",
- "index": 0
- }
- ]
- ]
- },
- "AI Agent3": {
- "main": [
- [
- {
- "node": "Slack1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "If": {
- "main": [
- [
- {
- "node": "AI Agent",
- "type": "main",
- "index": 0
- }
- ],
- [
- {
- "node": "Wait",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Edit Fields": {
- "main": [
- [
- {
- "node": "AI Agent3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Slack1": {
- "main": [
- [
- {
- "node": "Slack",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Slack2": {
- "main": [
- [
- {
- "node": "Slack3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Slack": {
- "main": [
- [
- {
- "node": "Aggregate",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Wait": {
- "main": [
- [
- {
- "node": "Slack",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "AI Agent": {
- "main": [
- [
- {
- "node": "Slack2",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Aggregate": {
- "main": [
- [
- {
- "node": "If",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OpenAI Chat Model1": {
- "ai_languageModel": [
- [
- {
- "node": "AI Agent",
- "type": "ai_languageModel",
- "index": 0
- }
- ]
- ]
- },
- "If1": {
- "main": [
- [
- {
- "node": "summerise and format for storage",
- "type": "main",
- "index": 0
- }
- ],
- [
- {
- "node": "Wait1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Slack3": {
- "main": [
- [
- {
- "node": "Aggregate1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Wait1": {
- "main": [
- [
- {
- "node": "Slack3",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Aggregate1": {
- "main": [
- [
- {
- "node": "If1",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "summerise and format for storage": {
- "main": [
- [
- {
- "node": "Slack4",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "OpenAI Chat Model2": {
- "ai_languageModel": [
- [
- {
- "node": "summerise and format for storage",
- "type": "ai_languageModel",
- "index": 0
- }
- ]
- ]
- },
- "Slack4": {
- "main": [
- [
- {
- "node": "No Operation, do nothing",
- "type": "main",
- "index": 0
- }
- ]
- ]
- }
- },
- "pinData": {
- "Slack Trigger": [
- {
- "user": "U036APJKAPL",
- "type": "app_mention",
- "ts": "1747619119.567769",
- "client_msg_id": "34ce7439-2607-4fc9-b23a-958990926b27",
- "text": "<@U08GMKHTXCG> hi",
- "team": "T03644LBLLW",
- "blocks": [
- {
- "type": "rich_text",
- "block_id": "n6SMo",
- "elements": [
- {
- "type": "rich_text_section",
- "elements": [
- {
- "type": "user",
- "user_id": "U08GMKHTXCG"
- },
- {
- "type": "text",
- "text": " hi"
- }
- ]
- }
- ]
- }
- ],
- "channel": "C08KJFF8D7W",
- "event_ts": "1747619119.567769"
- }
- ]
- },
- "meta": {
- "templateId": "2606",
- "templateCredsSetupCompleted": true,
- "instanceId": "b7c8e9091f3c04b2ab375bd3b3a3403634617af0af6a44559346a014a548084f"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement