categorize files
This commit is contained in:
3777
Other_Integrations_and_Use_Cases/API Schema Extractor.txt
Normal file
3777
Other_Integrations_and_Use_Cases/API Schema Extractor.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"id": "133",
|
||||
"name": "Analyze the sentiment of feedback and send a message on Mattermost",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Typeform Trigger",
|
||||
"type": "n8n-nodes-base.typeformTrigger",
|
||||
"position": [
|
||||
510,
|
||||
260
|
||||
],
|
||||
"webhookId": "ad8a87ef-d293-4e48-8d36-838d69ebce0f",
|
||||
"parameters": {
|
||||
"formId": ""
|
||||
},
|
||||
"credentials": {
|
||||
"typeformApi": "typeform"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Cloud Natural Language",
|
||||
"type": "n8n-nodes-base.googleCloudNaturalLanguage",
|
||||
"position": [
|
||||
710,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"content": "={{$node[\"Typeform Trigger\"].json[\"What did you think about the event?\"]}}",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCloudNaturalLanguageOAuth2Api": "cloud"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
910,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$node[\"Google Cloud Natural Language\"].json[\"documentSentiment\"][\"score\"]}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Mattermost",
|
||||
"type": "n8n-nodes-base.mattermost",
|
||||
"position": [
|
||||
1110,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"message": "=You got a new feedback with a score of {{$node[\"Google Cloud Natural Language\"].json[\"documentSentiment\"][\"score\"]}}. Here is what it says:{{$node[\"Typeform Trigger\"].json[\"What did you think about the event?\"]}}",
|
||||
"channelId": "4h1bz64cyifwxnzojkzh8hxh4a",
|
||||
"attachments": [],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"mattermostApi": "mattermost"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "NoOp",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
1110,
|
||||
360
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Mattermost",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "NoOp",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Typeform Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Cloud Natural Language",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Cloud Natural Language": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Mattermost",
|
||||
"type": "n8n-nodes-base.mattermost",
|
||||
"position": [
|
||||
810,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"message": "=You got new feedback with a score of {{$json[\"SentimentScore\"][\"Negative\"]}}. Here is what it says:{{$node[\"Typeform Trigger\"].json[\"What did you think about the event?\"]}}",
|
||||
"channelId": "h7cxrd1cefr13x689enzyw7xhc",
|
||||
"attachments": [],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"mattermostApi": "Mattermost Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "NoOp",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
800,
|
||||
500
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
600,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [],
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{$json[\"Sentiment\"]}}",
|
||||
"value2": "NEGATIVE"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "AWS Comprehend",
|
||||
"type": "n8n-nodes-base.awsComprehend",
|
||||
"position": [
|
||||
400,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{$json[\"What did you think about the event?\"]}}",
|
||||
"operation": "detectSentiment"
|
||||
},
|
||||
"credentials": {
|
||||
"aws": "AWS Comprehend Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Typeform Trigger",
|
||||
"type": "n8n-nodes-base.typeformTrigger",
|
||||
"position": [
|
||||
200,
|
||||
400
|
||||
],
|
||||
"webhookId": "ad8a87ef-d293-4e48-8d36-838d69ebce0f",
|
||||
"parameters": {
|
||||
"formId": "DuJHEGW5"
|
||||
},
|
||||
"credentials": {
|
||||
"typeformApi": "typeform"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Mattermost",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "NoOp",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AWS Comprehend": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Typeform Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AWS Comprehend",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,527 @@
|
||||
{
|
||||
"id": "gP9EsxKN5agUGzDS",
|
||||
"meta": {
|
||||
"instanceId": "73d9d5380db181d01f4e26492c771d4cb5c4d6d109f18e2621cf49cac4c50763",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Automate Pinterest Analysis & AI-Powered Content Suggestions With Pinterest API",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "7f582bb4-97cd-458e-a7b7-b518c5b8a4ca",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
540,
|
||||
-260
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "95QGJD3XSz0piaNU",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "c6772882-468c-4391-a259-93e52daf49d4",
|
||||
"name": "Airtable2",
|
||||
"type": "n8n-nodes-base.airtableTool",
|
||||
"position": [
|
||||
700,
|
||||
-260
|
||||
],
|
||||
"parameters": {
|
||||
"id": "=",
|
||||
"base": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "appfsNi1QEhw6WvXK",
|
||||
"cachedResultUrl": "https://airtable.com/appfsNi1QEhw6WvXK",
|
||||
"cachedResultName": "Pinterest_Metrics"
|
||||
},
|
||||
"table": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "tbl9Dxdrwx5QZGFnp",
|
||||
"cachedResultUrl": "https://airtable.com/appfsNi1QEhw6WvXK/tbl9Dxdrwx5QZGFnp",
|
||||
"cachedResultName": "Pinterest_Organic_Data"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"airtableTokenApi": {
|
||||
"id": "0ApVmNsLu7aFzQD6",
|
||||
"name": "Airtable Personal Access Token account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "85ea8bec-14c8-4277-b2e3-eb145db0713a",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
920,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "95QGJD3XSz0piaNU",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "b8f7d0d6-b58f-4a41-a15d-99f4d838bb8c",
|
||||
"name": "8:00am Morning Scheduled Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
-660,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"daysInterval": 7,
|
||||
"triggerAtHour": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "593a320d-825e-42f9-8ab6-adafd5288fa5",
|
||||
"name": "Pull List of Pinterest Pins From Account",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-340,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.pinterest.com/v5/pins",
|
||||
"options": {
|
||||
"redirect": {
|
||||
"redirect": {}
|
||||
}
|
||||
},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"value": "Bearer "
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "1e6d00fe-2b32-4d46-a230-063254ebab74",
|
||||
"name": "Update Data Field To Include Organic",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
-20,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Initialize an array to hold the output formatted for Airtable\nconst outputItems = [];\n\nfor (const item of $input.all()) {\n if (item.json.items && Array.isArray(item.json.items)) {\n for (const subItem of item.json.items) {\n // Construct an object with only the required fields for Airtable\n outputItems.push({\n id: subItem.id || null,\n created_at: subItem.created_at || null,\n title: subItem.title || null,\n description: subItem.description || null,\n link: subItem.link || null,\n type: \"Organic\" // Assign the value \"Organic\" to the 'Type' field\n });\n }\n }\n}\n\n// Return the structured output\nreturn outputItems;\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "539de144-dc67-4b14-b58e-2896edb1c3e6",
|
||||
"name": "Create Record Within Pinterest Data Table",
|
||||
"type": "n8n-nodes-base.airtable",
|
||||
"position": [
|
||||
260,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"base": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "appfsNi1QEhw6WvXK",
|
||||
"cachedResultUrl": "https://airtable.com/appfsNi1QEhw6WvXK",
|
||||
"cachedResultName": "Pinterest_Metrics"
|
||||
},
|
||||
"table": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "tbl9Dxdrwx5QZGFnp",
|
||||
"cachedResultUrl": "https://airtable.com/appfsNi1QEhw6WvXK/tbl9Dxdrwx5QZGFnp",
|
||||
"cachedResultName": "Pinterest_Organic_Data"
|
||||
},
|
||||
"columns": {
|
||||
"value": {
|
||||
"link": "={{ $json.link }}",
|
||||
"type": "={{ $json.type }}",
|
||||
"title": "={{ $json.title }}",
|
||||
"pin_id": "={{ $json.id }}",
|
||||
"created_at": "={{ $json.created_at }}",
|
||||
"description": "={{ $json.description }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "id",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": true,
|
||||
"required": false,
|
||||
"displayName": "id",
|
||||
"defaultMatch": true
|
||||
},
|
||||
{
|
||||
"id": "pin_id",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "pin_id",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "created_at",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "created_at",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "title",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "title",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "description",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "description",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "link",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "link",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "type",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "type",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "active7DayUsers",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": true,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "active7DayUsers",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "sessions",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": true,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "sessions",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "userEngagementDuration",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": true,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "userEngagementDuration",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [
|
||||
"id"
|
||||
],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {},
|
||||
"operation": "upsert"
|
||||
},
|
||||
"credentials": {
|
||||
"airtableTokenApi": {
|
||||
"id": "0ApVmNsLu7aFzQD6",
|
||||
"name": "Airtable Personal Access Token account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "250f5121-437e-4bff-82af-95a156126127",
|
||||
"name": "Pinterest Analysis AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
540,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"text": "You are a data analysis expert. You will pull data from the table and provide any information in regards to trends in the data. \n\nYour output should be suggestions of new pins that we can post to reach the target audiences. \n\nAnalyze the data and just summary of the pin suggestions that the team should build. ",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "181e9d89-c0f9-4de2-bdce-9359b967157c",
|
||||
"name": "Pinterest Data Analysis Summary LLM",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
|
||||
"position": [
|
||||
900,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"summarizationMethodAndPrompts": {
|
||||
"values": {
|
||||
"prompt": "=Write a concise summary of the following:\n\n\n\"{{ $json.output }}\"\n\n\nCONCISE SUMMARY:"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "432e7bd7-36b4-4903-8e93-c8bd6e140a04",
|
||||
"name": "Send Marketing Trends & Pinterest Analysis To Marketing Manager",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
1220,
|
||||
-440
|
||||
],
|
||||
"webhookId": "f149c1b5-c028-4dff-9d22-a72951f2ef91",
|
||||
"parameters": {
|
||||
"sendTo": "john.n.foster1@gmail.com",
|
||||
"message": "={{ $json.response.text }}",
|
||||
"options": {},
|
||||
"subject": "Pinterest Trends & Suggestions"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "pIXP1ZseBP4Z5CCp",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"executeOnce": true,
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "dadfb22a-b1d3-459d-a332-5a2c52fd4ca0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-740,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 280,
|
||||
"height": 440,
|
||||
"content": "Scheduled trigger at 8:00am to start the workflow. \n\nThis can be updated to your schedule preference as an email with marketing trends can be sent to best fit one's schedule. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3b156d97-11bf-4d8a-9bd9-c1e23a0592d8",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-420,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 860,
|
||||
"height": 360,
|
||||
"content": "Scheduled trigger begin process to gather Pinterest Pin data and store them within Airtable. This data can be referenced or analyzed accordingly. \n\n*If you would like to bring in Pinterest Ads data, the data is already labeled as Organic.\n\nThis is perfect for those who are creating content calendars to understand content scheduling."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "65586422-a631-477b-833d-5c445b1be744",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
480,
|
||||
-580
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 940,
|
||||
"height": 460,
|
||||
"content": "AI Agent will go through Pinterest Pins and analyze any data and trends to be able to reach target audience. The data is then summarized within the Summary LLM.\n\nThe summarized results are then sent to the Marketing Manager within an email to help lead content creation efforts. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d6f64ee7-ae49-4a6b-8bf8-9a709c580357",
|
||||
"connections": {
|
||||
"Airtable2": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Pinterest Analysis AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Pinterest Analysis AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Pinterest Data Analysis Summary LLM",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pinterest Analysis AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Pinterest Data Analysis Summary LLM",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"8:00am Morning Scheduled Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Pull List of Pinterest Pins From Account",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pinterest Data Analysis Summary LLM": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Marketing Trends & Pinterest Analysis To Marketing Manager",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Update Data Field To Include Organic": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create Record Within Pinterest Data Table",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Pinterest Analysis AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pull List of Pinterest Pins From Account": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Update Data Field To Include Organic",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,743 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "86ddd018-3d6b-46b9-aa93-dedd6c6b5076",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-880,
|
||||
360
|
||||
],
|
||||
"webhookId": "a9668bb8-bbe8-418a-b5c9-ff7dd431244f",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a5ba5090-8e3b-4408-82df-92d2c524039e",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-680,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\n1. Extract TTP information from SIEM data.\n2. Provide actionable remediation steps tailored to the alert.\n3. Cross-reference historical patterns and related alerts.\n4. Recommend external resources for deeper understanding.\n\nEnsure that:\n- TTPs are tagged with the tactic, technique name, and technique ID.\n- Remediation steps are specific and actionable.\n- Historical data includes related alerts and notable trends.\n- External links are relevant to the observed behavior.\n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "67c52944-b616-4ea6-9507-e9fb6fcdbe2b",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-740,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "QpFZ2EiM3WGl6Zr3",
|
||||
"name": "Marketing OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "55f6c16a-51ed-45e4-a1ab-aaaf1d7b5733",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
-720,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "46a5b8c6-3d34-4e9b-b812-23135f28c278",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-580,
|
||||
1420
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "QpFZ2EiM3WGl6Zr3",
|
||||
"name": "Marketing OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "561b0737-26d5-450d-bd9e-08e0a608d6f9",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
-460,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "id",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"value": "={{ $json.name }}"
|
||||
},
|
||||
{
|
||||
"name": "killchain",
|
||||
"value": "={{ $json.kill_chain_phases }}"
|
||||
},
|
||||
{
|
||||
"name": "external",
|
||||
"value": "={{ $json.external_references }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"jsonData": "={{ $json.description }}",
|
||||
"jsonMode": "expressionData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6e8a4aed-7e8c-492a-b816-6ab1a98c312a",
|
||||
"name": "Token Splitter1",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
|
||||
"position": [
|
||||
-460,
|
||||
1620
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0c54049e-b5e8-448f-b864-39aeb274de3e",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
-580,
|
||||
580
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "96b776a0-10da-4f70-99d0-ad6b6ee8fcca",
|
||||
"name": "Embeddings OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-460,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"model": "text-embedding-3-large",
|
||||
"options": {
|
||||
"dimensions": 1536
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "QpFZ2EiM3WGl6Zr3",
|
||||
"name": "Marketing OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "695fba89-8f42-47c3-9d86-73f4ea0e72df",
|
||||
"name": "Extract from File",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
-920,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "fromJson"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0b9897b0-149b-43ce-b66c-e78552729aa5",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-1360,
|
||||
1220
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d8c29a14-0389-4748-a9de-686bf9a682c5",
|
||||
"name": "AI Agent1",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-540,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Siem Alert Data:\nAlert: {{ $json.raw_subject }}\nDescription: {{ $json.description }}",
|
||||
"options": {
|
||||
"systemMessage": "You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\n1. Extract TTP information from SIEM data.\n2. Provide actionable remediation steps tailored to the alert.\n3. Cross-reference historical patterns and related alerts.\n4. Recommend external resources for deeper understanding.\n\nEnsure that:\n- TTPs are tagged with the tactic, technique name, and technique ID.\n- Remediation steps are specific and actionable.\n- Historical data includes related alerts and notable trends.\n- External links are relevant to the observed behavior.\n\nPlease output your response in html format, but do not include ```html at the beginning \n"
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "55d0b00a-5046-45fa-87cb-cb0257caae87",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-600,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "QpFZ2EiM3WGl6Zr3",
|
||||
"name": "Marketing OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9b53566b-e021-403d-9d78-28504c5c1dfa",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-320,
|
||||
-40
|
||||
],
|
||||
"parameters": {
|
||||
"model": "text-embedding-3-large",
|
||||
"options": {
|
||||
"dimensions": 1536
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "QpFZ2EiM3WGl6Zr3",
|
||||
"name": "Marketing OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "f3b44ef5-e928-4662-81ef-4dd044829607",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
-940,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "cc572b71-65c9-460c-bdcd-1d20feb15b32",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1460,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1380,
|
||||
"height": 820,
|
||||
"content": "\n## Embed your Vector Store\nTo provide data for your Vector store, you need to pass it in as JSON, and ensure it's setup correctly. This flow pulls the JSON file from Google Drive and extracts the JSON data and then passes it into the qdrant collection. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d5052d52-bec2-4b70-b460-6d5789c28d2c",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1460,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1380,
|
||||
"height": 680,
|
||||
"content": "\n## Talk to your Vector Store\nNow that your vector store has been updated with the embedded data, \nyou can use the n8n chat interface to talk to your data using OpenAI, \nOllama, or any of our supported LLMs."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5cb478f6-17f3-4d7a-9b66-9e0654bd1dc9",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1460,
|
||||
-700
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 2140,
|
||||
"height": 900,
|
||||
"content": "\n## Deploy your Vector Store\nThis flow adds contextual information to your tickets using the Mitre Attack framework to help contextualize the ticket data."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "71ee28f5-84a2-4c6c-855a-6c7c09b2d62a",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
0,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchemaExample": "{\n \"ttp_identification\": {\n \"alert_summary\": \"The alert indicates a check-in from the NetSupport RAT, a known Remote Access Trojan, suggesting command and control (C2) communication.\",\n \"mitre_attack_ttps\": [\n {\n \"tactic\": \"Command and Control\",\n \"technique\": \"Protocol or Service Impersonation\",\n \"technique_id\": \"T1001.003\",\n \"description\": \"The RAT's check-in over port 443 implies potential masquerading of its traffic as legitimate SSL/TLS traffic, a tactic often used to blend C2 communications with normal web traffic.\",\n \"reference\": \"https://attack.mitre.org/techniques/T1001/003/\"\n }\n ]\n },\n \"remediation_steps\": {\n \"network_segmentation\": {\n \"action\": \"Isolate the affected host\",\n \"target\": \"10.11.26.183\",\n \"reason\": \"Prevents further C2 communication or lateral movement.\"\n },\n \"endpoint_inspection\": {\n \"action\": \"Perform a thorough inspection\",\n \"target\": \"Impacted endpoint\",\n \"method\": \"Use endpoint detection and response (EDR) tools to check for additional persistence mechanisms.\"\n },\n \"network_traffic_analysis\": {\n \"action\": \"Investigate and block unusual traffic\",\n \"target\": \"IP 194.180.191.64\",\n \"method\": \"Implement blocks for the IP across the firewall or IDS/IPS systems.\"\n },\n \"system_patching\": {\n \"action\": \"Ensure all systems are updated\",\n \"method\": \"Apply the latest security patches to mitigate vulnerabilities exploited by RAT malware.\"\n },\n \"ioc_hunting\": {\n \"action\": \"Search for Indicators of Compromise (IoCs)\",\n \"method\": \"Check for NetSupport RAT IoCs across other endpoints within the network.\"\n }\n },\n \"historical_patterns\": {\n \"network_anomalies\": \"Past alerts involving similar attempts to use standard web ports (e.g., 80, 443) for non-standard applications could suggest a broader attempt to blend malicious traffic into legitimate streams.\",\n \"persistence_tactics\": \"Any detection of anomalies in task scheduling or shortcut modifications may indicate persistence methods similar to those used by RATs.\"\n },\n \"external_resources\": [\n {\n \"title\": \"ESET Report on Okrum and Ketrican\",\n \"description\": \"Discusses similar tactics involving protocol impersonation and C2.\",\n \"url\": \"https://www.eset.com/int/about/newsroom/research/okrum-ketrican/\"\n },\n {\n \"title\": \"Malleable C2 Profiles\",\n \"description\": \"Document on crafting custom C2 traffic profiles similar to the targeting methods used by NetSupport RAT.\",\n \"url\": \"https://www.cobaltstrike.com/help-malleable-c2\"\n },\n {\n \"title\": \"MITRE ATT&CK Technique Overview\",\n \"description\": \"Overview of Protocol or Service Impersonation tactics.\",\n \"url\": \"https://attack.mitre.org/techniques/T1001/003/\"\n }\n ]\n}\n"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "3aeb973d-22e5-4eaf-8fe8-fae3447909e1",
|
||||
"name": "Pull Mitre Data From Gdrive",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-1140,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d",
|
||||
"cachedResultUrl": "https://drive.google.com/file/d/1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d/view?usp=drivesdk",
|
||||
"cachedResultName": "cleaned_mitre_attack_data.json"
|
||||
},
|
||||
"options": {},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "AVa7MXBLiB9NYjuO",
|
||||
"name": "Angel Gdrive"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "3b35633c-de80-4062-8497-cb65092d5708",
|
||||
"name": "Embed JSON in Qdrant Collection",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-520,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "mitre"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "u0qre50aar6iqyxu",
|
||||
"name": "Angel MitreAttack Demo Cluster"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5f7f2fd8-276f-4b3a-ae88-1f1765967883",
|
||||
"name": "Query Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-480,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "retrieve-as-tool",
|
||||
"options": {},
|
||||
"toolName": "mitre_attack_vector_store",
|
||||
"toolDescription": "The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\n\nBy analyzing input text, the vector store can:\n\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\nProvide structured context about potential adversary behaviors.\nSuggest remediation actions or detection methods based on the input.",
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "mitre",
|
||||
"cachedResultName": "mitre"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "u0qre50aar6iqyxu",
|
||||
"name": "Angel MitreAttack Demo Cluster"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "298ffc29-1d60-4c05-92c6-a61071629a3f",
|
||||
"name": "Qdrant Vector Store query",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-320,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "retrieve-as-tool",
|
||||
"options": {},
|
||||
"toolName": "mitre_attack_vector_store",
|
||||
"toolDescription": "The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\n\nBy analyzing input text, the vector store can:\n\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\nProvide structured context about potential adversary behaviors.\nSuggest remediation actions or detection methods based on the input.",
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "mitre",
|
||||
"cachedResultName": "mitre"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "u0qre50aar6iqyxu",
|
||||
"name": "Angel MitreAttack Demo Cluster"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c47f0ae6-106d-46da-afc3-f7afb86923ff",
|
||||
"name": "Get all Zendesk Tickets",
|
||||
"type": "n8n-nodes-base.zendesk",
|
||||
"position": [
|
||||
-1180,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "getAll"
|
||||
},
|
||||
"credentials": {
|
||||
"zendeskApi": {
|
||||
"id": "ROx0ipJapRomRxEX",
|
||||
"name": "Zendesk Demo Access"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0ec2c505-5721-41af-91c8-1b0b55826d9e",
|
||||
"name": "Update Zendesk with Mitre Data",
|
||||
"type": "n8n-nodes-base.zendesk",
|
||||
"position": [
|
||||
0,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"id": "={{ $('Loop Over Items').item.json.id }}",
|
||||
"operation": "update",
|
||||
"updateFields": {
|
||||
"internalNote": "=Summary: {{ $json.output.ttp_identification.alert_summary }}\n\n",
|
||||
"customFieldsUi": {
|
||||
"customFieldsValues": [
|
||||
{
|
||||
"id": 34479547176212,
|
||||
"value": "={{ $json.output.ttp_identification.mitre_attack_ttps[0].technique_id }}"
|
||||
},
|
||||
{
|
||||
"id": 34479570659732,
|
||||
"value": "={{ $json.output.ttp_identification.mitre_attack_ttps[0].tactic }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"zendeskApi": {
|
||||
"id": "ROx0ipJapRomRxEX",
|
||||
"name": "Zendesk Demo Access"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6a74a6d4-610a-4a13-afe4-7bb03d83d4c8",
|
||||
"name": "Move on to next ticket",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
360,
|
||||
-80
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"AI Agent1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Update Zendesk with Mitre Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Embed JSON in Qdrant Collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
[],
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Token Splitter1": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store query",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract from File": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Embed JSON in Qdrant Collection",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI2": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Query Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Embed JSON in Qdrant Collection",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Move on to next ticket": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get all Zendesk Tickets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Query Qdrant Vector Store": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pull Mitre Data From Gdrive": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Extract from File",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Update Zendesk with Mitre Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Move on to next ticket",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Pull Mitre Data From Gdrive",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
{
|
||||
"id": "wDD4XugmHIvx3KMT",
|
||||
"meta": {
|
||||
"instanceId": "149cdf730f0c143663259ddc6124c9c26e824d8d2d059973b871074cf4bda531"
|
||||
},
|
||||
"name": "Analyze Screenshots with AI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "6d7f34b8-6203-4512-a428-7b5a18c63db6",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
240,
|
||||
1100
|
||||
],
|
||||
"parameters": {
|
||||
"width": 373.2796418305297,
|
||||
"height": 381.1230421279239,
|
||||
"content": "## Setup \n**For Testing use the Setup node to put in test name & url.**\n\nIf you want to use this workflow in production, you can expand it to load data from other sources like a DB or Google Sheet"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ae568c65-e8f6-45bb-9c96-a870da1fc7d6",
|
||||
"name": "Setup",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
360,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "website_name",
|
||||
"value": "=n8n"
|
||||
},
|
||||
{
|
||||
"name": "url",
|
||||
"value": "https://n8n.io/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "ca9f0357-a596-4453-b351-fdd8d47c81ad",
|
||||
"name": "URLbox API Request",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
780,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.urlbox.io/v1/render/sync",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "url",
|
||||
"value": "={{ $json.url }}"
|
||||
},
|
||||
{
|
||||
"name": "full_page",
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"value": "YOUR_API_KEY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"retryOnFail": true,
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "3caffa3c-657a-4f74-a3cb-daf7beb67890",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
640,
|
||||
920
|
||||
],
|
||||
"parameters": {
|
||||
"width": 373.2796418305297,
|
||||
"height": 381.1230421279239,
|
||||
"content": "## URLbox API call \n[URLbox](https://urlbox.com/) is a Screenshot API. With this API you can automate making screenshots based on website url's.\n\nYou have to replace the Placeholder with your API Key"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d2b81b41-1497-4733-8130-67f8de0acff4",
|
||||
"name": "Analyze the Screenshot",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1220,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Your Input is a Screenshot of a Website.\nDescribe the content of the Website in one sentence.",
|
||||
"options": {},
|
||||
"resource": "image",
|
||||
"imageUrls": "renderURL",
|
||||
"operation": "analyze"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "68d86931-69bb-4b78-a7fe-44969172672f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1080,
|
||||
920
|
||||
],
|
||||
"parameters": {
|
||||
"width": 373.2796418305297,
|
||||
"height": 381.1230421279239,
|
||||
"content": "## Analyze the Screenshot \nAnalyze the screenshot using OpenAI.\n\nAdd your OpenAI Credentials on the top of the node.\n\nThe prompt is an example. Change it based on what you want to extract from the screenshot."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8a22fca5-7f06-45fb-a03f-585a7eb35b40",
|
||||
"name": "Merge Name & Description",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1620,
|
||||
1300
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combinationMode": "mergeByPosition"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "4f902a0a-ee93-4190-9b1e-ab3fa15eb4aa",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1480,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"width": 371.85912137154685,
|
||||
"height": 300.15337596590155,
|
||||
"content": "## Merge\nMerge the description with the name of the website & the url."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8b3eb3f4-b31a-48f0-94bb-35379d07a81f",
|
||||
"name": "Manual Execution",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
20,
|
||||
1320
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "ff37faa1-c61c-44be-89f0-62f8e1b8317c",
|
||||
"connections": {
|
||||
"Setup": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "URLbox API Request",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge Name & Description",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Manual Execution": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Setup",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"URLbox API Request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Analyze the Screenshot",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Analyze the Screenshot": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Name & Description",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,435 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Simplify Result",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
680,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "Content",
|
||||
"value": "={{$json[\"full_text\"].replace(/(?:https?|ftp):\\/\\/[\\n\\S]+/g, '')}}"
|
||||
},
|
||||
{
|
||||
"name": "Author",
|
||||
"value": "={{$json[\"user\"][\"name\"]}} (@{{$json[\"user\"][\"screen_name\"]}})"
|
||||
},
|
||||
{
|
||||
"name": "Created",
|
||||
"value": "={{new Date($json[\"created_at\"]).toISOString()}}"
|
||||
},
|
||||
{
|
||||
"name": "URL",
|
||||
"value": "=https://twitter.com/{{$json[\"user\"][\"screen_name\"]}}/status/{{$json[\"id_str\"]}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"keepOnlySet": true
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Store in Strapi",
|
||||
"type": "n8n-nodes-base.strapi",
|
||||
"position": [
|
||||
1780,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"columns": "Content,Author,Created,URL",
|
||||
"operation": "create",
|
||||
"contentType": "posts"
|
||||
},
|
||||
"credentials": {
|
||||
"strapiApi": {
|
||||
"id": "136",
|
||||
"name": "Strapi Demo"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Every 30 Minutes",
|
||||
"type": "n8n-nodes-base.interval",
|
||||
"position": [
|
||||
240,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"unit": "minutes",
|
||||
"interval": 30
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Is Retweet or Old?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
900,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{$json[\"Content\"]}}",
|
||||
"value2": "RT @",
|
||||
"operation": "startsWith"
|
||||
}
|
||||
],
|
||||
"dateTime": [
|
||||
{
|
||||
"value1": "={{$json[\"Created\"]}}",
|
||||
"value2": "={{new Date(new Date().getTime() - 30 * 60 * 1000)}}",
|
||||
"operation": "before"
|
||||
}
|
||||
]
|
||||
},
|
||||
"combineOperation": "any"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Search Tweets",
|
||||
"type": "n8n-nodes-base.twitter",
|
||||
"position": [
|
||||
460,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "search",
|
||||
"searchText": "(strapi OR n8n.io) AND lang:en",
|
||||
"additionalFields": {
|
||||
"tweetMode": "extended",
|
||||
"resultType": "recent"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"twitterOAuth1Api": {
|
||||
"id": "15",
|
||||
"name": "@MutedJam"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
240,
|
||||
-120
|
||||
],
|
||||
"webhookId": "6f833370-9068-44ef-8e56-4ceb563a851e",
|
||||
"parameters": {
|
||||
"path": "6f833370-9068-44ef-8e56-4ceb563a851e",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Simplify Webhook Result",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
460,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "Content",
|
||||
"value": "={{$json[\"body\"][\"data\"][\"fields\"][1][\"value\"]}}"
|
||||
},
|
||||
{
|
||||
"name": "Author",
|
||||
"value": "={{$json[\"body\"][\"data\"][\"fields\"][0][\"value\"]}}"
|
||||
},
|
||||
{
|
||||
"name": "Created",
|
||||
"value": "={{new Date().toISOString()}}"
|
||||
},
|
||||
{
|
||||
"name": "URL"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"keepOnlySet": true
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Analyze Form Submission",
|
||||
"type": "n8n-nodes-base.googleCloudNaturalLanguage",
|
||||
"position": [
|
||||
680,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"content": "={{$json[\"Content\"]}}",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCloudNaturalLanguageOAuth2Api": {
|
||||
"id": "138",
|
||||
"name": "Google Cloud Natural Language account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Analyze Tweet",
|
||||
"type": "n8n-nodes-base.googleCloudNaturalLanguage",
|
||||
"position": [
|
||||
1120,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"content": "={{$json[\"Content\"]}}",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCloudNaturalLanguageOAuth2Api": {
|
||||
"id": "138",
|
||||
"name": "Google Cloud Natural Language account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Merge Form Sentiment with Source",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
900,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "mergeByIndex"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Merge Tweet Sentiment with Source",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1340,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "mergeByIndex"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Positive Form Sentiment?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1120,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$json[\"documentSentiment\"][\"score\"]}}",
|
||||
"value2": 0.4,
|
||||
"operation": "larger"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Store Form Submission in Strapi",
|
||||
"type": "n8n-nodes-base.strapi",
|
||||
"position": [
|
||||
1340,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"columns": "Content,Author,Created,URL",
|
||||
"operation": "create",
|
||||
"contentType": "posts"
|
||||
},
|
||||
"credentials": {
|
||||
"strapiApi": {
|
||||
"id": "136",
|
||||
"name": "Strapi Demo"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Positive Tweet Sentiment?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1560,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$json[\"documentSentiment\"][\"score\"]}}",
|
||||
"value2": 0.3,
|
||||
"operation": "larger"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify Webhook Result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Analyze Tweet": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Tweet Sentiment with Source",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Search Tweets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify Result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify Result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Is Retweet or Old?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Every 30 Minutes": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Search Tweets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Is Retweet or Old?": {
|
||||
"main": [
|
||||
null,
|
||||
[
|
||||
{
|
||||
"node": "Analyze Tweet",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge Tweet Sentiment with Source",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Analyze Form Submission": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Form Sentiment with Source",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify Webhook Result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Analyze Form Submission",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge Form Sentiment with Source",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Positive Form Sentiment?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Store Form Submission in Strapi",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Positive Tweet Sentiment?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Store in Strapi",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Form Sentiment with Source": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Positive Form Sentiment?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Tweet Sentiment with Source": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Positive Tweet Sentiment?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,710 @@
|
||||
{
|
||||
"id": "cmGsNvW9bEORABdo",
|
||||
"meta": {
|
||||
"instanceId": "15c09ee9508dd818e298e675375571ba4b871bbb8c420fd01ac9ed7c58622669"
|
||||
},
|
||||
"name": "Bitrix24 Chatbot Application Workflow example with Webhook Integration",
|
||||
"tags": [
|
||||
{
|
||||
"id": "5YZ9E6AmGZn6WTMa",
|
||||
"name": "Tech demo",
|
||||
"createdAt": "2024-12-28T09:13:02.965Z",
|
||||
"updatedAt": "2024-12-28T09:13:02.965Z"
|
||||
},
|
||||
{
|
||||
"id": "hEvnK1kMYTPrL3vs",
|
||||
"name": "Bitrix24",
|
||||
"createdAt": "2025-01-04T16:12:36.741Z",
|
||||
"updatedAt": "2025-01-04T16:12:36.741Z"
|
||||
},
|
||||
{
|
||||
"id": "yKS9RGKLuFUhYFIE",
|
||||
"name": "Chatbot",
|
||||
"createdAt": "2025-01-04T16:12:36.757Z",
|
||||
"updatedAt": "2025-01-04T16:12:36.757Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ddd802bb-0da0-474d-b1e9-74f247e603e0",
|
||||
"name": "Bitrix24 Handler",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"webhookId": "c3ae607d-41f0-42bc-b669-c2c77936d443",
|
||||
"parameters": {
|
||||
"path": "bitrix24/handler.php",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5676a53e-6758-4ad5-ace6-e494fa10b6c3",
|
||||
"name": "Credentials",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
200,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "030f8f90-2669-4c20-9eab-c572c4b7c70c",
|
||||
"name": "CLIENT_ID",
|
||||
"type": "string",
|
||||
"value": "local.6779636e712043.37129431"
|
||||
},
|
||||
{
|
||||
"id": "de9bbb7a-b782-4540-b259-527625db8490",
|
||||
"name": "CLIENT_SECRET",
|
||||
"type": "string",
|
||||
"value": "dTzUfBoTFLxNhuzc1zsnDbCeii98ZaE5By4aQPQEOxLJAS9y6i"
|
||||
},
|
||||
{
|
||||
"id": "86b7aff7-1e25-4b12-a366-23cf34e5a405",
|
||||
"name": "application_token",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body['auth[application_token]'] }}"
|
||||
},
|
||||
{
|
||||
"id": "69bbcb1f-ba6e-42eb-be8a-ee0707ce997d",
|
||||
"name": "domain",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body['auth[domain]'] }}\n"
|
||||
},
|
||||
{
|
||||
"id": "dc1b0515-f06a-4731-b0dc-912a8d04e56b",
|
||||
"name": "access_token",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body['auth[access_token]'] }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"includeOtherFields": true
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "b72c00cf-9f8c-4c2a-9093-b80d82bab85b",
|
||||
"name": "Validate Token",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
400,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "or",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "da73d0ba-6eeb-405e-89fe-9d041fd2e0cd",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.CLIENT_ID }}",
|
||||
"rightValue": "={{ $json.application_token }}"
|
||||
},
|
||||
{
|
||||
"id": "4ba90f7b-0299-4097-9ae7-6e4dee428a74",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "1",
|
||||
"rightValue": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "f0feb392-873a-4643-b7ad-0e6d9f877e82",
|
||||
"name": "Route Event",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
600,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "ONIMBOTMESSAGEADD",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.event }}",
|
||||
"rightValue": "ONIMBOTMESSAGEADD"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "ONIMBOTJOINCHAT",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "e9125f57-129e-4026-86ff-746d40b92b04",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.event }}",
|
||||
"rightValue": "ONIMBOTJOINCHAT"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "ONAPPINSTALL",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "2db7bed5-fd88-4900-b8d2-e27b49c2fcca",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.event }}",
|
||||
"rightValue": "ONAPPINSTALL"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "ONIMBOTDELETE",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "b708d339-fd46-470d-b0d5-ff2eb405f5ce",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.event }}",
|
||||
"rightValue": "ONIMBOTDELETE"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "56fcdc5f-d509-4c9f-a437-79c53add49f8",
|
||||
"name": "Process Message",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
800,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "// Process Message Node\nconst items = $input.all();\nconst item = items[0];\n\n// Get message data from the correct path\nconst message = item.json.body['data[PARAMS][MESSAGE]'];\nconst dialogId = item.json.body['data[PARAMS][DIALOG_ID]'];\n\n// Get auth data\nconst auth = {\n access_token: item.json.access_token,\n domain: item.json.domain\n};\n\nif (message.toLowerCase() === \"what's hot\") {\n return {\n json: {\n DIALOG_ID: dialogId,\n MESSAGE: \"Hi! I am an example-bot.\\nI repeat what you say\",\n AUTH: auth.access_token,\n DOMAIN: auth.domain\n }\n };\n} else {\n return {\n json: {\n DIALOG_ID: dialogId,\n MESSAGE: `You said:\\n${message}`,\n AUTH: auth.access_token,\n DOMAIN: auth.domain\n }\n };\n}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a647ed67-c812-4416-8c85-55a681bc7f80",
|
||||
"name": "Process Join",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
800,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "// Process Join Node\nconst items = $input.all();\nconst item = items[0];\n\n// Get dialog ID from the correct path\nconst dialogId = item.json.body['data[PARAMS][DIALOG_ID]'];\n\n// Get auth data\nconst auth = {\n access_token: item.json.access_token,\n domain: item.json.domain\n};\n\nreturn {\n json: {\n DIALOG_ID: dialogId,\n MESSAGE: 'Hi! I am an example-bot. I repeat what you say',\n AUTH: auth.access_token,\n DOMAIN: auth.domain\n }\n};"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4aac8853-d80e-4201-9f31-7838d18afe71",
|
||||
"name": "Process Install",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
800,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "// Process Install Node\nconst items = $input.all();\nconst item = items[0];\n\n// Get the webhook URL from input\nconst handlerBackUrl = item.json.webhookUrl;\n\n// Get auth data directly from item.json\nconst auth = {\n access_token: item.json.access_token,\n application_token: item.json.application_token,\n domain: item.json.domain\n};\n\nreturn {\n json: {\n handler_back_url: handlerBackUrl,\n CODE: 'LocalExampleBot',\n TYPE: 'B',\n EVENT_MESSAGE_ADD: handlerBackUrl,\n EVENT_WELCOME_MESSAGE: handlerBackUrl,\n EVENT_BOT_DELETE: handlerBackUrl,\n PROPERTIES: {\n NAME: 'Bot',\n LAST_NAME: 'Example',\n COLOR: 'AQUA',\n EMAIL: 'no@example.com',\n PERSONAL_BIRTHDAY: '2020-07-18',\n WORK_POSITION: 'Report on affairs',\n PERSONAL_GENDER: 'M'\n },\n // Use the auth data from item.json\n AUTH: auth.access_token,\n CLIENT_ID: auth.application_token,\n DOMAIN: auth.domain\n }\n};"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "30922462-255b-4ba6-8167-88aec244fdb1",
|
||||
"name": "Register Bot",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1000,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://{{ $json.DOMAIN }}/rest/imbot.register?auth={{$json.AUTH}}",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "CODE",
|
||||
"value": "LocalExampleBot"
|
||||
},
|
||||
{
|
||||
"name": "TYPE",
|
||||
"value": "B"
|
||||
},
|
||||
{
|
||||
"name": "EVENT_MESSAGE_ADD",
|
||||
"value": "={{$json.handler_back_url}}"
|
||||
},
|
||||
{
|
||||
"name": "EVENT_WELCOME_MESSAGE",
|
||||
"value": "={{$json.handler_back_url}}"
|
||||
},
|
||||
{
|
||||
"name": "EVENT_BOT_DELETE",
|
||||
"value": "={{$json.handler_back_url}}"
|
||||
},
|
||||
{
|
||||
"name": "PROPERTIES",
|
||||
"value": "={{ {\n NAME: 'Bot',\n LAST_NAME: 'Example',\n COLOR: 'AQUA',\n EMAIL: 'no@example.com',\n PERSONAL_BIRTHDAY: '2020-07-18',\n WORK_POSITION: 'Report on affairs',\n PERSONAL_GENDER: 'M'\n} }}"
|
||||
},
|
||||
{
|
||||
"name": "CLIENT_ID",
|
||||
"value": "={{ $json.CLIENT_ID }}"
|
||||
},
|
||||
{
|
||||
"name": "CLIENT_SECRET",
|
||||
"value": "={{ $json.AUTH }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "8c1c7ebf-d5b3-472e-9d98-34cc65ba86ba",
|
||||
"name": "Send Message",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1000,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://{{$json.DOMAIN}}/rest/imbot.message.add?auth={{$json.AUTH}}",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "DIALOG_ID",
|
||||
"value": "={{ $json.DIALOG_ID }}"
|
||||
},
|
||||
{
|
||||
"name": "MESSAGE",
|
||||
"value": "={{ $json.MESSAGE }}"
|
||||
},
|
||||
{
|
||||
"name": "AUTH",
|
||||
"value": "={{ $json.AUTH }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "af0d2b44-53f7-4c4c-9428-d54ebcf41bff",
|
||||
"name": "Send Join Message",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1000,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://{{$json.DOMAIN}}/rest/imbot.message.add",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "DIALOG_ID",
|
||||
"value": "={{ $json.DIALOG_ID }}"
|
||||
},
|
||||
{
|
||||
"name": "MESSAGE",
|
||||
"value": "={{ $json.MESSAGE }}"
|
||||
},
|
||||
{
|
||||
"name": "AUTH",
|
||||
"value": "={{ $json.AUTH }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "9110f66d-1c35-44b4-bc73-18f821b50b71",
|
||||
"name": "Process Delete",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
800,
|
||||
480
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "81a5fc23-47a4-4ef8-bfb4-31593aed12fd",
|
||||
"name": "Success Response",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
1200,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseCode": 200
|
||||
},
|
||||
"respondWith": "json",
|
||||
"responseBody": "={\n \"result\": true\n}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a19f3b0b-496f-4f3d-a9c2-044356070e32",
|
||||
"name": "Error Response",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
400,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseCode": 401
|
||||
},
|
||||
"respondWith": "json",
|
||||
"responseBody": "={{\n \"result\": false,\n \"error\": \"Invalid application token\"\n}}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {
|
||||
"Bitrix24 Handler": [
|
||||
{
|
||||
"json": {
|
||||
"body": {
|
||||
"ts": "1737037713",
|
||||
"event": "ONIMBOTMESSAGEADD",
|
||||
"auth[scope]": "imbot,im",
|
||||
"auth[domain]": "hgap.bitrix24.eu",
|
||||
"auth[status]": "L",
|
||||
"auth[expires]": "1737041313",
|
||||
"auth[user_id]": "256",
|
||||
"data[USER][ID]": "256",
|
||||
"auth[member_id]": "19acdffbcfadf692f61b677d3d824490",
|
||||
"auth[expires_in]": "3600",
|
||||
"data[USER][NAME]": "Java Tech User",
|
||||
"event_handler_id": "126",
|
||||
"auth[access_token]": "a12589670074bb250066880900000100000007f6bf4682415a014425fed22a6b37af33",
|
||||
"data[USER][GENDER]": "M",
|
||||
"data[USER][IS_BOT]": "N",
|
||||
"auth[refresh_token]": "91a4b0670074bb2500668809000001000000075047004f6b25a0b76236e66bb7316e97",
|
||||
"auth[client_endpoint]": "https://hgap.bitrix24.eu/rest/",
|
||||
"auth[server_endpoint]": "https://oauth.bitrix.info/rest/",
|
||||
"data[BOT][302][scope]": "imbot,im",
|
||||
"data[PARAMS][CHAT_ID]": "6196",
|
||||
"data[PARAMS][MESSAGE]": "Szia!",
|
||||
"data[USER][LAST_NAME]": "Java",
|
||||
"data[BOT][302][BOT_ID]": "302",
|
||||
"data[BOT][302][domain]": "hgap.bitrix24.eu",
|
||||
"data[BOT][302][status]": "L",
|
||||
"data[PARAMS][LANGUAGE]": "en",
|
||||
"data[USER][FIRST_NAME]": "Tech User",
|
||||
"data[USER][IS_NETWORK]": "N",
|
||||
"auth[application_token]": "0d83800efe3a5b2977650e025e0754d5",
|
||||
"data[BOT][302][expires]": "1737041313",
|
||||
"data[BOT][302][user_id]": "302",
|
||||
"data[PARAMS][AUTHOR_ID]": "256",
|
||||
"data[PARAMS][CHAT_TYPE]": "P",
|
||||
"data[PARAMS][DIALOG_ID]": "256",
|
||||
"data[USER][IS_EXTRANET]": "N",
|
||||
"data[BOT][302][BOT_CODE]": "LocalExampleBot",
|
||||
"data[PARAMS][MESSAGE_ID]": "314686",
|
||||
"data[PARAMS][TO_USER_ID]": "302",
|
||||
"data[USER][IS_CONNECTOR]": "N",
|
||||
"data[BOT][302][client_id]": "local.6779636e712043.37129431",
|
||||
"data[BOT][302][member_id]": "19acdffbcfadf692f61b677d3d824490",
|
||||
"data[PARAMS][TEMPLATE_ID]": "09c62e39-23c2-4281-a53f-4a3a76d2cf4a",
|
||||
"data[USER][WORK_POSITION]": "Technical User",
|
||||
"data[BOT][302][expires_in]": "3600",
|
||||
"data[PARAMS][FROM_USER_ID]": "256",
|
||||
"data[PARAMS][MESSAGE_TYPE]": "P",
|
||||
"data[PARAMS][SKIP_COMMAND]": "N",
|
||||
"data[BOT][302][AUTH][scope]": "imbot,im",
|
||||
"data[BOT][302][AUTH][domain]": "hgap.bitrix24.eu",
|
||||
"data[BOT][302][AUTH][status]": "L",
|
||||
"data[BOT][302][access_token]": "a12589670074bb25006688090000012ee0e30782de43659ca7cc172d61e7a91b24b241",
|
||||
"data[PARAMS][SKIP_CONNECTOR]": "N",
|
||||
"data[PARAMS][SKIP_URL_INDEX]": "N",
|
||||
"data[BOT][302][AUTH][expires]": "1737041313",
|
||||
"data[BOT][302][AUTH][user_id]": "302",
|
||||
"data[BOT][302][refresh_token]": "91a4b0670074bb25006688090000012ee0e307bbd7e4e8b80e4c5ba61e3c99f0283f40",
|
||||
"data[PARAMS][COMMAND_CONTEXT]": "TEXTAREA",
|
||||
"data[PARAMS][SILENT_CONNECTOR]": "N",
|
||||
"data[BOT][302][AUTH][client_id]": "local.6779636e712043.37129431",
|
||||
"data[BOT][302][AUTH][member_id]": "19acdffbcfadf692f61b677d3d824490",
|
||||
"data[BOT][302][client_endpoint]": "https://hgap.bitrix24.eu/rest/",
|
||||
"data[BOT][302][server_endpoint]": "https://oauth.bitrix.info/rest/",
|
||||
"data[BOT][302][AUTH][expires_in]": "3600",
|
||||
"data[BOT][302][application_token]": "0d83800efe3a5b2977650e025e0754d5",
|
||||
"data[PARAMS][IMPORTANT_CONNECTOR]": "N",
|
||||
"data[BOT][302][AUTH][access_token]": "a12589670074bb25006688090000012ee0e30782de43659ca7cc172d61e7a91b24b241",
|
||||
"data[BOT][302][AUTH][refresh_token]": "91a4b0670074bb25006688090000012ee0e307bbd7e4e8b80e4c5ba61e3c99f0283f40",
|
||||
"data[BOT][302][AUTH][client_endpoint]": "https://hgap.bitrix24.eu/rest/",
|
||||
"data[BOT][302][AUTH][server_endpoint]": "https://oauth.bitrix.info/rest/",
|
||||
"data[PARAMS][SKIP_COUNTER_INCREMENTS]": "N",
|
||||
"data[BOT][302][AUTH][application_token]": "0d83800efe3a5b2977650e025e0754d5"
|
||||
},
|
||||
"query": {},
|
||||
"params": {},
|
||||
"headers": {
|
||||
"host": "orpheus-dev.h-gap.hu",
|
||||
"x-real-ip": "3.217.33.54",
|
||||
"user-agent": "Bitrix24 Webhook Engine",
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
"content-length": "3711",
|
||||
"accept-encoding": "gzip",
|
||||
"x-forwarded-for": "3.217.33.54",
|
||||
"x-forwarded-proto": "https",
|
||||
"x-forwarded-scheme": "https"
|
||||
},
|
||||
"webhookUrl": "REDACTED_WEBHOOK_URL",
|
||||
"executionMode": "production"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "401b00c7-dc0c-4067-9b27-27dc171cc52e",
|
||||
"connections": {
|
||||
"Credentials": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Validate Token",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Route Event": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Process Message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Process Join",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Process Install",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Process Delete",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Process Join": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Join Message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Register Bot": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Success Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Send Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Success Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Process Delete": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Success Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Validate Token": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Route Event",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Error Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Process Install": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Register Bot",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Process Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Bitrix24 Handler": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Credentials",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Send Join Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Success Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,405 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
880,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Edit your own prompt ⬇️\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Filter comments and customize your trigger words ⬇️"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-120,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Replace your gitlab URL and token ⬇️"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-540,
|
||||
760
|
||||
],
|
||||
"webhookId": "6cfd2f23-6f45-47d4-9fe0-8f6f1c05829a",
|
||||
"parameters": {
|
||||
"path": "e21095c0-1876-4cd9-9e92-a2eac737f03e",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"name": "Code",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
720,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nvar diff = $input.item.json.gitDiff\n\nlet lines = diff.trimEnd().split('\\n');\n\nlet originalCode = '';\nlet newCode = '';\n\nlines.forEach(line => {\n console.log(line)\n if (line.startsWith('-')) {\n originalCode += line + \"\\n\";\n } else if (line.startsWith('+')) {\n newCode += line + \"\\n\";\n } else {\n originalCode += line + \"\\n\";\n newCode += line + \"\\n\";\n }\n});\n\nreturn {\n originalCode:originalCode,\n newCode:newCode\n};\n\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"name": "Split Out1",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
140,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "changes"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
900,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"baseURL": ""
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Get Changes1",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-60,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://gitlab.com/api/v4/projects/{{ $json[\"body\"][\"project_id\"] }}/merge_requests/{{ $json[\"body\"][\"merge_request\"][\"iid\"] }}/changes",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "PRIVATE-TOKEN"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"name": "Skip File Change1",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
340,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "false",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.renamed_file }}",
|
||||
"rightValue": ""
|
||||
},
|
||||
{
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "false",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.deleted_file }}",
|
||||
"rightValue": ""
|
||||
},
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "startsWith"
|
||||
},
|
||||
"leftValue": "={{ $json.diff }}",
|
||||
"rightValue": "@@"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"name": "Parse Last Diff Line1",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
540,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const parseLastDiff = (gitDiff) => {\n gitDiff = gitDiff.replace(/\\n\\\\ No newline at end of file/, '')\n \n const diffList = gitDiff.trimEnd().split('\\n').reverse();\n const lastLineFirstChar = diffList?.[0]?.[0];\n const lastDiff =\n diffList.find((item) => {\n return /^@@ \\-\\d+,\\d+ \\+\\d+,\\d+ @@/g.test(item);\n }) || '';\n\n const [lastOldLineCount, lastNewLineCount] = lastDiff\n .replace(/@@ \\-(\\d+),(\\d+) \\+(\\d+),(\\d+) @@.*/g, ($0, $1, $2, $3, $4) => {\n return `${+$1 + +$2},${+$3 + +$4}`;\n })\n .split(',');\n \n if (!/^\\d+$/.test(lastOldLineCount) || !/^\\d+$/.test(lastNewLineCount)) {\n return {\n lastOldLine: -1,\n lastNewLine: -1,\n gitDiff,\n };\n }\n\n\n const lastOldLine = lastLineFirstChar === '+' ? null : (parseInt(lastOldLineCount) || 0) - 1;\n const lastNewLine = lastLineFirstChar === '-' ? null : (parseInt(lastNewLineCount) || 0) - 1;\n\n return {\n lastOldLine,\n lastNewLine,\n gitDiff,\n };\n};\n\nreturn parseLastDiff($input.item.json.diff)\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"name": "Post Discussions1",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://gitlab.com/api/v4/projects/{{ $('Webhook').item.json[\"body\"][\"project_id\"] }}/merge_requests/{{ $('Webhook').item.json[\"body\"][\"merge_request\"][\"iid\"] }}/discussions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"contentType": "multipart-form-data",
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"value": "={{ $('Basic LLM Chain1').item.json[\"text\"] }}"
|
||||
},
|
||||
{
|
||||
"name": "position[position_type]",
|
||||
"value": "text"
|
||||
},
|
||||
{
|
||||
"name": "position[old_path]",
|
||||
"value": "={{ $('Split Out1').item.json.old_path }}"
|
||||
},
|
||||
{
|
||||
"name": "position[new_path]",
|
||||
"value": "={{ $('Split Out1').item.json.new_path }}"
|
||||
},
|
||||
{
|
||||
"name": "position[start_sha]",
|
||||
"value": "={{ $('Get Changes1').item.json.diff_refs.start_sha }}"
|
||||
},
|
||||
{
|
||||
"name": "position[head_sha]",
|
||||
"value": "={{ $('Get Changes1').item.json.diff_refs.head_sha }}"
|
||||
},
|
||||
{
|
||||
"name": "position[base_sha]",
|
||||
"value": "={{ $('Get Changes1').item.json.diff_refs.base_sha }}"
|
||||
},
|
||||
{
|
||||
"name": "position[new_line]",
|
||||
"value": "={{ $('Parse Last Diff Line1').item.json.lastNewLine || '' }}"
|
||||
},
|
||||
{
|
||||
"name": "position[old_line]",
|
||||
"value": "={{ $('Parse Last Diff Line1').item.json.lastOldLine || '' }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "PRIVATE-TOKEN"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"name": "Need Review1",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-320,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.object_attributes.note }}",
|
||||
"rightValue": "+0"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"name": "Basic LLM Chain1",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
880,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"prompt": "=File path:{{ $('Skip File Change1').item.json.new_path }}\n\n```Original code\n {{ $json.originalCode }}\n```\nchange to\n```New code\n {{ $json.newCode }}\n```\nPlease review the code changes in this section:",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "# Overview:\n You are a senior programming expert Bot, responsible for reviewing code changes and providing review recommendations.\n At the beginning of the suggestion, it is necessary to clearly make a decision to \"reject\" or \"accept\" the code change, and rate the change in the format \"Change Score: Actual Score\", with a score range of 0-100 points.\n Then, point out the existing problems in concise language and a stern tone.\n If you feel it is necessary, you can directly provide the modified content.\n Your review proposal must use rigorous Markdown format."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1200,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Replace your gitlab URL and token ⬇️"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Code": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Need Review1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Skip File Change1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Changes1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Need Review1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Changes1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Basic LLM Chain1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Post Discussions1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Skip File Change1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Parse Last Diff Line1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain1",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Parse Last Diff Line1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,537 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "8920dc6e-b2fb-4446-8cb3-f3f6d626dcb3",
|
||||
"name": "Linear Trigger",
|
||||
"type": "n8n-nodes-base.linearTrigger",
|
||||
"position": [
|
||||
420,
|
||||
360
|
||||
],
|
||||
"webhookId": "a02faf62-684f-44bb-809f-e962c9ede70d",
|
||||
"parameters": {
|
||||
"teamId": "7a330c36-4b39-4bf1-922e-b4ceeb91850a",
|
||||
"resources": [
|
||||
"issue"
|
||||
],
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"linearOAuth2Api": {
|
||||
"id": "02MqKUMdPxr9t3mX",
|
||||
"name": "Nik's Linear Creds"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "61214884-62f9-4a00-9517-e2d51b44d0ae",
|
||||
"name": "Only tickets that need to be classified",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"position": [
|
||||
1000,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bc3a756d-b2b6-407b-91c9-a1cd9da004e0",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "notContains"
|
||||
},
|
||||
"leftValue": "={{ $('Linear Trigger').item.json.data.description }}",
|
||||
"rightValue": "Add a description here"
|
||||
},
|
||||
{
|
||||
"id": "f3d8d0fc-332d-41a6-aef8-1f221bf30c0e",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $('Linear Trigger').item.json.data.state.id }}",
|
||||
"rightValue": "6b9a8eec-82dc-453a-878b-50f4c98d3e53"
|
||||
},
|
||||
{
|
||||
"id": "9cdb55b2-3ca9-43bd-84b0-ef025b59ce18",
|
||||
"operator": {
|
||||
"type": "number",
|
||||
"operation": "gt"
|
||||
},
|
||||
"leftValue": "={{ $('Linear Trigger').item.json.data.labels.filter(label => label.id === 'f2b6e3e9-b42d-4106-821c-6a08dcb489a9').length }}",
|
||||
"rightValue": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "da4d8e0c-895b-4a84-8319-438f971af403",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1000,
|
||||
111.31510859283728
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"height": 219.68489140716272,
|
||||
"content": "### When does this fire?\nIn our setup we have a general team in Linear where we post new tickets to. Additionally, the bug needs to have a certain label and the description needs to be filled. \nYou're of course free to adjust this to your needs\n👇"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b7e3a328-96c4-4082-93a9-0cb331367190",
|
||||
"name": "Update team",
|
||||
"type": "n8n-nodes-base.linear",
|
||||
"position": [
|
||||
2160,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"issueId": "={{ $('Linear Trigger').item.json.data.id }}",
|
||||
"operation": "update",
|
||||
"updateFields": {
|
||||
"teamId": "={{ $json.teamId }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"linearApi": {
|
||||
"id": "oYIZvhmcNt5JWTCP",
|
||||
"name": "Nik's Linear Key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "858764ce-cd24-4399-88ce-cf69e676beaa",
|
||||
"name": "Get all linear teams",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1300,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.linear.app/graphql",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "query",
|
||||
"value": "{ teams { nodes { id name } } }"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "linearOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"linearOAuth2Api": {
|
||||
"id": "02MqKUMdPxr9t3mX",
|
||||
"name": "Nik's Linear Creds"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "167f0c66-5bfb-4dd7-a345-81f4d62df2c4",
|
||||
"name": "Set team ID",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2000,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "a46c4476-b851-4112-ac72-e805308c5ab7",
|
||||
"name": "teamId",
|
||||
"type": "string",
|
||||
"value": "={{ $('Get all linear teams').first().json.data.teams.nodes.find(team => team.name === $json.message.content).id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "36363240-2b03-4af8-8987-0db95094403b",
|
||||
"name": "Set me up",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
700,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "a56f24c8-0a28-4dd2-885a-cb6a081a5bf4",
|
||||
"name": "teams",
|
||||
"type": "string",
|
||||
"value": "- [Adore][Is responsible for every persona that is not Enterprise. This includes signup journeys, trials, n8n Cloud, the Canvas building experience and more, the nodes detail view (NDV), the nodes panel, the workflows list and the executions view] \n- [Payday][Is responsible for the Enterprise persona. This includes making sure n8n is performant, the enterprise features SSO, LDAP, SAML, Log streaming, environments, queue mode, version control, external storage. Additionally the team looks out for the execution logic in n8n and how branching works] \n- [Nodes][This team is responsible for everything that is related to a specific node in n8n] \n- [Other][This is a placeholder if you don't know to which team something belongs]"
|
||||
},
|
||||
{
|
||||
"id": "d672cb59-72be-4fc8-9327-2623795f225d",
|
||||
"name": "slackChannel",
|
||||
"type": "string",
|
||||
"value": "#yourChannelName"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "49f2a157-b037-46d9-a6d7-97f8a72ee093",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
581.3284642016245,
|
||||
85.15358950105212
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 349.85308830334156,
|
||||
"height": 439.62604295396085,
|
||||
"content": "## Setup\n1. Add your Linear and OpenAi credentials\n2. Change the team in the `Linear Trigger` to match your needs\n3. Customize your teams and their areas of responsibility in the `Set me up` node. Please use the format `[Teamname][Description/Areas of responsibility]`. Also make sure that the teamnames match the names in Linear exactly.\n4. Change the Slack channel in the `Set me up` node to your Slack channel of choice."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8cdb3d0d-4fd3-4ea2-957f-daf746934728",
|
||||
"name": "Check if AI was able to find a team",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1780,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "86bfb688-3ecc-4360-b83a-d706bb11c8f9",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "notEquals"
|
||||
},
|
||||
"leftValue": "={{ $json.message.content }}",
|
||||
"rightValue": "Other"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "a4cb20ca-658a-4b30-9185-5af9a32a7e20",
|
||||
"name": "Notify in Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
2000,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "The AI was not able to identify a fitting team for a bug",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $('Set me up').first().json.slackChannel }}"
|
||||
},
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "376",
|
||||
"name": "Idea Bot"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "393b2392-80be-4a68-9240-dc1065e0081a",
|
||||
"name": "Merge data",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1600,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "chooseBranch"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "f25da511-b255-4a53-ba4e-5765916e90be",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1220,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4-32k-0314",
|
||||
"cachedResultName": "GPT-4-32K-0314"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "I need you to classify a bug ticket and tell me which team should work on it"
|
||||
},
|
||||
{
|
||||
"role": "system",
|
||||
"content": "All possible teams will be described in the following format: [Teamname][Areas of responsibility] "
|
||||
},
|
||||
{
|
||||
"role": "system",
|
||||
"content": "=The possible teams are the following:\n {{ $('Set me up').first().json.teams }}"
|
||||
},
|
||||
{
|
||||
"role": "system",
|
||||
"content": "=This is the bug that we're trying to classify:\nTitle: {{ $('Linear Trigger').first().json.data.title }}\nDescription: {{ $('Linear Trigger').first().json.data.description }}"
|
||||
},
|
||||
{
|
||||
"content": "Which team should work on this bug?"
|
||||
},
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Do not respond with anything else than the name of the team from the list you were given"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VQtv7frm7eLiEDnd",
|
||||
"name": "OpenAi account 7"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Linear Trigger": [
|
||||
{
|
||||
"url": "https://linear.app/n8n/issue/N8N-6945/cannot-scroll-the-canvas-after-duplicating-or-pausing-a-note",
|
||||
"data": {
|
||||
"id": "94a4b770-3c80-4099-9376-ffe951f633db",
|
||||
"url": "https://linear.app/n8n/issue/N8N-6945/cannot-scroll-the-canvas-after-duplicating-or-pausing-a-note",
|
||||
"team": {
|
||||
"id": "7a330c36-4b39-4bf1-922e-b4ceeb91850a",
|
||||
"key": "N8N",
|
||||
"name": "Engineering"
|
||||
},
|
||||
"state": {
|
||||
"id": "6b9a8eec-82dc-453a-878b-50f4c98d3e53",
|
||||
"name": "Triage",
|
||||
"type": "triage",
|
||||
"color": "#FC7840"
|
||||
},
|
||||
"title": "cannot scroll the canvas after duplicating or pausing a note",
|
||||
"labels": [
|
||||
{
|
||||
"id": "f2b6e3e9-b42d-4106-821c-6a08dcb489a9",
|
||||
"name": "type/bug",
|
||||
"color": "#eb5757"
|
||||
}
|
||||
],
|
||||
"number": 6945,
|
||||
"teamId": "7a330c36-4b39-4bf1-922e-b4ceeb91850a",
|
||||
"cycleId": null,
|
||||
"dueDate": null,
|
||||
"stateId": "6b9a8eec-82dc-453a-878b-50f4c98d3e53",
|
||||
"trashed": null,
|
||||
"botActor": {
|
||||
"name": "Unknown",
|
||||
"type": "apiKey"
|
||||
},
|
||||
"estimate": null,
|
||||
"labelIds": [
|
||||
"f2b6e3e9-b42d-4106-821c-6a08dcb489a9"
|
||||
],
|
||||
"parentId": null,
|
||||
"priority": 0,
|
||||
"createdAt": "2023-09-12T12:51:41.696Z",
|
||||
"creatorId": "49ae7598-ae5d-42e6-8a03-9f6038a0d37a",
|
||||
"projectId": null,
|
||||
"sortOrder": -154747,
|
||||
"startedAt": null,
|
||||
"triagedAt": null,
|
||||
"updatedAt": "2024-02-29T16:00:27.794Z",
|
||||
"archivedAt": null,
|
||||
"assigneeId": null,
|
||||
"boardOrder": 0,
|
||||
"canceledAt": null,
|
||||
"identifier": "N8N-6945",
|
||||
"completedAt": null,
|
||||
"description": "## Description\n\nAfter using the canvas for a while I always had issues where the scrolling would stop working. I finally found a way to reproduce the issue reliably.\n\n## Expected\n\nI would like to always be able to scroll the canvas using CMD + click\n\n## Actual\n\nSometimes when using the app the scrolling stops working and you have to refresh to get it back to work.\n\n## Steps or workflow to reproduce (with screenshots/recordings)\n\n**n8n version:** \\[Deployment type\\] \\[version\\]\n\n1. Add any nodes to the canvas\n2. Click either the Duplicate or Pause buttons that appear when hovering over a node\n3. Try scrolling using CMD/CTRL + Click. Scrolling should no longer work while it should still work\n\nCreated by Omar",
|
||||
"snoozedById": null,
|
||||
"autoClosedAt": null,
|
||||
"slaStartedAt": null,
|
||||
"priorityLabel": "No priority",
|
||||
"slaBreachesAt": null,
|
||||
"subscriberIds": [
|
||||
"49ae7598-ae5d-42e6-8a03-9f6038a0d37a"
|
||||
],
|
||||
"autoArchivedAt": null,
|
||||
"snoozedUntilAt": null,
|
||||
"descriptionData": "{\"type\":\"doc\",\"content\":[{\"type\":\"heading\",\"attrs\":{\"level\":2,\"id\":\"d836020f-77f5-4ae0-9d6e-a69bd4567656\"},\"content\":[{\"type\":\"text\",\"text\":\"Description\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"After using the canvas for a while I always had issues where the scrolling would stop working. I finally found a way to reproduce the issue reliably.\"}]},{\"type\":\"heading\",\"attrs\":{\"level\":2,\"id\":\"4125614d-17b0-4530-bfc0-384d43bf80f9\"},\"content\":[{\"type\":\"text\",\"text\":\"Expected\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"I would like to always be able to scroll the canvas using CMD + click\"}]},{\"type\":\"heading\",\"attrs\":{\"level\":2,\"id\":\"3e8caaae-c152-46c1-a604-f0f9c75fb8c9\"},\"content\":[{\"type\":\"text\",\"text\":\"Actual\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Sometimes when using the app the scrolling stops working and you have to refresh to get it back to work.\"}]},{\"type\":\"heading\",\"attrs\":{\"level\":2,\"id\":\"73e4d549-a030-4b0c-b7d8-bcfa69d1b832\"},\"content\":[{\"type\":\"text\",\"text\":\"Steps or workflow to reproduce (with screenshots/recordings)\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"n8n version:\",\"marks\":[{\"type\":\"strong\",\"attrs\":{}}]},{\"type\":\"text\",\"text\":\" [Deployment type] [version]\"}]},{\"type\":\"ordered_list\",\"attrs\":{\"order\":1},\"content\":[{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Add any nodes to the canvas\"}]}]},{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Click either the Duplicate or Pause buttons that appear when hovering over a node\"}]}]},{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Try scrolling using CMD/CTRL + Click. Scrolling should no longer work while it should still work\"}]}]}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Created by Omar\"}]}]}",
|
||||
"startedTriageAt": "2023-09-12T12:51:41.825Z",
|
||||
"subIssueSortOrder": null,
|
||||
"projectMilestoneId": null,
|
||||
"previousIdentifiers": [],
|
||||
"externalUserCreatorId": null,
|
||||
"lastAppliedTemplateId": null
|
||||
},
|
||||
"type": "Issue",
|
||||
"actor": {
|
||||
"id": "49ae7598-ae5d-42e6-8a03-9f6038a0d37a",
|
||||
"name": "Niklas Hatje"
|
||||
},
|
||||
"action": "update",
|
||||
"createdAt": "2024-02-29T16:00:27.794Z",
|
||||
"webhookId": "2120ca07-c896-413a-ab8d-a270e14c1d9e",
|
||||
"updatedFrom": {
|
||||
"updatedAt": "2024-02-29T16:00:27.794Z",
|
||||
"description": "## Description\n\nAfter using the canvas for a while I always had issues where the scrolling would stop working. I finally found a way to reproduce the issue reliably.\n\n## Expected\n\nI would like to always be able to scroll the canvas using CMD + click\n\n## Actual\n\nSometimes when using the app the scrolling stops working and you have to refresh to get it back to work.\n\n## Steps or workflow to reproduce (with screenshots/recordings)\n\n**n8n version:** \\[Deployment type\\] \\[version\\]\n\n1. Add any nodes to the canvas\n2. Click either the Duplicate or Pause buttons that appear when hovering over a node\n3. Try scrolling using CMD/CTRL + Click. Scrolling should no longer work while it should still work\n\nCreated by: Omar",
|
||||
"descriptionData": "{\"type\":\"doc\",\"content\":[{\"type\":\"heading\",\"attrs\":{\"id\":\"d836020f-77f5-4ae0-9d6e-a69bd4567656\",\"level\":2},\"content\":[{\"text\":\"Description\",\"type\":\"text\"}]},{\"type\":\"paragraph\",\"content\":[{\"text\":\"After using the canvas for a while I always had issues where the scrolling would stop working. I finally found a way to reproduce the issue reliably.\",\"type\":\"text\"}]},{\"type\":\"heading\",\"attrs\":{\"id\":\"4125614d-17b0-4530-bfc0-384d43bf80f9\",\"level\":2},\"content\":[{\"text\":\"Expected\",\"type\":\"text\"}]},{\"type\":\"paragraph\",\"content\":[{\"text\":\"I would like to always be able to scroll the canvas using CMD + click\",\"type\":\"text\"}]},{\"type\":\"heading\",\"attrs\":{\"id\":\"3e8caaae-c152-46c1-a604-f0f9c75fb8c9\",\"level\":2},\"content\":[{\"text\":\"Actual\",\"type\":\"text\"}]},{\"type\":\"paragraph\",\"content\":[{\"text\":\"Sometimes when using the app the scrolling stops working and you have to refresh to get it back to work.\",\"type\":\"text\"}]},{\"type\":\"heading\",\"attrs\":{\"id\":\"73e4d549-a030-4b0c-b7d8-bcfa69d1b832\",\"level\":2},\"content\":[{\"text\":\"Steps or workflow to reproduce (with screenshots/recordings)\",\"type\":\"text\"}]},{\"type\":\"paragraph\",\"content\":[{\"text\":\"n8n version:\",\"type\":\"text\",\"marks\":[{\"type\":\"strong\",\"attrs\":{}}]},{\"text\":\" [Deployment type] [version]\",\"type\":\"text\"}]},{\"type\":\"ordered_list\",\"attrs\":{\"order\":1},\"content\":[{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"text\":\"Add any nodes to the canvas\",\"type\":\"text\"}]}]},{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"text\":\"Click either the Duplicate or Pause buttons that appear when hovering over a node\",\"type\":\"text\"}]}]},{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"text\":\"Try scrolling using CMD/CTRL + Click. Scrolling should no longer work while it should still work\",\"type\":\"text\"}]}]}]},{\"type\":\"paragraph\",\"content\":[{\"text\":\"Created by: Omar\",\"type\":\"text\"}]}]}"
|
||||
},
|
||||
"organizationId": "1c35bbc6-9cd4-427e-8bc5-e5d370a9869f",
|
||||
"webhookTimestamp": 1709222430026
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set me up": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Only tickets that need to be classified",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check if AI was able to find a team",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set team ID": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Update team",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Linear Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set me up",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get all linear teams": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge data",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check if AI was able to find a team": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set team ID",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Notify in Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Only tickets that need to be classified": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Get all linear teams",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"id": "127",
|
||||
"name": "Create, update, and get a profile in Humantic AI",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "On clicking 'execute'",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
290,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Humantic AI",
|
||||
"type": "n8n-nodes-base.humanticAi",
|
||||
"position": [
|
||||
490,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"userId": "https://www.linkedin.com/in/harshil1712/"
|
||||
},
|
||||
"credentials": {
|
||||
"humanticAiApi": "humantic"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "HTTP Request",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
690,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"url": "",
|
||||
"options": {},
|
||||
"responseFormat": "file"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Humantic AI1",
|
||||
"type": "n8n-nodes-base.humanticAi",
|
||||
"position": [
|
||||
890,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"userId": "={{$node[\"Humantic AI\"].json[\"results\"][\"userid\"]}}",
|
||||
"operation": "update",
|
||||
"sendResume": true
|
||||
},
|
||||
"credentials": {
|
||||
"humanticAiApi": "humantic"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Humantic AI2",
|
||||
"type": "n8n-nodes-base.humanticAi",
|
||||
"position": [
|
||||
1090,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"userId": "={{$node[\"Humantic AI\"].json[\"results\"][\"userid\"]}}",
|
||||
"options": {
|
||||
"persona": [
|
||||
"hiring"
|
||||
]
|
||||
},
|
||||
"operation": "get"
|
||||
},
|
||||
"credentials": {
|
||||
"humanticAiApi": "humantic"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"Humantic AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HTTP Request",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HTTP Request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Humantic AI1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Humantic AI1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Humantic AI2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On clicking 'execute'": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Humantic AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,457 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d61d8ff3-532a-4b0d-a5a7-e02d2e79ddce",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
2660,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b6d5c1cf-b4a1-4901-b001-0c375747ee63",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
1660,
|
||||
520
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f4e08e32-bb96-4b5d-852e-26ad6fec3c8c",
|
||||
"name": "Add to Messages Stack",
|
||||
"type": "n8n-nodes-base.redis",
|
||||
"position": [
|
||||
1340,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"list": "=chat-buffer:{{ $json.From }}",
|
||||
"tail": true,
|
||||
"operation": "push",
|
||||
"messageData": "={{ $json.Body }}"
|
||||
},
|
||||
"credentials": {
|
||||
"redis": {
|
||||
"id": "zU4DA70qSDrZM1El",
|
||||
"name": "Redis account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "181ae99e-ebe7-4e99-b5a5-999acc249621",
|
||||
"name": "Should Continue?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1660,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "ec39573f-f92a-4fe4-a832-0a137de8e7d0",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $('Get Latest Message Stack').item.json.messages.last() }}",
|
||||
"rightValue": "={{ $('Twilio Trigger').item.json.Body }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "640c63ca-2798-48a9-8484-b834c1a36301",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
2780,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "=chat-debouncer:{{ $('Twilio Trigger').item.json.From }}",
|
||||
"sessionIdType": "customKey"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "123c35c5-f7b2-4b4d-b220-0e5273e25115",
|
||||
"name": "Twilio Trigger",
|
||||
"type": "n8n-nodes-base.twilioTrigger",
|
||||
"position": [
|
||||
940,
|
||||
360
|
||||
],
|
||||
"webhookId": "0ca3da0e-e4e1-4e94-8380-06207bf9b429",
|
||||
"parameters": {
|
||||
"updates": [
|
||||
"com.twilio.messaging.inbound-message.received"
|
||||
]
|
||||
},
|
||||
"credentials": {
|
||||
"twilioApi": {
|
||||
"id": "TJv4H4lXxPCLZT50",
|
||||
"name": "Twilio account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f4e86455-7f4d-4401-8f61-a859be1433a9",
|
||||
"name": "Get Latest Message Stack",
|
||||
"type": "n8n-nodes-base.redis",
|
||||
"position": [
|
||||
1500,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"key": "=chat-buffer:{{ $json.From }}",
|
||||
"keyType": "list",
|
||||
"options": {},
|
||||
"operation": "get",
|
||||
"propertyName": "messages"
|
||||
},
|
||||
"credentials": {
|
||||
"redis": {
|
||||
"id": "zU4DA70qSDrZM1El",
|
||||
"name": "Redis account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": false
|
||||
},
|
||||
{
|
||||
"id": "02f8e7f5-12b4-4a5a-9ce9-5f0558e447aa",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1232.162872321277,
|
||||
-50.203627749982275
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 632.8309394802918,
|
||||
"height": 766.7069233634998,
|
||||
"content": "## Step 2. Buffer Incoming Messages\n[Learn more about using Redis](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.redis)\n\n* New messages are captured into a list.\n* After X seconds, we get a fresh copy of this list\n* If the last message on the list is the same as the incoming message, then we know no new follow-on messages were sent within the last 5 seconds. Hence the user should be waiting and it is safe to reply.\n* But if the reverse is true, then we will abort the execution here."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "311c0d69-a735-4435-91b6-e80bf7d4c012",
|
||||
"name": "Send Reply",
|
||||
"type": "n8n-nodes-base.twilio",
|
||||
"position": [
|
||||
3000,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"to": "={{ $('Twilio Trigger').item.json.From }}",
|
||||
"from": "={{ $('Twilio Trigger').item.json.To }}",
|
||||
"message": "={{ $json.output }}",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"twilioApi": {
|
||||
"id": "TJv4H4lXxPCLZT50",
|
||||
"name": "Twilio account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c0e0cd08-66e3-4ca3-9441-8436c0d9e664",
|
||||
"name": "Wait 5 seconds",
|
||||
"type": "n8n-nodes-base.wait",
|
||||
"position": [
|
||||
1340,
|
||||
360
|
||||
],
|
||||
"webhookId": "d486979c-8074-4ecb-958e-fcb24455086b",
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c7959fa2-69a5-46b4-8e67-1ef824860f4e",
|
||||
"name": "Get Chat History",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
2000,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"groupMessages": true
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "55933c54-5546-4770-8b36-a31496163528",
|
||||
"name": "Window Buffer Memory1",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
2000,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "=chat-debouncer:{{ $('Twilio Trigger').item.json.From }}",
|
||||
"sessionIdType": "customKey"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "459c0181-d239-4eec-88b6-c9603868d518",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
774.3250485705519,
|
||||
198.07493876489747
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 431.1629802181097,
|
||||
"height": 357.49804533541777,
|
||||
"content": "## Step 1. Listen for Twilio Messages\n[Read more about Twilio Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.twiliotrigger)\n\nIn this example, we'll use the sender's phone number as the session ID. This will be important in retrieving chat history."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e06313a9-066a-4387-a36c-a6c6ff57d6f9",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1900,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 618.970917763344,
|
||||
"height": 501.77420646931444,
|
||||
"content": "## Step 3. Get Messages Since Last Reply\n[Read more about using Chat Memory](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorymanager)\n\nOnce conditions are met and we allow the agent to reply, we'll need to find the bot's last reply and work out the buffer of user messages since then. We can do this by looking using chat memory and comparing this to the latest message in our redis messages stack."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "601a71f6-c6f8-4b73-98c7-cfa11b1facaa",
|
||||
"name": "Get Messages Buffer",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2320,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "01434acb-c224-46d2-99b0-7a81a2bb50c5",
|
||||
"name": "messages",
|
||||
"type": "string",
|
||||
"value": "={{\n$('Get Latest Message Stack').item.json.messages\n .slice(\n $('Get Latest Message Stack').item.json.messages.lastIndexOf(\n $('Get Chat History').item.json.messages.last().human\n || $('Twilio Trigger').item.json.chatInput\n ),\n $('Get Latest Message Stack').item.json.messages.length\n )\n .join('\\n')\n}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "9e49f2de-89e6-4152-8e9c-ed47c5fc4654",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2549,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 670.2274698011594,
|
||||
"height": 522.5993538768389,
|
||||
"content": "## Step 4. Send Single Agent Reply For Many Messages\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)\n\nFinally, our buffered messages are sent to the AI Agent that can formulate a single response for all. This could potentially improve the conversation experience if the chat interaction is naturally more rapid and spontaneous. A drawback however is that responses could be feel much slower - tweak the wait threshold to suit your needs!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "be13c74a-467c-4ab1-acca-44878c68dba4",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 375.55385425077225,
|
||||
"height": 486.69228315530853,
|
||||
"content": "## Try It Out!\n### This workflow demonstrates a simple approach to stagger an AI Agent's reply if users often send in a sequence of partial messages and in short bursts.\n\n* Twilio webhook receives user's messages which are recorded in a message stack powered by Redis.\n* The execution is immediately paused for 5 seconds and then another check is done against the message stack for the latest message.\n* The purpose of this check lets use know if the user is sending more messages or if they are waiting for a reply.\n* The execution is aborted if the latest message on the stack differs from the incoming message and continues if they are the same.\n* For the latter, the agent receives buffered messages and is able to respond to all in a single reply."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "334d38e1-ec16-46f2-a57d-bf531adb8d3d",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
2660,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.messages }}",
|
||||
"agent": "conversationalAgent",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Reply",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Twilio Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add to Messages Stack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Wait 5 seconds",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wait 5 seconds": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Latest Message Stack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Chat History": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Messages Buffer",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Should Continue?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Chat History",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Messages Buffer": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory1": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Get Chat History",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Latest Message Stack": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Should Continue?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,404 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "6ea4e702-1af8-407b-b653-964a519db1c2",
|
||||
"name": "Basic LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1560,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=You are a highly skilled news categorizer, specializing in indentifying interesting stuff from Hacker News front-page headlines.\n\nYou are provided with JSON data containing a list of dates and their corresponding top headlines from the Hacker News front page. Each headline will also include a URL linking to the original article or discussion. Importantly, the dates provided will be the SAME DAY across MULTIPLE YEARS (e.g., January 1st, 2023, January 1st, 2022, January 1st, 2021, etc.). You need to indentify key headlines and also analyze how the tech landscape has evolved over the years, as reflected in the headlines for this specific day.\n\nYour task is to indentify top 10-15 headlines from across the years from the given json data and return in Markdown formatted bullet points categorizing into themes and adding markdown hyperlinks to the source URL with Prefixing Year before the headline. Follow the Output Foramt Mentioned.\n\n**Input Format:**\n\n```json\n[\n {\n \"headlines\": [\n \"Headline 1 Title [URL1]\",\n \"Headline 2 Title [URL2]\",\n \"Headline 3 Title [URL3]\",\n ...\n ]\n \"date\": \"YYYY-MM-DD\",\n },\n {\n \"headlines\": [\n \"Headline 1 Title [URL1]\",\n \"Headline 2 Title [URL2]\",\n ...\n ]\n \"date\": \"YYYY-MM-DD\",\n },\n ...\n]\n```\n\n**Output Format In Markdown**\n\n```\n# HN Lookback <FullMonthName-DD> | <start YYYY> to <end YYYY> \n\n## [Theme 1]\n- YYYY [Headline 1](URL1)\n- YYYY [Headline 2](URL2)\n...\n\n## [Theme 2]\n- YYYY [Headline 1](URL1)\n- YYYY [Headline 2](URL2)\n...\n\n... \n\n## <this is optional>\n<if any interesing ternds emerge mention them in oneline>\n```\n\n**Here is the Json data for Hackernews Headlines across the years**\n\n```\n{{ JSON.stringify($json.data) }}\n```",
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "b5a97c2a-0c3b-4ebe-aec5-7bca6b55ad4c",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
1740,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-pro"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "Hx1fn2jrUvojSKye",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "18cba750-aef5-451d-880f-2c12d8540d78",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
-380,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"triggerAtHour": 21
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "341da616-8670-4cd9-b47a-ee25e2ae9862",
|
||||
"name": "CreateYearsList",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
-200,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "for (const item of $input.all()) {\n const currentDateStr = item.json.timestamp.split('T')[0];\n const currentDate = new Date(currentDateStr);\n const currentYear = currentDate.getFullYear();\n const currentMonth = currentDate.getMonth(); // 0 for January, 1 for February, etc.\n const currentDay = currentDate.getDate();\n\n const datesToFetch = [];\n for (let year = currentYear; year >= 2007; year--) {\n let targetDate;\n if (year === 2007) {\n // Special handling for 2007 to start from Feb 19\n if (currentMonth > 1 || (currentMonth === 1 && currentDay >= 19))\n {\n targetDate = new Date(2007, 1, 19); // Feb 19, 2007\n } else {\n continue; // Skip 2007 if currentDate is before Feb 19\n }\n } else {\n targetDate = new Date(year, currentMonth, currentDay);\n }\n \n // Format the date as YYYY-MM-DD\n const formattedDate = targetDate.toISOString().split('T')[0];\n datesToFetch.push(formattedDate);\n }\n item.json.datesToFetch = datesToFetch;\n}\n\nreturn $input.all();"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "42e24547-be24-4f29-8ce8-c0df7d47a6ff",
|
||||
"name": "CleanUpYearList",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
0,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "b269dc0d-21e1-4124-8f3a-2c7bfa4add5c",
|
||||
"name": "datesToFetch",
|
||||
"type": "array",
|
||||
"value": "={{ $json.datesToFetch }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "6e51ad05-0f3d-4bfb-8c8d-5b71e7355344",
|
||||
"name": "SplitOutYearList",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
200,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "datesToFetch"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6f827071-718f-4e27-9f7a-cc50296f7bc4",
|
||||
"name": "GetFrontPage",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
420,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://news.ycombinator.com/front",
|
||||
"options": {
|
||||
"batching": {
|
||||
"batch": {
|
||||
"batchSize": 1,
|
||||
"batchInterval": 3000
|
||||
}
|
||||
}
|
||||
},
|
||||
"sendQuery": true,
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "day",
|
||||
"value": "={{ $json.datesToFetch }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "7287e6b1-337f-4634-ac23-5ceaa87b0db3",
|
||||
"name": "ExtractDetails",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
640,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "extractHtmlContent",
|
||||
"extractionValues": {
|
||||
"values": [
|
||||
{
|
||||
"key": "=headlines",
|
||||
"cssSelector": ".titleline",
|
||||
"returnArray": true,
|
||||
"skipSelectors": "span"
|
||||
},
|
||||
{
|
||||
"key": "date",
|
||||
"cssSelector": ".pagetop > font"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "fceff31e-4dcd-4199-89c5-8eb75cd479bf",
|
||||
"name": "GetHeadlines",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
920,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "e1ce33e9-e4f8-4215-bbdb-156a955a0a97",
|
||||
"name": "headlines",
|
||||
"type": "array",
|
||||
"value": "={{ $json.headlines }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "f7683614-7225-4f05-ba12-86b326fdb4a1",
|
||||
"name": "GetDate",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
920,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "fc1d15f6-a999-4d6b-a7bc-3ffa9427679e",
|
||||
"name": "date",
|
||||
"type": "string",
|
||||
"value": "={{ $json.date }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "7e09ce85-ece1-46a0-aa59-8e3da66413b2",
|
||||
"name": "MergeHeadlinesDate",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1180,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "db3bf408-8179-4ca4-a5b4-8a390b68f994",
|
||||
"name": "SingleJson",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1380,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2abbc0e9-ed1e-4ba0-9d2f-7c3cd314a0fe",
|
||||
"name": "Telegram",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"position": [
|
||||
2020,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.text }}",
|
||||
"chatId": "@OnThisDayHN",
|
||||
"additionalFields": {
|
||||
"parse_mode": "Markdown",
|
||||
"appendAttribution": false
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"id": "6nIwfhIWcwJFTPTg",
|
||||
"name": "OnThisDayHNBot"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"GetDate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "MergeHeadlinesDate",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"SingleJson": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GetFrontPage": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ExtractDetails",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GetHeadlines": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "MergeHeadlinesDate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ExtractDetails": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GetHeadlines",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "GetDate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Basic LLM Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Telegram",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"CleanUpYearList": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "SplitOutYearList",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"CreateYearsList": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "CleanUpYearList",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "CreateYearsList",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"SplitOutYearList": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GetFrontPage",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"MergeHeadlinesDate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "SingleJson",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,334 @@
|
||||
{
|
||||
"id": "Nfh274NHoDy7pB4M",
|
||||
"meta": {
|
||||
"instanceId": "00493e38fecfc163cb182114bc2fab90114038eb9aad665a7a752d076920d3d5",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Integrating AI with Open-Meteo API for Enhanced Weather Forecasting",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "80debfe0-c591-4ba1-aca1-068adac62aa9",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
100,
|
||||
-300
|
||||
],
|
||||
"webhookId": "4a44e974-db62-4727-9913-12a22bc88e01",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {
|
||||
"title": "N8N 👋",
|
||||
"subtitle": "Weather Assistant: Example of Tools Using ChatGPT",
|
||||
"allowFileUploads": false,
|
||||
"loadPreviousSession": "memory"
|
||||
},
|
||||
"initialMessages": "Type like this: Weather Forecast for the Next 7 Days in São Paulo"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "ec375027-1c0d-438b-9fca-7bc4fbef2479",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
420,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "bhRvwBXztNmJVObo",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bd2f5967-8188-4b1f-9255-8008870aaf7b",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-540,
|
||||
-640
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 500,
|
||||
"height": 720,
|
||||
"content": "## Integrating AI with Open-Meteo API for Enhanced Weather Forecasting\n\n## Use case\n\n### Workshop\n\nWe are using this workflow in our workshops to teach how to use Tools a.k.a functions with artificial intelligence. In this specific case, we will use a generic \"AI Agent\" node to illustrate that it could use other models from different data providers.\n\n### Enhanced Weather Forecasting\n\nIn this small example, it's easy to demonstrate how to obtain weather forecast results from the Open-Meteo site to accurately display the upcoming days.\n\nThis can be used to plan travel decisions, for example.\n\n## What this workflow does\n\n1. We will make an HTTP request to find out the geographic coordinates of a city.\n2. Then, we will make other HTTP requests to discover the weather for the upcoming days.\n\nIn this workshop, we demonstrate that the AI will be able to determine which tool to call first—it will first call the geolocation tool and then the weather forecast tool. All of this within a single client conversation call.\n\n\n## Setup\n\nInsert an OpenAI Key and activate the workflow.\n\nby Davi Saranszky Mesquita\nhttps://www.linkedin.com/in/mesquitadavi/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3cfeea52-a310-4101-8377-0f393bf54c8d",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
60,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"width": 340,
|
||||
"height": 220,
|
||||
"content": "## Create an Hosted Web Chat\n\n### And setup the trigger!\n\nExample: https://website/webhook/4a4..../chat"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "55713ffc-da61-4594-99f4-ca6b448cbee2",
|
||||
"name": "Generic AI Tool Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
440,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "7f608ddc-87bb-4e54-84a8-4db6b7f95011",
|
||||
"name": "Chat Memory Buffer",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
200,
|
||||
-60
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "77f82443-1efe-47d3-92ec-aa193853c8a5",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
320,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"width": 260,
|
||||
"content": "-\n\n\n## Setup OpenAI Key"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ed37ea94-3cff-47cb-bf45-bce620b0f056",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
780,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 280,
|
||||
"height": 360,
|
||||
"content": "### Open Meteo SPEC - City Geolocation\n\nThis tool will go to the URL https://geocoding-api.open-meteo.com/v1/search to fetch the geolocation data of the city, and I only need to get the name of the city.\n\nSo, I will ask the user to input the name of the city and pass some pre-existing information, such as returning only the first city and returning in JSON format.\n\n- name (By Model) - And placeholder - The parameter that the AI will need to fill in as required.\n\n- count - 1 by default because I want only the first city.\n\n- format - Putting JSON for no specific reason, but OpenAI could figure out how to process that information."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f9b0e65d-a85e-4511-bdd2-adf54b1c039d",
|
||||
"name": "A tool to get the weather forecast based on geolocation",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1100,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.open-meteo.com/v1/forecast",
|
||||
"sendQuery": true,
|
||||
"parametersQuery": {
|
||||
"values": [
|
||||
{
|
||||
"name": "latitude"
|
||||
},
|
||||
{
|
||||
"name": "longitude"
|
||||
},
|
||||
{
|
||||
"name": "daily",
|
||||
"value": "temperature_2m_max,precipitation_sum",
|
||||
"valueProvider": "fieldValue"
|
||||
},
|
||||
{
|
||||
"name": "timezone",
|
||||
"value": "GMT",
|
||||
"valueProvider": "fieldValue"
|
||||
},
|
||||
{
|
||||
"name": "forecast_days"
|
||||
}
|
||||
]
|
||||
},
|
||||
"toolDescription": "To get forecast of next [forecast_days] input the geolocation of an City",
|
||||
"placeholderDefinitions": {
|
||||
"values": [
|
||||
{
|
||||
"name": "longitude",
|
||||
"type": "number",
|
||||
"description": "longitude"
|
||||
},
|
||||
{
|
||||
"name": "latitude",
|
||||
"type": "number",
|
||||
"description": "latitude"
|
||||
},
|
||||
{
|
||||
"name": "forecast_days",
|
||||
"type": "number",
|
||||
"description": "forecast_days number of days ahead"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "76382491-dd75-4b51-a2d8-cb9782246af8",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1240,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 280,
|
||||
"height": 320,
|
||||
"content": "### Open Meteo SPEC - Weather Forecast\n\nThis tool will go to the Open Meteo site with the geolocation information at https://api.open-meteo.com/v1/forecast\n\nIt will pass the information on latitude, longitude, and the number of days for which it will bring data.\n\nThere are many default pieces of information within, but the focus is not to explain the Open Meteo API.\n\nVariables like latitude, longitude, and forecast_days are self-explanatory for OpenAI, making it the easiest tool to configure.\n\n- latitude (By Model) and Placeholder\n- longitude (By Model) and Placeholder\n- forecast_days (By Model) and Placeholder\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1c8087ce-6800-4ece-8234-23914e21a692",
|
||||
"name": "A tool for inputting the city and obtaining geolocation",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
820,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://geocoding-api.open-meteo.com/v1/search",
|
||||
"sendQuery": true,
|
||||
"parametersQuery": {
|
||||
"values": [
|
||||
{
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"name": "count",
|
||||
"value": "1",
|
||||
"valueProvider": "fieldValue"
|
||||
},
|
||||
{
|
||||
"name": "format",
|
||||
"value": "json",
|
||||
"valueProvider": "fieldValue"
|
||||
}
|
||||
]
|
||||
},
|
||||
"toolDescription": "Input the City and get geolocation, geocode or coordinates from Requested City",
|
||||
"placeholderDefinitions": {
|
||||
"values": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"description": "Requested City"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "15ae7421-eff9-4677-b8cf-b7bbb5d2385e",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-100,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 840,
|
||||
"height": 80,
|
||||
"content": "## Within N8N, there will be a chat button to test, or you can use the external chat link from the trigger."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "778e2544-db78-4836-8bd1-771f333a621c",
|
||||
"connections": {
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Generic AI Tool Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Memory Buffer": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "When chat message received",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Generic AI Tool Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Generic AI Tool Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"A tool for inputting the city and obtaining geolocation": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Generic AI Tool Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"A tool to get the weather forecast based on geolocation": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Generic AI Tool Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "abccacce-bbdc-428e-94e0-19996c5bfe02",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1720,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 319.5392879244982,
|
||||
"height": 218.88813194060202,
|
||||
"content": "### AI agent that can scrape webpages\nRemake of https://n8n.io/workflows/2006-ai-agent-that-can-scrape-webpages/\n\n**Changes**:\n* Replaces Execute Workflow Tool and Subworkflow\n* Replaces Response Formatting"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9fc05c79-5a2d-4ac4-a4f5-32b9c1b385e1",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1340,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "45c9bdaf-d51e-4026-8911-4b04c5473b06",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1720,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 365.9021913627245,
|
||||
"height": 245.35379866205295,
|
||||
"content": "### Allow your AI to call an API to fetch data\nRemake of https://n8n.io/workflows/2094-allow-your-ai-to-call-an-api-to-fetch-data/\n\n**Changes**:\n* Replaces Execute Workflow Tool and Subworkflow\n* Replaces Manual Query Params Definitions\n* Replaces Response Formatting"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bc1754e6-01f4-4561-8814-c08feb45acec",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1340,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a40230ae-6050-4bb8-b275-3a893dc3ad98",
|
||||
"name": "Activity Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1560,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://bored-api.appbrewery.com/filter",
|
||||
"sendQuery": true,
|
||||
"parametersQuery": {
|
||||
"values": [
|
||||
{
|
||||
"name": "type"
|
||||
},
|
||||
{
|
||||
"name": "participants"
|
||||
}
|
||||
]
|
||||
},
|
||||
"toolDescription": "Call this tool to suggest an activity where:\n* the parameter \"type\" is one of \"education\", \"recreational\",\"social\",\"diy\",\"charity\",\"cooking\",\"relaxation\",\"music\",\"busywork\"\n* the parameter \"participants\" is the number of participants for the activity"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "297377e0-e149-4786-b521-82670ac390a7",
|
||||
"name": "Set ChatInput1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1180,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "e976bf5f-8803-4129-9136-115b3d15755c",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "Hi! Please suggest something to do. I feel like learning something new!"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "a9128da1-4486-4a17-b9b3-64ebc402348d",
|
||||
"name": "AI Agent1",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1360,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "28a5e75e-e32d-4c94-bea2-7347923e6bb9",
|
||||
"name": "Set ChatInput",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1160,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "9695c156-c882-4e43-8a4e-70fbdc1a63de",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "Can get the latest 10 issues from https://github.com/n8n-io/n8n/issues?"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "d29b30fb-7edb-4665-bc6b-a511caf9db9f",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
900,
|
||||
400
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "066f9cdd-4bd3-48a1-bf9b-32eda3e28945",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1360,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "fb4abae8-7e38-47b7-9595-403e523f7125",
|
||||
"name": "Webscraper Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1560,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.firecrawl.dev/v0/scrape",
|
||||
"fields": "markdown",
|
||||
"method": "POST",
|
||||
"sendBody": true,
|
||||
"dataField": "data",
|
||||
"authentication": "genericCredentialType",
|
||||
"parametersBody": {
|
||||
"values": [
|
||||
{
|
||||
"name": "url"
|
||||
},
|
||||
{
|
||||
"name": "pageOptions",
|
||||
"value": "={{ {\n onlyMainContent: true,\n replaceAllPathsWithAbsolutePaths: true,\n removeTags: 'img,svg,video,audio'\n} }}",
|
||||
"valueProvider": "fieldValue"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fieldsToInclude": "selected",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"toolDescription": "Call this tool to fetch a webpage content.",
|
||||
"optimizeResponse": true
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "OUOnyTkL9vHZNorB",
|
||||
"name": "Firecrawl API"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "73d3213c-1ecb-4007-b882-1cc756a6f6e0",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
420,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"width": 413.82332632615135,
|
||||
"height": 435.92895157500243,
|
||||
"content": "## Try It Out!\n\n### The HTTP tool is drastically simplifies API-enabled AI agents cutting down the number of workflow nodes by as much as 10!\n\n* Available since v1.47.0\n* Recommended for single purpose APIs which don't require much post-fetch formatting.\n* If you require a chain of API calls, you may need to implement a subworkflow instead.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Activity Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set ChatInput": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set ChatInput1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webscraper Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent1",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set ChatInput",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Set ChatInput1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "f1142274-898d-43da-a7ff-2b2e03f2dc73",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
1220,
|
||||
840
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1f407421-2dd6-4e0c-bc74-cfb291e475ed",
|
||||
"name": "Query Confluence",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1640,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://n8n-labs.atlassian.net/wiki/rest/api/search",
|
||||
"options": {},
|
||||
"sendQuery": true,
|
||||
"sendHeaders": true,
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpBasicAuth",
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "cql",
|
||||
"value": "=text ~ \"{{ $json.query }}\""
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "accept",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpBasicAuth": {
|
||||
"id": "B1Cj4Uh9d9WKWxBO",
|
||||
"name": "Confluence API Key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "f1ab7e79-6bd8-4b87-b6dc-96f9d46cdd16",
|
||||
"name": "Return Tool Response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2040,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "c1d46e59-9340-43f3-bc2a-fbd4e0def74f",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "=\"Title\": \"{{ $json.results[0].content.title }}\"\n\"Link\": \"{{ $json._links.base }}{{ $json.results[0].content._links.webui }}\"\n\"Content\": {{ $json[\"results\"][0][\"excerpt\"] }}\nWhen users request the password, make sure to send them the link above to reset it in markdown. "
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "19be50a2-4835-48a6-b06a-7996231c519d",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1037.1879432624112,
|
||||
466.2978723404259
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 460.26595744680884,
|
||||
"height": 598.588007755415,
|
||||
"content": "\n## Receive Query from Parent Workflow\nThis node receives input from the AI Agent in the top level workflow where it passes just the Slack Message directly to this workflow."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0012feaa-89f5-40a4-86d6-98e0e9648bd5",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1520,
|
||||
469.2511978555872
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 350.94680851063845,
|
||||
"height": 588.3931371954408,
|
||||
"content": "\n## Search Confluence\nThe newly created prompt is then sent into Confluence's API as a search string. \n\nTo replace this with your own KB tool, find the Endpoint that allows search, and replace this HTTP Request node with your own HTTP Request or Built in n8n node and pass the search variable into the search input. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6982692e-61c5-47fc-9946-ada32d5fa2a1",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1900,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 648.2749545725208,
|
||||
"height": 597.2865893156994,
|
||||
"content": "\n## Respond to Parent Workflow with Confluence Results\nThe final output is then sent to the Parent workflow to be used in the final AI Agent API call to the LLM of your choice as part of the final output. Here is the prompt output: \n```\n\"Title\": \"Title of content so AI Agent will know the name of the content\"\n\"Link\": \"Link to URL of KB article. Great for giving back to user to self help\"\n\"Content\": Truncated output of content so that the large language model will have more context in it's final response. \nWhen users request the password, make sure to send them the link above to reset it in markdown. \n```"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9570ee97-8508-4c7f-a2da-a327fbc7db46",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
460,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 543.0233137166141,
|
||||
"height": 854.6009864319319,
|
||||
"content": "\n## Enhance Query Resolution with the Knowledge Base Tool!\n\nOur **Knowledge Base Tool** is crafted to seamlessly integrate into the IT Department Q&A Workflow, enhancing the IT support process by enabling sophisticated search and response capabilities via Slack.\n\n**Workflow Functionality:**\n- **Receive Queries**: Directly accepts user queries from the main workflow, initiating a dynamic search process.\n- **AI-Powered Query Transformation**: Utilizes OpenAI's GPT-4 to refine user queries into searchable keywords that are most likely to retrieve relevant information from the Knowledge Base.\n- **Confluence Integration**: Executes searches within Confluence using the refined keywords to find the most applicable articles and information.\n- **Deliver Accurate Responses**: Gathers essential details from the Confluence results, including article titles, links, and summaries, preparing them to be sent back to the parent workflow for final user response.\n\n\n**Quick Setup Guide:**\n- Ensure correct configurations are set for OpenAI and Confluence API integrations.\n- Customize query transformation logic as per your specific Knowledge Base structure to improve search accuracy.\n\n\n**Need Help?**\n- Dive into our [Documentation](https://docs.n8n.io) or get support from the [Community Forum](https://community.n8n.io)!\n\n\nDeploy this tool to provide precise and informative responses, significantly boosting the efficiency and reliability of your IT support workflow.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Query Confluence": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Return Tool Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Query Confluence",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,551 @@
|
||||
{
|
||||
"id": "Z5OgwYfK4reCTv9y",
|
||||
"meta": {
|
||||
"instanceId": "c59c4acfed171bdc864e7c432be610946898c3ee271693e0303565c953d88c1d"
|
||||
},
|
||||
"name": "LINE Assistant with Google Calendar and Gmail Integration",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "9e1e1c11-f406-47de-8f65-9669cf078d3d",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-1140,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.body.events[0].message.text }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a helpful assistant.\n\nHere is the current date {{ $now }}"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "fa722820-8804-47da-bb21-02c0d2b5d665",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
-1020,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "={{ $json.body.events[0].source.userId }}",
|
||||
"sessionIdType": "customKey"
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "5149b91a-5934-4037-a444-dfdb93d0cd16",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-1180,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "211a120d-d65f-4708-adc2-66dc8f4a40d6",
|
||||
"name": "Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
|
||||
"position": [
|
||||
-360,
|
||||
380
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0e03137d-0300-47a4-bbd8-03c87c93d6e2",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
-780,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Your task is to extract and condense the answer into an easily readable format. Don't provide a link or details such as \"ดูเพิ่มเติม\" or \"ดูรายละเอียดได้ที่นี่.\""
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.output }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "8c6e96bc-aa9d-44d1-b7ce-6bb85b175cf1",
|
||||
"name": "Switch Between Text and Others",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
-1820,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $('Line Receiving').item.json.body.events[0].message.type }}",
|
||||
"rightValue": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"fallbackOutput": "extra"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "721a5e5e-3a9a-435e-9302-03ca7cf64fb7",
|
||||
"name": "Line Receiving",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-2320,
|
||||
560
|
||||
],
|
||||
"webhookId": "********-****-****-****-************",
|
||||
"parameters": {
|
||||
"path": "linechatbotagent",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "2b47f8f1-a501-4204-9221-c838edfceae7",
|
||||
"name": "Error Handling from AI Response",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
-220,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.message.content }}",
|
||||
"rightValue": "={{ $json.output }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"fallbackOutput": "extra"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "99218c08-5ec7-44b9-a795-e98f1ec4aab3",
|
||||
"name": "Text Cleansing",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "********-****-****-****-************",
|
||||
"name": "message.content",
|
||||
"type": "string",
|
||||
"value": "={{ $json.message.content.replaceAll(\"\\n\",\"\\\\n\").replaceAll(\"\\n\",\"\").removeMarkdown().removeTags().replaceAll('\"',\"\") }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "39476f44-9dc7-4c72-a857-9e79f85ccd72",
|
||||
"name": "Line Answering (Error Case)",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
760,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.line.me/v2/bot/message/reply",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"replyToken\": \"{{ $('Line Receiving').item.json.body.events[0].replyToken }}\",\n \"messages\": [\n {\n \"type\": \"text\",\n \"text\": \"กรุณาส่งอย่างอื่นเถอะนะเตงอัว\"\n }\n ]}",
|
||||
"sendBody": true,
|
||||
"jsonHeaders": "{\n\"Authorization\": \"Bearer ****************************************\",\n\"Content-Type\": \"application/json\"\n}",
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"specifyHeaders": "json"
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "a7f8837d-c21b-457d-ad8b-b0b69e3c1ba7",
|
||||
"name": "Line Answering (Ordinary Case)",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
600,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.line.me/v2/bot/message/reply",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"replyToken\": \"{{ $('Line Receiving').item.json.body.events[0].replyToken }}\",\n \"messages\": [\n {\n \"type\": \"text\",\n \"text\": \"{{ $json.message.content }}\"\n }\n ]}",
|
||||
"sendBody": true,
|
||||
"jsonHeaders": "{\n\"Authorization\": \"Bearer ****************************************\",\n\"Content-Type\": \"application/json\"\n}",
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"specifyHeaders": "json"
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "3280f331-0130-41c2-a581-14feccf76514",
|
||||
"name": "Google Calendar Create",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
-640,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"end": "= {{ $fromAI(\"createenddate\",\"end date and time to create event\") }}",
|
||||
"start": "= {{ $fromAI(\"createstartdate\",\"start date and time to create event\") }}",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "***********@gmail.com",
|
||||
"cachedResultName": "***********@gmail.com"
|
||||
},
|
||||
"additionalFields": {
|
||||
"summary": "={{ $fromAI(\"event_name\",\"Name of an Event\") }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "0PzHsuCKdTBU5E2Q",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "7701895f-9781-41b9-aa80-8440e4e9cbd3",
|
||||
"name": "Google Calendar Read",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
-880,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 5,
|
||||
"options": {
|
||||
"timeMax": "={{ $fromAI(\"enddate\",\"end date user mentioned about\") }}",
|
||||
"timeMin": "={{ $fromAI(\"startdate\",\"start date user mentioned about\") }}"
|
||||
},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "***********@gmail.com",
|
||||
"cachedResultName": "***********@gmail.com"
|
||||
},
|
||||
"operation": "getAll"
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "0PzHsuCKdTBU5E2Q",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "881daa7f-cf9a-4d1f-8235-55d206925ac0",
|
||||
"name": "Gmail Read",
|
||||
"type": "n8n-nodes-base.gmailTool",
|
||||
"position": [
|
||||
-700,
|
||||
560
|
||||
],
|
||||
"webhookId": "********-****-****-****-************",
|
||||
"parameters": {
|
||||
"limit": 5,
|
||||
"filters": {
|
||||
"receivedAfter": "={{ $fromAI(\"receiveddate\",\"the date email received\") }}"
|
||||
},
|
||||
"operation": "getAll"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "cZmU8EQya5OtXVgQ",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"Line Receiving": [
|
||||
{
|
||||
"json": {
|
||||
"body": {
|
||||
"events": [
|
||||
{
|
||||
"mode": "active",
|
||||
"type": "message",
|
||||
"source": {
|
||||
"type": "user",
|
||||
"userId": "****************************************"
|
||||
},
|
||||
"message": {
|
||||
"id": "539986086979174564",
|
||||
"text": "",
|
||||
"type": "text",
|
||||
"quoteToken": "****************************************"
|
||||
},
|
||||
"timestamp": 1734688093030,
|
||||
"replyToken": "********************************",
|
||||
"webhookEventId": "01JFHQFD2KQE4BA5VVW32YDBZV",
|
||||
"deliveryContext": {
|
||||
"isRedelivery": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"destination": "****************************************"
|
||||
},
|
||||
"query": {},
|
||||
"params": {},
|
||||
"headers": {
|
||||
"host": "n8n-9pul.onrender.com",
|
||||
"cf-ray": "****************",
|
||||
"rndr-id": "****************",
|
||||
"cdn-loop": "cloudflare; loops=1; subreqs=1",
|
||||
"cf-ew-via": "15",
|
||||
"cf-worker": "onrender.com",
|
||||
"cf-visitor": "{\"scheme\":\"https\"}",
|
||||
"user-agent": "LineBotWebhook/2.0",
|
||||
"cf-ipcountry": "JP",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"content-length": "619",
|
||||
"true-client-ip": "***.***.***.**",
|
||||
"accept-encoding": "gzip, br",
|
||||
"x-forwarded-for": "***.***.***.***, ***.***.***.**",
|
||||
"x-request-start": "1734688093431195",
|
||||
"cf-connecting-ip": "***.***.***.**",
|
||||
"render-proxy-ttl": "4",
|
||||
"x-line-signature": "****************************************",
|
||||
"x-forwarded-proto": "https"
|
||||
},
|
||||
"webhookUrl": "https://n8n-9pul.onrender.com/webhook/linechatbotagent",
|
||||
"executionMode": "production"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "14065639-6706-4161-9380-4f4dde6eb501",
|
||||
"connections": {
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Error Handling from AI Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Gmail Read": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Line Receiving": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch Between Text and Others",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Text Cleansing": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Line Answering (Ordinary Case)",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar Read": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar Create": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Switch Between Text and Others": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Line Answering (Error Case)",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Error Handling from AI Response": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Text Cleansing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Line Answering (Error Case)",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,793 @@
|
||||
{
|
||||
"id": "f9X48gqgIUwyseMM",
|
||||
"meta": {
|
||||
"instanceId": "d47f3738b860eed937a1b18d7345fa2c65cf4b4957554e29477cb064a7039870"
|
||||
},
|
||||
"name": "Obsidian Notes Read Aloud: Available as a Podcast Feed",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "a44b5cb3-6c9f-4227-a45f-a21765ea120c",
|
||||
"name": "OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
-660,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"input": "={{ $json.body.content }}",
|
||||
"options": {
|
||||
"response_format": "mp3"
|
||||
},
|
||||
"resource": "audio"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "q8L9oWVM7QyzYEE5",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "9ca589b6-f1c7-44a9-8ff7-4abb979a71c3",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1200,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"width": 440,
|
||||
"height": 540,
|
||||
"content": "## Send Notes to Webhook\n**Setup:**\n- Install [Post Webhook Plugin](https://github.com/Masterb1234/obsidian-post-webhook/) in Obsidian\n- Enter n8n Webhook URL and name in plugin settings\n\n**Usage:**\n- Select text or use full note\n- Open Command Palette (Ctrl+P)\n- Choose 'Send Note/Selection to [name]'\n- Audio file appears in Podcast Feed and note"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3ea132e5-8c67-4140-a9b2-607ea256e90f",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1200,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"width": 440,
|
||||
"height": 440,
|
||||
"content": "## Generic Podcast Feed Module\nA reusable module for any 'X-to-Podcast' workflow. Generates standard RSS feed from:\n- Source data (Google Sheets)\n- Podcast metadata\n\nCompatible with all major podcast platforms (Apple, Google, Spotify, etc.).\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "92d6a6df-0e4e-423b-8447-dce10d5373ae",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-720,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 440,
|
||||
"height": 540,
|
||||
"content": "## Create Audio and Write Description\nOpenAI TTS converts notes to audio while the messaging model generates concise descriptions for podcast apps."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b950b0ab-e27e-473d-9891-d5551a44ed17",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 380,
|
||||
"height": 540,
|
||||
"content": "## Append Row to Google Sheets\nSaves essential podcast parameters (<title>, <link>, <description>, <duration>) to Google Sheets for Feed generation."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "02fda37f-77a5-47f5-81bc-b59486704386",
|
||||
"name": "Webhook GET Note",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-1040,
|
||||
-120
|
||||
],
|
||||
"webhookId": "64fac784-9b98-4bbc-aaf2-dd45763d3362",
|
||||
"parameters": {
|
||||
"path": "64fac784-9b98-4bbc-aaf2-dd45763d3362",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "845d04ea-d221-4034-b5e1-75061e5f351c",
|
||||
"name": "Webhook GET Podcast Feed",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-1040,
|
||||
460
|
||||
],
|
||||
"webhookId": "2f0a6706-54da-4b89-91f4-5e147b393bd8",
|
||||
"parameters": {
|
||||
"path": "2f0a6706-54da-4b89-91f4-5e147b393bd8h",
|
||||
"options": {},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "ce6d766c-89e6-4d62-9d48-d6715a28592f",
|
||||
"name": "Upload Audio to Cloudinary",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-220,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.cloudinary.com/v1_1/CLOUDINARY_ENV/upload",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"contentType": "multipart-form-data",
|
||||
"sendHeaders": true,
|
||||
"authentication": "genericCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "file",
|
||||
"parameterType": "formBinaryData",
|
||||
"inputDataFieldName": "data"
|
||||
},
|
||||
{
|
||||
"name": "upload_preset",
|
||||
"value": "rb_preset"
|
||||
},
|
||||
{
|
||||
"name": "resource_type",
|
||||
"value": "auto"
|
||||
}
|
||||
]
|
||||
},
|
||||
"genericAuthType": "httpCustomAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "multipart/form-data"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpCustomAuth": {
|
||||
"id": "DHmR14pD9rTrd3nS",
|
||||
"name": "Cloudinary API"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "1f86c18d-8197-4671-9c41-726a02108c4e",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
-660,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
},
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Based on the user input text, write a concise and engaging description of 50–150 characters. Highlight the key idea or takeaway while making it compelling and easy to understand. Avoid unnecessary details or repetition."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "q8L9oWVM7QyzYEE5",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "0942959c-2231-4055-b196-4483c210a39d",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
320,
|
||||
-40
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "ee7ba6a7-f8dd-4863-bf5c-6ec8eb2329ea",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
460,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f403d045-08e9-400e-9988-c8f55a5aa609",
|
||||
"name": "Give Audio Unique Name",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-460,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "97f0fe66-7ddf-4eff-a3cf-3104e74dbfac",
|
||||
"name": "fileName",
|
||||
"type": "string",
|
||||
"value": "={{ $('Webhook GET Note').item.json.body.timestamp }}.mp3"
|
||||
}
|
||||
]
|
||||
},
|
||||
"includeOtherFields": true
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "2dbff0f5-f359-43b7-b0de-4b9d657c69c0",
|
||||
"name": "Send Audio to Obsidian",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
80,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "content-type",
|
||||
"value": "=audio/mpeg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "binary",
|
||||
"responseDataSource": "set"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ede7c038-b210-4b29-8557-7530ea4cf63e",
|
||||
"name": "Rename Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
620,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "3a7d01f4-7448-40e0-9f46-e6edea971b72",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"value": "={{ $('Webhook GET Note').item.json.body.filename.split('.md')[0] }}"
|
||||
},
|
||||
{
|
||||
"id": "f49446df-3975-4133-a964-ebdcc0d904dd",
|
||||
"name": "link",
|
||||
"type": "string",
|
||||
"value": "={{ $json.data[0].url }}"
|
||||
},
|
||||
{
|
||||
"id": "8be5df35-ec79-45b1-94c3-306d58100fd2",
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"value": "={{ $json.data[1].message.content }}"
|
||||
},
|
||||
{
|
||||
"id": "231d0ee2-13d2-4a28-a19c-adc4920130fd",
|
||||
"name": "date",
|
||||
"type": "string",
|
||||
"value": "={{ $json.data[0].created_at }}"
|
||||
},
|
||||
{
|
||||
"id": "cd2748b3-999a-4514-9b31-49b7d045101f",
|
||||
"name": "duration",
|
||||
"type": "number",
|
||||
"value": "={{ $json.data[0].duration }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "10a35ef9-ab86-4010-9fcc-3cd765384e93",
|
||||
"name": "Append Item to Google Sheet",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
940,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {},
|
||||
"schema": [
|
||||
{
|
||||
"id": "title",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "title",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "link",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "link",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "description",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "description",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "date",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "date",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "duration",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "duration",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "autoMapInputData",
|
||||
"matchingColumns": []
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F73a7uuzLAq916w2JFndumv0JhnCAvOTN-Cn_OOP3uA/edit#gid=0",
|
||||
"cachedResultName": "Blad1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1F73a7uuzLAq916w2JFndumv0JhnCAvOTN-Cn_OOP3uA",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F73a7uuzLAq916w2JFndumv0JhnCAvOTN-Cn_OOP3uA/edit?usp=drivesdk",
|
||||
"cachedResultName": "obsidian-n8n"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "3Pu0wlfxgNYzVqY6",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "62dd3faf-22db-40f9-892c-2cf9368a9496",
|
||||
"name": "Get Items from Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
-660,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F73a7uuzLAq916w2JFndumv0JhnCAvOTN-Cn_OOP3uA/edit#gid=0",
|
||||
"cachedResultName": "Blad1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1F73a7uuzLAq916w2JFndumv0JhnCAvOTN-Cn_OOP3uA",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F73a7uuzLAq916w2JFndumv0JhnCAvOTN-Cn_OOP3uA/edit?usp=drivesdk",
|
||||
"cachedResultName": "obsidian-n8n"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "3Pu0wlfxgNYzVqY6",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "7b465ed0-d2cc-4862-b0e6-4bd6215f3945",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-720,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 440,
|
||||
"height": 360,
|
||||
"content": "## Podcast Feed Configuration\n- Static: Configure podcast metadata in 'Edit Fields'\n- Dynamic: Episodes automatically pulled from Google Sheets"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1608ce65-bf1f-4dce-b4c7-b85b72ecb8c7",
|
||||
"name": "Write RSS Feed",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
-120,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Variables from a separate edit node\nconst baseUrl = $node[\"Manually Enter Other Data for Podcast Feed\"].data.baseUrl; \nconst podcastTitle = $node[\"Manually Enter Other Data for Podcast Feed\"].data.podcastTitle;\nconst podcastDescription = $node[\"Manually Enter Other Data for Podcast Feed\"].data.podcastDescription;\nconst authorName = $node[\"Manually Enter Other Data for Podcast Feed\"].data.authorName;\nconst ownerName = $node[\"Manually Enter Other Data for Podcast Feed\"].data.ownerName;\nconst ownerEmail = $node[\"Manually Enter Other Data for Podcast Feed\"].data.ownerEmail;\nconst coverImageUrl = $node[\"Manually Enter Other Data for Podcast Feed\"].data.coverImageUrl;\nconst language = $node[\"Manually Enter Other Data for Podcast Feed\"].data.language || 'en-us';\nconst explicitContent = $node[\"Manually Enter Other Data for Podcast Feed\"].data.explicitContent || false;\nconst itunesCategory = $node[\"Manually Enter Other Data for Podcast Feed\"].data.itunesCategory;\nconst webhookUrl = $node[\"Webhook GET Podcast Feed\"].data.webhookUrl\n\n// Get the input items\nconst inputItems = items;\n\n// Function to format date to RFC 822 format\nfunction formatDate(dateString) {\n return new Date(dateString || new Date()).toUTCString();\n}\n\n// Function to convert duration from seconds to HH:MM:SS\nfunction formatDuration(seconds = 0) {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n const remainingSeconds = Math.floor(seconds % 60);\n\n const minutesStr = minutes.toString().padStart(2, '0');\n const secondsStr = remainingSeconds.toString().padStart(2, '0');\n \n if (hours > 0) {\n return `${hours}:${minutesStr}:${secondsStr}`;\n }\n return `${minutesStr}:${secondsStr}`;\n}\n\n// Function to safely sanitize text\nfunction sanitizeText(text) {\n if (text === undefined || text === null) {\n return '';\n }\n return String(text)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\n// Generate the RSS feed header\nlet rssFeed = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\" \n xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n xmlns:atom=\"http://www.w3.org/2005/Atom\"\n version=\"2.0\">\n <channel>\n <title>${sanitizeText(podcastTitle)}</title>\n <description>${sanitizeText(podcastDescription)}</description>\n <link>${sanitizeText(baseUrl)}</link>\n <atom:link href=\"${sanitizeText(webhookUrl)}\" rel=\"self\" type=\"application/rss+xml\"/>\n <language>${sanitizeText(language)}</language>\n <copyright>© ${new Date().getFullYear()} ${sanitizeText(authorName)}</copyright>\n <lastBuildDate>${new Date().toUTCString()}</lastBuildDate>\n <itunes:author>${sanitizeText(authorName)}</itunes:author>\n <itunes:owner>\n <itunes:name>${sanitizeText(ownerName)}</itunes:name>\n <itunes:email>${sanitizeText(ownerEmail)}</itunes:email>\n </itunes:owner>\n <itunes:image href=\"${sanitizeText(coverImageUrl)}\"/>\n <itunes:category text=\"${sanitizeText(itunesCategory)}\"/>\n <itunes:explicit>${explicitContent}</itunes:explicit>\n <itunes:type>episodic</itunes:type>\\n`;\n\n// Generate items\nfor (const item of inputItems) {\n const json = item.json;\n \n // Extract values from the json object\n const title = sanitizeText(json.title);\n const description = sanitizeText(json.description);\n const link = sanitizeText(json.link);\n const date = json.date;\n const duration = json.duration;\n \n // Assign episode and season numbers dynamically based on row_number\n const episodeNumber = json.row_number; // Use row_number for the episode number\n const seasonNumber = 1; // You can adjust this logic if your episodes span multiple seasons\n\n rssFeed += ` <item>\n <title>${title}</title>\n <description>${description}</description>\n <link>${link}</link>\n <guid isPermaLink=\"false\">${link}</guid>\n <pubDate>${formatDate(date)}</pubDate>\n <enclosure \n url=\"${link}\"\n length=\"0\"\n type=\"audio/mpeg\"/>\n <itunes:duration>${formatDuration(duration)}</itunes:duration>\n <itunes:summary>${description}</itunes:summary>\n <itunes:episodeType>full</itunes:episodeType>\n <itunes:episode>${episodeNumber}</itunes:episode>\n <itunes:season>${seasonNumber}</itunes:season>\n <itunes:explicit>${explicitContent}</itunes:explicit>\n <content:encoded>\n <![CDATA[\n <p>${description}</p>\n ]]>\n </content:encoded>\n </item>\\n`;\n}\n\n// Close the RSS feed\nrssFeed += ` </channel>\n</rss>`;\n\n// Return the complete RSS feed\nreturn [{\n json: {\n rssFeed\n }\n}];\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "c8c7fbfc-c408-438e-af7e-5c384cfce4a5",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 340,
|
||||
"height": 360,
|
||||
"content": "## Write Podcast Feed\nGenerates RSS feed XML from collected data."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b5962e24-49eb-423a-ab8c-cb04daf5e1a0",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 460,
|
||||
"height": 540,
|
||||
"content": "## Audio to Cloudinary and Obsidian\nCloudinary stores audio files and provides duration metadata for podcast feed.\n\nSetup:\n- Create Custom Auth credentials\n- Set CLOUDINARY_ENV to your environment"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e0f18eda-13fc-4771-8ce0-11574a4469ad",
|
||||
"name": "Return Podcast Feed to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
200,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/xml"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.rssFeed }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "d3afe3f0-79e4-48c1-a0d6-356b462156c7",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
260,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 500,
|
||||
"height": 540,
|
||||
"content": "## Prepare Relevant Data\nConsolidates and formats data for Google Sheets storage."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f77ff10c-e4e3-4761-b4db-4c42d5831f5c",
|
||||
"name": "Manually Enter Other Data for Podcast Feed",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-460,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "05d1c4f7-ebe7-4df8-925b-0e0d5539f172",
|
||||
"name": "baseUrl",
|
||||
"type": "string",
|
||||
"value": "https://n8n.io"
|
||||
},
|
||||
{
|
||||
"id": "e8c6845e-887f-49e9-8336-ca2cb2a2fd29",
|
||||
"name": "podcastTitle",
|
||||
"type": "string",
|
||||
"value": "My Notes to Podcast"
|
||||
},
|
||||
{
|
||||
"id": "bf2948ed-cffa-4d3f-9bab-5fb008d83b4c",
|
||||
"name": "podcastDescription",
|
||||
"type": "string",
|
||||
"value": "My Notes Read Aloud"
|
||||
},
|
||||
{
|
||||
"id": "f5008697-3e52-4ae2-94da-c059b60a6de9",
|
||||
"name": "authorName",
|
||||
"type": "string",
|
||||
"value": "Your Name"
|
||||
},
|
||||
{
|
||||
"id": "6595bf45-e054-4e18-ade9-13e38e6efedb",
|
||||
"name": "ownerName",
|
||||
"type": "string",
|
||||
"value": "Owner Name"
|
||||
},
|
||||
{
|
||||
"id": "b21efe1c-e5b5-4bb3-bf07-a52859c7a607",
|
||||
"name": "ownerEmail",
|
||||
"type": "string",
|
||||
"value": "owner@email.com"
|
||||
},
|
||||
{
|
||||
"id": "3f0b090c-0b5e-41cb-9841-05b7b8f83126",
|
||||
"name": "coverImageUrl",
|
||||
"type": "string",
|
||||
"value": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRPDcMnpgGkzIFxDpDaHEIFVg_D6nVG5Z0pPA&s"
|
||||
},
|
||||
{
|
||||
"id": "1fb27792-1f2b-4a9a-a353-a64e31bb4747",
|
||||
"name": "language",
|
||||
"type": "string",
|
||||
"value": "en-us"
|
||||
},
|
||||
{
|
||||
"id": "7c3d868a-f3c0-4fd0-8909-e4172f8a4b18",
|
||||
"name": "explicitContent",
|
||||
"type": "string",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"id": "6aa041b4-554c-4540-889c-e37a314d5842",
|
||||
"name": "itunesCategory",
|
||||
"type": "string",
|
||||
"value": "Technology"
|
||||
}
|
||||
]
|
||||
},
|
||||
"includeOtherFields": true
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "4eb1c404-4e77-45ea-b413-4b79d8f40b1d",
|
||||
"connections": {
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Give Audio Unique Name",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Rename Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Rename Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Append Item to Google Sheet",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Write RSS Feed": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Return Podcast Feed to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook GET Note": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Give Audio Unique Name": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Upload Audio to Cloudinary",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Send Audio to Obsidian",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook GET Podcast Feed": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Items from Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Upload Audio to Cloudinary": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Append Item to Google Sheet": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Get Items from Google Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Manually Enter Other Data for Podcast Feed",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Manually Enter Other Data for Podcast Feed": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Write RSS Feed",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,342 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "0bd9e607aabfd58640f9f5a370e768a7755e93315179f5bcc6d1f8f114b3567a"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "97b36168-7fa8-4a97-a6cc-c42496918c4c",
|
||||
"name": "Search Person in CRM",
|
||||
"type": "n8n-nodes-base.pipedrive",
|
||||
"position": [
|
||||
-880,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"term": "={{ $json.from.value[0].address }}",
|
||||
"limit": 1,
|
||||
"resource": "person",
|
||||
"operation": "search",
|
||||
"additionalFields": {
|
||||
"includeFields": ""
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"pipedriveApi": {
|
||||
"id": "MdJQDtRDHnpwuVYP",
|
||||
"name": "Pipedrive LinkedUp"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2a17582b-9375-4a01-87d9-a50f573b83db",
|
||||
"name": "In campaign?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-420,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{ $json.in_campaign }}",
|
||||
"value2": "True"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2a8d509f-8ac2-4f45-a905-f34552833381",
|
||||
"name": "Get person from CRM",
|
||||
"type": "n8n-nodes-base.pipedrive",
|
||||
"position": [
|
||||
-640,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"personId": "={{ $json.id }}",
|
||||
"resource": "person",
|
||||
"operation": "get",
|
||||
"resolveProperties": true
|
||||
},
|
||||
"credentials": {
|
||||
"pipedriveApi": {
|
||||
"id": "MdJQDtRDHnpwuVYP",
|
||||
"name": "Pipedrive LinkedUp"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b9c6f3d3-1a6d-4144-8e77-3a3c6e5282d8",
|
||||
"name": "Is interested?",
|
||||
"type": "n8n-nodes-base.openAi",
|
||||
"position": [
|
||||
-180,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4",
|
||||
"prompt": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "=You are the best sales development representative in the world. You send cold email messages daily to CEOs and founders of companies. You do this to persuade them to make contact. This could be a phone call or a video meeting. \n\nYour task is to assess whether someone is interested in meeting up or calling sometime. You do this by attentively evaluating their response.\n\nThis is the email:\n{{ $('Get email').item.json.text }}\n\nThe response format should be:\n{\"interested\": [yes/no],\n\"reason\": reason\n}\n\nJSON:"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"resource": "chat"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "qPBzqgpCRxncJ90K",
|
||||
"name": "OpenAi account 2"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f1eb438d-f002-4082-8481-51565df13f5c",
|
||||
"name": "Get email",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-1100,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "email",
|
||||
"stringValue": "={{ $json.text }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "78461c36-ba54-4f0f-a38e-183bfafa576c",
|
||||
"name": "Create deal in CRM",
|
||||
"type": "n8n-nodes-base.pipedrive",
|
||||
"position": [
|
||||
460,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"title": "={{ $('Get person from CRM').item.json.Name }} Deal",
|
||||
"additionalFields": {}
|
||||
},
|
||||
"credentials": {
|
||||
"pipedriveApi": {
|
||||
"id": "MdJQDtRDHnpwuVYP",
|
||||
"name": "Pipedrive LinkedUp"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "efe07661-9afc-4184-b558-e1f547b6721f",
|
||||
"name": "IF interested",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
240,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{ $json.interested }}",
|
||||
"value2": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7c2b7b59-9d68-4d8c-9b9f-a36ea47526c9",
|
||||
"name": "Get response",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
20,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "let interested = JSON.parse($json[\"message\"][\"content\"]).interested\nlet reason = JSON.parse($json[\"message\"][\"content\"]).reason\n\nreturn {json:{\n interested: interested,\n reason: reason\n}}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "53f51f8c-5995-4bcd-a038-3018834942e6",
|
||||
"name": "Email box 1",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"position": [
|
||||
-1300,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"filters": {
|
||||
"labelIds": []
|
||||
},
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bb1254ec-676a-4edc-bf4a-a1c66bac78bb",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1880,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"width": 452.37174177689576,
|
||||
"height": 462.1804790107177,
|
||||
"content": "## About the workflow\nThe workflow reads every reply that is received from a cold email campaign and qualifies if the lead is interested in a meeting. If the lead is interested, a deal is made in pipedrive. You can add as many email inboxes as you need!\n\n## Setup:\n- Add credentials to the Gmail, OpenAI and Pipedrive Nodes.\n- Add a in_campaign field in Pipedrive for persons. In Pipedrive click on your credentials at the top right, go to company settings > Data fields > Person and click on add custom field. Single option [TRUE/FALSE].\n- If you have only one email inbox, you can delete one of the Gmail nodes.\n- If you have more than two email inboxes, you can duplicate a Gmail node as many times as you like. Just connect it to the Get email node, and you are good to go!\n- In the Gmail inbox nodes, select Inbox under label names and uncheck Simplify."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c1aaee97-11f4-4e9d-9a71-90ca3f5773a9",
|
||||
"name": "Email box 2",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"position": [
|
||||
-1300,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"filters": {
|
||||
"labelIds": []
|
||||
},
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Get email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Search Person in CRM",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email box 1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email box 2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get response": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF interested",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"In campaign?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Is interested?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"IF interested": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create deal in CRM",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Is interested?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get person from CRM": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "In campaign?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Search Person in CRM": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get person from CRM",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa",
|
||||
"templateId": "2436"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b24c6e28-3c9e-4069-9e87-49b2efd47257",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1200,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "AzPPV759YPBxJj3o",
|
||||
"name": "Max's DevRel OpenAI account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c71a3e22-f0fd-4377-9be2-32438b282430",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
200,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 494.9629292914819,
|
||||
"content": "\n## \"Hey Siri, Ask Agent\" workflow\n**Made by [Max Tkacz](https://www.linkedin.com/in/maxtkacz) during the [30 Day AI Sprint](https://30dayaisprint.notion.site/)**\n\nThis template integrates with Apple Shortcuts to trigger an n8n AI Agent via a \"Hey Siri\" command. The shortcut prompts for spoken input, transcribes it, and sends it to the workflow's `When Called by Apple Shortcut` Webhook trigger. The AI Agent processes the input and Siri dictates the response back to you.\n\nThe workflow also passes the current date and time to the `AI Agent`, which you can extend with additional context, like data from an App node, for more customized responses.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a4ec93c3-eefa-4006-b02c-f995fb7bc410",
|
||||
"name": "Respond to Apple Shortcut",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
1640,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.output }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "942b284e-e26a-4534-8f33-eb92b0a88fdb",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
200,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 438.5821431288714,
|
||||
"content": "### Set up steps\n1. Add an OpenAI API credential in `OpenAI Chat Model` node, or replace it with another model. Try `Groq` if you want a free alternative (can be used with free Groq account, no CC).\n2. Copy the \"Production URL\" from `When called by Apple Shortcut` node, you'll need this when setting up the shortcut.\n3. Save and activate this n8n workflow.\n4. Download the [Apple Shortcut here](https://uploads.n8n.io/devrel/ask-agent.shortcut), open it on macOS or iOS. This adds the shortcut to your device.\n5. Open the shortcut and swap URL in `Get contents of\" step to the \"Production URL\" you copied from `When called by Apple Shortcut`.\n6. Test it by saying \"Hey Siri, AI Agent\", then ask a question."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ebb9e886-546a-429c-b4b5-35c0a7b6370e",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
503.6292958565226,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 240.6839895136402,
|
||||
"content": "### ... or watch set up video [5 min]\n[](https://youtu.be/dewsB-4iGA8)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5a842fa9-be8c-4ba8-996b-a26a53273b3f",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1240,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Here is my request: {{ $json.body.input }}\n",
|
||||
"agent": "conversationalAgent",
|
||||
"options": {
|
||||
"systemMessage": "=## Task\nYou are a helpful assistant. Provide concise replies as the user receives them via voice on their mobile phone. Avoid using symbols like \"\\n\" to prevent them from being narrated.\n\n## Context\n- Today is {{ $now.format('dd LLL yy') }}.\n- Current time: {{ $now.format('h:mm a') }} in Berlin, Germany.\n- When asked, you are an AI Agent running as an n8n workflow.\n\n## Output\nKeep responses short and clear, optimized for voice delivery. Don't hallucinate, if you don't know the answer, say you don't know. "
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "598d22d5-7472-44c5-ab2e-69c8bbb23ddd",
|
||||
"name": "When called by Apple Shortcut",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
980,
|
||||
460
|
||||
],
|
||||
"webhookId": "f0224b4b-1644-4d3d-9f12-01a9c04879e4",
|
||||
"parameters": {
|
||||
"path": "assistant",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Apple Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When called by Apple Shortcut": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,504 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b165115d-5505-4e03-bf41-c21320cb8b09",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 681.8337349708484,
|
||||
"height": 843.1482165886073,
|
||||
"content": "## Workflow: Text automations using Apple Shortcuts\n\n**Overview**\n- This workflow answers user requests sent via Apple Shortcuts\n- Several Shortcuts call the same webhook, with a query and a type of query\n- Types of query are:\n - translate to english\n - translate to spanish\n - correct grammar (without changing the actual content)\n - make content shorter\n - make content longer\n\n\n**How it works**\n- Select a text you are writing\n- Launch the shortcut\n- The text is sent to the webhook\n- Depending on the type of request, a different prompt is used\n- Each request is sent to an OpenAI node\n- The workflow responds to the request with the response from GPT\n- Shortcut replace the selected text with the new one\n\n**How to use it**\n- Activate the workflow\n- Download [this Shortcut template](https://drive.usercontent.google.com/u/0/uc?id=16zs5iJX7KeX_4e0SoV49_KfbU7-EF0NE&export=download)\n- Install the shortcut\n- In step 2 of the shortcut, change the url of the Webhook\n- In Shortcut details, \"add Keyboard Shortcut\" with the key you want to use to launch the shortcut\n- Go to settings, advanced, check \"Allow running scripts\"\n- You are ready to use the shortcut. Select a text and hit the keyboard shortcut you just defined\n\n\n**Notes**\n- If you use rich formatting, you'll have to test multiple ways to replace characters in the output. For example, you might use `{{ $json.message.content.output.replaceAll('\\n', \"<br/>\") }}` in the \"Respond to Shortcut\" node depending on the app you use most.\n- This is a basic example that you can extend and modify at your will\n- You can duplicate and modify the example shortcut based on your need, as well as making new automations in this workflow."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c45400b8-d3b8-47f7-81c6-d791bce4c266",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1020,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "spanish",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "spanish"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "english",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bedb302f-646c-4dcd-8246-1fcfecfe3f2e",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "english"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "grammar",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "94e6cf7d-576d-4ad9-85b0-c6b945eb41b7",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "grammar"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "shorter",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "1ed0d1e1-2df0-4f8d-b102-4004a25919ed",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "shorter"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "longer",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "4756df03-7e7c-4e28-9b37-14684326b083",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "longer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "48e0e58e-6293-4e11-a488-ca9943b53484",
|
||||
"name": "Respond to Shortcut",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
1840,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.message.content.output.replaceAll('\\n', '<br/>') }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "2655b782-9538-416c-ae65-35f8c77889c7",
|
||||
"name": "Webhook from Shortcut",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
840,
|
||||
400
|
||||
],
|
||||
"webhookId": "e4ddadd2-a127-4690-98ca-e9ee75c1bdd6",
|
||||
"parameters": {
|
||||
"path": "shortcut-global-as",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "880ed4a2-0756-4943-a51f-368678e22273",
|
||||
"name": "OpenAI - Make Shorter",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Summarize this content a little bit (5% shorter)\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "c6c6d988-7aab-4677-af1f-880d05691ec3",
|
||||
"name": "OpenAI - Make Longer",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Make this content a little longer (5% longer)\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "8e6de4b7-22c3-45c9-a8d7-d498cf829b6f",
|
||||
"name": "OpenAI - Correct Grammar",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Correct grammar only, don't change the actual contents.\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "bc006b36-5a96-4c3a-9a28-2778a6c49f10",
|
||||
"name": "OpenAI - To Spanish",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Translate this message to Spanish.\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "330d2e40-1e52-4517-94e0-ce96226697fa",
|
||||
"name": "OpenAI - To English",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Translate this message to English.\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "925e4b55-ac26-4c16-941f-66d17b6794ab",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
900
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 469.15174499329123,
|
||||
"height": 341.88919758842485,
|
||||
"content": "### Check these explanations [< 3 min]\n\n[](https://www.loom.com/share/c5b657568af64bb1b50fa8e8a91c45d1?sid=a406be73-55eb-4754-9f51-9ddf49b22d69)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - To Spanish",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - To English",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Correct Grammar",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Make Shorter",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Make Longer",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - To English": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - To Spanish": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Make Longer": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Make Shorter": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook from Shortcut": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Correct Grammar": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,504 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b165115d-5505-4e03-bf41-c21320cb8b09",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 681.8337349708484,
|
||||
"height": 843.1482165886073,
|
||||
"content": "## Workflow: Text automations using Apple Shortcuts\n\n**Overview**\n- This workflow answers user requests sent via Apple Shortcuts\n- Several Shortcuts call the same webhook, with a query and a type of query\n- Types of query are:\n - translate to english\n - translate to spanish\n - correct grammar (without changing the actual content)\n - make content shorter\n - make content longer\n\n\n**How it works**\n- Select a text you are writing\n- Launch the shortcut\n- The text is sent to the webhook\n- Depending on the type of request, a different prompt is used\n- Each request is sent to an OpenAI node\n- The workflow responds to the request with the response from GPT\n- Shortcut replace the selected text with the new one\n\n**How to use it**\n- Activate the workflow\n- Download [this Shortcut template](https://drive.usercontent.google.com/u/0/uc?id=16zs5iJX7KeX_4e0SoV49_KfbU7-EF0NE&export=download)\n- Install the shortcut\n- In step 2 of the shortcut, change the url of the Webhook\n- In Shortcut details, \"add Keyboard Shortcut\" with the key you want to use to launch the shortcut\n- Go to settings, advanced, check \"Allow running scripts\"\n- You are ready to use the shortcut. Select a text and hit the keyboard shortcut you just defined\n\n\n**Notes**\n- If you use rich formatting, you'll have to test multiple ways to replace characters in the output. For example, you might use `{{ $json.message.content.output.replaceAll('\\n', \"<br/>\") }}` in the \"Respond to Shortcut\" node depending on the app you use most.\n- This is a basic example that you can extend and modify at your will\n- You can duplicate and modify the example shortcut based on your need, as well as making new automations in this workflow."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c45400b8-d3b8-47f7-81c6-d791bce4c266",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1020,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "spanish",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "spanish"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "english",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bedb302f-646c-4dcd-8246-1fcfecfe3f2e",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "english"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "grammar",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "94e6cf7d-576d-4ad9-85b0-c6b945eb41b7",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "grammar"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "shorter",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "1ed0d1e1-2df0-4f8d-b102-4004a25919ed",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "shorter"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "longer",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "4756df03-7e7c-4e28-9b37-14684326b083",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.type }}",
|
||||
"rightValue": "longer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "48e0e58e-6293-4e11-a488-ca9943b53484",
|
||||
"name": "Respond to Shortcut",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
1840,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.message.content.output.replaceAll('\\n', '<br/>') }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "2655b782-9538-416c-ae65-35f8c77889c7",
|
||||
"name": "Webhook from Shortcut",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
840,
|
||||
400
|
||||
],
|
||||
"webhookId": "e4ddadd2-a127-4690-98ca-e9ee75c1bdd6",
|
||||
"parameters": {
|
||||
"path": "shortcut-global-as",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "880ed4a2-0756-4943-a51f-368678e22273",
|
||||
"name": "OpenAI - Make Shorter",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Summarize this content a little bit (5% shorter)\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "c6c6d988-7aab-4677-af1f-880d05691ec3",
|
||||
"name": "OpenAI - Make Longer",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Make this content a little longer (5% longer)\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "8e6de4b7-22c3-45c9-a8d7-d498cf829b6f",
|
||||
"name": "OpenAI - Correct Grammar",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Correct grammar only, don't change the actual contents.\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "bc006b36-5a96-4c3a-9a28-2778a6c49f10",
|
||||
"name": "OpenAI - To Spanish",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Translate this message to Spanish.\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "330d2e40-1e52-4517-94e0-ce96226697fa",
|
||||
"name": "OpenAI - To English",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1300,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Translate this message to English.\nOutput a JSON with a single field: output"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.body.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "925e4b55-ac26-4c16-941f-66d17b6794ab",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
900
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 469.15174499329123,
|
||||
"height": 341.88919758842485,
|
||||
"content": "### Check these explanations [< 3 min]\n\n[](https://www.loom.com/share/c5b657568af64bb1b50fa8e8a91c45d1?sid=a406be73-55eb-4754-9f51-9ddf49b22d69)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - To Spanish",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - To English",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Correct Grammar",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Make Shorter",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Make Longer",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - To English": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - To Spanish": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Make Longer": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Make Shorter": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook from Shortcut": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Correct Grammar": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Shortcut",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,465 @@
|
||||
{
|
||||
"id": "SJrqDqTBIAyaZQkq",
|
||||
"meta": {
|
||||
"instanceId": "73d9d5380db181d01f4e26492c771d4cb5c4d6d109f18e2621cf49cac4c50763",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "UTM Link Creator & QR Code Generator with Scheduled Google Analytics Reports",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "5efbd956-51b6-4f94-aebc-07e3e691f7eb",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-180,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "95QGJD3XSz0piaNU",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "a1acd323-ed07-41b4-a51e-614afe361893",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
0,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "={{ $json.timestamp }}",
|
||||
"sessionIdType": "customKey",
|
||||
"contextWindowLength": 200
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "c3c2b5fa-c294-4306-a050-dccd592477fa",
|
||||
"name": "Google Analytics",
|
||||
"type": "n8n-nodes-base.googleAnalyticsTool",
|
||||
"position": [
|
||||
160,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"metricsGA4": {
|
||||
"metricValues": [
|
||||
{
|
||||
"listName": "sessions"
|
||||
}
|
||||
]
|
||||
},
|
||||
"propertyId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "404306108",
|
||||
"cachedResultUrl": "https://analytics.google.com/analytics/web/#/p404306108/",
|
||||
"cachedResultName": "East Coast Concrete Coating"
|
||||
},
|
||||
"dimensionsGA4": {
|
||||
"dimensionValues": [
|
||||
{},
|
||||
{
|
||||
"listName": "sourceMedium"
|
||||
}
|
||||
]
|
||||
},
|
||||
"additionalFields": {}
|
||||
},
|
||||
"credentials": {
|
||||
"googleAnalyticsOAuth2": {
|
||||
"id": "sVZ61SpNfC2D1Z7V",
|
||||
"name": "Google Analytics account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "cbc7b539-2fa6-493b-a66c-13db8d8d420c",
|
||||
"name": "Create UTM Link & Send To Database",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-440,
|
||||
-80
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5358f2cc-bdb0-4e9b-a6b9-93418f83db02",
|
||||
"name": "Set UTM Parameters For Link",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-220,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "28d0a36d-5b03-4b74-9941-ef0e1aab86bf",
|
||||
"name": "website_url",
|
||||
"type": "string",
|
||||
"value": "https://ecconcretecoating.com/"
|
||||
},
|
||||
{
|
||||
"id": "1a2ee174-4684-4246-813f-b67285af48b8",
|
||||
"name": "campaign_id",
|
||||
"type": "string",
|
||||
"value": "12246"
|
||||
},
|
||||
{
|
||||
"id": "e15a846d-6e37-4fbf-a9f4-b3fce3441295",
|
||||
"name": "campaign_source",
|
||||
"type": "string",
|
||||
"value": "google"
|
||||
},
|
||||
{
|
||||
"id": "f15e2bb1-08a6-48c4-8458-b753864e9364",
|
||||
"name": "campaign_medium",
|
||||
"type": "string",
|
||||
"value": "display"
|
||||
},
|
||||
{
|
||||
"id": "548900ab-aa2c-498f-bbd9-a787306e72db",
|
||||
"name": "campaign_name",
|
||||
"type": "string",
|
||||
"value": "summerfun"
|
||||
},
|
||||
{
|
||||
"id": "fd8d1bd4-a75d-4c49-b795-8fda7c377b66",
|
||||
"name": "campaign_term",
|
||||
"type": "string",
|
||||
"value": "conretecoating"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "45daf73a-01c2-40ab-8546-7fdd489e2a1c",
|
||||
"name": "Create UTM Link With Parameters",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
40,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n const utmUrl = `${item?.json?.website_url}?utm_source=${item?.json?.campaign_source}&utm_medium=${item?.json?.campaign_medium}&utm_campaign=${item?.json?.campaign_name}&utm_term=${item?.json?.campaign_term}&utm_content=${item?.json?.campaign_id}`;\n item.json.utmUrl = utmUrl;\n return item;\n});\nreturn updatedItems;\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "a621984d-eea5-464d-9be3-e620e779abd5",
|
||||
"name": "Submit UTM Link To Database",
|
||||
"type": "n8n-nodes-base.airtable",
|
||||
"position": [
|
||||
280,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"base": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "appIXd8a8JeB9bPaL",
|
||||
"cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL",
|
||||
"cachedResultName": "Untitled Base"
|
||||
},
|
||||
"table": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "tblXyFxXMHraieGCa",
|
||||
"cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL/tblXyFxXMHraieGCa",
|
||||
"cachedResultName": "UTM_URL"
|
||||
},
|
||||
"columns": {
|
||||
"value": {
|
||||
"URL": "={{ $json.utmUrl }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "id",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": true,
|
||||
"required": false,
|
||||
"displayName": "id",
|
||||
"defaultMatch": true
|
||||
},
|
||||
{
|
||||
"id": "URL",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": false,
|
||||
"required": false,
|
||||
"displayName": "URL",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [
|
||||
"id"
|
||||
],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {},
|
||||
"operation": "upsert"
|
||||
},
|
||||
"credentials": {
|
||||
"airtableTokenApi": {
|
||||
"id": "0ApVmNsLu7aFzQD6",
|
||||
"name": "Airtable Personal Access Token account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "19074462-d719-4fdf-bc59-d6b2ecd1ce20",
|
||||
"name": "Create QR Code With Submitted QR Link",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
280,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://quickchart.io/qr?text={{ $json.utmUrl }}&size=300&margin=10&ecLevel=H&dark=000000&light=FFFFFF\n",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "a8c22bb2-f8eb-4e5f-b288-9c25e0aeb648",
|
||||
"name": "Schedule Google Analytics Report To Marketing Manager",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
-460,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "268c110c-2b7c-4450-b5b0-5d5326eac17f",
|
||||
"name": "Google Analytics Data Analysis Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-100,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.timestamp }}",
|
||||
"options": {
|
||||
"systemMessage": "\"You are an advanced data analytics AI specializing in executive reporting. Your task is to analyze the provided dataset and generate a structured executive summary that highlights key insights, trends, and actionable takeaways. Structure your summary in the following format:\n\nOverview – Briefly describe the dataset and its significance.\nKey Performance Indicators (KPIs) – Highlight the most important metrics and compare them to previous periods if applicable.\nTrends & Insights – Identify patterns, growth areas, declines, and anomalies.\nOpportunities & Recommendations – Provide strategic recommendations based on the insights.\nConclusion – Summarize the key takeaways concisely.\n*Ensure the tone is professional, clear, and tailored for executives who require quick, data-driven insights without unnecessary details.\""
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "1b012731-e67b-4e0d-95b7-a7f587754a05",
|
||||
"name": "Send Summary Report To Marketing Manager",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
300,
|
||||
280
|
||||
],
|
||||
"webhookId": "a9b88615-c7e2-4b56-891a-98f4d6b34220",
|
||||
"parameters": {
|
||||
"sendTo": "john@marketingcanopy.com",
|
||||
"message": "={{ $json.output }}",
|
||||
"options": {},
|
||||
"subject": "Google Analytics Metrics Summary Report"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "pIXP1ZseBP4Z5CCp",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "9da758e1-8aed-446b-a074-8fee5405583f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-540,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 500,
|
||||
"height": 400,
|
||||
"content": "Create a marketing link with UTM parameters. Easily store in database and have QR code created and ready as well.\n\nType in requirements:\nwebsite URL\ncampaign id\ncampaign source\ncampaign medium\ncampaign name\ncampaign term\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "92f5df8d-88ca-4b58-b544-c0b2d3578a73",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 580,
|
||||
"height": 540,
|
||||
"content": "Code node creates the URL with UTM parameters. \n\nIt then sends to your Airtable database to store for records. It also creates a QR code with the embedded link to be used for materials. \n\nSample Airtable Setup:\n-Website Link UTM column"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "408af10c-4b0e-4d94-b02d-5d887fb150c3",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-540,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 1340,
|
||||
"height": 460,
|
||||
"content": "Schedule a Google Analytics Reports with Medium/Source to track UTM link performance. Update the reporting fields to fit your business needs. You can track traffic, conversions and other engagement metrics.\n\n*Sample Google Report Metrics: Sessions. Update metrics as needed."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "6e6641fd-a59c-49e9-af43-1b2b9b458544",
|
||||
"connections": {
|
||||
"Google Analytics": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Google Analytics Data Analysis Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Google Analytics Data Analysis Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Google Analytics Data Analysis Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set UTM Parameters For Link": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create UTM Link With Parameters",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Submit UTM Link To Database": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create UTM Link With Parameters": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create QR Code With Submitted QR Link",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Submit UTM Link To Database",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create UTM Link & Send To Database": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set UTM Parameters For Link",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Analytics Data Analysis Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Summary Report To Marketing Manager",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Send Summary Report To Marketing Manager": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Schedule Google Analytics Report To Marketing Manager": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Analytics Data Analysis Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d45cf237-dbbc-48ed-a7f0-fa9506ae1d67",
|
||||
"name": "Update priority in todoist",
|
||||
"type": "n8n-nodes-base.todoist",
|
||||
"position": [
|
||||
2060,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"taskId": "={{ $('Get inbox tasks').item.json.id }}",
|
||||
"operation": "update",
|
||||
"updateFields": {
|
||||
"priority": "={{ $('Your Projects').first().json.projects[$json.message.content] }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"todoistApi": {
|
||||
"id": "1",
|
||||
"name": "Todoist account"
|
||||
}
|
||||
},
|
||||
"retryOnFail": true,
|
||||
"typeVersion": 2,
|
||||
"waitBetweenTries": 5000
|
||||
},
|
||||
{
|
||||
"id": "4d0ebf98-5a1d-4dfd-85df-da182b3c5099",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
600,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "a950e470-6885-42f4-9b17-7b2c2525d3e4",
|
||||
"name": "Get inbox tasks",
|
||||
"type": "n8n-nodes-base.todoist",
|
||||
"position": [
|
||||
1020,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"filters": {
|
||||
"projectId": "938017196"
|
||||
},
|
||||
"operation": "getAll",
|
||||
"returnAll": true
|
||||
},
|
||||
"credentials": {
|
||||
"todoistApi": {
|
||||
"id": "1",
|
||||
"name": "Todoist account"
|
||||
}
|
||||
},
|
||||
"retryOnFail": true,
|
||||
"typeVersion": 2,
|
||||
"waitBetweenTries": 5000
|
||||
},
|
||||
{
|
||||
"id": "093bcb2e-79b7-427e-b13d-540a5b28f427",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 358.6620209059232,
|
||||
"height": 256.5853658536585,
|
||||
"content": "## 💫 To setup this template\n\n1. Add your Todoist credentials\n2. Add your OpenAI credentials\n3. Set your project names and add priority"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "430290e7-1732-46fe-a38d-fa6dc7f78a26",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"width": 192.77351916376313,
|
||||
"height": 80,
|
||||
"content": " 👆🏽 Add your projects and priority here"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6d5a1b7e-f7fa-4a1b-848c-1b4e79f6f667",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"width": 192.77351916376313,
|
||||
"height": 80,
|
||||
"content": " 👇🏽 Add your Todoist credentials here"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "feff35d2-e37d-48a5-9a90-c5a2efde688f",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2060,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"width": 192.77351916376313,
|
||||
"height": 80,
|
||||
"content": " 👇🏽 Add your Todoist credentials here"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e454ebfe-47f6-4e39-8b89-d706da742911",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1540,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"width": 192.77351916376313,
|
||||
"height": 80,
|
||||
"content": " 👆🏽 Add your OpenAI credentials here"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a79effcb-6904-4abf-835b-e1ccd94ca429",
|
||||
"name": "Your Projects",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
820,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "50dc1412-21f8-4158-898d-3940a146586b",
|
||||
"name": "projects",
|
||||
"type": "object",
|
||||
"value": "={{ {\n apartment: 1,\n health: 2,\n german: 3\n} }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "b5988629-2225-455f-b579-73e60449d2a3",
|
||||
"name": "Categorize",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1460,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "=Categorize the user's todo item to a project. Return the project name or just \"other\" if it does not belong to a project."
|
||||
},
|
||||
{
|
||||
"content": "=Projects:\n{{ $('Your Projects').first().json.projects.keys().join('\\n') }}\n\nTodo item:\n{{ $('Get inbox tasks').item.json.content }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "9",
|
||||
"name": "n8n OpenAi"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "0dca3953-c0ac-4319-9323-c3aed9488bfb",
|
||||
"name": "If task is not a subtask",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"position": [
|
||||
1240,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "36dd4bc9-1282-4342-89dd-1dac81c7290e",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "empty",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.parent_id }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "12e25a81-dbde-4542-a137-365329da415e",
|
||||
"name": "If other or ai hallucinates",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"position": [
|
||||
1820,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "c4f69265-abe1-451c-8462-e68ff3b06799",
|
||||
"operator": {
|
||||
"type": "array",
|
||||
"operation": "contains",
|
||||
"rightType": "any"
|
||||
},
|
||||
"leftValue": "={{ $('Your Projects').first().json.projects.keys() }}",
|
||||
"rightValue": "={{ $json.message.content }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Categorize": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If other or ai hallucinates",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Your Projects": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get inbox tasks",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get inbox tasks": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If task is not a subtask",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Your Projects",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If task is not a subtask": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Categorize",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If other or ai hallucinates": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Update priority in todoist",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"id": "7DPLpEkww5Uctcml",
|
||||
"meta": {
|
||||
"instanceId": "75d76ac1fb686d403c2294ca007b62282f34c3e15dc3528cc1dbe36a827c0c6e"
|
||||
},
|
||||
"name": "get_a_web_page",
|
||||
"tags": [
|
||||
{
|
||||
"id": "7v5QbLiQYkQ7zGTK",
|
||||
"name": "tools",
|
||||
"createdAt": "2025-01-08T16:33:21.887Z",
|
||||
"updatedAt": "2025-01-08T16:33:21.887Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "290cc9b8-e4b1-4124-ab0e-afbb02a9072b",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-460,
|
||||
-100
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f256ed59-ba61-4912-9a75-4e7703547de5",
|
||||
"name": "FireCrawl",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-220,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.firecrawl.dev/v1/scrape",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"url\": \"{{ $json.query.url }}\",\n \"formats\": [\n \"markdown\"\n ]\n} ",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "RoJ6k6pWBzSVp9JK",
|
||||
"name": "Firecrawl"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "a28bdbe6-fa59-4bf1-b0ab-c34ebb10cf0f",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-20,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "1af62ef9-7385-411a-8aba-e4087f09c3a9",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ $json.data.markdown }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "fcd26213-038a-453f-80e5-a3936e4c2d06",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-480,
|
||||
-340
|
||||
],
|
||||
"parameters": {
|
||||
"width": 620,
|
||||
"height": 200,
|
||||
"content": "## Send URL got Crawl\nThis can be reused by Ai Agents and any Workspace to crawl a site. All that Workspace has to do is send a request:\n\n```json\n {\n \"url\": \"Some URL to Get\"\n }\n```"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"Execute Workflow Trigger": [
|
||||
{
|
||||
"json": {
|
||||
"query": {
|
||||
"url": "https://en.wikipedia.org/wiki/Linux"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "396f46a7-3120-42f9-b3d5-2021e6e995b8",
|
||||
"connections": {
|
||||
"FireCrawl": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "FireCrawl",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,533 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "50695e7f-3334-4124-a46e-1b3819412e26",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1260,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.1
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2f07481d-3ca4-48ab-a8ff-59e9ab5c6062",
|
||||
"name": "Execute Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflow",
|
||||
"position": [
|
||||
2360,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"waitForSubWorkflow": true
|
||||
},
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "49120164-4ffc-4fe0-8ee3-4ae13bda6c8d",
|
||||
"name": "Execute \"Generate a chart\" tool",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
1320,
|
||||
1140
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0fc6eaf9-8521-44ec-987e-73644d0cba79",
|
||||
"name": "OpenAI - Generate Chart definition with Structured Output",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/chat/completions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Based on the user request, generate a valid Chart.js definition. Important: - Be careful with the data scale and beginatzero that all data are visible. Example if ploted data 2 and 3 on a bar chart, the baseline should be 0. - Charts colors should be different only if there are multiple datasets. - Output valid JSON. In scales, min and max are numbers. Example: `{scales:{yAxes:[{ticks:{min:0,max:3}`\"\n },\n {\n \"role\": \"user\",\n \"content\": \"**User Request**: {{ $json.user_question }} \\n **Data to visualize**: {{ $json.output.replaceAll('\\n', \" \").replaceAll('\"', \"\") }}\"\n }\n ],\n \"response_format\": {\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"chart_configuration\",\n \"description\": \"Configuration schema for Chart.js charts\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\"bar\", \"line\", \"radar\", \"pie\", \"doughnut\", \"polarArea\", \"bubble\", \"scatter\", \"area\"]\n },\n \"data\": {\n \"type\": \"object\",\n \"properties\": {\n \"labels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"datasets\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\n \"type\": [\"string\", \"null\"]\n },\n \"data\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n },\n \"backgroundColor\": {\n \"type\": [\"array\", \"null\"],\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"borderColor\": {\n \"type\": [\"array\", \"null\"],\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"borderWidth\": {\n \"type\": [\"number\", \"null\"]\n }\n },\n \"required\": [\"data\", \"label\", \"backgroundColor\", \"borderColor\", \"borderWidth\"],\n \"additionalProperties\": false\n }\n }\n },\n \"required\": [\"labels\", \"datasets\"],\n \"additionalProperties\": false\n },\n \"options\": {\n \"type\": \"object\",\n \"properties\": {\n \"scales\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"yAxes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"ticks\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"max\": {\n \"type\": [\"number\", \"null\"]\n },\n \"min\": {\n \"type\": [\"number\", \"null\"]\n },\n \"stepSize\": {\n \"type\": [\"number\", \"null\"]\n },\n \"beginAtZero\": {\n \"type\": [\"boolean\", \"null\"]\n }\n },\n \"required\": [\"max\", \"min\", \"stepSize\", \"beginAtZero\"],\n \"additionalProperties\": false\n },\n \"stacked\": {\n \"type\": [\"boolean\", \"null\"]\n }\n },\n \"required\": [\"ticks\", \"stacked\"],\n \"additionalProperties\": false\n }},\n \"xAxes\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"stacked\": {\n \"type\": [\"boolean\", \"null\"]\n }\n },\n \"required\": [\"stacked\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"yAxes\", \"xAxes\"],\n \"additionalProperties\": false\n },\n \"plugins\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"title\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"display\": {\n \"type\": [\"boolean\", \"null\"]\n },\n \"text\": {\n \"type\": [\"string\", \"null\"]\n }\n },\n \"required\": [\"display\", \"text\"],\n \"additionalProperties\": false\n },\n \"legend\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"display\": {\n \"type\": [\"boolean\", \"null\"]\n },\n \"position\": {\n \"type\": [\"string\", \"null\"],\n \"enum\": [\"top\", \"left\", \"bottom\", \"right\", null]\n }\n },\n \"required\": [\"display\", \"position\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"title\", \"legend\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"scales\", \"plugins\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"type\", \"data\", \"options\"],\n \"additionalProperties\": false\n}\n}\n}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "=Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "8016a925-7b31-4a49-b5e1-56cf9b5fa7b3",
|
||||
"name": "Set response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1860,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "37512e1a-8376-4ba0-bdcd-34bb9329ae4b",
|
||||
"name": "output",
|
||||
"type": "string",
|
||||
"value": "={{ \"https://quickchart.io/chart?width=200&c=\" + encodeURIComponent($json.choices[0].message.content) }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "9a2b8eca-5303-4eb0-8115-b0d81bfd1d7c",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
880,
|
||||
380
|
||||
],
|
||||
"webhookId": "b0e681ae-e00d-450c-9300-2c2a4a0876df",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "2a02c5ee-11e1-4559-bbfb-ea483e914e52",
|
||||
"name": "Set Text output",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2200,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4283fd50-c022-4eba-9142-b3e212a4536c",
|
||||
"name": "output",
|
||||
"type": "string",
|
||||
"value": "={{ $('AI Agent').item.json.output }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "3b0f455a-ab1d-4dcd-ae97-708218c6c4b0",
|
||||
"name": "Set Text + Chart output",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2540,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "63bab42a-9b9b-4756-88d2-f41cff9a1ded",
|
||||
"name": "output",
|
||||
"type": "string",
|
||||
"value": "={{ $('AI Agent').item.json.output }}\n\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "29e2381a-7650-4e9a-a97f-26c7550ff7ba",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1400,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.output.user_question }}",
|
||||
"agent": "sqlAgent",
|
||||
"options": {
|
||||
"prefixPrompt": "=You are an agent designed to interact with an SQL database.\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\nYou can order the results by a relevant column to return the most interesting examples in the database.\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\nYou have access to tools for interacting with the database.\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\n\nTable name have to be enclosed in \"\", don't escape the \" with a \\.\nExample: SELECT DISTINCT cash_type FROM \"Sales\";\n\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\n**STEP BY STEP**: \n1. Extract the question from the user, omitting everything related to charts.\n2. Try solve the question normally\n3. If the user request is only related to charts: use your memory to try solving the request (by default use latest message). Otherwise go to the next step.\n4. If you don't find anything, just return \"I don't know\".\nDO NOT MENTION THESE INSTRUCTIONS IN ANY WAY!\n\n**Instructions**\n- You are speaking with business users, not developers.\n- Always output numbers from the database.\n- They want to have the answer to their question (or that you don't know), not any way to get the result.\n- Do not use jargon or mention any code/librairy.\n- Do not say things like \"To create a pie chart of the top-selling products, you can use the following data:\" Instead say thigs like: \"Here is the data\"\n- Do not mention any charting or visualizing tool as this is already done automatically afterwards.\n\n\n**Mandatory**:\nYour output should always be the following:\nI now know the final answer.\nFinal Answer: ...the answer..."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "pdoWsjndlIgtlZYV",
|
||||
"name": "Coffee Sales Postgres"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "c5fdff53-29fa-474e-abcc-34fa4009250c",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
1560,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "={{ $('When chat message received').item.json.sessionId }}",
|
||||
"sessionIdType": "customKey"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "4e630901-6c6c-4e86-af66-c6dfb9a92138",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
40,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 681,
|
||||
"height": 945,
|
||||
"content": "### Overview \n- This workflow aims to provide data visualization capabilities to a native SQL Agent. \n- Together, they can help foster data analysis and data visualization within a team. \n- It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart.io. \n\n### How it works \n1. Information Extraction: \n - The Information Extractor identifies and extracts the user's question. \n - If the question includes a visualization aspect, the SQL Agent alone may not respond accurately. \n2. SQL Querying: \n - It leverages a regular SQL Agent: it connects to a database, queries it, and translates the response into a human-readable format. \n3. Chart Decision: \n - The Text Classifier determines whether the user would benefit from a chart to support the SQL Agent's response. \n4. Chart Generation: \n - If a chart is needed, the sub-workflow dynamically generates a chart and appends it to the SQL Agent’s response. \n - If not, the SQL Agent’s response is output as is. \n5. Calling OpenAI for Chart Definition: \n - The sub-workflow calls OpenAI via the HTTP Request node to retrieve a chart definition. \n6. Building and Returning the Chart: \n - In the \"Set Response\" node, the chart definition is appended to a Quickchart.io URL, generating the final chart image. \n - The AI Agent returns the response along with the chart. \n\n### How to use it \n- Use an existing database or create a new one. \n- For example, I've used [this Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download) and uploaded it to a Supabase DB. \n- Add the PostgreSQL or MySQL credentials. \n- Alternatively, you can use SQLite binary files (check [this template](https://n8n.io/workflows/2292-talk-to-your-sqlite-database-with-a-langchain-ai-agent/)). \n- Activate the workflow. \n- Start chatting with the AI SQL Agent. \n- If the Text Classifier determines a chart would be useful, it will generate one in addition to the SQL Agent's response. \n\n### Notes \n- The full Quickchart.io specifications have not been fully integrated, so there may be some glitches (e.g., radar graphs may not display properly due to size limitations). "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36d7b17f-c7df-4a0a-8781-626dc1edddee",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1260,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 769,
|
||||
"height": 523,
|
||||
"content": "## Generate a Quickchart definition \n[Original template](https://n8n.io/workflows/2400-ai-agent-with-charts-capabilities-using-openai-structured-output-and-quickchart/)\n\n**HTTP Request node**\n- Send the chart query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The JSON structure is based on ChartJS and Quickchart.io definitions, that let us create nice looking graphs.\n- The output is a JSON containing the chart definition that is passed to the next node.\n\n**Set Response node**\n- Adds the chart definition at the end of a Quickchart.io URL ([see documentation](https://quickchart.io/documentation/usage/parameters/))\n- Note that in the parameters, we specify the width to 250 in order to be properly displayed in the chart interface."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9ccea33b-c5d9-422e-a5b9-11efbc05ab1a",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
840,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 888,
|
||||
"height": 646,
|
||||
"content": "### Information Extractor \n- This Information Extractor is added to extract the user's question\n- In some cases, if the question contains a visualization aspect, the SQL Agent may not responding accurately.\n\n### SQL Agent\n- This SQL Agent is connected to a Database.\n- It queries the Database for each user message.\n- In this example, the prompt has been slightly changed to address an issue with querying a Supabase DB. Feel free to change the `Prefix Prompt` to suit your needs.\n- This example uses the data from this [Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d8bf0767-faf0-4030-b325-08315188adcb",
|
||||
"name": "OpenAI Chat Model Classifier",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1900,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4bcd676f-44f3-4242-a5fd-7cf2098a3a64",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1760,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 948,
|
||||
"height": 646,
|
||||
"content": "### Respond with a text only or also include a chart \n- The text classifier determines if the response from the SQL Agent would benefit from a chart\n- If it does, then it executes the subworkflow to dynamically generate a chart, and append the chart to the response from the SQL Agent\n- If it doesn't, then the SQL Agent response is directly outputted. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "256cb28b-0d83-4f6d-bb11-33745c9efa4a",
|
||||
"name": "Text Classifier - Chart required?",
|
||||
"type": "@n8n/n8n-nodes-langchain.textClassifier",
|
||||
"position": [
|
||||
1800,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"inputText": "=**User Request**: {{ $('When chat message received').item.json.chatInput }}\n**Data to visualize**: {{ $json.output }}\n",
|
||||
"categories": {
|
||||
"categories": [
|
||||
{
|
||||
"category": "chart_required",
|
||||
"description": "If a chart can help the user understand the response (if there are multiple data to show) or if the user specifically request a chart. "
|
||||
},
|
||||
{
|
||||
"category": "chart_not_required",
|
||||
"description": "if a chart doesn't help the user understand the response (e.g a single data point that doesn't require visualization).\n\"I don't know\" does fall into this category"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6df60db5-19c0-4585-a229-b56f4b9a2b29",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
40,
|
||||
1020
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 680,
|
||||
"height": 720,
|
||||
"content": "## Demo\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a843845d-e010-4a09-ab50-e169beb67811",
|
||||
"name": "User question + Agent initial response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2200,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "debab41c-da64-4999-a80f-fae06522d672",
|
||||
"name": "user_question",
|
||||
"type": "string",
|
||||
"value": "={{ $('When chat message received').item.json.chatInput }}"
|
||||
},
|
||||
{
|
||||
"id": "2b4bbf7f-9890-4ef3-9d8f-15e3a55fbfda",
|
||||
"name": "output",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "12c9dc38-c0fe-4f4c-a101-ec1ff7ea9048",
|
||||
"name": "Information Extractor - User question",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
1060,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"attributes": [
|
||||
{
|
||||
"name": "user_question",
|
||||
"required": true,
|
||||
"description": "Extract the question from the user, omitting everything related to charts."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Text Classifier - Chart required?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Text + Chart output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Information Extractor - User question",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Information Extractor - User question",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model Classifier": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Text Classifier - Chart required?",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute \"Generate a chart\" tool": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Generate Chart definition with Structured Output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Text Classifier - Chart required?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "User question + Agent initial response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Set Text output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Information Extractor - User question": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"User question + Agent initial response": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Execute Workflow",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Generate Chart definition with Structured Output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,765 @@
|
||||
{
|
||||
"id": "jhNsy4dPQYw9QDaa",
|
||||
"meta": {
|
||||
"instanceId": "1acdaec6c8e84424b4715cf41a9f7ec057947452db21cd2e22afbc454c8711cd",
|
||||
"templateId": "2683",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Zoom AI Meeting Assistant",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "9b4b21aa-c746-4b94-a4dd-12736a7d4098",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
2160,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "EjchNb5GBqYh0Cqn",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "536e360c-d668-4f58-8670-4e78ef579dbe",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
160,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eb2b6b98-ca3c-46a9-9d5f-9b5297441224",
|
||||
"name": "No Recording/Transcript available",
|
||||
"type": "n8n-nodes-base.stopAndError",
|
||||
"position": [
|
||||
880,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"errorMessage": "={{ $json.error.cause.message }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "33ee5d8b-a373-44a8-9777-9386cf8cf008",
|
||||
"name": "Zoom: Get data of last meeting",
|
||||
"type": "n8n-nodes-base.zoom",
|
||||
"position": [
|
||||
340,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"filters": {
|
||||
"type": "scheduled"
|
||||
},
|
||||
"operation": "getAll",
|
||||
"returnAll": true,
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"zoomOAuth2Api": {
|
||||
"id": "MmccxSST1g202tG2",
|
||||
"name": "Zoom account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d67d1fcb-78d1-47e5-bc0e-5735f0f48350",
|
||||
"name": "Filter transcript URL",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"onError": "continueRegularOutput",
|
||||
"position": [
|
||||
880,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "ef149af8-7f9d-4e5a-8ccf-4a5f1e09eecc",
|
||||
"name": "transcript_file",
|
||||
"type": "string",
|
||||
"value": "={{ $json.recording_files.find(f => f.file_type === 'TRANSCRIPT').download_url }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "41665b4e-4d3e-4da9-9b0d-c6f9f0b2cde4",
|
||||
"name": "Filter: Only 1 item",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
1060,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "ea12b33a-ae01-403d-9f14-466dc8880874",
|
||||
"name": "Zoom: Get transcript file",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1240,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.transcript_file }}",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "zoomOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"zoomOAuth2Api": {
|
||||
"id": "MmccxSST1g202tG2",
|
||||
"name": "Zoom account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "fb1c32c3-5161-499d-8cd6-7624fb78ed3e",
|
||||
"name": "Extract text from transcript file",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
1420,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "text"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "87986fd3-37f0-48cd-942a-73fd3b5bd70f",
|
||||
"name": "Format transcript text",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1600,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "70019192-02ef-4b0a-a747-3ca5f46aeeaa",
|
||||
"name": "transcript",
|
||||
"type": "string",
|
||||
"value": "={{ $json.data.split('\\r\\n\\r\\n').slice(1).map(block => {\n const lines = block.split('\\r\\n');\n return lines.slice(2).join(' ');\n}).join('\\n') }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "9af3559d-2fd0-481f-84d6-caefbcd8e4f2",
|
||||
"name": "Zoom: Get participants data",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1760,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://api.zoom.us/v2/past_meetings/{{ $('Filter: Last 24 hours').item.json.id }}/participants",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "zoomOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"zoomOAuth2Api": {
|
||||
"id": "MmccxSST1g202tG2",
|
||||
"name": "Zoom account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "03feecc5-e60d-45cb-bf29-6645afb86b4c",
|
||||
"name": "Create meeting summary",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1920,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o",
|
||||
"cachedResultName": "GPT-4O"
|
||||
},
|
||||
"options": {},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"content": "=Create a formal meeting minutes document from the following transcript and meeting details.\n\nMeeting Date: {{ $('Zoom: Get data of last meeting').item.json.start_time }} // This needs to be formatted from the meeting details\nParticipants: {{ $json.participants.map(p => p.name + ' (' + p.user_email + ')').join(', ') }}\n\nTranscript:\n{{ $('Format transcript text').item.json.transcript }}\n\nPlease create the minutes in the following format:\n\nMeeting on [Date]\n\nParticipants:\n[List of participants with email addresses]\n\nSummary of the Meeting:\n[Brief and concise summary of the topics discussed]\n\nTasks:\n- [Task] (Responsible: [Name])\n- ...\n\nImportant Dates:\n- [Date] ([Context])\n- ...\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "EjchNb5GBqYh0Cqn",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.8
|
||||
},
|
||||
{
|
||||
"id": "5edc73f7-aa1b-47ae-97f7-c6f897e914a6",
|
||||
"name": "Sort for mail delivery",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2240,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "cc51b7e4-d5c2-4cd4-9488-4d181eaaa02e",
|
||||
"name": "subject",
|
||||
"type": "string",
|
||||
"value": "=Meeting summary: {{ $('Zoom: Get data of last meeting').item.json.topic }} on {{ $('Zoom: Get data of last meeting').item.json.start_time }}"
|
||||
},
|
||||
{
|
||||
"id": "f3940ea2-9084-4c25-828e-5ddaa428ec83",
|
||||
"name": "=to",
|
||||
"type": "string",
|
||||
"value": "={{ $('Zoom: Get participants data').item.json.participants[0].user_email }}"
|
||||
},
|
||||
{
|
||||
"id": "1211af5b-2240-44ce-9df7-63d93f57806e",
|
||||
"name": "body",
|
||||
"type": "string",
|
||||
"value": "={{ $json.message.content }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "29ad24ba-016b-4e65-b8c8-908d8e2207c5",
|
||||
"name": "Format to html",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
2400,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const items = [];\n\nfor (const item of $input.all()) {\n const body = item.json.body;\n if (!body) continue;\n\n // Simple split approach\n const sections = body.split('\\n\\n');\n const title = sections[0].replace(/\\*\\*/g, '');\n const participants = sections[1].split('\\n').slice(1).join('\\n');\n const summary = sections[2].split('\\n').slice(1).join('\\n');\n const tasks = sections[3].split('\\n').slice(1).join('\\n');\n const dates = sections[4].split('\\n').slice(1).join('\\n');\n\n const html = `<html>\n<body style=\"font-family: Arial, sans-serif; max-width: 800px; margin: 20px;\">\n<h1 style=\"color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px;\">${title}</h1>\n<h2 style=\"color: #2c3e50; margin-top: 20px;\">Participants:</h2>\n<ul style=\"list-style-type: none; padding-left: 20px;\">\n${participants.split('\\n').map(p => `<li>${p.replace('- ', '')}</li>`).join('\\n')}\n</ul>\n<h2 style=\"color: #2c3e50; margin-top: 20px;\">Meeting Summary:</h2>\n<p style=\"margin-left: 20px;\">${summary}</p>\n<h2 style=\"color: #2c3e50; margin-top: 20px;\">Tasks:</h2>\n<ul style=\"margin-left: 20px;\">\n${tasks.split('\\n').map(t => `<li>${t.replace('- ', '')}</li>`).join('\\n')}\n</ul>\n<h2 style=\"color: #2c3e50; margin-top: 20px;\">Important Dates:</h2>\n<ul style=\"margin-left: 20px;\">\n${dates.split('\\n').map(d => `<li>${d.replace('- ', '')}</li>`).join('\\n')}\n</ul>\n</body>\n</html>`;\n\n items.push({\n json: {\n html,\n to: item.json.to,\n subject: item.json.subject\n }\n });\n}\n\nreturn items;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "60c9d778-d97a-4e17-858c-804f523590e5",
|
||||
"name": "Send meeting summary",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"position": [
|
||||
2560,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.html }}",
|
||||
"options": {},
|
||||
"subject": "={{ $json.subject }}",
|
||||
"toEmail": "={{ $json.to }}",
|
||||
"fromEmail": "friedemann.schuetz@posteo.de"
|
||||
},
|
||||
"credentials": {
|
||||
"smtp": {
|
||||
"id": "OFGEnOq5l8U8Lb3U",
|
||||
"name": "SMTP account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "39d8bb49-d9e9-46e3-89b3-fcbf9345bad8",
|
||||
"name": "Create tasks",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2340,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"name": "create_task",
|
||||
"schemaType": "manual",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "zSKQLEObdU9RiThI",
|
||||
"cachedResultName": "create_task"
|
||||
},
|
||||
"description": "=Use this tool to create a task. \nFor task creation use only action items for me Friedemann, don't use action items for other participants.",
|
||||
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\",\n \"description\": \"An array of tasks\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the task\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"A detailed description of the task\"\n },\n \"due_date\": {\n \"type\": \"string\",\n \"description\": \"Due Date\"\n },\n \"priority\": {\n \"type\": \"string\",\n \"description\": \"Priority. . Please capitalize first letter\"\n },\n \"project_name\": {\n \"type\": \"string\",\n \"description\": \"Name of the project. Word 'Project' shouldn't be included\"\n }\n },\n \"required\": [\n \"name\",\n \"description\",\n \"due_date\",\n \"priority\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"required\": [\n \"items\"\n ],\n \"additionalProperties\": false\n}",
|
||||
"specifyInputSchema": true
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "9fa8eb9e-d4fc-4a2a-9843-2f51055944e9",
|
||||
"name": "Create tasks and follow-up call",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
2240,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=<system_prompt>\n\nTODAY IS: {{ $now }}\n\nYOU ARE A MEETING ASSISTANT FOR AUTOMATION IN N8N. YOUR TASK IS TO EFFICIENTLY AND PRECISELY PROCESS INFORMATION FROM ZOOM MEETINGS TO GENERATE TO-DOS AND SCHEDULE FOLLOW-UP MEETINGS. YOU HAVE ACCESS TO THE FOLLOWING DATA:\n\n### INPUTS ###\n- **MEETING TITLE**: {{ $('Zoom: Get data of last meeting').item.json.topic }}\n- **PARTICIPANTS**: {{ $('Zoom: Get participants data').item.json.participants[0].name }}\n- **TRANSCRIPT**: {{ $('Format transcript text').item.json.transcript }}\n\n### YOUR TASKS ###\n1. **CREATE TO-DOS**:\n - IDENTIFY TASKS AND TO-DOS IN THE TRANSCRIPT.\n - FORMULATE CLEAR, CONCRETE TASKS.\n - PASS THESE TASKS TO THE TOOL \"Create tasks\" TO SAVE THEM IN CLICKUP. \n - DATA STRUCTURE:\n - **TASK DESCRIPTION**: Brief description of the task.\n - **ASSIGNED PERSON**: First name from the participant list.\n - **DUE DATE**: Use any date mentioned in the transcript; otherwise, set to \"Not specified.\"\n\n2. **CREATE MEETING**:\n - ANALYZE THE TRANSCRIPT TO IDENTIFY INFORMATION ABOUT THE NEXT MEETING (DATE, TIME, AND TOPIC).\n - PASS THIS INFORMATION TO THE TOOL \"Create follow-up call.\"\n - DATA STRUCTURE:\n - **MEETING TITLE**: \"Follow-up: [Meeting Title]\"\n - **DATE AND TIME**: Determined from the transcript or set to \"Next Tuesday at 10:00 AM\" if no information is provided.\n - **PARTICIPANTS**: Add all participants from the list.\n\n### CHAIN OF THOUGHTS ###\n1. **UNDERSTAND**: Read and analyze the provided inputs (title, participants, transcript).\n2. **IDENTIFY**: Extract relevant information for the to-dos and the next meeting.\n3. **DIVIDE**: Split the task into two separate processes: creating to-dos and creating the meeting.\n4. **STRUCTURE**: Format the results in the required structure for the respective tools.\n5. **TRANSMIT**: Pass the data to the designated tools in n8n.\n6. **VERIFY**: Ensure the data is correct and complete.\n\n### WHAT YOU SHOULD NOT DO ###\n- **NEVER**: Create unclear or vague to-dos.\n- **NEVER**: Ignore missing data – use default values where uncertain.\n- **NEVER**: Overlook information from the inputs or make incorrect connections.\n- **NEVER**: Transmit tasks or meetings without proper formatting.\n\n### OUTPUT EXAMPLES ###\n1. **TO-DO**:\n - **TASK DESCRIPTION**: \"Prepare presentation for the next meeting.\"\n - **ASSIGNED PERSON**: \"John Doe.\"\n - **DUE DATE**: \"2025-01-25.\"\n\n2. **MEETING**:\n - **MEETING TITLE**: \"Follow-up: Project Discussion.\"\n - **DATE AND TIME**: \"2025-01-28 at 10:00 AM.\"\n - **PARTICIPANTS**: \"John Doe, Jane Example.\"\n\n### NOTES ###\n- EXECUTE YOUR TASKS WITH THE HIGHEST PRECISION AND CONTEXT SENSITIVITY.\n- RELY ON THE PROVIDED DATA AND DEFAULT VALUES WHERE NECESSARY.\n</system_prompt>\n",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "05515784-c99d-4197-9d88-62350bacfb7b",
|
||||
"name": "Create follow-up call",
|
||||
"type": "n8n-nodes-base.microsoftOutlookTool",
|
||||
"position": [
|
||||
2500,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"subject": "={{ $fromAI(\"meeting_name\",\"Meeting name\",\"string\") }}",
|
||||
"resource": "event",
|
||||
"operation": "create",
|
||||
"calendarId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "AQMkADAwATNiZmYAZC1jYjE5LWExMzQtMDACLTAwCgBGAAAD1gD8iHcpKEiYQc0w4fCLUgcA-79r8r8ac0aInYGVxRUqCwAAAgEGAAAA-79r8r8ac0aInYGVxRUqCwAAAkH-AAAA",
|
||||
"cachedResultName": "Calendar"
|
||||
},
|
||||
"endDateTime": "={{ $fromAI(\"end_date_time\",\"Date and time of meeting end\",\"string\") }}",
|
||||
"startDateTime": "={{ $fromAI(\"start_date_time\",\"Date and time of meeting start\",\"string\") }}",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "=Use tool to create Outlook Calendar Event. Use this tool only when transcript contains information that call should be scheduled.",
|
||||
"additionalFields": {
|
||||
"timeZone": "Europe/Berlin"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"microsoftOutlookOAuth2Api": {
|
||||
"id": "DNMkqql32uwVETij",
|
||||
"name": "Microsoft Outlook account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "2f00c2c6-2389-429c-8c9a-f8f1fbfb6524",
|
||||
"name": "Filter: Last 24 hours",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"position": [
|
||||
500,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "de097a4f-1f3e-4dc0-9ab6-139311ff4676",
|
||||
"operator": {
|
||||
"type": "dateTime",
|
||||
"operation": "afterOrEquals"
|
||||
},
|
||||
"leftValue": "={{ $json.start_time }}",
|
||||
"rightValue": "={{$now.minus({ hours: 24 }).toISO()}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "fd353a51-eac3-4d04-ae06-dd8e90b82990",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"disabled": true,
|
||||
"position": [
|
||||
1280,
|
||||
980
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "40480f97-699b-4a49-867a-54950702af79",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1500,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "query.items"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "22e6165f-d7c2-4b23-be63-00c76505cdd3",
|
||||
"name": "ClickUp",
|
||||
"type": "n8n-nodes-base.clickUp",
|
||||
"position": [
|
||||
1720,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"list": "901207046581",
|
||||
"name": "={{ $json.name }}",
|
||||
"team": "9012366821",
|
||||
"space": "90122025710",
|
||||
"folder": "90123813376",
|
||||
"authentication": "oAuth2",
|
||||
"additionalFields": {
|
||||
"content": "={{ $json.description }}",
|
||||
"dueDate": "={{ $json.due_date }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"clickUpOAuth2Api": {
|
||||
"id": "KYxmoCCdfSkwWlXE",
|
||||
"name": "ClickUp account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "742a411e-05cb-4aa0-a541-7b67e613e2bb",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1060,
|
||||
900
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1000,
|
||||
"height": 280,
|
||||
"content": "## Sub workflow: Create Task in ClickUp"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ebc5f1df-b417-4977-9700-b71b49a15cbb",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"width": 660,
|
||||
"height": 520,
|
||||
"content": "## Welcome to my Zoom AI Meeting Assistant Workflow!\n\n### This workflow has the following sequence:\n\n1. manual trigger (Can be replaced by a scheduled trigger or a webhook)\n2. retrieval of of Zoom meeting data\n3. filter the events of the last 24 hours\n4. retrieval of transcripts and extract of the text\n5. creating a meeting summary, format to html and send per mail\n6. create tasks and follow-up call (if discussed in the meeting) in ClickUp/Outlook (can be replaced by Gmail, Airtable, and so forth) via sub workflow\n\n### The following accesses are required for the workflow:\n- Zoom Workspace (via API and HTTP Request): [Documentation](https://docs.n8n.io/integrations/builtin/credentials/zoom/)\n- Microsoft Outlook: [Documentation](https://docs.n8n.io/integrations/builtin/credentials/microsoft/)\n- ClickUp: [Documentation](https://docs.n8n.io/integrations/builtin/credentials/clickup/)\n- AI API access (e.g. via OpenAI, Anthropic, Google or Ollama)\n- SMTP access data (for sending the mail)\n\nYou can contact me via LinkedIn, if you have any questions: https://www.linkedin.com/in/friedemann-schuetz"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d9109d09-eb1f-4685-a78b-d17e3dd22438",
|
||||
"name": "Zoom: Get transcripts data",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"onError": "continueErrorOutput",
|
||||
"position": [
|
||||
680,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://api.zoom.us/v2/meetings/{{ $json.id }}/recordings",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "zoomOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"zoomOAuth2Api": {
|
||||
"id": "MmccxSST1g202tG2",
|
||||
"name": "Zoom account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"Execute Workflow Trigger": [
|
||||
{
|
||||
"json": {
|
||||
"query": {
|
||||
"items": [
|
||||
{
|
||||
"name": "Partner abtelefonieren",
|
||||
"due_date": "2025-01-06",
|
||||
"priority": "High",
|
||||
"description": "Am 6. Januar alle Partner anrufen, um zu klären, ob Interesse an einer weiteren Kooperation besteht und wie diese dargestellt werden kann.",
|
||||
"project_name": "Partnerkooperationen"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {},
|
||||
"versionId": "7dd6e3c4-87d1-4d88-ab7c-10e041e64674",
|
||||
"connections": {
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ClickUp",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create tasks": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Create tasks and follow-up call",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format to html": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send meeting summary",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Create tasks and follow-up call",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Filter: Only 1 item": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Filter: Only 1 item",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Zoom: Get transcript file",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Send meeting summary": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create follow-up call": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Create tasks and follow-up call",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Filter transcript URL": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Filter: Only 1 item",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Filter: Last 24 hours": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Zoom: Get transcripts data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create meeting summary": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Sort for mail delivery",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Create tasks and follow-up call",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format transcript text": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Zoom: Get participants data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Sort for mail delivery": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format to html",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Zoom: Get transcript file": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Extract text from transcript file",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Zoom: Get transcripts data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Filter transcript URL",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "No Recording/Transcript available",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Zoom: Get participants data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create meeting summary",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Zoom: Get data of last meeting": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Filter: Last 24 hours",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create tasks and follow-up call": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Extract text from transcript file": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format transcript text",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Zoom: Get data of last meeting",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user