feat: add folder support for workflows (fixes #70)

This commit is contained in:
Praveen Mudalgeri
2025-08-05 09:40:47 +05:30
parent 307d530f9b
commit c4885eee92
2057 changed files with 985290 additions and 974268 deletions

View File

@@ -0,0 +1,266 @@
{
"meta": {
"instanceId": "4359279a248a64f23ddf72d3bc2de4dead8a687e643e9296f8a007dd65120396"
},
"nodes": [
{
"id": "59b786fe-8e45-4616-aa45-9748df144c3a",
"name": "MySQL",
"type": "n8n-nodes-base.mySql",
"position": [
-80,
220
],
"parameters": {
"query": "SELECT \n company,\n cost_center AS default_cost_center,\n COUNT(*) AS project_count\nFROM \n tabProject\nWHERE \n status = 'Open' \n AND project_type = 'External'\n AND is_active = 'Yes'\n AND budgeted_project_cost = 0\n \nGROUP BY \n company, cost_center\nORDER BY \n company, project_count DESC;\n",
"options": {},
"operation": "executeQuery"
},
"typeVersion": 2.4
},
{
"id": "48c20822-9f2e-4108-8bfb-b300689a9724",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-360,
220
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "3757860b-b7a0-4617-a398-37ac42f1acea",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
180,
200
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "A",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "423062ba-e116-4e22-aa00-29107e8c24ce",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.default_cost_center }}",
"rightValue": "Cost Center A"
}
]
},
"renameOutput": true
},
{
"outputKey": "B",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e065ab84-61fd-4e6c-8835-92d08be3e359",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.default_cost_center }}",
"rightValue": "Cost Center B"
}
]
},
"renameOutput": true
},
{
"outputKey": "C",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0ef8ce35-2507-4ff4-8dea-11380262098e",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.default_cost_center }}",
"rightValue": "=COST CENTER C"
}
]
},
"renameOutput": true
},
{
"outputKey": "D",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9152e548-cca9-441c-b4b6-8903f449dc2b",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.default_cost_center }}",
"rightValue": "Cost Center D"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "bf8fd5f4-e107-44e8-af1a-be32596d664e",
"name": "Microsoft Outlook6",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
560,
-20
],
"webhookId": "dce42873-919a-4dac-9f9d-792b0a39b7f7",
"parameters": {
"subject": "Project Cost Missing",
"bodyContent": "==<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Missing Budgeted Cost Notification</title>\n <style>\n body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; }\n .email-container { max-width: 600px; margin: 20px auto; background-color: #ffffff; border-radius: 8px; overflow: hidden; }\n .email-header { background-color: #007BFF; color: #ffffff; padding: 20px; text-align: center; font-size: 18px; font-weight: bold; }\n .email-body { padding: 20px; font-size: 16px; color: #333333; }\n .email-body strong { color: #007BFF; }\n .email-footer { padding: 10px 20px; font-size: 14px; color: #555555; text-align: left; }\n </style>\n</head>\n<body>\n <div class=\"email-container\">\n <div class=\"email-header\">\n {{ $json.default_cost_center }} - Project Data Missing\n </div>\n <div class=\"email-body\">\n Dear {{ $json.default_cost_center }} Team,<br><br>\n There are <strong>{{ $json.project_count }}</strong> active projects with missing <strong>Budgeted Cost</strong>.<br>\n Kindly coordinate with the <strong>Accounts Team</strong> to update the missing values for accurate tracking.<br><br>\n Your timely attention is appreciated.<br><br>\n Regards,\n </div>\n <div class=\"email-footer\">\n <strong>Amjid Ali</strong><br>\n Automation Demo n8n\n </div>\n </div>\n</body>\n</html>\n",
"toRecipients": "amjid@amjidali.com",
"additionalFields": {
"bodyContentType": "html"
}
},
"typeVersion": 2
},
{
"id": "e4ffe557-0862-401e-9f65-7195a72db1d9",
"name": "Microsoft Outlook1",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
560,
160
],
"webhookId": "ea8b2720-cbb6-4712-b9ff-4b443958d0d0",
"parameters": {
"subject": "Projects Cost Missing",
"bodyContent": "==<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Missing Budgeted Cost Notification</title>\n <style>\n body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; }\n .email-container { max-width: 600px; margin: 20px auto; background-color: #ffffff; border-radius: 8px; overflow: hidden; }\n .email-header { background-color: #007BFF; color: #ffffff; padding: 20px; text-align: center; font-size: 18px; font-weight: bold; }\n .email-body { padding: 20px; font-size: 16px; color: #333333; }\n .email-body strong { color: #007BFF; }\n .email-footer { padding: 10px 20px; font-size: 14px; color: #555555; text-align: left; }\n </style>\n</head>\n<body>\n <div class=\"email-container\">\n <div class=\"email-header\">\n {{ $json.default_cost_center }} - Project Data Missing\n </div>\n <div class=\"email-body\">\n Dear {{ $json.default_cost_center }} Team,<br><br>\n There are <strong>{{ $json.project_count }}</strong> active projects with missing <strong>Budgeted Cost</strong>.<br>\n Kindly coordinate with the <strong>Accounts Team</strong> to update the missing values for accurate tracking.<br><br>\n Your timely attention is appreciated.<br><br>\n Regards,\n </div>\n <div class=\"email-footer\">\n <strong>Amjid Ali</strong><br>\n Automation Demo n8n\n </div>\n </div>\n</body>\n</html>\n",
"toRecipients": "amjid@amjidali.com",
"additionalFields": {
"bodyContentType": "html"
}
},
"typeVersion": 2
},
{
"id": "e0722ebd-1e05-4efe-a27a-e4db193dec80",
"name": "Microsoft Outlook7",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
560,
380
],
"webhookId": "46e6a678-d922-4dfc-b51d-864477e6b01e",
"parameters": {
"subject": "Projects Cost Missing",
"bodyContent": "==<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Missing Budgeted Cost Notification</title>\n <style>\n body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; }\n .email-container { max-width: 600px; margin: 20px auto; background-color: #ffffff; border-radius: 8px; overflow: hidden; }\n .email-header { background-color: #007BFF; color: #ffffff; padding: 20px; text-align: center; font-size: 18px; font-weight: bold; }\n .email-body { padding: 20px; font-size: 16px; color: #333333; }\n .email-body strong { color: #007BFF; }\n .email-footer { padding: 10px 20px; font-size: 14px; color: #555555; text-align: left; }\n </style>\n</head>\n<body>\n <div class=\"email-container\">\n <div class=\"email-header\">\n {{ $json.default_cost_center }} - Project Data Missing\n </div>\n <div class=\"email-body\">\n Dear {{ $json.default_cost_center }} Team,<br><br>\n There are <strong>{{ $json.project_count }}</strong> active projects with missing <strong>Budgeted Cost</strong>.<br>\n Kindly coordinate with the <strong>Accounts Team</strong> to update the missing values for accurate tracking.<br><br>\n Your timely attention is appreciated.<br><br>\n Regards,\n </div>\n <div class=\"email-footer\">\n <strong>Amjid Ali</strong><br>\n Automation Demo n8n\n </div>\n </div>\n</body>\n</html>\n",
"toRecipients": "amjid@amjidali.com",
"additionalFields": {
"bodyContentType": "html"
}
},
"typeVersion": 2
}
],
"pinData": {},
"connections": {
"MySQL": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Microsoft Outlook6",
"type": "main",
"index": 0
}
],
[
{
"node": "Microsoft Outlook1",
"type": "main",
"index": 0
}
],
[
{
"node": "Microsoft Outlook7",
"type": "main",
"index": 0
}
],
[]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "MySQL",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,277 @@
{
"id": "0HVA2TOmkdNpH5DP",
"meta": {
"instanceId": "ba8f1362d8ed4c2ce84171d2f481098de4ee775241bdc1660d1dce80434ec7d4",
"templateCredsSetupCompleted": true
},
"name": "Google calendar to Outlook",
"tags": [],
"nodes": [
{
"id": "e7e75d4a-ee5a-4ee7-b69d-71d8eb51fe55",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
920,
800
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineAll"
},
"typeVersion": 3
},
{
"id": "6e159340-910c-4c1e-9e6b-c6ef679309be",
"name": "Incoming Event Trigger",
"type": "n8n-nodes-base.googleCalendarTrigger",
"position": [
500,
360
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "eventCreated",
"calendarId": {
"__rl": true,
"mode": "list",
"value": "your_email@gmail.com",
"cachedResultName": "Your Name"
}
},
"credentials": {
"googleCalendarOAuth2Api": {
"id": "IgBZqXCtaacRpIKt",
"name": "Your Name Google Calendar account"
}
},
"typeVersion": 1
},
{
"id": "7ffb13c3-7d16-4bd8-aed0-7f6378394a1c",
"name": "Cancel Event Trigger",
"type": "n8n-nodes-base.googleCalendarTrigger",
"position": [
280,
600
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "eventCancelled",
"calendarId": {
"__rl": true,
"mode": "list",
"value": "your_email@gmail.com",
"cachedResultName": "Your Name"
}
},
"credentials": {
"googleCalendarOAuth2Api": {
"id": "IgBZqXCtaacRpIKt",
"name": "Your Name Google Calendar account"
}
},
"typeVersion": 1
},
{
"id": "f0e81f5b-a813-4e03-9400-a97842b6b9b5",
"name": "Create Outlook Event",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
740,
360
],
"parameters": {
"subject": "={{ \"From private: \" + $json.summary }}",
"resource": "event",
"operation": "create",
"calendarId": {
"__rl": true,
"mode": "list",
"value": "AAMkAGUxOTQ4ZmU0LWMxYjUtNDRiZi1iYjdlLTNmYTFhOWQ3MWZhNwBGAAAAAABlzj22ZOwJQZOQBjwNTK5fBwBW9yW5dIfsR51ayk6B4bZSAAAAAAEGAABW9yW5dIfsR51ayk6B4bZSAAAAAeGaAAA=",
"cachedResultName": "Calendar"
},
"endDateTime": "={{ $json.end.dateTime != undefined ? $json.end.dateTime : $json.end.date }}",
"startDateTime": "={{ $json.start.dateTime != undefined ? $json.start.dateTime : $json.start.date }}",
"additionalFields": {
"body": "={{ $json.description != undefined ? $json.description + \"\\n\" : \"\" + $json.htmlLink }}"
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "IsGdpQBgFdZ9bMsM",
"name": "Microsoft Outlook account (alex NLD)"
}
},
"typeVersion": 2
},
{
"id": "0e7c3511-cb4a-46a7-937e-57bdf6bdc00c",
"name": "Get Event to Cancel",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
520,
600
],
"parameters": {
"limit": 1,
"filters": {
"custom": "=contains(subject, '{{ $json.summary }}')"
},
"resource": "event",
"calendarId": {
"__rl": true,
"mode": "list",
"value": "AAMkAGUxOTQ4ZmU0LWMxYjUtNDRiZi1iYjdlLTNmYTFhOWQ3MWZhNwBGAAAAAABlzj22ZOwJQZOQBjwNTK5fBwBW9yW5dIfsR51ayk6B4bZSAAAAAAEGAABW9yW5dIfsR51ayk6B4bZSAAAAAeGaAAA=",
"cachedResultName": "Calendar"
},
"fromAllCalendars": false
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "IsGdpQBgFdZ9bMsM",
"name": "Microsoft Outlook account (work email)"
}
},
"typeVersion": 2
},
{
"id": "6540c5f5-963b-4260-8c10-1c7f5bb75315",
"name": "Delete Event",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
780,
600
],
"parameters": {
"eventId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"resource": "event",
"operation": "delete",
"calendarId": {
"__rl": true,
"mode": "list",
"value": "AAMkAGUxOTQ4ZmU0LWMxYjUtNDRiZi1iYjdlLTNmYTFhOWQ3MWZhNwBGAAAAAABlzj22ZOwJQZOQBjwNTK5fBwBW9yW5dIfsR51ayk6B4bZSAAAAAAEGAABW9yW5dIfsR51ayk6B4bZSAAAAAeGaAAA=",
"cachedResultName": "Calendar"
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "IsGdpQBgFdZ9bMsM",
"name": "Microsoft Outlook account (alex NLD)"
}
},
"typeVersion": 2
},
{
"id": "03cf261c-4c26-4db1-a335-e249c0f590ec",
"name": "Send E-mail with details",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1060,
620
],
"parameters": {
"subject": "={{ $json.subject + \" Cancelled\" }}",
"bodyContent": "<h1>Event cancelled via Google Calendar</h1>",
"toRecipients": "your_email@work.zom",
"additionalFields": {
"bodyContentType": "html"
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "IsGdpQBgFdZ9bMsM",
"name": "Microsoft Outlook account (work email)"
}
},
"typeVersion": 2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "34dc3a4d-0db5-4efc-8814-c94d3468540a",
"connections": {
"Merge": {
"main": [
[
{
"node": "Send E-mail with details",
"type": "main",
"index": 0
}
]
]
},
"Delete Event": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Get Event to Cancel": {
"main": [
[
{
"node": "Delete Event",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Cancel Event Trigger": {
"main": [
[
{
"node": "Get Event to Cancel",
"type": "main",
"index": 0
}
]
]
},
"Incoming Event Trigger": {
"main": [
[
{
"node": "Create Outlook Event",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,241 @@
{
"id": "mqindLlOy0A0e5aA",
"meta": {
"instanceId": "aae6cde6c06a77e3bf2445b060051b4c63107a8258d59cb57184495848d659de",
"templateCredsSetupCompleted": true
},
"name": "Outlook",
"tags": [],
"nodes": [
{
"id": "b2e6066f-a4c7-486c-aa0d-06a4c92aa745",
"name": "Connect Outlook & Set Filter",
"type": "n8n-nodes-base.microsoftOutlookTrigger",
"position": [
-240,
-260
],
"parameters": {
"output": "raw",
"filters": {
"sender": "sales@yourcompany.com"
},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "nRYwUzhHrSBFtcSS",
"name": "Microsoft Outlook account 2"
}
},
"typeVersion": 1
},
{
"id": "98f20649-4842-44b8-86c3-a153cd7f4ce2",
"name": "Add OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
140,
100
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "sXujPvtyB7ZEzKZs",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "bf4cb647-91c6-4f3d-a685-ed928b431ef5",
"name": "Add AI Agent Instructions",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
140,
-120
],
"parameters": {
"text": "=Write a reply to the following email, then save it as a draft to the email thread:\n<email>\nID: {{ $json.id }}\nFrom: {{ $json.from.emailAddress.address }}\nSubject: {{ $json.subject }}\nMessage: {{ $json.body.content }}\n</email>",
"options": {
"systemMessage": "#role\nYou are an AI assistant specializing in replying to incoming emails to [YOUR NAME] Outlook inbox.\n\n#capabilities and limitations\nYour reply will be limited to the current email message, not the email string. Do not hallucinate.\n\n#response\nReply in a casual, modern, professional, concise writing style. You should sound like [YOUR NAME HERE]. Here are examples of [YOUR NAME HERE] voice:\n<example>\n[COPY & PASTE REPLY SAMPLES FROM YOUR EMAIL]\n</example>\n<example>\n[COPY & PASTE REPLY SAMPLES FROM YOUR EMAIL]\n</example>\n<example>\n[ADD A VARIETY OF REPLY SAMPLES SO THE AGENT UNDERSTANDS YOUR TONE & STYLE]\n</example>"
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "8432a5b8-db95-4e1a-b573-6d4f6a026659",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-60,
-320
],
"parameters": {
"color": 5,
"content": "Trigger Action\n1) Connect a Microsoft email account you can authenticate\n2) Trigger is set to \"message received\" and the output \"raw\"\n3) Add the email address(es) you want the AI agent to handle"
},
"typeVersion": 1
},
{
"id": "72b652a4-cebe-48d6-81ad-d078f0655041",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-300,
-80
],
"parameters": {
"color": 5,
"width": 340,
"height": 440,
"content": "Agent Instructions\n\n#role\nYou are an AI assistant specializing in replying to incoming emails to [YOUR NAME] Outlook inbox.\n\n#capabilities and limitations\nYour reply will be limited to the current email message, not the email string. Do not hallucinate.\n\n#response\nReply in a casual, modern, professional, concise writing style. You should sound like [YOUR NAME HERE]. Here are examples of [YOUR NAME HERE] voice:\n<example>\n[COPY & PASTE REPLY SAMPLES FROM YOUR EMAIL]\n</example>\n<example>\n[COPY & PASTE REPLY SAMPLES FROM YOUR EMAIL]\n</example>\n<example>\n[ADD A VARIETY OF REPLY SAMPLES SO THE AGENT UNDERSTANDS YOUR TONE & STYLE]\n</example>"
},
"typeVersion": 1
},
{
"id": "e2e761a3-9744-439c-9764-ab4c68621c69",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
260
],
"parameters": {
"color": 5,
"height": 100,
"content": "Add AI Model\n1) OpenAI Account Credentials Required\n2) Select model (ie. gpt-4o-mini)"
},
"typeVersion": 1
},
{
"id": "555f37e2-a8fe-4cd4-9a55-758c07b6a4c4",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
320,
180
],
"parameters": {
"color": 5,
"height": 180,
"content": "Reply Settings\n1) Manually set the resource, operation, and message\n2) Toggle switch to reply only to sender\n3) Let the AI model define the \"message\"\n4) Additional fields for the \"reply to\" and \"subject\""
},
"typeVersion": 1
},
{
"id": "9b1a5b51-e502-42f4-80ad-03d050a3c7cb",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
120
],
"parameters": {
"height": 140,
"content": "Draft a Reply\n1. Follows all the same \"Reply to Email\" settings EXCEPT the email reply is saved in your DRAFTS folder\n2. This setting is great if you want a human checkpoint before sending"
},
"typeVersion": 1
},
{
"id": "46f4b974-4da7-471b-ba49-3737685d123e",
"name": "Reply to Email",
"type": "n8n-nodes-base.microsoftOutlookTool",
"position": [
400,
40
],
"webhookId": "6d01cb74-0463-4042-8917-acd2f552d4b5",
"parameters": {
"message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
"options": {},
"messageId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"operation": "reply",
"descriptionType": "manual",
"additionalFields": {
"replyTo": "={{ $json.sender.emailAddress.address }}",
"subject": "={{ $json.subject }}"
},
"replyToSenderOnly": true
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "nRYwUzhHrSBFtcSS",
"name": "Microsoft Outlook"
}
},
"typeVersion": 2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "fcd52e16-512c-4655-ae18-1a4b87190e0d",
"connections": {
"Reply to Email": {
"ai_tool": [
[
{
"node": "Add AI Agent Instructions",
"type": "ai_tool",
"index": 0
}
]
]
},
"Add OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Add AI Agent Instructions",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Draft a Reply [optional]": {
"ai_tool": [
[
{
"node": "Add AI Agent Instructions",
"type": "ai_tool",
"index": 0
}
]
]
},
"Connect Outlook & Set Filter": {
"main": [
[
{
"node": "Add AI Agent Instructions",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,228 @@
{
"id": "okMME97B70fXzK5U",
"meta": {
"instanceId": "2ed3d505bdd5b40b1b0ebc27913bd00ac94bca7476c7375336a42d5c4724f977",
"templateCredsSetupCompleted": true
},
"name": "send file to kindle through telegram bot",
"tags": [],
"nodes": [
{
"id": "6e581437-28dc-4573-88f2-ce44ec497819",
"name": "receive file message from telegram bot",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
460,
520
],
"webhookId": "5d8d9b97-672d-461a-83c5-1665136494dd",
"parameters": {
"updates": [
"message"
],
"additionalFields": {
"download": true
}
},
"typeVersion": 1.1
},
{
"id": "6eb48c62-69a9-4bd2-a6ab-cffb5cde03df",
"name": "check if there is a file in the message",
"type": "n8n-nodes-base.if",
"position": [
680,
520
],
"parameters": {
"options": {
"ignoreCase": false
},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4ad69b1f-c19f-436d-8af3-203722f4dd4c",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.message.document }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2,
"alwaysOutputData": false
},
{
"id": "5dec7f0b-e650-4249-a5fb-e31cebda8e81",
"name": "reply to warn that file is missing",
"type": "n8n-nodes-base.telegram",
"position": [
900,
720
],
"parameters": {
"text": "There is no file in message.Please check.",
"chatId": "={{ $('receive file message from telegram bot').item.json.message.chat.id }}",
"additionalFields": {
"reply_to_message_id": "={{ $('receive file message from telegram bot').item.json.message.message_id }}"
}
},
"typeVersion": 1.1
},
{
"id": "79f49881-6cb0-4207-8143-11f021e71083",
"name": "rename file to as attachment out email",
"type": "n8n-nodes-base.code",
"position": [
900,
320
],
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.binary.data.fileName = item.json.message.document.file_name;\n}\n\nreturn $input.all();"
},
"typeVersion": 2
},
{
"id": "059babdc-eb35-416a-9ff4-31a34bd6a4f9",
"name": "send email with the file as attchament to kindle",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1160,
320
],
"parameters": {
"subject": "book from telegram bot",
"bodyContent": "=This is a book named {{ $json.message.document.file_name }} from telegram bot.",
"toRecipients": "hulb.kindle11@kindle.com",
"additionalFields": {
"attachments": {
"attachments": [
{
"binaryPropertyName": "data"
}
]
}
}
},
"notesInFlow": false,
"typeVersion": 2
},
{
"id": "8c927ee3-5b65-4aeb-861c-fe459db1e4c9",
"name": "reply to telegram chat that the file has been sent successfully",
"type": "n8n-nodes-base.telegram",
"position": [
1380,
320
],
"parameters": {
"text": "file is sent to kindle successfully!",
"chatId": "={{ $('receive file message from telegram bot').item.json.message.chat.id }}",
"additionalFields": {
"reply_to_message_id": "={{ $('receive file message from telegram bot').item.json.message.message_id }}"
}
},
"typeVersion": 1.1
},
{
"id": "ceba7af1-b23c-426e-a1e7-5fd996021ffe",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
360,
200
],
"parameters": {
"width": 252,
"height": 229,
"content": "## preparations\n1. create a new telegram bot through bot father and save the credential on n8n\n2. save your email credential on n8n\n3. setup your kindle on amazon to allow your email address send to your kindle."
},
"typeVersion": 1
},
{
"id": "989939ec-b7ea-4903-b375-6f0fc6c4cee1",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1080,
140
],
"parameters": {
"content": "## email setup\nmake sure you have allowed your email address as the sender to kindle on amazon. And use the kindle address as the email receiver"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "XNlgpSG3BUF32PIk",
"executionOrder": "v1",
"saveManualExecutions": true
},
"versionId": "624798e9-5f62-4c14-9bf3-5ad92b8713e6",
"connections": {
"receive file message from telegram bot": {
"main": [
[
{
"node": "check if there is a file in the message",
"type": "main",
"index": 0
}
]
]
},
"rename file to as attachment out email": {
"main": [
[
{
"node": "send email with the file as attchament to kindle",
"type": "main",
"index": 0
}
]
]
},
"check if there is a file in the message": {
"main": [
[
{
"node": "rename file to as attachment out email",
"type": "main",
"index": 0
}
],
[
{
"node": "reply to warn that file is missing",
"type": "main",
"index": 0
}
]
]
},
"send email with the file as attchament to kindle": {
"main": [
[
{
"node": "reply to telegram chat that the file has been sent successfully",
"type": "main",
"index": 0
}
]
]
}
}
}