Advertisement
Guest User

Untitled

a guest
May 18th, 2025
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.59 KB | None | 0 0
  1. {
  2. "nodes": [
  3. {
  4. "parameters": {
  5. "trigger": [
  6. "app_mention"
  7. ],
  8. "channelId": {
  9. "__rl": true,
  10. "value": "C08KJFF8D7W",
  11. "mode": "id"
  12. },
  13. "options": {}
  14. },
  15. "type": "n8n-nodes-base.slackTrigger",
  16. "typeVersion": 1,
  17. "position": [
  18. 780,
  19. 1060
  20. ],
  21. "id": "7384920f-37c4-4311-91bd-5d623fb457ce",
  22. "name": "Slack Trigger",
  23. "webhookId": "8889245d-5e39-4d1e-ae89-f52417e6199a",
  24. "credentials": {
  25. "slackApi": {
  26. "id": "EIQTI5m00hw2aRIJ",
  27. "name": "Slack account"
  28. }
  29. }
  30. },
  31. {
  32. "parameters": {
  33. "model": {
  34. "__rl": true,
  35. "mode": "list",
  36. "value": "gpt-4o-mini"
  37. },
  38. "options": {}
  39. },
  40. "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
  41. "typeVersion": 1.2,
  42. "position": [
  43. 1160,
  44. 1320
  45. ],
  46. "id": "2f2e0f9a-840c-4e68-aee2-7042df058f58",
  47. "name": "OpenAI Chat Model",
  48. "credentials": {
  49. "openAiApi": {
  50. "id": "IlK7ncOVZORhyWf5",
  51. "name": "OpenAi account"
  52. }
  53. }
  54. },
  55. {
  56. "parameters": {
  57. "promptType": "define",
  58. "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",
  59. "options": {
  60. "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"
  61. }
  62. },
  63. "type": "@n8n/n8n-nodes-langchain.agent",
  64. "typeVersion": 1.8,
  65. "position": [
  66. 1260,
  67. 1060
  68. ],
  69. "id": "526092c6-9612-4493-8b86-fcd7474f16d3",
  70. "name": "AI Agent3"
  71. },
  72. {
  73. "parameters": {
  74. "conditions": {
  75. "options": {
  76. "caseSensitive": true,
  77. "leftValue": "",
  78. "typeValidation": "strict",
  79. "version": 2
  80. },
  81. "conditions": [
  82. {
  83. "id": "0134a63c-3085-44e0-8033-12e8b41069f5",
  84. "leftValue": "={{ $json.data[0].reply_count }}",
  85. "rightValue": 0,
  86. "operator": {
  87. "type": "number",
  88. "operation": "gt"
  89. }
  90. },
  91. {
  92. "id": "e320395b-5a59-413d-9b9c-537dc2178271",
  93. "leftValue": "",
  94. "rightValue": "",
  95. "operator": {
  96. "type": "string",
  97. "operation": "equals",
  98. "name": "filter.operator.equals"
  99. }
  100. }
  101. ],
  102. "combinator": "and"
  103. },
  104. "options": {}
  105. },
  106. "type": "n8n-nodes-base.if",
  107. "typeVersion": 2.2,
  108. "position": [
  109. 2380,
  110. 1080
  111. ],
  112. "id": "8aacca57-2fb6-431a-8d48-d98d166e8168",
  113. "name": "If"
  114. },
  115. {
  116. "parameters": {
  117. "assignments": {
  118. "assignments": [
  119. {
  120. "id": "8c64255e-15cd-4433-a779-761bbb6cdc13",
  121. "name": "message ",
  122. "value": "={{ $json.blocks[0].elements[0].elements[1].text }}",
  123. "type": "string"
  124. },
  125. {
  126. "id": "b9adbcb9-b04c-4f55-a3e9-c12af90a0ead",
  127. "name": "firstemail",
  128. "value": true,
  129. "type": "boolean"
  130. },
  131. {
  132. "id": "0ecbc18f-2333-46fd-b4bd-8d307b81afe6",
  133. "name": "2nd mail",
  134. "value": false,
  135. "type": "boolean"
  136. }
  137. ]
  138. },
  139. "options": {}
  140. },
  141. "type": "n8n-nodes-base.set",
  142. "typeVersion": 3.4,
  143. "position": [
  144. 1060,
  145. 1060
  146. ],
  147. "id": "1644885f-00ae-4745-b2ef-74f2f25120cc",
  148. "name": "Edit Fields"
  149. },
  150. {
  151. "parameters": {
  152. "select": "channel",
  153. "channelId": {
  154. "__rl": true,
  155. "value": "C08KJFF8D7W",
  156. "mode": "id"
  157. },
  158. "text": "={{ $json.output }}",
  159. "otherOptions": {
  160. "includeLinkToWorkflow": false
  161. }
  162. },
  163. "type": "n8n-nodes-base.slack",
  164. "typeVersion": 2.3,
  165. "position": [
  166. 1620,
  167. 1060
  168. ],
  169. "id": "f3e00b96-1df8-48e1-87ab-0fee8a8c9103",
  170. "name": "Slack1",
  171. "webhookId": "da236d52-4e20-4205-9432-b9814689a7be",
  172. "credentials": {
  173. "slackApi": {
  174. "id": "EIQTI5m00hw2aRIJ",
  175. "name": "Slack account"
  176. }
  177. }
  178. },
  179. {
  180. "parameters": {
  181. "select": "channel",
  182. "channelId": {
  183. "__rl": true,
  184. "value": "C08KJFF8D7W",
  185. "mode": "id"
  186. },
  187. "text": "={{ $json.output }}",
  188. "otherOptions": {
  189. "includeLinkToWorkflow": false,
  190. "thread_ts": {
  191. "replyValues": {
  192. "thread_ts": "={{ $('Aggregate').item.json.data[1].ts }}",
  193. "reply_broadcast": true
  194. }
  195. }
  196. }
  197. },
  198. "type": "n8n-nodes-base.slack",
  199. "typeVersion": 2.3,
  200. "position": [
  201. 3360,
  202. 1060
  203. ],
  204. "id": "f15b9f36-2a74-4005-838f-266a1798762c",
  205. "name": "Slack2",
  206. "webhookId": "da236d52-4e20-4205-9432-b9814689a7be",
  207. "credentials": {
  208. "slackApi": {
  209. "id": "EIQTI5m00hw2aRIJ",
  210. "name": "Slack account"
  211. }
  212. }
  213. },
  214. {
  215. "parameters": {
  216. "resource": "channel",
  217. "operation": "replies",
  218. "channelId": {
  219. "__rl": true,
  220. "value": "C08KJFF8D7W",
  221. "mode": "id"
  222. },
  223. "ts": "={{ $('Slack1').item.json.message.ts }}",
  224. "returnAll": true,
  225. "filters": {}
  226. },
  227. "type": "n8n-nodes-base.slack",
  228. "typeVersion": 2.3,
  229. "position": [
  230. 1940,
  231. 1060
  232. ],
  233. "id": "3d50fa59-6dfe-4bc1-b202-5eaa3de97902",
  234. "name": "Slack",
  235. "webhookId": "f1f018c7-19fb-4da6-a57f-0b1d2380ab98",
  236. "executeOnce": false,
  237. "credentials": {
  238. "slackApi": {
  239. "id": "EIQTI5m00hw2aRIJ",
  240. "name": "Slack account"
  241. }
  242. }
  243. },
  244. {
  245. "parameters": {
  246. "amount": 1
  247. },
  248. "type": "n8n-nodes-base.wait",
  249. "typeVersion": 1.1,
  250. "position": [
  251. 2540,
  252. 1180
  253. ],
  254. "id": "cecf134d-f587-4734-b716-382a28e443db",
  255. "name": "Wait",
  256. "webhookId": "576e83b9-89b4-4739-8904-10a4830d47b2"
  257. },
  258. {
  259. "parameters": {
  260. "promptType": "define",
  261. "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",
  262. "options": {
  263. "systemMessage": "You are a helpful assistant, this is question two based of question 1 inputs"
  264. }
  265. },
  266. "type": "@n8n/n8n-nodes-langchain.agent",
  267. "typeVersion": 1.9,
  268. "position": [
  269. 2960,
  270. 1060
  271. ],
  272. "id": "a13d0166-c3b7-4e13-b6a8-761499669f4f",
  273. "name": "AI Agent"
  274. },
  275. {
  276. "parameters": {
  277. "aggregate": "aggregateAllItemData",
  278. "options": {}
  279. },
  280. "type": "n8n-nodes-base.aggregate",
  281. "typeVersion": 1,
  282. "position": [
  283. 2160,
  284. 1060
  285. ],
  286. "id": "305ae426-e983-454c-985a-d2d6f76f6bf8",
  287. "name": "Aggregate"
  288. },
  289. {
  290. "parameters": {
  291. "model": {
  292. "__rl": true,
  293. "mode": "list",
  294. "value": "gpt-4o-mini"
  295. },
  296. "options": {}
  297. },
  298. "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
  299. "typeVersion": 1.2,
  300. "position": [
  301. 2900,
  302. 1260
  303. ],
  304. "id": "71835cad-b307-4e8e-b7ab-347deff8cb33",
  305. "name": "OpenAI Chat Model1",
  306. "credentials": {
  307. "openAiApi": {
  308. "id": "IlK7ncOVZORhyWf5",
  309. "name": "OpenAi account"
  310. }
  311. }
  312. },
  313. {
  314. "parameters": {
  315. "conditions": {
  316. "options": {
  317. "caseSensitive": true,
  318. "leftValue": "",
  319. "typeValidation": "strict",
  320. "version": 2
  321. },
  322. "conditions": [
  323. {
  324. "id": "0134a63c-3085-44e0-8033-12e8b41069f5",
  325. "leftValue": "={{ $json.data[0].reply_count }}",
  326. "rightValue": 2,
  327. "operator": {
  328. "type": "number",
  329. "operation": "gt"
  330. }
  331. },
  332. {
  333. "id": "e320395b-5a59-413d-9b9c-537dc2178271",
  334. "leftValue": "",
  335. "rightValue": "",
  336. "operator": {
  337. "type": "string",
  338. "operation": "equals",
  339. "name": "filter.operator.equals"
  340. }
  341. }
  342. ],
  343. "combinator": "and"
  344. },
  345. "options": {}
  346. },
  347. "type": "n8n-nodes-base.if",
  348. "typeVersion": 2.2,
  349. "position": [
  350. 4120,
  351. 1060
  352. ],
  353. "id": "39426d53-33b3-4c04-a050-eb10d1e555e7",
  354. "name": "If1"
  355. },
  356. {
  357. "parameters": {
  358. "resource": "channel",
  359. "operation": "replies",
  360. "channelId": {
  361. "__rl": true,
  362. "value": "C08KJFF8D7W",
  363. "mode": "id"
  364. },
  365. "ts": "={{ $('Slack1').item.json.message.ts }}",
  366. "returnAll": true,
  367. "filters": {}
  368. },
  369. "type": "n8n-nodes-base.slack",
  370. "typeVersion": 2.3,
  371. "position": [
  372. 3660,
  373. 1060
  374. ],
  375. "id": "9efe6bd3-c1f2-4ed9-9982-c95a91c74e23",
  376. "name": "Slack3",
  377. "webhookId": "f1f018c7-19fb-4da6-a57f-0b1d2380ab98",
  378. "executeOnce": false,
  379. "credentials": {
  380. "slackApi": {
  381. "id": "EIQTI5m00hw2aRIJ",
  382. "name": "Slack account"
  383. }
  384. }
  385. },
  386. {
  387. "parameters": {
  388. "amount": 1
  389. },
  390. "type": "n8n-nodes-base.wait",
  391. "typeVersion": 1.1,
  392. "position": [
  393. 4300,
  394. 1180
  395. ],
  396. "id": "a54e8791-c12f-4ee4-b10f-301ebe82e860",
  397. "name": "Wait1",
  398. "webhookId": "576e83b9-89b4-4739-8904-10a4830d47b2"
  399. },
  400. {
  401. "parameters": {
  402. "aggregate": "aggregateAllItemData",
  403. "options": {}
  404. },
  405. "type": "n8n-nodes-base.aggregate",
  406. "typeVersion": 1,
  407. "position": [
  408. 3920,
  409. 1060
  410. ],
  411. "id": "294ccbca-1f9b-423e-9418-b205d2bdf9eb",
  412. "name": "Aggregate1"
  413. },
  414. {
  415. "parameters": {
  416. "promptType": "define",
  417. "text": "={{ JSON.stringify($json.data) }} he are all the key details summerise this so we can store it into notion \n",
  418. "options": {}
  419. },
  420. "type": "@n8n/n8n-nodes-langchain.agent",
  421. "typeVersion": 1.9,
  422. "position": [
  423. 4580,
  424. 1080
  425. ],
  426. "id": "7ccd724d-1d55-4575-9f53-ea0adeb1ae05",
  427. "name": "summerise and format for storage"
  428. },
  429. {
  430. "parameters": {
  431. "model": {
  432. "__rl": true,
  433. "mode": "list",
  434. "value": "gpt-4o-mini"
  435. },
  436. "options": {}
  437. },
  438. "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
  439. "typeVersion": 1.2,
  440. "position": [
  441. 4660,
  442. 1300
  443. ],
  444. "id": "404ad8c5-b514-4add-9487-8db48ecb14c8",
  445. "name": "OpenAI Chat Model2",
  446. "credentials": {
  447. "openAiApi": {
  448. "id": "IlK7ncOVZORhyWf5",
  449. "name": "OpenAi account"
  450. }
  451. }
  452. },
  453. {
  454. "parameters": {},
  455. "type": "n8n-nodes-base.noOp",
  456. "typeVersion": 1,
  457. "position": [
  458. 5100,
  459. 1080
  460. ],
  461. "id": "87d70d18-c652-471d-be7f-2745d23f231b",
  462. "name": "No Operation, do nothing"
  463. },
  464. {
  465. "parameters": {
  466. "select": "channel",
  467. "channelId": {
  468. "__rl": true,
  469. "value": "C08KJFF8D7W",
  470. "mode": "id"
  471. },
  472. "text": "={{ $json.output }}",
  473. "otherOptions": {
  474. "includeLinkToWorkflow": false,
  475. "thread_ts": {
  476. "replyValues": {
  477. "thread_ts": "={{ $('Aggregate').item.json.data[1].ts }}",
  478. "reply_broadcast": true
  479. }
  480. }
  481. }
  482. },
  483. "type": "n8n-nodes-base.slack",
  484. "typeVersion": 2.3,
  485. "position": [
  486. 4920,
  487. 1080
  488. ],
  489. "id": "2cdeb62f-d4a8-4c21-a081-cd97f3936d95",
  490. "name": "Slack4",
  491. "webhookId": "da236d52-4e20-4205-9432-b9814689a7be",
  492. "credentials": {
  493. "slackApi": {
  494. "id": "EIQTI5m00hw2aRIJ",
  495. "name": "Slack account"
  496. }
  497. }
  498. }
  499. ],
  500. "connections": {
  501. "Slack Trigger": {
  502. "main": [
  503. [
  504. {
  505. "node": "Edit Fields",
  506. "type": "main",
  507. "index": 0
  508. }
  509. ]
  510. ]
  511. },
  512. "OpenAI Chat Model": {
  513. "ai_languageModel": [
  514. [
  515. {
  516. "node": "AI Agent3",
  517. "type": "ai_languageModel",
  518. "index": 0
  519. }
  520. ]
  521. ]
  522. },
  523. "AI Agent3": {
  524. "main": [
  525. [
  526. {
  527. "node": "Slack1",
  528. "type": "main",
  529. "index": 0
  530. }
  531. ]
  532. ]
  533. },
  534. "If": {
  535. "main": [
  536. [
  537. {
  538. "node": "AI Agent",
  539. "type": "main",
  540. "index": 0
  541. }
  542. ],
  543. [
  544. {
  545. "node": "Wait",
  546. "type": "main",
  547. "index": 0
  548. }
  549. ]
  550. ]
  551. },
  552. "Edit Fields": {
  553. "main": [
  554. [
  555. {
  556. "node": "AI Agent3",
  557. "type": "main",
  558. "index": 0
  559. }
  560. ]
  561. ]
  562. },
  563. "Slack1": {
  564. "main": [
  565. [
  566. {
  567. "node": "Slack",
  568. "type": "main",
  569. "index": 0
  570. }
  571. ]
  572. ]
  573. },
  574. "Slack2": {
  575. "main": [
  576. [
  577. {
  578. "node": "Slack3",
  579. "type": "main",
  580. "index": 0
  581. }
  582. ]
  583. ]
  584. },
  585. "Slack": {
  586. "main": [
  587. [
  588. {
  589. "node": "Aggregate",
  590. "type": "main",
  591. "index": 0
  592. }
  593. ]
  594. ]
  595. },
  596. "Wait": {
  597. "main": [
  598. [
  599. {
  600. "node": "Slack",
  601. "type": "main",
  602. "index": 0
  603. }
  604. ]
  605. ]
  606. },
  607. "AI Agent": {
  608. "main": [
  609. [
  610. {
  611. "node": "Slack2",
  612. "type": "main",
  613. "index": 0
  614. }
  615. ]
  616. ]
  617. },
  618. "Aggregate": {
  619. "main": [
  620. [
  621. {
  622. "node": "If",
  623. "type": "main",
  624. "index": 0
  625. }
  626. ]
  627. ]
  628. },
  629. "OpenAI Chat Model1": {
  630. "ai_languageModel": [
  631. [
  632. {
  633. "node": "AI Agent",
  634. "type": "ai_languageModel",
  635. "index": 0
  636. }
  637. ]
  638. ]
  639. },
  640. "If1": {
  641. "main": [
  642. [
  643. {
  644. "node": "summerise and format for storage",
  645. "type": "main",
  646. "index": 0
  647. }
  648. ],
  649. [
  650. {
  651. "node": "Wait1",
  652. "type": "main",
  653. "index": 0
  654. }
  655. ]
  656. ]
  657. },
  658. "Slack3": {
  659. "main": [
  660. [
  661. {
  662. "node": "Aggregate1",
  663. "type": "main",
  664. "index": 0
  665. }
  666. ]
  667. ]
  668. },
  669. "Wait1": {
  670. "main": [
  671. [
  672. {
  673. "node": "Slack3",
  674. "type": "main",
  675. "index": 0
  676. }
  677. ]
  678. ]
  679. },
  680. "Aggregate1": {
  681. "main": [
  682. [
  683. {
  684. "node": "If1",
  685. "type": "main",
  686. "index": 0
  687. }
  688. ]
  689. ]
  690. },
  691. "summerise and format for storage": {
  692. "main": [
  693. [
  694. {
  695. "node": "Slack4",
  696. "type": "main",
  697. "index": 0
  698. }
  699. ]
  700. ]
  701. },
  702. "OpenAI Chat Model2": {
  703. "ai_languageModel": [
  704. [
  705. {
  706. "node": "summerise and format for storage",
  707. "type": "ai_languageModel",
  708. "index": 0
  709. }
  710. ]
  711. ]
  712. },
  713. "Slack4": {
  714. "main": [
  715. [
  716. {
  717. "node": "No Operation, do nothing",
  718. "type": "main",
  719. "index": 0
  720. }
  721. ]
  722. ]
  723. }
  724. },
  725. "pinData": {
  726. "Slack Trigger": [
  727. {
  728. "user": "U036APJKAPL",
  729. "type": "app_mention",
  730. "ts": "1747619119.567769",
  731. "client_msg_id": "34ce7439-2607-4fc9-b23a-958990926b27",
  732. "text": "<@U08GMKHTXCG> hi",
  733. "team": "T03644LBLLW",
  734. "blocks": [
  735. {
  736. "type": "rich_text",
  737. "block_id": "n6SMo",
  738. "elements": [
  739. {
  740. "type": "rich_text_section",
  741. "elements": [
  742. {
  743. "type": "user",
  744. "user_id": "U08GMKHTXCG"
  745. },
  746. {
  747. "type": "text",
  748. "text": " hi"
  749. }
  750. ]
  751. }
  752. ]
  753. }
  754. ],
  755. "channel": "C08KJFF8D7W",
  756. "event_ts": "1747619119.567769"
  757. }
  758. ]
  759. },
  760. "meta": {
  761. "templateId": "2606",
  762. "templateCredsSetupCompleted": true,
  763. "instanceId": "b7c8e9091f3c04b2ab375bd3b3a3403634617af0af6a44559346a014a548084f"
  764. }
  765. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement