Automatisation / worflows.json
FreudArthur's picture
Connecting Database : Migration from sqlite3 to Postgree
bad1b41
Raw History Blame Contribute Delete
11.3 kB
{
"nodes": [
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"id": "f9970906-4d66-4985-a8fb-46a83253031e",
"name": "Listen for incoming events",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-1120,
80
],
"webhookId": "0474fc6c-1a7d-4a9d-bc34-54b3257ad414",
"typeVersion": 1,
"credentials": {
"telegramApi": {
"id": "xtyS4FnQD7jP4b6g",
"name": "Telegram account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "allow_1",
"name": "allow",
"type": "string",
"value": "<chat id>"
}
]
},
"options": {}
},
"id": "911b7e65-1f7c-4681-865b-40a8cc8c4170",
"name": "AllowList",
"type": "n8n-nodes-base.set",
"position": [
-896,
80
],
"typeVersion": 3.4
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 3
},
"combinator": "and",
"conditions": [
{
"id": "auth_check",
"operator": {
"type": "number",
"operation": "equals"
},
"leftValue": "={{ $('Listen for incoming events').first().json.message.from.id }}",
"rightValue": "={{ $json.allow }}"
}
]
},
"looseTypeValidation": true,
"options": {}
},
"id": "342754af-d745-4d8f-aab0-d4f81bc1743c",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
-672,
80
],
"typeVersion": 2.3
},
{
"parameters": {
"fields": {
"values": [
{
"name": "text",
"stringValue": "={{ $('Listen for incoming events').item.json.message.text || '' }}"
},
{
"name": "sessionId",
"stringValue": "={{ $('Listen for incoming events').item.json.message.from.id }}"
}
]
},
"options": {}
},
"id": "46702015-eacb-45a0-8a82-1baa5cc13bc4",
"name": "Voice or Text",
"type": "n8n-nodes-base.set",
"position": [
-448,
80
],
"typeVersion": 3.2
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "voice_check",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $('Listen for incoming events').item.json.message.text }}",
"rightValue": ""
}
]
},
"options": {}
},
"id": "8884e905-9c26-47c6-b1c9-1b4ed640896b",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-224,
80
],
"typeVersion": 2.2
},
{
"parameters": {
"resource": "file",
"fileId": "={{ $('Listen for incoming events').item.json.message.voice.file_id }}",
"additionalFields": {}
},
"id": "1603f070-eac2-40f6-9997-cc19b448ada1",
"name": "Get Voice File",
"type": "n8n-nodes-base.telegram",
"position": [
0,
0
],
"webhookId": "7731f83c-2346-4983-8916-c1360836de7d",
"typeVersion": 1.1
},
{
"parameters": {
"resource": "audio",
"operation": "transcribe",
"options": {}
},
"id": "616213f1-01ae-4e07-a85d-da85a75df75f",
"name": "Speech to Text",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
224,
0
],
"typeVersion": 1.3
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.text }}",
"options": {
"systemMessage": "You are a helpful assistant.\n\nToday's date is {{ $now }}.\n\nGuidelines:\n- When fetching emails, filter out any promotional emails.\n- When summarizing emails, include Sender, Message date, subject, and brief summary of email.\n- if the user did not specify a date in the request assume they are asking for today\n- Use baserow tool to answer questions about tasks\n- When answering questions about calendar events, filter out events that don't apply to the question. For example, the question is about events for today, only reply with events for today. Don't mention future events if it's more than 1 week away"
}
},
"id": "f4aad433-122b-4247-b159-6d2a40549938",
"name": "Angie, AI Assistant",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
704,
80
],
"typeVersion": 3.1
},
{
"parameters": {
"options": {}
},
"id": "03a33ec8-b4f0-4e98-9fe6-616bda6b5a41",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
448,
304
],
"typeVersion": 1
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "angie_session_default",
"contextWindowLength": 10
},
"id": "9b74e818-3241-4e65-beec-063ce2be804d",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
576,
304
],
"typeVersion": 1.3
},
{
"parameters": {
"databaseId": 146496,
"tableId": 372174,
"additionalOptions": {}
},
"id": "6e15db3c-0e61-4b44-b002-351dd739398b",
"name": "Tasks",
"type": "n8n-nodes-base.baserowTool",
"position": [
704,
304
],
"typeVersion": 1
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Useful for getting contact information. For example emails or phone numbers.",
"databaseId": 146496,
"tableId": 372177,
"additionalOptions": {}
},
"id": "5566f43b-eb18-4bc8-9ba9-f3fc466253e8",
"name": "Contacts",
"type": "n8n-nodes-base.baserowTool",
"position": [
832,
304
],
"typeVersion": 1
},
{
"parameters": {
"operation": "getAll",
"calendar": {
"__rl": true,
"mode": "list",
"value": "user@example.com"
},
"options": {
"timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('date', 'the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS') }}",
"fields": "=items(summary, start(dateTime))"
}
},
"id": "bf450ea8-0144-4cf6-bb99-3d479b37063b",
"name": "Google Calendar",
"type": "n8n-nodes-base.googleCalendarTool",
"position": [
960,
304
],
"typeVersion": 1.1
},
{
"parameters": {
"chatId": "={{ $('Listen for incoming events').first().json.message.from.id }}",
"text": "={{ $json.output }}",
"additionalFields": {
"appendAttribution": false,
"parse_mode": "Markdown"
}
},
"id": "e9cf83cb-b0f3-4309-96a9-e081d9c329e6",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
1296,
80
],
"webhookId": "40027a52-0dce-4542-a6ec-496040e9d094",
"typeVersion": 1.1
},
{
"parameters": {
"operation": "getAll",
"filters": {}
},
"id": "7b64557f-b030-4e62-ab52-f39abeb2794e",
"name": "Get many messages in Gmail",
"type": "n8n-nodes-base.gmailTool",
"position": [
1088,
304
],
"webhookId": "48dd8198-8fd5-4cfc-897c-72cbc15d319f",
"typeVersion": 2.2
}
],
"connections": {
"Listen for incoming events": {
"main": [
[
{
"node": "AllowList",
"type": "main",
"index": 0
}
]
]
},
"AllowList": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Voice or Text",
"type": "main",
"index": 0
}
]
]
},
"Voice or Text": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "Get Voice File",
"type": "main",
"index": 0
}
],
[
{
"node": "Angie, AI Assistant",
"type": "main",
"index": 0
}
]
]
},
"Get Voice File": {
"main": [
[
{
"node": "Speech to Text",
"type": "main",
"index": 0
}
]
]
},
"Speech to Text": {
"main": [
[
{
"node": "Angie, AI Assistant",
"type": "main",
"index": 0
}
]
]
},
"Angie, AI Assistant": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Angie, AI Assistant",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Angie, AI Assistant",
"type": "ai_memory",
"index": 0
}
]
]
},
"Tasks": {
"ai_tool": [
[
{
"node": "Angie, AI Assistant",
"type": "ai_tool",
"index": 0
}
]
]
},
"Contacts": {
"ai_tool": [
[
{
"node": "Angie, AI Assistant",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Calendar": {
"ai_tool": [
[
{
"node": "Angie, AI Assistant",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get many messages in Gmail": {
"ai_tool": [
[
{
"node": "Angie, AI Assistant",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "48f9007a4d0e1a91936b441574a682e3216460c6ca816348665f2c35d7390c3f"
}
}