-
Notifications
You must be signed in to change notification settings - Fork 2
/
my-workflow-Pd5c3KKDHtdPADSP.json
1 lines (1 loc) · 7.21 KB
/
my-workflow-Pd5c3KKDHtdPADSP.json
1
{"createdAt":"2023-10-08T19:57:24.021Z","updatedAt":"2023-10-08T19:57:24.021Z","id":"Pd5c3KKDHtdPADSP","name":"My workflow","active":false,"nodes":[{"parameters":{"conditions":{"number":[{"value1":"={{ $json.message.chat.id }}","operation":"equal"}]}},"id":"d799f87b-ef94-47f3-88d8-2965f3be0b20","name":"Check chat ID","type":"n8n-nodes-base.if","typeVersion":1,"position":[1400,1200]},{"parameters":{"amount":3,"unit":"seconds"},"id":"5fc3d1c7-9a26-43d0-8f7d-0dbafe71d9ec","name":"Wait 3 seconds","type":"n8n-nodes-base.wait","typeVersion":1,"position":[1880,1360],"webhookId":"5927178d-1fed-4ee6-bcad-c83fec83c92a"},{"parameters":{"chatId":"={{ $node['Telegram trigger'].json.message.chat.id }}","text":"I'm not authorized to speak with you. ","additionalFields":{}},"id":"86f6d4e4-b2cd-47b9-9181-96c5042a252b","name":"Send unauthorized info [TELEGRAM]","type":"n8n-nodes-base.telegram","typeVersion":1,"position":[2080,1360],"credentials":{"telegramApi":{"id":"sTd6UinHeRVEv74q","name":"Telegram account"}}},{"parameters":{"chatId":"={{ $node['Check chat ID'].json.message.chat.id }}","text":"={{$node['Generate answer [OPENAI]'].json.message.content }}","additionalFields":{}},"id":"7546e106-8257-4ca3-ab60-d0b1215c4c10","name":"Send response [TELEGRAM]","type":"n8n-nodes-base.telegram","typeVersion":1,"position":[2080,1000],"credentials":{"telegramApi":{"id":"sTd6UinHeRVEv74q","name":"Telegram account"}}},{"parameters":{"resource":"chat","prompt":{"messages":[{"role":"assistant","content":"You're an assistant called WorkfloowsAI. Your task is to help user with daily tasks."},{"role":"assistant","content":"="},{"content":"={{ $node[\"Telegram trigger\"].json[\"message\"][\"text\"] }}"}]},"options":{}},"id":"64ca6884-cb48-46d3-b307-6ef48a86ca4a","name":"Generate answer [OPENAI]","type":"n8n-nodes-base.openAi","typeVersion":1,"position":[1880,1000],"credentials":{"openAiApi":{"id":"2","name":"OpenAi (Workfloows)"}}},{"parameters":{"conditions":{"string":[{"value1":"={{ $json.message.text }}","value2":"/start"}]}},"id":"cc4a84dc-841d-4821-99ff-59c572f43ab6","name":"Check if start","type":"n8n-nodes-base.if","typeVersion":1,"position":[1180,1020]},{"parameters":{},"id":"2b5dd15c-0d97-4a90-b057-e9ddb2897781","name":"No operation","type":"n8n-nodes-base.noOp","typeVersion":1,"position":[1400,800]},{"parameters":{"content":"## ⚠️ Note\n\n1. Complete video guide for this workflow is available [on my YouTube](https://www.youtube.com/watch?v=Gc2lW5BiGDQ). \n2. Remember to add your credentials and configure nodes (covered in the video guide).\n3. If you like this workflow, please subscribe to [my YouTube channel](https://www.youtube.com/@workfloows) and/or [my newsletter](https://workfloows.com/).\n\n**Thank you for your support!**","height":258.9141682442004,"width":382.8182353336517},"id":"5bd6460f-dbae-48ab-990e-ce30a4a79933","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[940,580]},{"parameters":{"updates":["message"],"additionalFields":{}},"id":"6b1b2f23-447d-46b3-9524-7ab66bc7c157","name":"Telegram trigger","type":"n8n-nodes-base.telegramTrigger","typeVersion":1,"position":[980,1020],"webhookId":"64456f84-9a61-4ccc-a28c-3aca7a498103","credentials":{"telegramApi":{"id":"sTd6UinHeRVEv74q","name":"Telegram account"}}},{"parameters":{"content":"## Trigger\nRemember to add credentials of your Telegram bot.","height":339.51767272727324,"width":182.4715262478496},"id":"7e4bc640-ba2a-4072-8e45-2f52e6b8f5a5","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[940,860]},{"parameters":{"content":"## Ignore start\nThis node will ignore initial ```/start``` message that is sent by first conversation with bot.","height":339.51767272727324,"width":182.4715262478496},"id":"46f4ebd6-552c-43f8-bc74-491ac4cfcbc4","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1140,860]},{"parameters":{"content":"## Authorize\nChange default value ```0``` to your 10-digit chat ID to authorize conversation and disable other people to talk to your bot.","height":367.74256847311284,"width":182.4715262478496},"id":"0e27713c-619e-4110-8409-57bfa6cc0a8e","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1360,1000]},{"parameters":{"operation":"sendChatAction","chatId":"={{ $json.message.chat.id }}"},"id":"419541e9-f5e2-46ad-a003-0ce723100677","name":"Send typing action [TELEGRAM] [1]","type":"n8n-nodes-base.telegram","typeVersion":1,"position":[1680,1000],"credentials":{"telegramApi":{"id":"sTd6UinHeRVEv74q","name":"Telegram account"}}},{"parameters":{"content":"## Send \"unauthorized\" message\nWhen unknown user (chat ID) wants to come into interaction with bot, workflow will send \"typing\" action, wait 3 seconds and respond: *\"I'm not authorized to speak with you\"*.","height":339.42690909090965,"width":643.3545239632286},"id":"e3bfcf37-02a3-4ff1-9204-c5350216bd58","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1620,1220]},{"parameters":{"content":"## Generate response\nThis sequence sends \"typing action\", gets answer from GPT and returns message to authorized user. Feel free to play with prompt, configuration etc.","height":339.42690909090965,"width":643.3545239632286},"id":"0678a811-5a4e-4be4-833d-f739f1715f8f","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1620,860]},{"parameters":{"operation":"sendChatAction","chatId":"={{ $json.message.chat.id }}"},"id":"c5994d14-d121-4e9d-a5d0-32711738c58c","name":"Send typing action [TELEGRAM] [2]","type":"n8n-nodes-base.telegram","typeVersion":1,"position":[1680,1360],"credentials":{"telegramApi":{"id":"sTd6UinHeRVEv74q","name":"Telegram account"}}},{"parameters":{"content":"## 🦜🔗 Add LangChain \n\n**This is just a basic workflow.** If you want to make your bot more powerful, consider installing [FlowiseAI](https://flowiseai.com/) (LangChain UI) on your server and connecting your bot via simple cURL (HTTP Request node). I cover example [in my YouTube video](https://www.youtube.com/watch?v=Gc2lW5BiGDQ).\n\nInstallation guides and other data about FlowiseAI can be found [here](https://github.com/FlowiseAI/Flowise).","height":258.16986559669937,"width":345.7880926620822},"id":"d5316cce-b994-4710-bb01-455cc3335d50","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[580,580]}],"connections":{"Check chat ID":{"main":[[{"node":"Send typing action [TELEGRAM] [1]","type":"main","index":0}],[{"node":"Send typing action [TELEGRAM] [2]","type":"main","index":0}]]},"Wait 3 seconds":{"main":[[{"node":"Send unauthorized info [TELEGRAM]","type":"main","index":0}]]},"Generate answer [OPENAI]":{"main":[[{"node":"Send response [TELEGRAM]","type":"main","index":0}]]},"Check if start":{"main":[[{"node":"No operation","type":"main","index":0}],[{"node":"Check chat ID","type":"main","index":0}]]},"Telegram trigger":{"main":[[{"node":"Check if start","type":"main","index":0}]]},"Send typing action [TELEGRAM] [1]":{"main":[[{"node":"Generate answer [OPENAI]","type":"main","index":0}]]},"Send typing action [TELEGRAM] [2]":{"main":[[{"node":"Wait 3 seconds","type":"main","index":0}]]}},"settings":{"executionOrder":"v1"},"staticData":null,"pinData":{},"versionId":"389cae76-723d-47a9-88bc-7228db814634","triggerCount":0,"tags":[]}