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

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

View File

@@ -0,0 +1,434 @@
{
"meta": {
"instanceId": "db80165df40cb07c0377167c050b3f9ab0b0fb04f0e8cae0dc53f5a8527103ca",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "ed5363cf-1fb6-4662-b12c-073b2b3a3576",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-240,
140
],
"webhookId": "ebe97b63-ae4b-40e7-9738-b7cf7ffbc8b6",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "e47a166f-3e70-433e-ad0d-2100309cac92",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-60,
500
],
"parameters": {
"options": {
"topP": 1
},
"modelName": "models/gemini-2.0-flash-lite"
},
"credentials": {
"googlePalmApi": {
"id": "Xp5T9q3YYxBIw2nd",
"name": "Google Gemini(PaLM) Api account✅"
}
},
"typeVersion": 1
},
{
"id": "5474805f-8d18-4a09-a3ea-5602af97a5de",
"name": "Auto-fixing Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
"position": [
500,
360
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "d9a0eadc-54c7-4980-b4f8-79fd77627c32",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
600,
520
],
"parameters": {
"jsonSchemaExample": "{\n\t\"name\": \"Name of the prompt\",\n \"category\" : \"the prompt category\"\n}"
},
"typeVersion": 1.2
},
{
"id": "898f64cd-2332-42ad-9bac-a817dd9bf3d7",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
220,
140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "9c5fec90-b7f0-45f3-81a3-22e0956fc3bf",
"name": "text",
"type": "string",
"value": "={{ $json.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "4bbd160a-98bd-4622-a54e-77b61ff91b46",
"name": "Google Gemini Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
380,
540
],
"parameters": {
"options": {
"topP": 1
},
"modelName": "models/gemini-2.0-flash-lite"
},
"credentials": {
"googlePalmApi": {
"id": "Xp5T9q3YYxBIw2nd",
"name": "Google Gemini(PaLM) Api account✅"
}
},
"typeVersion": 1
},
{
"id": "f45cbed4-c2b8-4f1b-8026-4686324a714a",
"name": "Return results",
"type": "n8n-nodes-base.set",
"position": [
960,
140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "40aba86b-57b7-4c74-8e9f-d09cd2f344c5",
"name": "text",
"type": "string",
"value": "={{ $('Generate a new prompt').item.json.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "25650ec5-b559-4bfc-a95a-f81c674bc680",
"name": "Categorize and name Prompt",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
360,
140
],
"parameters": {
"text": "={{ $json.text }}",
"messages": {
"messageValues": [
{
"message": "=Categorize the above prompt into a category that it can fall into"
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.5
},
{
"id": "c324d952-0722-40aa-981c-fcb2007b43b9",
"name": "set prompt fields",
"type": "n8n-nodes-base.set",
"position": [
660,
140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "cbf3b587-67fd-4f08-b50f-53561e869827",
"name": "name",
"type": "string",
"value": "={{ $json.output.name }}"
},
{
"id": "7fda5833-9a3b-4c8a-b18d-4c31b35dae94",
"name": "category",
"type": "string",
"value": "={{ $json.output.category }}"
},
{
"id": "50f06ab3-97d5-43cb-83ff-1a6aac45251b",
"name": "Prompt",
"type": "string",
"value": "={{ $('Edit Fields').item.json.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "97ad8d84-141e-4c21-8ce4-930dbe921f76",
"name": "add to airtable",
"type": "n8n-nodes-base.airtable",
"position": [
800,
140
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "app994hU3fOw0ssrx",
"cachedResultUrl": "https://airtable.com/app994hU3fOw0ssrx",
"cachedResultName": "Prompt Library"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tbldwJrCK2HmAeknA",
"cachedResultUrl": "https://airtable.com/app994hU3fOw0ssrx/tbldwJrCK2HmAeknA",
"cachedResultName": "Prompt Library"
},
"columns": {
"value": {
"Name": "={{ $json.name }}",
"Prompt": "={{ $json.Prompt }}",
"Category": "={{ $json.category }}"
},
"schema": [
{
"id": "Name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Prompt",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Prompt",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Created ON",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "Created ON",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Updated",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "Updated",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Category",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Category",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "create"
},
"credentials": {
"airtableTokenApi": {
"id": "CAa937hASXcJZWTv",
"name": "Airtable Personal Access Token account✅"
}
},
"typeVersion": 2.1
},
{
"id": "516dc434-25d9-4011-9453-bb28521823ca",
"name": "Generate a new prompt",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-80,
140
],
"parameters": {
"messages": {
"messageValues": [
{
"message": "=You are an **expert n8n prompt engineer**, specializing in creating highly optimized, context-aware prompts for AI agents in n8n workflows. Your primary goal is to ensure AI agents execute well-defined tasks **accurately, autonomously, and efficiently**. \n\n### Instructions \n1. **Define the AI Agent's Role and Rules** \n - Use a structured role definition format: \n `\"You are a [SPECIFIC ROLE] working for [SPECIFIC BUSINESS CONTEXT].\"` \n - Clearly specify the agent's responsibilities and scope. \n\n2. **Provide Task Instructions** \n - Use a **step-by-step** numbered list to outline the process. \n - Ensure the instructions allow for flexibility but prevent errors. \n\n3. **Set Rules to Guide AI Behavior** \n - Enumerate key constraints such as: \n - Timezone requirements \n - Prohibitions on making assumptions \n - Required formatting for responses \n\n4. **Use Few-Shot Prompting** \n - Provide clear examples of desired outputs inside `<example>` tags. \n\n5. **Include Additional Context** \n - Define relevant business details, the current date/time, and any required environmental context. \n\n---\n\n## Input Layer \n### Structuring User Inputs \n1. **Define Input Type** \n - Specify whether inputs come from a human user (chat-based) or an external system (API calls). \n\n2. **Handle Dynamic Inputs** \n - Use placeholders (e.g., `{customer_name}`, `{appointment_date}`) for adaptable prompts. \n\n3. **Ensure Personalization** \n - Format prompts naturally while maintaining clarity and specificity. \n\n4. **Merge Static & Dynamic Data** \n - Concatenate fixed prompt structures with real-time system data from n8n. \n\n---\n## Action Layer \n### Tool and Function Calling \n1. **Standardized Tool Naming** \n - Use `snake_case` names for tools (e.g., `check_calendar_availability`). \n\n2. **Provide Clear Tool Descriptions** \n - Example: \n `\"Use the `fetch_customer_data` tool to retrieve details about a specific user based on their email address.\"` \n\n3. **Specify Tool Parameters & Expected Responses** \n - Define required inputs, expected formats, and error handling strategies. \n\n4. **Avoid Hallucinations** \n - AI should **only** use tools for their defined purposes. If information is missing, request clarification instead of guessing. \n\n---\n## Example Prompt for an AI Agent in n8n \n\n```yaml\n# System Layer\n## Role\nYou are a **Scheduling Assistant** working for a **beauty salon**. Your role is to help customers book appointments. \n\n## Instructions\n1. Ask the user for their preferred appointment date. \n2. Use `check_calendar_availability` to find open slots. \n3. If no slots are available, ask the user to select another day. \n4. Capture the users **full name** and **email**. \n5. Use `create_calendar_appointment` to confirm the booking. \n6. Notify the user with appointment details. \n\n## Rules\n- Always use **UTC+1 timezone**. \n- Do not assume details—ask if unsure. \n- If asked about non-scheduling topics, respond: `\"I can only assist with booking appointments.\"` \n\n## Few-shot Example \n<example>\n\"I have successfully booked your appointment:\n- Date & Time: **Wednesday, 15 March 2025, 14:00 (UTC+1)**\n- Booking Email: **jane.doe@example.com**\nIf you need to cancel, please call +49 123 456 789.\"\n</example>\n```\n---\n## Key Considerations \n✅ **Avoid vague roles** (e.g., \"You are an assistant\"). Always specify **business context**. \n✅ **Keep task steps structured** but flexible. \n✅ **Provide explicit tool instructions** in a separate section. \n✅ **Enable AI to ask clarifying questions** instead of making assumptions. \n✅ **Use examples to guide expected outputs.** \n\n\n"
}
]
}
},
"typeVersion": 1.5
}
],
"pinData": {},
"connections": {
"Edit Fields": {
"main": [
[
{
"node": "Categorize and name Prompt",
"type": "main",
"index": 0
}
]
]
},
"add to airtable": {
"main": [
[
{
"node": "Return results",
"type": "main",
"index": 0
}
]
]
},
"set prompt fields": {
"main": [
[
{
"node": "add to airtable",
"type": "main",
"index": 0
}
]
]
},
"Generate a new prompt": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Generate a new prompt",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Auto-fixing Output Parser",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Auto-fixing Output Parser": {
"ai_outputParser": [
[
{
"node": "Categorize and name Prompt",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Google Gemini Chat Model1": {
"ai_languageModel": [
[
{
"node": "Categorize and name Prompt",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Auto-fixing Output Parser",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Categorize and name Prompt": {
"main": [
[
{
"node": "set prompt fields",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Generate a new prompt",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,130 @@
{
"nodes": [
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
450,
300
],
"webhookId": "39f1b81f-f538-4b94-8788-29180d5e4016",
"parameters": {
"path": "39f1b81f-f538-4b94-8788-29180d5e4016",
"options": {
"binaryData": true
},
"httpMethod": "POST",
"responseData": "allEntries",
"responseMode": "lastNode",
"authentication": "headerAuth"
},
"credentials": {
"httpHeaderAuth": "Webhook Workflow Credentials"
},
"typeVersion": 1
},
{
"name": "Mindee",
"type": "n8n-nodes-base.mindee",
"position": [
650,
300
],
"parameters": {
"binaryPropertyName": "receipt"
},
"credentials": {
"mindeeReceiptApi": "expense-tracker"
},
"typeVersion": 1
},
{
"name": "Airtable",
"type": "n8n-nodes-base.airtable",
"position": [
850,
300
],
"parameters": {
"table": "Receipt",
"fields": [
"category",
"date",
"currency",
"locale",
"merchant",
"time",
"total"
],
"options": {},
"operation": "append",
"application": "appThOr4e97XjXcDu",
"addAllFields": false
},
"credentials": {
"airtableApi": "Airtable Credentials n8n"
},
"typeVersion": 1
},
{
"name": "Set",
"type": "n8n-nodes-base.set",
"position": [
1050,
300
],
"parameters": {
"values": {
"string": [
{
"name": "data",
"value": "={{$json[\"fields\"]}}"
},
{
"name": "message",
"value": "=You spent {{$json[\"fields\"][\"currency\"]}} {{$json[\"fields\"][\"total\"]}} on {{$json[\"fields\"][\"category\"]}} at {{$json[\"fields\"][\"merchant\"]}} on {{$json[\"fields\"][\"date\"]}} at {{$json[\"fields\"][\"time\"]}}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
}
],
"connections": {
"Mindee": {
"main": [
[
{
"node": "Airtable",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Mindee",
"type": "main",
"index": 0
}
]
]
},
"Airtable": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,219 @@
{
"id": "7",
"name": "Daily Language Learning",
"nodes": [
{
"name": "Daily trigger",
"type": "n8n-nodes-base.cron",
"position": [
620,
750
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 8
}
]
}
},
"typeVersion": 1
},
{
"name": "Get top 3 articles",
"type": "n8n-nodes-base.hackerNews",
"position": [
820,
750
],
"parameters": {
"limit": 3,
"resource": "all",
"additionalFields": {
"tags": [
"front_page"
]
}
},
"typeVersion": 1
},
{
"name": "Extract words",
"type": "n8n-nodes-base.function",
"position": [
1020,
750
],
"parameters": {
"functionCode": "const words = [];\nconst regex = /\\d/g;\nconst newItems = [];\n\n// Splits titles into words and removes numbers\n// using regular expressions\n\nfor(let i=0; i < items.length; i++) {\n let split_titles = []; \n split_titles = items[i].json.title.split(' ');\n for(let j=0; j < split_titles.length; j++) {\n if(regex.test(split_titles[j])) {\n continue;\n } else {\n words.push(split_titles[j]);\n }\n }\n}\n\n// Removes all duplicate words by converting the\n// array into a set and then back into an array\n\nconst uniqueWords = [...new Set(words)];\n\n// Transform the array to the data structure expected\n// by n8n\n\nfor(let k=0; k < uniqueWords.length; k++) {\n newItems.push({json: { words: uniqueWords[k] }});\n}\n\nreturn newItems;"
},
"typeVersion": 1
},
{
"name": "Translate",
"type": "n8n-nodes-base.lingvaNex",
"position": [
1220,
750
],
"parameters": {
"text": "={{$node[\"Extract words\"].json[\"words\"]}}",
"options": {},
"translateTo": "de_DE"
},
"credentials": {
"lingvaNexApi": "LingvaNex"
},
"typeVersion": 1
},
{
"name": "Filter data ",
"type": "n8n-nodes-base.set",
"position": [
1420,
750
],
"parameters": {
"values": {
"string": [
{
"name": "English word",
"value": "={{$node[\"Translate\"].json[\"source\"]}}"
},
{
"name": "Translated word",
"value": "={{$node[\"Translate\"].json[\"result\"]}}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"name": "Save today's words",
"type": "n8n-nodes-base.airtable",
"position": [
1620,
850
],
"parameters": {
"table": "Table 1",
"options": {},
"operation": "append",
"application": "app4Y6qcCHIO1cYNB"
},
"credentials": {
"airtableApi": "Airtable"
},
"typeVersion": 1
},
{
"name": "Craft message",
"type": "n8n-nodes-base.function",
"position": [
1620,
650
],
"parameters": {
"functionCode": "const number_of_words = 5;\nconst words = [];\n\n// Crafts the words to be sent in en_word : translated_word format\n// and adds them to an array\n\nfor(let i=0; i < number_of_words; i++) {\n words.push(items[i].json['English word'] + ' : ' + items[i].json['Translated word']);\n}\n\n// Takes all the items from the array and converts them into a comma\n// separated string\n\nconst words_of_the_day = words.join(', ');\n\nreturn [{json: {words_of_the_day: words_of_the_day}}];"
},
"typeVersion": 1
},
{
"name": "Send SMS",
"type": "n8n-nodes-base.vonage",
"position": [
1820,
650
],
"parameters": {
"to": "+4915225152610",
"from": "Vonage APIs",
"message": "=Good morning, here are your words for today\n{{$node[\"Craft message\"].json[\"words_of_the_day\"]}}",
"additionalFields": {}
},
"credentials": {
"vonageApi": "Vonage"
},
"typeVersion": 1
}
],
"active": false,
"settings": {},
"connections": {
"Translate": {
"main": [
[
{
"node": "Filter data ",
"type": "main",
"index": 0
}
]
]
},
"Filter data ": {
"main": [
[
{
"node": "Craft message",
"type": "main",
"index": 0
},
{
"node": "Save today's words",
"type": "main",
"index": 0
}
]
]
},
"Craft message": {
"main": [
[
{
"node": "Send SMS",
"type": "main",
"index": 0
}
]
]
},
"Daily trigger": {
"main": [
[
{
"node": "Get top 3 articles",
"type": "main",
"index": 0
}
]
]
},
"Extract words": {
"main": [
[
{
"node": "Translate",
"type": "main",
"index": 0
}
]
]
},
"Get top 3 articles": {
"main": [
[
{
"node": "Extract words",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,81 @@
{
"nodes": [
{
"name": "Airtable",
"type": "n8n-nodes-base.airtable",
"position": [
440,
320
],
"parameters": {
"operation": "list",
"additionalOptions": {}
},
"credentials": {
"airtableApi": "Airtable Credentials n8n"
},
"typeVersion": 1
},
{
"name": "Lemlist",
"type": "n8n-nodes-base.lemlist",
"position": [
640,
320
],
"parameters": {
"email": "={{$json[\"fields\"][\"Email\"]}}",
"resource": "lead",
"campaignId": "cam_H5pYEryq6mRKBiy5v",
"additionalFields": {
"firstName": "={{$json[\"fields\"][\"Name\"]}}"
}
},
"credentials": {
"lemlistApi": "Lemlist API Credentials"
},
"typeVersion": 1
},
{
"name": "Lemlist1",
"type": "n8n-nodes-base.lemlist",
"position": [
840,
320
],
"parameters": {
"email": "={{$node[\"Airtable\"].json[\"fields\"][\"Email\"]}}",
"resource": "lead",
"operation": "get"
},
"credentials": {
"lemlistApi": "Lemlist API Credentials"
},
"typeVersion": 1
}
],
"connections": {
"Lemlist": {
"main": [
[
{
"node": "Lemlist1",
"type": "main",
"index": 0
}
]
]
},
"Airtable": {
"main": [
[
{
"node": "Lemlist",
"type": "main",
"index": 0
}
]
]
}
}
}