feat: add folder support for workflows (fixes #70)
This commit is contained in:
@@ -0,0 +1,439 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "79573e58-f33f-445a-ad9a-0a92fde845c2",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-280,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1174.6162657502882,
|
||||
"height": 578.9520146851776,
|
||||
"content": "## Sub-workflow: Return the capitals of fictional countries\nIt can either list the countries it knows about or return the capital of a specific country"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5eddcce9-7ee5-4ec7-a0a1-525a9b806994",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-280,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1168,
|
||||
"height": 528,
|
||||
"content": "## Main workflow: Chat with OpenAI Assistant\nClick the 'Chat' button at the bottom of the screen to try"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a6c38394-1be1-4002-a9b7-c4672823aaa5",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-180,
|
||||
40
|
||||
],
|
||||
"webhookId": "91f22813-2f7b-4ff9-a3e6-9d53fc86fbd9",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "de0398ea-c2ad-49b9-860b-695149b94590",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
100,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "asst_BWy0154vMGMdrX7MjCYaYv6a"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.8
|
||||
},
|
||||
{
|
||||
"id": "050042f4-f5ff-433a-9651-43cbec8eafb6",
|
||||
"name": "Simple Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
360,
|
||||
260
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "e4ed4cfe-78fb-44a5-8bef-67168dac95ec",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-180,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a3a1059c-5c36-4d90-90e2-98e37f62bdd2",
|
||||
"name": "Tool to call the workflow below",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
40,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"name": "country_capitals_tool",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "This tool has two modes:\n1. Pass 'list' to the tool to get a list of countries that the tool has the capitals for (one per line). This is useful if you can't find a match, to see if the country being asked about might have been misspelled.\n2. Pass one of the country names in the list to the tool to get the capital of that country. Note that the country must be spelled exactly as it is in the list of countries returned in mode 1",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "query",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "query",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "80924ec9-5e82-4e90-8b72-42fc805d83c0",
|
||||
"name": "Tool: Get current date and time",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolCode",
|
||||
"position": [
|
||||
200,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"name": "date_tool",
|
||||
"jsCode": "let now = DateTime.now()\nreturn now.toISO()",
|
||||
"description": "Call this tool to get the current timestamp (in ISO format). No parameters necessary"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "8f6a83bd-71eb-4f2d-b906-a18476f18f40",
|
||||
"name": "List countries?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
40,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "ca43a9bd-5db3-4240-ae46-0402c8411818",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.query }}",
|
||||
"rightValue": "list"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "40d93a59-4c91-43e4-a4a3-3732475617d6",
|
||||
"name": "Mapping data",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
260,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return [\n {\n \"country\": \"Wakanda\",\n \"capital\": \"Birnin Zana\"\n },\n {\n \"country\": \"Narnia\",\n \"capital\": \"Cair Paravel\"\n },\n {\n \"country\": \"Gondor\",\n \"capital\": \"Minas Tirith\"\n },\n {\n \"country\": \"Oz\",\n \"capital\": \"The Emerald City\"\n },\n {\n \"country\": \"Westeros\",\n \"capital\": \"King's Landing\"\n },\n {\n \"country\": \"Panem\",\n \"capital\": \"The Capitol\"\n },\n {\n \"country\": \"Ruritania\",\n \"capital\": \"Strelsau\"\n },\n {\n \"country\": \"Mordor\",\n \"capital\": \"Barad-dûr\"\n },\n {\n \"country\": \"Latveria\",\n \"capital\": \"Doomstadt\"\n },\n {\n \"country\": \"Atlantis\",\n \"capital\": \"Poseidonis\"\n }\n]\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "8765b405-8991-421c-bdc5-3eb6d3757fcb",
|
||||
"name": "Concatenate country names",
|
||||
"type": "n8n-nodes-base.summarize",
|
||||
"position": [
|
||||
460,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldsToSummarize": {
|
||||
"values": [
|
||||
{
|
||||
"field": "country",
|
||||
"separateBy": "\n",
|
||||
"aggregation": "concatenate"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c0b21934-8518-49b4-bbab-f13ad0a74343",
|
||||
"name": "Return country list",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
660,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "c97c3abc-40b2-4238-912d-030eb9ca3440",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ $json.concatenated_country }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "5d4f05cc-f4e3-4ce6-9ea8-a324257fa7c3",
|
||||
"name": "Mapping data1",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
260,
|
||||
880
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return [\n {\n \"country\": \"Wakanda\",\n \"capital\": \"Birnin Zana\"\n },\n {\n \"country\": \"Narnia\",\n \"capital\": \"Cair Paravel\"\n },\n {\n \"country\": \"Gondor\",\n \"capital\": \"Minas Tirith\"\n },\n {\n \"country\": \"Oz\",\n \"capital\": \"The Emerald City\"\n },\n {\n \"country\": \"Westeros\",\n \"capital\": \"King's Landing\"\n },\n {\n \"country\": \"Panem\",\n \"capital\": \"The Capitol\"\n },\n {\n \"country\": \"Ruritania\",\n \"capital\": \"Strelsau\"\n },\n {\n \"country\": \"Mordor\",\n \"capital\": \"Barad-dûr\"\n },\n {\n \"country\": \"Latveria\",\n \"capital\": \"Doomstadt\"\n },\n {\n \"country\": \"Atlantis\",\n \"capital\": \"Poseidonis\"\n }\n]\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "5ed65e2c-b56d-49d9-a205-1e4cc8914fa9",
|
||||
"name": "Get the matching country's details",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
460,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"advanced": true,
|
||||
"joinMode": "enrichInput1",
|
||||
"mergeByFields": {
|
||||
"values": [
|
||||
{
|
||||
"field1": "query",
|
||||
"field2": "country"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "313775a0-a4ce-488e-a7db-b1ddd49dc3cd",
|
||||
"name": "Return specific capital",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
660,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "03ac1883-126f-4419-93e4-c5062b2d766d",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ $ifEmpty($json.capital, 'Capital not found') }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Mapping data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Concatenate country names",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Mapping data1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get the matching country's details",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simple Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"List countries?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Mapping data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Get the matching country's details",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Mapping data1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Concatenate country names": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Return country list",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Tool to call the workflow below": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Tool: Get current date and time": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "List countries?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get the matching country's details": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Return specific capital",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b6836974-0d4b-482b-8a8a-c00f229f1136",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
100,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 150,
|
||||
"height": 293,
|
||||
"content": "### Replace me\nwith any other service, e.g. fetching your own data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c0b8b657-24b8-4c0b-bfe9-d4fe2075dbe5",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-180,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 406.875,
|
||||
"content": "### Sub-workflow: Custom tool\nThis can be called by the agent above. This example fetches the top 50 posts ever on Hacker News"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1dab7b1-b028-44a2-ab55-d8edee62e261",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-180,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 486.5625,
|
||||
"content": "### Main workflow: AI agent using custom tool\nTry it out by clicking 'Chat' and entering 'What is the 5th most popular post ever on Hacker News?'"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "84d91346-6b1d-4808-a6b3-ce212cd122d0",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-340,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"width": 185.9375,
|
||||
"height": 218,
|
||||
"content": "## Try me out\n\nClick the 'Chat' button and enter:\n\n_What is the 5th most popular post ever on Hacker News?_"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "50c7208d-d2dc-4380-9f81-6d7f4dee40b3",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-40,
|
||||
20
|
||||
],
|
||||
"webhookId": "34a31e43-46b8-4c4b-a47e-ef5ad6e66af0",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "6170523b-ac2d-4541-9186-0f2932829a36",
|
||||
"name": "Custom tool to call the wf below1",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
480,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"name": "hn_tool",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "Returns a list of the most popular posts ever on Hacker News, in json format",
|
||||
"workflowInputs": {
|
||||
"value": {},
|
||||
"schema": [],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "3f40434e-4055-4d8f-be26-051da2911aa1",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-120,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"inputSource": "passthrough"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "4a6cf195-6862-4007-b791-d021583a771e",
|
||||
"name": "Hacker News",
|
||||
"type": "n8n-nodes-base.hackerNews",
|
||||
"position": [
|
||||
120,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 50,
|
||||
"resource": "all",
|
||||
"additionalFields": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "03095e43-0d6e-47c0-8936-dceb2fb0dfb1",
|
||||
"name": "Clean up data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
340,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "171d5a66-fc72-42ab-9f6c-0c137f6b3415",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"value": "={{ $json._highlightResult.title.value }}"
|
||||
},
|
||||
{
|
||||
"id": "e6662f7e-8e44-43d6-8e8b-6162bfec34bc",
|
||||
"name": "points",
|
||||
"type": "string",
|
||||
"value": "={{ $json.points }}"
|
||||
},
|
||||
{
|
||||
"id": "7415a9f0-7cd4-4bad-bbcf-1903520af155",
|
||||
"name": "url",
|
||||
"type": "string",
|
||||
"value": "={{ $json.url }}"
|
||||
},
|
||||
{
|
||||
"id": "8b0c67a6-89b0-40de-85f2-b80c9298d81f",
|
||||
"name": "created_at",
|
||||
"type": "string",
|
||||
"value": "={{ $json.created_at }}"
|
||||
},
|
||||
{
|
||||
"id": "b7847fbb-4428-4a5b-980e-08e6069b0ac4",
|
||||
"name": "author",
|
||||
"type": "string",
|
||||
"value": "={{ $json.author }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "50ee96c0-36d6-4774-b5cf-b653f5b56868",
|
||||
"name": "Stringify",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
560,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return {\n 'response': JSON.stringify($input.all().map(x => x.json))\n}"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "ba221fc3-5249-4295-b64e-2c7370c6dad4",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
260,
|
||||
20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.8
|
||||
},
|
||||
{
|
||||
"id": "e8c45847-cc26-47b3-898c-8063b9c4b3a9",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
220,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Hacker News": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Clean up data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Clean up data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Stringify",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Custom tool to call the wf below1": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Hacker News",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "e12611f4-37d2-48f9-8a60-ddcf4ff34cfc",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-480,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1118.3459011229047,
|
||||
"height": 775.3931210698682,
|
||||
"content": "### Sub-workflow: Custom tool\nThe agent above can call this workflow. It checks if the user has supplied an email address. If they haven't it prompts them to provide one. If they have, it messages a customer support channel for help."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "72dbee3e-fe3b-4354-9b02-2fe52af23035",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-480,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 486.5625,
|
||||
"content": "### Main workflow: AI agent using custom tool"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1c9660d-84b1-418a-bbb3-88d79cdd79d3",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 197.45572294791873,
|
||||
"height": 179.21380662202682,
|
||||
"content": "**This tool calls the sub-workflow below**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b4ffb76d-c44f-46d6-b2d9-4e5d551adee1",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-280,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 150,
|
||||
"height": 213.44323866265472,
|
||||
"content": "**Set your credentials**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8a9187f1-3cf9-479f-aa7f-5581880394d0",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
40,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 178.0499248677781,
|
||||
"height": 250.57252651663197,
|
||||
"content": "**Set your credentials and Slack details**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3f72d117-e07a-4af4-aa1b-92ce04bf0b3c",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-640,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 185.9375,
|
||||
"height": 214.8397420554627,
|
||||
"content": "## Try it out\n\nSelect **Chat** at the bottom and enter:\n\n_Hi! Please respond to this as if you don't know the answer to my query._"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b85eff07-ee3c-4aeb-871e-b25a131a7afb",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
360,
|
||||
900
|
||||
],
|
||||
"parameters": {
|
||||
"height": 145,
|
||||
"content": "## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "feb1e50d-5044-4ea6-8719-72e176581e27",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-400,
|
||||
-120
|
||||
],
|
||||
"webhookId": "e0e69202-32e8-41b5-963b-50905dd93e88",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "6af81471-7cd4-4517-9677-b634b59620b4",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-240,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "37604c8d-5c70-4a81-a1d0-eafe42ce612d",
|
||||
"name": "Simple Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
-60,
|
||||
120
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "fd404bb5-0703-4d08-8b9b-4a8b01fd2bff",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-380,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "chatInput"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a807ca29-65bf-4d97-b89f-5ce16cd05347",
|
||||
"name": "Check if user has provided email",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-200,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "e6dce436-5e85-4722-a7e4-0ceb940a5477",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "regex"
|
||||
},
|
||||
"leftValue": "={{ $('When Executed by Another Workflow').item.json.chatInput }}",
|
||||
"rightValue": "=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)/gi"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "b9c552ce-4c58-48dd-b168-5e277de89954",
|
||||
"name": "Message Slack for help",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
80,
|
||||
620
|
||||
],
|
||||
"webhookId": "c54bea4c-bdb6-4f42-9f82-525857df5a9a",
|
||||
"parameters": {
|
||||
"text": "={{ \"A user had a question the bot couldn't answer. Here's their message: \" + $('When Executed by Another Workflow').first().json.chatInput }}",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "#general"
|
||||
},
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "VfK3js0YdqBdQLGP",
|
||||
"name": "Slack account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.3
|
||||
},
|
||||
{
|
||||
"id": "644a05fc-ac7e-4ea9-ab03-3b6fbf7a3654",
|
||||
"name": "Confirm that we've messaged a human",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
300,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const response = {\"response\": \"Thank you for getting in touch. I've messaged a human to help.\"}\nreturn response;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "38e81aa5-30b3-48f9-88e8-1039f607f3e7",
|
||||
"name": "Prompt the user to provide an email",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
80,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const response = {\"response\":\"I'm sorry I don't know the answer. Please repeat your question and include your email address so I can request help.\"};\nreturn response;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "61ddb25a-f7f2-4691-94d5-3f32c183ec46",
|
||||
"name": "Not sure?",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
140,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"name": "dont_know_tool",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "Use this tool if you don't know the answer to the user's question, or if you're not very confident about your answer.",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"chatInput": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('chatInput', ``, 'string') }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "chatInput",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "chatInput",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "395349d1-1715-4550-a0c8-1388d17b4386",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-180,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.8
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Not sure?": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simple Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Message Slack for help": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Confirm that we've messaged a human",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check if user has provided email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Message Slack for help",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Prompt the user to provide an email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check if user has provided email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,456 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "24be8907-684e-4b57-9642-6f4a45ca7af3",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 680,
|
||||
"height": 660,
|
||||
"content": "## 1. Set up an MCP Server Trigger\n[Read more about the MCP Server Trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d5845d0a-648f-4bc1-b087-bc0d17506ed3",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 380,
|
||||
"height": 100,
|
||||
"content": "### Always Authenticate Your Server!\nBefore going to production, it's always advised to enable authentication on your MCP server trigger."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fe9f1c8e-8334-4732-be3a-5ee49036e11e",
|
||||
"name": "FileSystem MCP Server",
|
||||
"type": "@n8n/n8n-nodes-langchain.mcpTrigger",
|
||||
"position": [
|
||||
-180,
|
||||
-140
|
||||
],
|
||||
"webhookId": "0d93cfd5-2fbf-457e-9535-5bfc9a73ba9e",
|
||||
"parameters": {
|
||||
"path": "0d93cfd5-2fbf-457e-9535-5bfc9a73ba9e"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fb49782f-d8de-480b-a470-e37adb2e3036",
|
||||
"name": "ListDirectory",
|
||||
"type": "n8n-nodes-base.executeCommandTool",
|
||||
"position": [
|
||||
-300,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"command": "=ls /home/node/{{ $fromAI('path', 'optional, leave blank for project root directory.') }}",
|
||||
"toolDescription": "List directories under the project root folder. The project root directory is /home/node/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8fa93054-bcf5-4fbc-9825-df16be063eb2",
|
||||
"name": "CreateDirectory",
|
||||
"type": "n8n-nodes-base.executeCommandTool",
|
||||
"position": [
|
||||
-200,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"command": "=mkdir -p /home/node/{{ $fromAI('filename', 'name of directory. Will be scoped under the /home/node/ project root directory. Optionally use path to create within subdirectories') }}",
|
||||
"toolDescription": "Create directories under the project root folder. The project root folder is /home/node."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "aafe884d-0e6e-476a-92fe-b2111f624417",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
400,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "operation"
|
||||
},
|
||||
{
|
||||
"name": "filenames",
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"name": "contents",
|
||||
"type": "array"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "d85925b6-d58d-43b5-a6ca-3e43cbc81121",
|
||||
"name": "Operation",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
580,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "writeOneOrMultipleFiles",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "c1da2138-e2df-46d4-b1f4-97525c05e778",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.operation }}",
|
||||
"rightValue": "writeOneOrMultipleFiles"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "readOneOrMultipleFiles",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "cc02a5a2-609c-4dbe-bdb6-45f145947e47",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.operation }}",
|
||||
"rightValue": "readOneOrMultipleFiles"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "e9ec2928-5e33-4213-a53a-92b7d840d49e",
|
||||
"name": "readOneOrMultipleFiles",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
840,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"command": "=cat {{ $json.filenames.join(' ') }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "77ba2a48-b4b9-4a23-818d-e028a7762514",
|
||||
"name": "ReadFiles",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
40,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"name": "readFil",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "=Call this tool to read the contents of a file. Include file extension.",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"contents": "[]",
|
||||
"filenames": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('filenames', `An array of filenames`, 'string') }}",
|
||||
"operation": "readOneOrMultipleFiles"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "operation",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "operation",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "filenames",
|
||||
"type": "array",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "filenames",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "contents",
|
||||
"type": "array",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "contents",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "2ddf9a9a-cade-41c0-a068-482345452d4b",
|
||||
"name": "WriteFiles",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
140,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"name": "write_file",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "Call this tool to write contents to one or more files. Filenames and Contents are matched by their respective Array Indexes. Eg. To write to a single file, use { filenames: [<filename1>,<filename2>], contents: [<content1>,<content2>] } ",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"contents": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('contents', `An array of strings for content to be written`, 'string') }}",
|
||||
"filenames": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('filenames', `An array of strings for filenames`, 'string') }}",
|
||||
"operation": "writeOneOrMultipleFiles"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "operation",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "operation",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "filenames",
|
||||
"type": "array",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "filenames",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "contents",
|
||||
"type": "array",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "contents",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "a5d9e11b-0583-4c67-b30b-be1d4185b891",
|
||||
"name": "writeOneOrMultipleFiles",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
840,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"command": "={{\n$json.filenames.map((filename,idx) =>\n `echo \"${$json.contents[idx] ?? ''}\" > /home/node/${filename}`\n).join('\\n')\n}}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "de2f715c-b6d1-4702-9d39-2527108b5706",
|
||||
"name": "SearchDirectory",
|
||||
"type": "n8n-nodes-base.executeCommandTool",
|
||||
"position": [
|
||||
-80,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"command": "=find /home/node/ -name \"{{ $fromAI('filename', 'A name search paramter for the linux find tool') }}\"\n",
|
||||
"toolDescription": "Search the project folder for a file by name. The project root directory is /home/node/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a4918bb1-8882-45c8-a05c-a3e22912cc0f",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
320,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 740,
|
||||
"height": 660,
|
||||
"content": "## 2. Use Custom Workflow Tool for More Complex Commands\n[Learn more about the Execute Command tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executecommand/)\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ebf6c15b-e4e0-4db0-bb4e-36e204fb6a47",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-880,
|
||||
-740
|
||||
],
|
||||
"parameters": {
|
||||
"width": 460,
|
||||
"height": 1120,
|
||||
"content": "## Try It Out!\n### This n8n demonstrates how to build a simple FileSystem MCP server. Connecting to this server allows MCP clients and agents to list, read and create directories and files on the local machine or remote server.\n\nThis MCP example is based off an official MCP reference implementation which can be found here -https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem\n\n### How it works\n* A MCP server trigger is used and connected to 5 tools: 3 Execute Command tools and 2 custom workflow tools.\n* The 3 Execute Command tools allow for listing, searching and creating directories. \n* The 2 custom workflow tools are for reading and writing files to disk.\n* Special care has been to not allow the MCP agent to execute arbitrary linux commands on the target server. This is achieved by only allowing the agent to provide parameters such as filenames and paths rather than raw commands. \n\n### How to use\n* This Filesystem MCP server will write to the server which hosts the n8n instance - this can be your local machine or a remove server. If your target filesystem is on neither, then modify the commands to connect to the desired server.\n* Connect your MCP client by following the n8n guidelines here - https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/#integrating-with-claude-desktop\n* Try the following queries in your MCP client:\n * \"Please help me list all folders under the project directory.\"\n * \"Help me create a bash script to send a notification to Slack.\"\n * \"Search for the log file on the 22nd April and read its contents. What was the cause of the outage?\"\n\n### Requirements\n* Linux file system for this example template. Feel free to modify if working on Windows.\n* MCP Client or Agent for usage such as Claude Desktop - https://claude.ai/download\n\n### Customising this workflow\n* Implement the moving and renaming of files by adding more custom workflow tools to the MCP server.\n* Remember to set the MCP server to require credentials before going to production and sharing this MCP server with others!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Operation": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "writeOneOrMultipleFiles",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "readOneOrMultipleFiles",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ReadFiles": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "FileSystem MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"WriteFiles": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "FileSystem MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ListDirectory": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "FileSystem MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"CreateDirectory": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "FileSystem MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"SearchDirectory": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "FileSystem MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Operation",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,460 @@
|
||||
{
|
||||
"id": "3wbxkdT6hilhq0Na",
|
||||
"meta": {
|
||||
"instanceId": "d47f3738b860eed937a1b18d7345fa2c65cf4b4957554e29477cb064a7039870"
|
||||
},
|
||||
"name": "Workflow Results to Markdown Notes in Your Obsidian Vault, via Google Drive",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "be787ece-4118-4063-98b0-41672dd570c0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
560,
|
||||
-480
|
||||
],
|
||||
"parameters": {
|
||||
"width": 440,
|
||||
"height": 680,
|
||||
"content": "## Connect folder to Obsidian Vault \n**Setup Instructions:**\n- Create a folder in your Google Drive that syncs with your desktop.\n- Configure the Google Drive node as follows:\n - Assign the newly created folder as the parent-folder.\n - Specify the filename, appending .md (e.g., `{{ $json.title }}.md`).\n - Add Markdown content, including optional YAML Frontmatter, in the File Content field.\n- Establish a Symlink between the Google Drive folder and a new folder in your Obsidian Vault."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a30f3fdc-95a1-44ff-844a-58353dc7e177",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-800,
|
||||
-480
|
||||
],
|
||||
"parameters": {
|
||||
"width": 440,
|
||||
"height": 680,
|
||||
"content": "## Workflow results to Obsidian Vault \nThis template automatically creates and updates notes in your Obsidian Vault in real-time from n8n workflow results. Markdown files and attachments saved in Google Drive instantly appear in your Obsidian Vault.\n\n**Send the output of any workflow to the Execute Workflow Trigger beow**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d9527913-dad1-4abc-8c86-8c76f53dd513",
|
||||
"name": "Save Markdown file",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
740,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"name": "={{ $json.title }}.md",
|
||||
"content": "=---\n{{ $json.frontmatter }}\n---\n{{ $json.content }}",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "15dvUtfSjaCCXmnOVeIUfeyRd_raI3PnQ",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/folders/15dvUtfSjaCCXmnOVeIUfeyRd_raI3PnQ",
|
||||
"cachedResultName": "clippings-attachments"
|
||||
},
|
||||
"operation": "createFromText"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "Vpmg4nRArCy8DHiE",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "6484937e-17fd-444c-916b-1527382927d4",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 460,
|
||||
"height": 540,
|
||||
"content": "## Create Symlink\nCreate a symlink to integrate your Google Drive Desktop folder with your Obsidian Vault, ensuring that workflow-generated notes stored in Google Drive instantly appear and update in Obsidian.\n\n- **Open an Administrator Command Prompt:**\nPress `Win + S`, type `cmd`, right-click on Command Prompt, and select `Run as Administrator`.\n\n- **Get Folder Paths:**\nIdentify the source path: This is the existing Google Drive folder you want to link to.\nDecide on the target path: This is the folder in your Obsidian Vault where the symlink will be created.\nEnsure the Target Path Does Not Already Exist\n\n- **Run the mklink Command:**\nUse the following syntax to create a directory symbolic link:\n`mklink /D \"Target Path\" \"Source Path\"`\nThe target path is the location in your Vault where the symlink will be created. The source path is the Google Drive folder.\n\n- **Example Command:**\n`mklink /D \"C:\\Users\\YourName\\Vault\\OtherFolder\" \"C:\\Users\\YourName\\Google Drive\\MyFolder\"`"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fe21a7c2-e8db-46be-87e7-63888bf6e9e7",
|
||||
"name": "Receive results from any workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-660,
|
||||
0
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8f2399ba-0bda-4a2e-b773-7e28df16e7c2",
|
||||
"name": "If the input has binary attachment",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
20,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "9f56b367-2313-4a92-9572-b2d2687aba71",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{$json[\"binary\"]}}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "d7cae1d6-5bfe-4e69-8257-0f7947b51c96",
|
||||
"name": "Write Zettlekasten note from input1",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-280,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ JSON.stringify($json) }}",
|
||||
"options": {
|
||||
"systemMessage": "You are an expert knowledge management assistant creating a Zettlekasten note from raw input data. Follow these precise steps:\n\n1. Extract key insights and meaningful connections from the provided JSON input.\n\n2. Structure the note using these Zettlekasten principles:\n- Create a clear, atomic central idea\n- Use precise, concise language\n- Link potential connections to other knowledge domains\n- Ensure the note can stand alone as a meaningful knowledge unit\n\n3. Note format:\n- Unique ID: Generate a unique identifier \n- Title: Concise, descriptive headline capturing core insight\n- Content: Synthesized information with clear reasoning\n- Tags: Relevant conceptual tags for future retrieval\n- References: Source of original data (optional)\n\n4. Prioritize intellectual clarity, semantic depth, and potential for future knowledge expansion.\n\nRespond ONLY with the completed Zettlekasten note in JSON format. Do not include any additional commentary or explanation."
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "303d6633-8e98-4fbc-8ee1-9f1075bcaa3e",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
-100,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n \"title\": \"Concise, Descriptive Title\",\n \"content\": \"Synthesized insights and key information\"\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "62800f09-8659-47b8-9a85-7d3d2c07ec1a",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-300,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "q8L9oWVM7QyzYEE5",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df11dfcb-fb38-4796-9b28-eb1876f68261",
|
||||
"name": "Restructure JSON",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
400,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "c9061623-d0d0-4b63-a166-4766d88992aa",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"value": "={{ $('Write Zettlekasten note from input1').item.json.output.title }}"
|
||||
},
|
||||
{
|
||||
"id": "9f870307-3cbf-41b3-ba69-309610b2d020",
|
||||
"name": "content",
|
||||
"type": "string",
|
||||
"value": "={{ $('Write Zettlekasten note from input1').item.json.output.content }}"
|
||||
},
|
||||
{
|
||||
"id": "1f40b120-00e4-479f-85b0-3fd903e629cb",
|
||||
"name": "frontmatter",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.frontmatter }}"
|
||||
},
|
||||
{
|
||||
"id": "5b845683-5a25-486b-92b0-98990fcbf7af",
|
||||
"name": "references",
|
||||
"type": "string",
|
||||
"value": "={{ $('Write Zettlekasten note from input1').item.json.output.references }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "2a701cf8-e59d-47ae-83c6-9ac7148bd2c8",
|
||||
"name": "Structured Output Parser1",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
240,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchemaExample": "{\n\t\"frontmatter\": \"frontmatter here\"\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "1e4da42e-e945-4be8-88ac-2579857ff3fa",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
60,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "q8L9oWVM7QyzYEE5",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "af5494d8-a53f-48b1-b939-210c882485be",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-340,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 880,
|
||||
"height": 460,
|
||||
"content": "## Optional - Use AI Agents for Note Composition\nInstead of directly using JSON parameters for the note's title, YAML frontmatter, and content, you can utilize AI agents to compose these elements. This approach involves inserting the AI-assisted workflow between the webhook and the Google Drive note, instead of the direct connection.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5d184ea4-88d0-4658-ab94-55246f3507fc",
|
||||
"name": "Write YAML Frontmatter",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
60,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.output.content }}",
|
||||
"options": {
|
||||
"systemMessage": "=Generate comprehensive YAML frontmatter for an Obsidian note, focusing on metadata extraction and organization.\n\nOutput Format:\n```yaml\ntitle: \"{Extract a clear, concise title from input data}\"\ndate: {{ $now.toFormat('yyyy-MM-dd') }}\n\ntags:\n - {Derive 3-4 most relevant conceptual tags}\naliases:\n - {Alternative titles or key phrases}\nstatus: \"draft\"\nsource: \"{Infer original data source if possible}\""
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "d2b291be-97af-4bcb-8cc6-b21439bdcfb9",
|
||||
"name": "Save attachment",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
740,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"name": "=",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "15dvUtfSjaCCXmnOVeIUfeyRd_raI3PnQ",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/folders/15dvUtfSjaCCXmnOVeIUfeyRd_raI3PnQ",
|
||||
"cachedResultName": "clippings-attachments"
|
||||
},
|
||||
"inputDataFieldName": "=data"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "Vpmg4nRArCy8DHiE",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"Write Zettlekasten note from input1": [
|
||||
{
|
||||
"json": {
|
||||
"output": {
|
||||
"id": "note-0235",
|
||||
"tags": [
|
||||
"Freelance",
|
||||
"Employment Trends",
|
||||
"Media Industry",
|
||||
"Permanent Contracts"
|
||||
],
|
||||
"title": "Shift from Freelancers to Permanent Contracts in Media",
|
||||
"content": "Recent developments in the media sector indicate a notable trend where freelancers are increasingly being offered permanent contracts, reflecting a shift in employment practices within the industry. This transition aligns with new leadership changes at prominent companies such as WPG Uitgevers and Mybusinessmedia, which may further influence operational dynamics. Additionally, the appointment of Marc Veeningen as the new editor-in-chief of Talpa Networks signifies fresh perspectives in media management, potentially impacting staffing strategies. This trend not only addresses the job security concerns of freelancers but also suggests a recalibration of talent acquisition by media organizations. Such evolutions warrant closer examination of the balance between flexibility and stability in the workforce.",
|
||||
"references": "Source: https://www.villamedia.nl/artikel/transfer-thursday-freelancers-naar-vast-contract-een-mooie-klus-bij-de-volkskrant-en-een-nieuwe-directeur-bij-wpg"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "c87bbecc-453d-4b8c-8b86-dcf7e1d6907b",
|
||||
"connections": {
|
||||
"Restructure JSON": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Write Zettlekasten note from input1",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Write YAML Frontmatter",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Save Markdown file": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Write YAML Frontmatter": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Restructure JSON",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Write Zettlekasten note from input1",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser1": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Write YAML Frontmatter",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Receive results from any workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If the input has binary attachment",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Save Markdown file",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If the input has binary attachment": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Save attachment",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Write Zettlekasten note from input1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Write YAML Frontmatter",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
{
|
||||
"name": "🤖Contact Agent",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"value": "gpt-4o",
|
||||
"mode": "list",
|
||||
"cachedResultName": "gpt-4o"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"typeVersion": 1.2,
|
||||
"position": [
|
||||
-140,
|
||||
140
|
||||
],
|
||||
"id": "789b640d-a981-43a1-ae88-9dbbd4de92c0",
|
||||
"name": "OpenAI Chat Model",
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "BP9v81AwJlpYGStD",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "search",
|
||||
"base": {
|
||||
"__rl": true,
|
||||
"value": "appK0rbtvf9e7vt6w",
|
||||
"mode": "list",
|
||||
"cachedResultName": "Contacts",
|
||||
"cachedResultUrl": "https://airtable.com/appK0rbtvf9e7vt6w"
|
||||
},
|
||||
"table": {
|
||||
"__rl": true,
|
||||
"value": "tbl08JGCfUK1RhXsG",
|
||||
"mode": "list",
|
||||
"cachedResultName": "Contacts",
|
||||
"cachedResultUrl": "https://airtable.com/appK0rbtvf9e7vt6w/tbl08JGCfUK1RhXsG"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.airtableTool",
|
||||
"typeVersion": 2.1,
|
||||
"position": [
|
||||
40,
|
||||
140
|
||||
],
|
||||
"id": "6b3489a8-75be-461b-a4e4-9592a23a138f",
|
||||
"name": "Get Contacts",
|
||||
"credentials": {
|
||||
"airtableTokenApi": {
|
||||
"id": "UlAGE0msyITVkoCN",
|
||||
"name": "Nate Airtable"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "upsert",
|
||||
"base": {
|
||||
"__rl": true,
|
||||
"value": "appK0rbtvf9e7vt6w",
|
||||
"mode": "list",
|
||||
"cachedResultName": "Contacts",
|
||||
"cachedResultUrl": "https://airtable.com/appK0rbtvf9e7vt6w"
|
||||
},
|
||||
"table": {
|
||||
"__rl": true,
|
||||
"value": "tbl08JGCfUK1RhXsG",
|
||||
"mode": "list",
|
||||
"cachedResultName": "Contacts",
|
||||
"cachedResultUrl": "https://airtable.com/appK0rbtvf9e7vt6w/tbl08JGCfUK1RhXsG"
|
||||
},
|
||||
"columns": {
|
||||
"mappingMode": "defineBelow",
|
||||
"value": {
|
||||
"name": "={{ $fromAI(\"name\") }}",
|
||||
"email": "={{ $fromAI(\"emailAddress\") }}",
|
||||
"phoneNumber": "={{ $fromAI(\"phoneNumber\") }}"
|
||||
},
|
||||
"matchingColumns": [
|
||||
"name"
|
||||
],
|
||||
"schema": [
|
||||
{
|
||||
"id": "name",
|
||||
"displayName": "name",
|
||||
"required": false,
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true,
|
||||
"display": true,
|
||||
"type": "string",
|
||||
"readOnly": false,
|
||||
"removed": false
|
||||
},
|
||||
{
|
||||
"id": "email",
|
||||
"displayName": "email",
|
||||
"required": false,
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true,
|
||||
"display": true,
|
||||
"type": "string",
|
||||
"readOnly": false,
|
||||
"removed": false
|
||||
},
|
||||
{
|
||||
"id": "phoneNumber",
|
||||
"displayName": "phoneNumber",
|
||||
"required": false,
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true,
|
||||
"display": true,
|
||||
"type": "string",
|
||||
"readOnly": false,
|
||||
"removed": false
|
||||
}
|
||||
],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.airtableTool",
|
||||
"typeVersion": 2.1,
|
||||
"position": [
|
||||
200,
|
||||
140
|
||||
],
|
||||
"id": "a0eb4ad0-4e60-41bd-8854-ad20942453a4",
|
||||
"name": "Add or Update Contact",
|
||||
"credentials": {
|
||||
"airtableTokenApi": {
|
||||
"id": "UlAGE0msyITVkoCN",
|
||||
"name": "Nate Airtable"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"promptType": "define",
|
||||
"text": "={{ $json.query }}",
|
||||
"options": {
|
||||
"systemMessage": "=# Overview\nYou are a contact management assistant. Your responsibilities include looking up contacts, adding new contacts, or updating a contact's information.\n\n**Contact Management** \n - Use \"Get Contacts\" to retrieve contact information. \n - Use \"Add or Update Contact\" to store new contact information or modify existing entries. "
|
||||
}
|
||||
},
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"typeVersion": 1.7,
|
||||
"position": [
|
||||
-20,
|
||||
-80
|
||||
],
|
||||
"id": "a3b9dae0-1458-4cb1-b17c-9349d41c03b5",
|
||||
"name": "Contact Agent",
|
||||
"onError": "continueErrorOutput"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4f360190-a717-4a93-8336-d03ea65975d5",
|
||||
"name": "response",
|
||||
"value": "={{ $json.output }}",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
500,
|
||||
-160
|
||||
],
|
||||
"id": "c33b944e-cb4f-447b-ad1f-5e199ed078ac",
|
||||
"name": "Response"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4f360190-a717-4a93-8336-d03ea65975d5",
|
||||
"name": "response",
|
||||
"value": "An error occurred. Please try again.",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
500,
|
||||
20
|
||||
],
|
||||
"id": "2df9e0c0-3f4f-4a06-a36f-f552fe99e2b8",
|
||||
"name": "Try Again"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"inputSource": "passthrough"
|
||||
},
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"typeVersion": 1.1,
|
||||
"position": [
|
||||
-240,
|
||||
-80
|
||||
],
|
||||
"id": "ca88c05c-5a68-4a88-b15b-22398fb15d86",
|
||||
"name": "When Executed by Another Workflow"
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Contact Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Contacts": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Contact Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add or Update Contact": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Contact Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Contact Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Try Again",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Contact Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "24f13596-516c-4365-b91d-e477ed1c652b",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "95e5a8c2e51c83e33b232ea792bbe3f063c094c33d9806a5565cb31759e1ad39"
|
||||
},
|
||||
"id": "IsSUyrla7wc1cDLE",
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
{
|
||||
"name": "🤖Content Creator Agent",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"toolDescription": "Use this tool to search the internet",
|
||||
"method": "POST",
|
||||
"url": "https://api.tavily.com/search",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "{\n \"api_key\": \"your-api-key\",\n \"query\": \"{searchTerm}\",\n \"search_depth\": \"basic\",\n \"include_answer\": true,\n \"topic\": \"news\",\n \"include_raw_content\": true,\n \"max_results\": 3\n} ",
|
||||
"placeholderDefinitions": {
|
||||
"values": [
|
||||
{
|
||||
"name": "searchTerm",
|
||||
"description": "What the user has requested to write a blog about",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"typeVersion": 1.1,
|
||||
"position": [
|
||||
240,
|
||||
180
|
||||
],
|
||||
"id": "0fb22922-121d-4f1c-8423-77c3cb7893ce",
|
||||
"name": "Tavily"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"promptType": "define",
|
||||
"text": "={{ $json.query}}",
|
||||
"options": {
|
||||
"systemMessage": "=# Overview\nYou are a skilled AI blog writer specializing in engaging, well-structured, and informative content. Your writing style is clear, compelling, and tailored to the target audience. You optimize for readability, SEO, and value, ensuring blogs are well-researched, original, and free of fluff.\n\n## Tools\nTavily - Use this to search the web about the requested topic for the blog post.\n\n## Blog Requirements\nFormat all blog content in HTML, using proper headings (<h1>, <h2>), paragraphs (<p>), bullet points (<ul><li>), and links (<a href=\"URL\">) for citations. All citations from the Tavily tool must be preserved, with clickable hyperlinks so readers can access the original sources.\n\nMaintain a natural, human-like tone, use varied sentence structures, and include relevant examples or data when needed. Structure content for easy reading with concise paragraphs and logical flow. Always ensure factual accuracy and align the tone with the intended brand or purpose.\""
|
||||
}
|
||||
},
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"typeVersion": 1.7,
|
||||
"position": [
|
||||
120,
|
||||
-100
|
||||
],
|
||||
"id": "585eaf6a-3f7b-4a85-973e-fd78806ba230",
|
||||
"name": "Content Creator Agent",
|
||||
"onError": "continueErrorOutput"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
|
||||
"typeVersion": 1.2,
|
||||
"position": [
|
||||
-40,
|
||||
140
|
||||
],
|
||||
"id": "0ad7fbd5-5317-4979-9688-d99bc3a3fad2",
|
||||
"name": "Anthropic Chat Model",
|
||||
"credentials": {
|
||||
"anthropicApi": {
|
||||
"id": "iEsH2oywXIJiWHnM",
|
||||
"name": "Anthropic account"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "14d9076e-27ea-4846-8b44-f83cf4022b9e",
|
||||
"name": "response",
|
||||
"value": "={{ $json.output }}",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
560,
|
||||
-180
|
||||
],
|
||||
"id": "ec1997eb-6a99-488b-b496-8355df6c003c",
|
||||
"name": "Response"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "f2a8ff2d-6b59-4ad6-a2e7-8705354f4105",
|
||||
"name": "response",
|
||||
"value": "Error occurred. Please try again.",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
560,
|
||||
0
|
||||
],
|
||||
"id": "0cf971a0-cd9f-4bcf-b020-4839fd3a3708",
|
||||
"name": "Try Again"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"inputSource": "passthrough"
|
||||
},
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"typeVersion": 1.1,
|
||||
"position": [
|
||||
-140,
|
||||
-100
|
||||
],
|
||||
"id": "9ad2ac76-7c2b-40ca-9bf2-9c30ac8d132b",
|
||||
"name": "When Executed by Another Workflow"
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Tavily": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Content Creator Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Anthropic Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Content Creator Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Content Creator Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Try Again",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Content Creator Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "18d27333-3b4c-4fe7-a85d-bbc7000820cf",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "95e5a8c2e51c83e33b232ea792bbe3f063c094c33d9806a5565cb31759e1ad39"
|
||||
},
|
||||
"id": "WWSu94V939ATcqvi",
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,462 @@
|
||||
{
|
||||
"id": "mNbQmMNEvpiZqASG",
|
||||
"meta": {
|
||||
"instanceId": "f80e038bf7b8c99e3db7e7d6a34de2c19f0af25e5d7445b15c36d79b6e8e9e55"
|
||||
},
|
||||
"name": "Format US Phone Number",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "bf150da4-5e01-4571-a606-10a0fb25004b",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
0,
|
||||
275
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "Phone Number",
|
||||
"type": "any"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "7c560ecf-c827-413f-a115-7b6bc8f21a41",
|
||||
"name": "Check if first digit is valid country code",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
660,
|
||||
275
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "4d5c838e-9b08-4466-b00d-c695fd76d66d",
|
||||
"operator": {
|
||||
"type": "number",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json['Phone Number'].toString().slice(0,1).toNumber() }}",
|
||||
"rightValue": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "783d8fd0-2a38-41fc-87c9-b0aec9933070",
|
||||
"name": "Add valid country code",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
880,
|
||||
475
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "e47a1812-f69c-4182-bed5-cf037071cd9b",
|
||||
"name": "Phone Number",
|
||||
"type": "number",
|
||||
"value": "=1{{ $json['Phone Number'] }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "a93923f3-5d8d-4617-a63d-50b66b3b1128",
|
||||
"name": "Strip phone number formatting",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
220,
|
||||
275
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "91d348df-6937-4118-8f7b-c9d386eb5c21",
|
||||
"name": "Phone Number",
|
||||
"type": "number",
|
||||
"value": "={{ $json['Phone Number'].match(/[0-9]+/gmi).join('') }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "58d6d280-ec86-4b69-a89c-e43571ce1035",
|
||||
"name": "Check number of digits in phone number",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
440,
|
||||
254
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "Full Number",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "66c9d1e7-dc56-4ce8-b7e4-64274feb8750",
|
||||
"operator": {
|
||||
"type": "number",
|
||||
"operation": "gte"
|
||||
},
|
||||
"leftValue": "={{ $json['Phone Number'].toString().length }}",
|
||||
"rightValue": 11
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "Number",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "2b9be422-2c4d-402a-b598-e8ab55aa5196",
|
||||
"operator": {
|
||||
"type": "number",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json['Phone Number'].toString().length }}",
|
||||
"rightValue": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "Invalid Number",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "a442130a-f2f8-4399-8edb-180d3607ec9b",
|
||||
"operator": {
|
||||
"type": "number",
|
||||
"operation": "lt"
|
||||
},
|
||||
"leftValue": "={{ $json['Phone Number'].toString().length }}",
|
||||
"rightValue": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "Not a Number",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "efba5af9-dfe4-47f0-8e82-253accd4f238",
|
||||
"operator": {
|
||||
"type": "number",
|
||||
"operation": "notExists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json['Phone Number'] }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "1f6a4aa7-0595-4db3-a9c3-dc7a72656597",
|
||||
"name": "Format phone numbers",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1100,
|
||||
325
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "402c8481-3dee-4b90-8a08-7e611156d012",
|
||||
"name": "Phone Number (Input)",
|
||||
"type": "string",
|
||||
"value": "={{ $('When Executed by Another Workflow').item.json['Phone Number'] }}"
|
||||
},
|
||||
{
|
||||
"id": "9bc193b1-664f-40c0-8545-6792b5599777",
|
||||
"name": "Phone Number",
|
||||
"type": "number",
|
||||
"value": "={{ $json['Phone Number'].toString().slice(0,11).toNumber() }}"
|
||||
},
|
||||
{
|
||||
"id": "a4944be5-bfd5-4804-aeb5-d84c59145485",
|
||||
"name": "=Phone Number (E-164)",
|
||||
"type": "string",
|
||||
"value": "={{ $json['Phone Number'] ? '+' + $json['Phone Number'] : '' }}"
|
||||
},
|
||||
{
|
||||
"id": "3a8d506c-45ba-4843-b186-78bf877b7903",
|
||||
"name": "Phone Number (National)",
|
||||
"type": "string",
|
||||
"value": "={{ $json['Phone Number'] ? '(' + $json['Phone Number'].toString().slice(1,4) + ') ' + $json['Phone Number'].toString().slice(4,7) + '-' + $json['Phone Number'].toString().slice(7,11) : '' }}"
|
||||
},
|
||||
{
|
||||
"id": "14daf876-5f94-44d7-915b-bc4a8d6afbc4",
|
||||
"name": "Phone Number (Full National)",
|
||||
"type": "string",
|
||||
"value": "={{ $json['Phone Number'] ? '1 (' + $json['Phone Number'].toString().slice(1,4) + ') ' + $json['Phone Number'].toString().slice(4,7) + '-' + $json['Phone Number'].toString().slice(7,11) : '' }}"
|
||||
},
|
||||
{
|
||||
"id": "3270cc41-bfd7-4c5d-a05e-4af8da028bd5",
|
||||
"name": "Phone Number (International)",
|
||||
"type": "string",
|
||||
"value": "={{ $json['Phone Number'] ? '00-1-' + $json['Phone Number'].toString().slice(1,4) + '-' + $json['Phone Number'].toString().slice(4,7) + '-' + $json['Phone Number'].toString().slice(7,11) : '' }}"
|
||||
},
|
||||
{
|
||||
"id": "a6bd3652-071f-41b6-b523-bca427ef54f5",
|
||||
"name": "Extension",
|
||||
"type": "number",
|
||||
"value": "={{ $json['Phone Number'].toString().slice(11).toNumber() }}"
|
||||
},
|
||||
{
|
||||
"id": "7b808bfb-0d69-410c-b8f4-cbf2cafcf7e8",
|
||||
"name": "Extension (String)",
|
||||
"type": "string",
|
||||
"value": "={{ $json['Phone Number'].toString().slice(11).toNumber() > 0 ? $json['Phone Number'].toString().slice(11).toNumber() : '' }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "7bc3c1a0-2056-48a0-b826-21a8c1bff31b",
|
||||
"name": "Clear invalid number",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
880,
|
||||
125
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "c8d90980-61c9-49c5-8769-32c445790328",
|
||||
"name": "Phone Number",
|
||||
"type": "string",
|
||||
"value": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"includeOtherFields": true
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"When Executed by Another Workflow": [
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "1-800-555-5555"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "1.800.555.5555"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "800.555.5555"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "1.800.555.55551234"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "1(800)555-55"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "5(800)555-5555"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "1(800)555-5555 extension 1234"
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"Phone Number": "A string"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "1b7626d5-b32b-41bd-989a-a79616769278",
|
||||
"connections": {
|
||||
"Clear invalid number": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format phone numbers",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format phone numbers": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Add valid country code": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format phone numbers",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Strip phone number formatting": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check number of digits in phone number",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Strip phone number formatting",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check number of digits in phone number": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check if first digit is valid country code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Add valid country code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Clear invalid number",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Clear invalid number",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check if first digit is valid country code": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format phone numbers",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Clear invalid number",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user