text
stringlengths
759
15.2k
messages
listlengths
3
3
original_index
int64
0
147
chunk_index
int64
0
2
total_chunks
int64
1
3
is_chunked
bool
2 classes
source_file
stringclasses
1 value
metadata
dict
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow aims to create a chatbot that answers questions using a Notion database as its knowledge source. Analyze this workflow: ```json { "meta": { "instanceId": "205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa" }, "nodes": [ { "id": "d1d4291e-fa37-43d0-81e0-f0a594371426", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 680, 620 ], "parameters": { "model": "gpt-4o", "options": { "timeout": 25000, "temperature": 0.7 } }, "credentials": { "openAiApi": { "id": "AzPPV759YPBxJj3o", "name": "Max's DevRel OpenAI account" } }, "typeVersion": 1 }, { "id": "68e6805b-9c19-4c9e-a300-8983f2b7c28a", "name": "Search notion database", "type": "@n8n/n8n-nodes-langchain.toolHttpRequest", "position": [ 980, 620 ], "parameters": { "url": "=https://api.notion.com/v1/databases/{{ $json.notionID }}/query", "method": "POST", "jsonBody": "{\n \"filter\": {\n \"or\": [\n {\n \"property\": \"question\",\n \"rich_text\": {\n \"contains\": \"{keyword}\"\n }\n },\n {\n \"property\": \"tags\",\n \"multi_select\": {\n \"contains\": \"{tag}\"\n }\n }\n ]\n },\n \"sorts\": [\n {\n \"property\": \"updated_at\",\n \"direction\": \"ascending\"\n }\n ]\n}", "sendBody": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "toolDescription": "=Use this tool to search the \"\" Notion app database.\n\nIt is structured with question and answer format. \nYou can filter query result by:\n- By keyword\n- filter by tag.\n\nKeyword and Tag have an OR relationship not AND.\n\n", "nodeCredentialType": "notionApi", "placeholderDefinitions": { "values": [ { "name": "keyword", "description": "Searches question of the record. Use one keyword at a time." }, { "name": "tag", "description": "=Options: {{ $json.tagsOptions }}" } ] } }, "credentials": { "notionApi": { "id": "gfNp6Jup8rsmFLRr", "name": "max-bot" } }, "typeVersion": 1.1 }, { "id": "c3164d38-a9fb-4ee3-b6bd-fccb4aa5a1a4", "name": "Get database details", "type": "n8n-nodes-base.notion", "position": [ 420, 380 ], "parameters": { "simple": false, "resource": "database", "databaseId": { "__rl": true, "mode": "list", "value": "7ea9697d-4875-441e-b262-1105337d232e", "cachedResultUrl": "https://www.notion.so/7ea9697d4875441eb2621105337d232e", "cachedResultName": "StarLens Company Knowledge Base" } }, "credentials": { "notionApi": { "id": "gfNp6Jup8rsmFLRr", "name": "max-bot" } }, "typeVersion": 2.2 }, { "id": "98300243-efcc-4427-88da-c1af8a91ddae", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 820, 620 ], "parameters": { "contextWindowLength": 4 }, "typeVersion": 1.2 }, { "id": "a8473f48-1343-4eb2-8e48-ec89377a2a00", "name": "Search inside database record", "type": "@n8n/n8n-nodes-langchain.toolHttpRequest", "notes": " ", "position": [ 1140, 620 ], "parameters": { "url": "https://api.notion.com/v1/blocks/{page_id}/children", "fields": "id, type, paragraph.text, heading_1.text, heading_2.text, heading_3.text, bulleted_list_item.text, numbered_list_item.text, to_do.text, children", "dataField": "results", "authentication": "predefinedCredentialType", "fieldsToInclude": "selected", "toolDescription": "=Use this tool to retrieve Notion page content using the page ID. \n\nIt is structured with question and answer format. \nYou can filter query result by:\n- By keyword\n- filter by tag.\n\nKeyword and Tag have an OR relationship not AND.\n\n", "optimizeResponse": true, "nodeCredentialType": "notionApi", "placeholderDefinitions": { "values": [ { "name": "page_id", "description": "Notion page id from 'Search notion database' tool results" } ] } }, "credentials": { "notionApi": { "id": "gfNp6Jup8rsmFLRr", "name": "max-bot" } }, "notesInFlow": true, "typeVersion": 1.1 }, { "id": "115c328e-84b0-43d2-8df7-8b3f74cbb2fb", "name": "Format schema", "type": "n8n-nodes-base.set", "position": [ 620, 380 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "a8e58791-ba51-46a2-8645-386dd1a0ff6e", "name": "sessionId", "type": "string", "value": "={{ $('When chat message received').item.json.sessionId }}" }, { "id": "434209de-39d5-43d8-a964-0fcb7396306c", "name": "action", "type": "string", "value": "={{ $('When chat message received').item.json.action }}" }, { "id": "cad4c972-51a9-4e16-a627-b00eea77eb30", "name": "chatInput", "type": "string", "value": "={{ $('When chat message received').item.json.chatInput }}" }, { "id": "8e88876c-2714-494d-bd5e-5e80c99f83e3", "name": "notionID", "type": "string", "value": "={{ $('Get database details').item.json.id }}" }, { "id": "a88a15f6-317c-4d2e-9d64-26f5ccaf7a97", "name": "databaseName", "type": "string", "value": "={{ $json.title[0].text.content }}" }, { "id": "7c3bf758-8ed3-469a-8695-6777f4af4fb9", "name": "tagsOptions", "type": "string", "value": "={{ $json.properties.tags.multi_select.options.map(item => item.name).join(',') }}" } ] } }, "typeVersion": 3.4 }, { "id": "3b82f4fe-6c0c-4e6e-a387-27de31fec758", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 240 ], "parameters": { "color": 6, "width": 462.3561535890252, "height": 95.12709218477178, "content": "## Notion knowledge base assistant [v1]\nBuilt as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/) by [@maxtkacz](https://x.com/maxtkacz)\n" }, "typeVersion": 1 }, { "id": "31debc55-6608-4e64-be18-1bc0fc0fbf16", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 1060 ], "parameters": { "color": 7, "width": 462.3561535890252, "height": 172.4760209818479, "content": "### FAQ\n- In `Get database details` if you see a `The resource you are requesting could not be found` error, you need to add your connection to the database (in the Notion app).\n- The `Get database details` pulls most recent `Tags` and informs AI Agent of them. However this step adds ~250-800ms per run. Watch detailed video to see how to remove this step. " }, "typeVersion": 1 }, { "id": "9f48e548-f032-477c-960d-9c99d61443df", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 820, 380 ], "parameters": { "text": "={{ $json.chatInput }}", "options": { "systemMessage": "=# Role:\nYou are a helpful agent. Query the \"{{ $json.databaseName }}\" Notion database to find relevant records or summarize insights based on multiple records.\n\n# Behavior:\n\nBe clear, very concise, efficient, and accurate in responses. Do not hallucinate.\nIf the request is ambiguous, ask for clarification. Do not embellish, only use facts from the Notion records. Do not offer general advice.\n\n# Error Handling:\n\nIf no matching records are found, try alternative search criteria. Example 1: Laptop, then Computer, then Equipment. Example 2: meetings, then meeting.\nClearly explain any issues with queries (e.g., missing fields or unsupported filters).\n\n# Output:\n\nReturn concise, user-friendly results or summaries.\nFor large sets, show top results by default and offer more if needed. Output URLs in markdown format. \n\nWhen a record has the answer to user question, always output the URL to that page. Do not output links twice." }, "promptType": "define" }, "typeVersion": 1.6 }, { "id": "f1274a12-128c-4549-a19b-6bfc3beccd89", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 220, 380 ], "webhookId": "b76d02c0-b406-4d21-b6bf-8ad2c623def3", "parameters": { "public": true, "options": { "title": "Notion Knowledge Base", "subtitle": "" }, "initialMessages": "=Happy {{ $today.weekdayLong }}!\nKnowledge source assistant at your service. How can I help you?" }, "typeVersion": 1.1 }, { "id": "2e25e4bc-7970-4d00-a757-ba1e418873aa", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 360 ], "parameters": { "color": 7, "width": 463.90418399676537, "height": 318.2958135288425, "content": "### Template set up quickstart video πŸ‘‡\n[![Video Thumbnail](https://uploads.n8n.io/maxt/notion-db-assistant-embedded-thumb.png#full-width)](https://www.youtube.com/watch?v=ynLZwS2Nhnc)\n" }, "typeVersion": 1 }, { "id": "ba6fe953-fd5c-497f-ac2a-7afa04b7e6cc", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 700 ], "parameters": { "color": 7, "width": 461.5634274842711, "height": 332.14098134070576, "content": "### Written set up steps\n1. Add a Notion credential to your n8n workspace (follow [this Notion guide](https://developers.notion.com/docs/create-a-notion-integration))\n2. [Duplicate Company knowledge base
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa\"\n },\n \"nodes\": [\n {\n \"id\": \"d1d4291e-fa37-43d0-81e0-f0a594371426\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 680,\n 620\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {\n \"timeout\": 25000,\n \"temperature\": 0.7\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"AzPPV759YPBxJj3o\",\n \"name\": \"Max's DevRel OpenAI account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"68e6805b-9c19-4c9e-a300-8983f2b7c28a\",\n \"name\": \"Search notion database\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolHttpRequest\",\n \"position\": [\n 980,\n 620\n ],\n \"parameters\": {\n \"url\": \"=https://api.notion.com/v1/databases/{{ $json.notionID }}/query\",\n \"method\": \"POST\",\n \"jsonBody\": \"{\\n \\\"filter\\\": {\\n \\\"or\\\": [\\n {\\n \\\"property\\\": \\\"question\\\",\\n \\\"rich_text\\\": {\\n \\\"contains\\\": \\\"{keyword}\\\"\\n }\\n },\\n {\\n \\\"property\\\": \\\"tags\\\",\\n \\\"multi_select\\\": {\\n \\\"contains\\\": \\\"{tag}\\\"\\n }\\n }\\n ]\\n },\\n \\\"sorts\\\": [\\n {\\n \\\"property\\\": \\\"updated_at\\\",\\n \\\"direction\\\": \\\"ascending\\\"\\n }\\n ]\\n}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"toolDescription\": \"=Use this tool to search the \\\"\\\" Notion app database.\\n\\nIt is structured with question and answer format. \\nYou can filter query result by:\\n- By keyword\\n- filter by tag.\\n\\nKeyword and Tag have an OR relationship not AND.\\n\\n\",\n \"nodeCredentialType\": \"notionApi\",\n \"placeholderDefinitions\": {\n \"values\": [\n {\n \"name\": \"keyword\",\n \"description\": \"Searches question of the record. Use one keyword at a time.\"\n },\n {\n \"name\": \"tag\",\n \"description\": \"=Options: {{ $json.tagsOptions }}\"\n }\n ]\n }\n },\n \"credentials\": {\n \"notionApi\": {\n \"id\": \"gfNp6Jup8rsmFLRr\",\n \"name\": \"max-bot\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"c3164d38-a9fb-4ee3-b6bd-fccb4aa5a1a4\",\n \"name\": \"Get database details\",\n \"type\": \"n8n-nodes-base.notion\",\n \"position\": [\n 420,\n 380\n ],\n \"parameters\": {\n \"simple\": false,\n \"resource\": \"database\",\n \"databaseId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"7ea9697d-4875-441e-b262-1105337d232e\",\n \"cachedResultUrl\": \"https://www.notion.so/7ea9697d4875441eb2621105337d232e\",\n \"cachedResultName\": \"StarLens Company Knowledge Base\"\n }\n },\n \"credentials\": {\n \"notionApi\": {\n \"id\": \"gfNp6Jup8rsmFLRr\",\n \"name\": \"max-bot\"\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"98300243-efcc-4427-88da-c1af8a91ddae\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 820,\n 620\n ],\n \"parameters\": {\n \"contextWindowLength\": 4\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"a8473f48-1343-4eb2-8e48-ec89377a2a00\",\n \"name\": \"Search inside database record\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolHttpRequest\",\n \"notes\": \" \",\n \"position\": [\n 1140,\n 620\n ],\n \"parameters\": {\n \"url\": \"https://api.notion.com/v1/blocks/{page_id}/children\",\n \"fields\": \"id, type, paragraph.text, heading_1.text, heading_2.text, heading_3.text, bulleted_list_item.text, numbered_list_item.text, to_do.text, children\",\n \"dataField\": \"results\",\n \"authentication\": \"predefinedCredentialType\",\n \"fieldsToInclude\": \"selected\",\n \"toolDescription\": \"=Use this tool to retrieve Notion page content using the page ID. \\n\\nIt is structured with question and answer format. \\nYou can filter query result by:\\n- By keyword\\n- filter by tag.\\n\\nKeyword and Tag have an OR relationship not AND.\\n\\n\",\n \"optimizeResponse\": true,\n \"nodeCredentialType\": \"notionApi\",\n \"placeholderDefinitions\": {\n \"values\": [\n {\n \"name\": \"page_id\",\n \"description\": \"Notion page id from 'Search notion database' tool results\"\n }\n ]\n }\n },\n \"credentials\": {\n \"notionApi\": {\n \"id\": \"gfNp6Jup8rsmFLRr\",\n \"name\": \"max-bot\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"115c328e-84b0-43d2-8df7-8b3f74cbb2fb\",\n \"name\": \"Format schema\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 620,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"a8e58791-ba51-46a2-8645-386dd1a0ff6e\",\n \"name\": \"sessionId\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.sessionId }}\"\n },\n {\n \"id\": \"434209de-39d5-43d8-a964-0fcb7396306c\",\n \"name\": \"action\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.action }}\"\n },\n {\n \"id\": \"cad4c972-51a9-4e16-a627-b00eea77eb30\",\n \"name\": \"chatInput\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.chatInput }}\"\n },\n {\n \"id\": \"8e88876c-2714-494d-bd5e-5e80c99f83e3\",\n \"name\": \"notionID\",\n \"type\": \"string\",\n \"value\": \"={{ $('Get database details').item.json.id }}\"\n },\n {\n \"id\": \"a88a15f6-317c-4d2e-9d64-26f5ccaf7a97\",\n \"name\": \"databaseName\",\n \"type\": \"string\",\n \"value\": \"={{ $json.title[0].text.content }}\"\n },\n {\n \"id\": \"7c3bf758-8ed3-469a-8695-6777f4af4fb9\",\n \"name\": \"tagsOptions\",\n \"type\": \"string\",\n \"value\": \"={{ $json.properties.tags.multi_select.options.map(item => item.name).join(',') }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3b82f4fe-6c0c-4e6e-a387-27de31fec758\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 240\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 462.3561535890252,\n \"height\": 95.12709218477178,\n \"content\": \"## Notion knowledge base assistant [v1]\\nBuilt as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/) by [@maxtkacz](https://x.com/maxtkacz)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"31debc55-6608-4e64-be18-1bc0fc0fbf16\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 1060\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 462.3561535890252,\n \"height\": 172.4760209818479,\n \"content\": \"### FAQ\\n- In `Get database details` if you see a `The resource you are requesting could not be found` error, you need to add your connection to the database (in the Notion app).\\n- The `Get database details` pulls most recent `Tags` and informs AI Agent of them. However this step adds ~250-800ms per run. Watch detailed video to see how to remove this step. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9f48e548-f032-477c-960d-9c99d61443df\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 820,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.chatInput }}\",\n \"options\": {\n \"systemMessage\": \"=# Role:\\nYou are a helpful agent. Query the \\\"{{ $json.databaseName }}\\\" Notion database to find relevant records or summarize insights based on multiple records.\\n\\n# Behavior:\\n\\nBe clear, very concise, efficient, and accurate in responses. Do not hallucinate.\\nIf the request is ambiguous, ask for clarification. Do not embellish, only use facts from the Notion records. Do not offer general advice.\\n\\n# Error Handling:\\n\\nIf no matching records are found, try alternative search criteria. Example 1: Laptop, then Computer, then Equipment. Example 2: meetings, then meeting.\\nClearly explain any issues with queries (e.g., missing fields or unsupported filters).\\n\\n# Output:\\n\\nReturn concise, user-friendly results or summaries.\\nFor large sets, show top results by default and offer more if needed. Output URLs in markdown format. \\n\\nWhen a record has the answer to user question, always output the URL to that page. Do not output links twice.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"f1274a12-128c-4549-a19b-6bfc3beccd89\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 220,\n 380\n ],\n \"webhookId\": \"b76d02c0-b406-4d21-b6bf-8ad2c623def3\",\n \"parameters\": {\n \"public\": true,\n \"options\": {\n \"title\": \"Notion Knowledge Base\",\n \"subtitle\": \"\"\n },\n \"initialMessages\": \"=Happy {{ $today.weekdayLong }}!\\nKnowledge source assistant at your service. How can I help you?\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2e25e4bc-7970-4d00-a757-ba1e418873aa\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 360\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 463.90418399676537,\n \"height\": 318.2958135288425,\n \"content\": \"### Template set up quickstart video πŸ‘‡\\n[![Video Thumbnail](https://uploads.n8n.io/maxt/notion-db-assistant-embedded-thumb.png#full-width)](https://www.youtube.com/watch?v=ynLZwS2Nhnc)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ba6fe953-fd5c-497f-ac2a-7afa04b7e6cc\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 700\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 461.5634274842711,\n \"height\": 332.14098134070576,\n \"content\": \"### Written set up steps\\n1. Add a Notion credential to your n8n workspace (follow [this Notion guide](https://developers.notion.com/docs/create-a-notion-integration))\\n2. [Duplicate Company knowledge base Notion template](https://www.notion.so/templates/knowledge-base-ai-assistant-with-n8n) to your Notion workspace, then make sure to share the new knowledge base with connection you created in Step 1. \\n3. Add Notion cred to `Get database details`:`Credential to connect with` parameter, then to `Search notion database`:`Notion API` parameter (same for `Search inside database record`)\\n4. Add OpenAI credential to `Open AI Chat Model` node (tested and working with Anthropic Claude 3.5 too)\\n5. In `Get database details`, select the db you created from Step 2 in `Database` dropdown.\\n6. Click `Chat` button to test the workflow. Then Activate it and copy the `Chat URL` from `When chat message received`.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Format schema\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get database details\": {\n \"main\": [\n [\n {\n \"node\": \"Format schema\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search notion database\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Get database details\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search inside database record\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
0
0
2
true
combined_workflows.json
{ "input": "The workflow aims to create a chatbot that answers questions using a Notion database as its knowledge source.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9824, "processed_size": 9824, "processed_timestamp": "2025-04-09T03:08:36.222137", "timestamp": "2025-04-09T02:34:24.722123", "token_count": 4095, "tokens": 979, "workflow_chunk_info": { "is_truncated": false, "original_size": 9824, "processed_size": 9824, "workflow_hash": "b0fe8adadb1e54761be2b06f9ce095d9" }, "workflow_hash": "b0fe8adadb1e54761be2b06f9ce095d9" }
97f-ac2a-7afa04b7e6cc", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 700 ], "parameters": { "color": 7, "width": 461.5634274842711, "height": 332.14098134070576, "content": "### Written set up steps\n1. Add a Notion credential to your n8n workspace (follow [this Notion guide](https://developers.notion.com/docs/create-a-notion-integration))\n2. [Duplicate Company knowledge base Notion template](https://www.notion.so/templates/knowledge-base-ai-assistant-with-n8n) to your Notion workspace, then make sure to share the new knowledge base with connection you created in Step 1. \n3. Add Notion cred to `Get database details`:`Credential to connect with` parameter, then to `Search notion database`:`Notion API` parameter (same for `Search inside database record`)\n4. Add OpenAI credential to `Open AI Chat Model` node (tested and working with Anthropic Claude 3.5 too)\n5. In `Get database details`, select the db you created from Step 2 in `Database` dropdown.\n6. Click `Chat` button to test the workflow. Then Activate it and copy the `Chat URL` from `When chat message received`." }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Format schema": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Get database details": { "main": [ [ { "node": "Format schema", "type": "main", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Search notion database": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "Get database details", "type": "main", "index": 0 } ] ] }, "Search inside database record": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa\"\n },\n \"nodes\": [\n {\n \"id\": \"d1d4291e-fa37-43d0-81e0-f0a594371426\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 680,\n 620\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {\n \"timeout\": 25000,\n \"temperature\": 0.7\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"AzPPV759YPBxJj3o\",\n \"name\": \"Max's DevRel OpenAI account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"68e6805b-9c19-4c9e-a300-8983f2b7c28a\",\n \"name\": \"Search notion database\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolHttpRequest\",\n \"position\": [\n 980,\n 620\n ],\n \"parameters\": {\n \"url\": \"=https://api.notion.com/v1/databases/{{ $json.notionID }}/query\",\n \"method\": \"POST\",\n \"jsonBody\": \"{\\n \\\"filter\\\": {\\n \\\"or\\\": [\\n {\\n \\\"property\\\": \\\"question\\\",\\n \\\"rich_text\\\": {\\n \\\"contains\\\": \\\"{keyword}\\\"\\n }\\n },\\n {\\n \\\"property\\\": \\\"tags\\\",\\n \\\"multi_select\\\": {\\n \\\"contains\\\": \\\"{tag}\\\"\\n }\\n }\\n ]\\n },\\n \\\"sorts\\\": [\\n {\\n \\\"property\\\": \\\"updated_at\\\",\\n \\\"direction\\\": \\\"ascending\\\"\\n }\\n ]\\n}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"toolDescription\": \"=Use this tool to search the \\\"\\\" Notion app database.\\n\\nIt is structured with question and answer format. \\nYou can filter query result by:\\n- By keyword\\n- filter by tag.\\n\\nKeyword and Tag have an OR relationship not AND.\\n\\n\",\n \"nodeCredentialType\": \"notionApi\",\n \"placeholderDefinitions\": {\n \"values\": [\n {\n \"name\": \"keyword\",\n \"description\": \"Searches question of the record. Use one keyword at a time.\"\n },\n {\n \"name\": \"tag\",\n \"description\": \"=Options: {{ $json.tagsOptions }}\"\n }\n ]\n }\n },\n \"credentials\": {\n \"notionApi\": {\n \"id\": \"gfNp6Jup8rsmFLRr\",\n \"name\": \"max-bot\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"c3164d38-a9fb-4ee3-b6bd-fccb4aa5a1a4\",\n \"name\": \"Get database details\",\n \"type\": \"n8n-nodes-base.notion\",\n \"position\": [\n 420,\n 380\n ],\n \"parameters\": {\n \"simple\": false,\n \"resource\": \"database\",\n \"databaseId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"7ea9697d-4875-441e-b262-1105337d232e\",\n \"cachedResultUrl\": \"https://www.notion.so/7ea9697d4875441eb2621105337d232e\",\n \"cachedResultName\": \"StarLens Company Knowledge Base\"\n }\n },\n \"credentials\": {\n \"notionApi\": {\n \"id\": \"gfNp6Jup8rsmFLRr\",\n \"name\": \"max-bot\"\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"98300243-efcc-4427-88da-c1af8a91ddae\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 820,\n 620\n ],\n \"parameters\": {\n \"contextWindowLength\": 4\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"a8473f48-1343-4eb2-8e48-ec89377a2a00\",\n \"name\": \"Search inside database record\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolHttpRequest\",\n \"notes\": \" \",\n \"position\": [\n 1140,\n 620\n ],\n \"parameters\": {\n \"url\": \"https://api.notion.com/v1/blocks/{page_id}/children\",\n \"fields\": \"id, type, paragraph.text, heading_1.text, heading_2.text, heading_3.text, bulleted_list_item.text, numbered_list_item.text, to_do.text, children\",\n \"dataField\": \"results\",\n \"authentication\": \"predefinedCredentialType\",\n \"fieldsToInclude\": \"selected\",\n \"toolDescription\": \"=Use this tool to retrieve Notion page content using the page ID. \\n\\nIt is structured with question and answer format. \\nYou can filter query result by:\\n- By keyword\\n- filter by tag.\\n\\nKeyword and Tag have an OR relationship not AND.\\n\\n\",\n \"optimizeResponse\": true,\n \"nodeCredentialType\": \"notionApi\",\n \"placeholderDefinitions\": {\n \"values\": [\n {\n \"name\": \"page_id\",\n \"description\": \"Notion page id from 'Search notion database' tool results\"\n }\n ]\n }\n },\n \"credentials\": {\n \"notionApi\": {\n \"id\": \"gfNp6Jup8rsmFLRr\",\n \"name\": \"max-bot\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"115c328e-84b0-43d2-8df7-8b3f74cbb2fb\",\n \"name\": \"Format schema\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 620,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"a8e58791-ba51-46a2-8645-386dd1a0ff6e\",\n \"name\": \"sessionId\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.sessionId }}\"\n },\n {\n \"id\": \"434209de-39d5-43d8-a964-0fcb7396306c\",\n \"name\": \"action\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.action }}\"\n },\n {\n \"id\": \"cad4c972-51a9-4e16-a627-b00eea77eb30\",\n \"name\": \"chatInput\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.chatInput }}\"\n },\n {\n \"id\": \"8e88876c-2714-494d-bd5e-5e80c99f83e3\",\n \"name\": \"notionID\",\n \"type\": \"string\",\n \"value\": \"={{ $('Get database details').item.json.id }}\"\n },\n {\n \"id\": \"a88a15f6-317c-4d2e-9d64-26f5ccaf7a97\",\n \"name\": \"databaseName\",\n \"type\": \"string\",\n \"value\": \"={{ $json.title[0].text.content }}\"\n },\n {\n \"id\": \"7c3bf758-8ed3-469a-8695-6777f4af4fb9\",\n \"name\": \"tagsOptions\",\n \"type\": \"string\",\n \"value\": \"={{ $json.properties.tags.multi_select.options.map(item => item.name).join(',') }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3b82f4fe-6c0c-4e6e-a387-27de31fec758\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 240\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 462.3561535890252,\n \"height\": 95.12709218477178,\n \"content\": \"## Notion knowledge base assistant [v1]\\nBuilt as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/) by [@maxtkacz](https://x.com/maxtkacz)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"31debc55-6608-4e64-be18-1bc0fc0fbf16\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 1060\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 462.3561535890252,\n \"height\": 172.4760209818479,\n \"content\": \"### FAQ\\n- In `Get database details` if you see a `The resource you are requesting could not be found` error, you need to add your connection to the database (in the Notion app).\\n- The `Get database details` pulls most recent `Tags` and informs AI Agent of them. However this step adds ~250-800ms per run. Watch detailed video to see how to remove this step. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9f48e548-f032-477c-960d-9c99d61443df\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 820,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.chatInput }}\",\n \"options\": {\n \"systemMessage\": \"=# Role:\\nYou are a helpful agent. Query the \\\"{{ $json.databaseName }}\\\" Notion database to find relevant records or summarize insights based on multiple records.\\n\\n# Behavior:\\n\\nBe clear, very concise, efficient, and accurate in responses. Do not hallucinate.\\nIf the request is ambiguous, ask for clarification. Do not embellish, only use facts from the Notion records. Do not offer general advice.\\n\\n# Error Handling:\\n\\nIf no matching records are found, try alternative search criteria. Example 1: Laptop, then Computer, then Equipment. Example 2: meetings, then meeting.\\nClearly explain any issues with queries (e.g., missing fields or unsupported filters).\\n\\n# Output:\\n\\nReturn concise, user-friendly results or summaries.\\nFor large sets, show top results by default and offer more if needed. Output URLs in markdown format. \\n\\nWhen a record has the answer to user question, always output the URL to that page. Do not output links twice.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"f1274a12-128c-4549-a19b-6bfc3beccd89\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 220,\n 380\n ],\n \"webhookId\": \"b76d02c0-b406-4d21-b6bf-8ad2c623def3\",\n \"parameters\": {\n \"public\": true,\n \"options\": {\n \"title\": \"Notion Knowledge Base\",\n \"subtitle\": \"\"\n },\n \"initialMessages\": \"=Happy {{ $today.weekdayLong }}!\\nKnowledge source assistant at your service. How can I help you?\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2e25e4bc-7970-4d00-a757-ba1e418873aa\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 360\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 463.90418399676537,\n \"height\": 318.2958135288425,\n \"content\": \"### Template set up quickstart video πŸ‘‡\\n[![Video Thumbnail](https://uploads.n8n.io/maxt/notion-db-assistant-embedded-thumb.png#full-width)](https://www.youtube.com/watch?v=ynLZwS2Nhnc)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ba6fe953-fd5c-497f-ac2a-7afa04b7e6cc\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 700\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 461.5634274842711,\n \"height\": 332.14098134070576,\n \"content\": \"### Written set up steps\\n1. Add a Notion credential to your n8n workspace (follow [this Notion guide](https://developers.notion.com/docs/create-a-notion-integration))\\n2. [Duplicate Company knowledge base Notion template](https://www.notion.so/templates/knowledge-base-ai-assistant-with-n8n) to your Notion workspace, then make sure to share the new knowledge base with connection you created in Step 1. \\n3. Add Notion cred to `Get database details`:`Credential to connect with` parameter, then to `Search notion database`:`Notion API` parameter (same for `Search inside database record`)\\n4. Add OpenAI credential to `Open AI Chat Model` node (tested and working with Anthropic Claude 3.5 too)\\n5. In `Get database details`, select the db you created from Step 2 in `Database` dropdown.\\n6. Click `Chat` button to test the workflow. Then Activate it and copy the `Chat URL` from `When chat message received`.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Format schema\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get database details\": {\n \"main\": [\n [\n {\n \"node\": \"Format schema\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search notion database\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Get database details\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search inside database record\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
0
1
2
true
combined_workflows.json
{ "input": "The workflow aims to create a chatbot that answers questions using a Notion database as its knowledge source.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9824, "processed_size": 9824, "processed_timestamp": "2025-04-09T03:08:36.245360", "timestamp": "2025-04-09T02:34:24.722123", "token_count": 876, "tokens": 979, "workflow_chunk_info": { "is_truncated": false, "original_size": 9824, "processed_size": 9824, "workflow_hash": "b0fe8adadb1e54761be2b06f9ce095d9" }, "workflow_hash": "b0fe8adadb1e54761be2b06f9ce095d9" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To create a chatbot that allows users to interact with a PostgreSQL database using natural language. Analyze this workflow: ```json { "id": "eOUewYsEzJmQixI6", "meta": { "instanceId": "77c4feba8f41570ef06dc76ece9a6ded0f0d44f7f1477a64c2d71a8508c11faa", "templateCredsSetupCompleted": true }, "name": "Chat with Postgresql Database", "tags": [], "nodes": [ { "id": "6501a54f-a68c-452d-b353-d7e871ca3780", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -300, -80 ], "webhookId": "cf1de04f-3e38-426c-89f0-3bdb110a5dcf", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "cd32221b-2a36-408d-b57e-8115fcd810c9", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 0, -80 ], "parameters": { "agent": "openAiFunctionsAgent", "options": { "systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user. Make sure every table has schema prefix to it in sql query which you can get from `Get DB Schema and Tables List` tool.\n\nFetch all data to analyse it for response if needed.\n\n## Tools\n\n- Execute SQL query - Executes any sql query generated by AI\n- Get DB Schema and Tables List - Lists all the tables in database with its schema name\n- Get Table Definition - Gets the table definition from db using table name and schema name" } }, "typeVersion": 1.7 }, { "id": "8accbeeb-7eaf-4e9e-aabc-de8ab3a0459b", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ -60, 160 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "48uG61Ilo8jndw3r", "name": "Your OpenAI Account Credentials" } }, "typeVersion": 1.2 }, { "id": "11f2013f-a080-4c9e-8773-c90492e2c628", "name": "Get Table Definition", "type": "n8n-nodes-base.postgresTool", "position": [ 780, 140 ], "parameters": { "query": "select\n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nfrom\n information_schema.columns c\nLEFT join\n information_schema.key_column_usage kcu\n ON c.table_name = kcu.table_name\n AND c.column_name = kcu.column_name\nLEFT join\n information_schema.table_constraints tc\n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT join\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nwhere\n c.table_name = '{{ $fromAI(\"table_name\") }}'\n AND c.table_schema = '{{ $fromAI(\"schema_name\") }}'\norder by\n c.ordinal_position", "options": {}, "operation": "executeQuery", "descriptionType": "manual", "toolDescription": "Get table definition to find all columns and types" }, "credentials": { "postgres": { "id": "nGI61D0TEEZz18rr", "name": "Your Postgresql Database Credentials" } }, "typeVersion": 2.5 }, { "id": "760bc9bc-0057-4088-b3f0-3ee37b3519df", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -300, -240 ], "parameters": { "color": 5, "width": 560, "height": 120, "content": "### πŸ‘¨β€πŸŽ€ Setup\n1. Add your **postgresql** and **OpenAI** credentials.\n2. Click **Chat** button and start asking questions to your database.\n3. Activate the workflow and you can make the chat publicly available." }, "typeVersion": 1 }, { "id": "0df33341-c859-4a54-b6d9-a99670e8d76d", "name": "Chat History", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 120, 160 ], "parameters": {}, "typeVersion": 1.3 }, { "id": "4938b22e-f187-4ca0-b9f1-60835e823799", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 360, 300 ], "parameters": { "color": 7, "width": 562, "height": 156, "content": "πŸ› οΈ Tools Used:\n1. Execute SQL Query: Used to execute any query generated by the agent.\n2. Get DB Schema and Tables List: It returns the list of all the tables with its schema name.\n3. Get Table Definition: It returns table details like column names, foreign keys and more of a particular table in a schema." }, "typeVersion": 1 }, { "id": "39780c78-4fbc-403e-a220-aa6a4b06df8c", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -100, 300 ], "parameters": { "color": 7, "width": 162, "height": 99, "content": "πŸ‘† You can exchange this with any other chat model of your choice." }, "typeVersion": 1 }, { "id": "28a5692c-5003-46cb-9a09-b7867734f446", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 100, 300 ], "parameters": { "color": 7, "width": 162, "height": 159, "content": "πŸ‘† You can change how many number of messages to keep using `Context Window Length` option. It's 5 by default." }, "typeVersion": 1 }, { "id": "c18ced71-6330-4ba0-9c52-1bb5852b3039", "name": "Execute SQL Query", "type": "n8n-nodes-base.postgresTool", "position": [ 380, 140 ], "parameters": { "query": "{{ $fromAI(\"sql_query\", \"SQL Query\") }}", "options": {}, "operation": "executeQuery", "descriptionType": "manual", "toolDescription": "Get all the data from Postgres, make sure you append the tables with correct schema. Every table is associated with some schema in the database." }, "credentials": { "postgres": { "id": "nGI61D0TEEZz18rr", "name": "Your Postgresql Database Credentials" } }, "typeVersion": 2.5 }, { "id": "557623c6-e499-48a6-a066-744f64f8b6f3", "name": "Get DB Schema and Tables List", "type": "n8n-nodes-base.postgresTool", "position": [ 580, 140 ], "parameters": { "query": "SELECT \n table_schema,\n table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE'\n AND table_schema NOT IN ('pg_catalog', 'information_schema')\nORDER BY table_schema, table_name;", "options": {}, "operation": "executeQuery", "descriptionType": "manual", "toolDescription": "Get list of all tables with their schema in the database" }, "credentials": { "postgres": { "id": "nGI61D0TEEZz18rr", "name": "Your Postgresql Database Credentials" } }, "typeVersion": 2.5 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "10c7c74e-b383-4ac7-8cb2-c9a15a2818fe", "connections": { "Chat History": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Execute SQL Query": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Get Table Definition": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Get DB Schema and Tables List": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"eOUewYsEzJmQixI6\",\n \"meta\": {\n \"instanceId\": \"77c4feba8f41570ef06dc76ece9a6ded0f0d44f7f1477a64c2d71a8508c11faa\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Chat with Postgresql Database\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"6501a54f-a68c-452d-b353-d7e871ca3780\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -300,\n -80\n ],\n \"webhookId\": \"cf1de04f-3e38-426c-89f0-3bdb110a5dcf\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"cd32221b-2a36-408d-b57e-8115fcd810c9\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 0,\n -80\n ],\n \"parameters\": {\n \"agent\": \"openAiFunctionsAgent\",\n \"options\": {\n \"systemMessage\": \"You are DB assistant. You need to run queries in DB aligned with user requests.\\n\\nRun custom SQL query to aggregate data and response to user. Make sure every table has schema prefix to it in sql query which you can get from `Get DB Schema and Tables List` tool.\\n\\nFetch all data to analyse it for response if needed.\\n\\n## Tools\\n\\n- Execute SQL query - Executes any sql query generated by AI\\n- Get DB Schema and Tables List - Lists all the tables in database with its schema name\\n- Get Table Definition - Gets the table definition from db using table name and schema name\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"8accbeeb-7eaf-4e9e-aabc-de8ab3a0459b\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -60,\n 160\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"48uG61Ilo8jndw3r\",\n \"name\": \"Your OpenAI Account Credentials\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"11f2013f-a080-4c9e-8773-c90492e2c628\",\n \"name\": \"Get Table Definition\",\n \"type\": \"n8n-nodes-base.postgresTool\",\n \"position\": [\n 780,\n 140\n ],\n \"parameters\": {\n \"query\": \"select\\n c.column_name,\\n c.data_type,\\n c.is_nullable,\\n c.column_default,\\n tc.constraint_type,\\n ccu.table_name AS referenced_table,\\n ccu.column_name AS referenced_column\\nfrom\\n information_schema.columns c\\nLEFT join\\n information_schema.key_column_usage kcu\\n ON c.table_name = kcu.table_name\\n AND c.column_name = kcu.column_name\\nLEFT join\\n information_schema.table_constraints tc\\n ON kcu.constraint_name = tc.constraint_name\\n AND tc.constraint_type = 'FOREIGN KEY'\\nLEFT join\\n information_schema.constraint_column_usage ccu\\n ON tc.constraint_name = ccu.constraint_name\\nwhere\\n c.table_name = '{{ $fromAI(\\\"table_name\\\") }}'\\n AND c.table_schema = '{{ $fromAI(\\\"schema_name\\\") }}'\\norder by\\n c.ordinal_position\",\n \"options\": {},\n \"operation\": \"executeQuery\",\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Get table definition to find all columns and types\"\n },\n \"credentials\": {\n \"postgres\": {\n \"id\": \"nGI61D0TEEZz18rr\",\n \"name\": \"Your Postgresql Database Credentials\"\n }\n },\n \"typeVersion\": 2.5\n },\n {\n \"id\": \"760bc9bc-0057-4088-b3f0-3ee37b3519df\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -300,\n -240\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 560,\n \"height\": 120,\n \"content\": \"### πŸ‘¨β€πŸŽ€ Setup\\n1. Add your **postgresql** and **OpenAI** credentials.\\n2. Click **Chat** button and start asking questions to your database.\\n3. Activate the workflow and you can make the chat publicly available.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0df33341-c859-4a54-b6d9-a99670e8d76d\",\n \"name\": \"Chat History\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 120,\n 160\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"4938b22e-f187-4ca0-b9f1-60835e823799\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 360,\n 300\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 562,\n \"height\": 156,\n \"content\": \"πŸ› οΈ Tools Used:\\n1. Execute SQL Query: Used to execute any query generated by the agent.\\n2. Get DB Schema and Tables List: It returns the list of all the tables with its schema name.\\n3. Get Table Definition: It returns table details like column names, foreign keys and more of a particular table in a schema.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"39780c78-4fbc-403e-a220-aa6a4b06df8c\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -100,\n 300\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 162,\n \"height\": 99,\n \"content\": \"πŸ‘† You can exchange this with any other chat model of your choice.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"28a5692c-5003-46cb-9a09-b7867734f446\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 100,\n 300\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 162,\n \"height\": 159,\n \"content\": \"πŸ‘† You can change how many number of messages to keep using `Context Window Length` option. It's 5 by default.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c18ced71-6330-4ba0-9c52-1bb5852b3039\",\n \"name\": \"Execute SQL Query\",\n \"type\": \"n8n-nodes-base.postgresTool\",\n \"position\": [\n 380,\n 140\n ],\n \"parameters\": {\n \"query\": \"{{ $fromAI(\\\"sql_query\\\", \\\"SQL Query\\\") }}\",\n \"options\": {},\n \"operation\": \"executeQuery\",\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Get all the data from Postgres, make sure you append the tables with correct schema. Every table is associated with some schema in the database.\"\n },\n \"credentials\": {\n \"postgres\": {\n \"id\": \"nGI61D0TEEZz18rr\",\n \"name\": \"Your Postgresql Database Credentials\"\n }\n },\n \"typeVersion\": 2.5\n },\n {\n \"id\": \"557623c6-e499-48a6-a066-744f64f8b6f3\",\n \"name\": \"Get DB Schema and Tables List\",\n \"type\": \"n8n-nodes-base.postgresTool\",\n \"position\": [\n 580,\n 140\n ],\n \"parameters\": {\n \"query\": \"SELECT \\n table_schema,\\n table_name\\nFROM information_schema.tables\\nWHERE table_type = 'BASE TABLE'\\n AND table_schema NOT IN ('pg_catalog', 'information_schema')\\nORDER BY table_schema, table_name;\",\n \"options\": {},\n \"operation\": \"executeQuery\",\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Get list of all tables with their schema in the database\"\n },\n \"credentials\": {\n \"postgres\": {\n \"id\": \"nGI61D0TEEZz18rr\",\n \"name\": \"Your Postgresql Database Credentials\"\n }\n },\n \"typeVersion\": 2.5\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"10c7c74e-b383-4ac7-8cb2-c9a15a2818fe\",\n \"connections\": {\n \"Chat History\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute SQL Query\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Table Definition\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get DB Schema and Tables List\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
1
0
1
false
combined_workflows.json
{ "input": "To create a chatbot that allows users to interact with a PostgreSQL database using natural language.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6656, "processed_size": 6656, "processed_timestamp": "2025-04-09T03:08:36.294972", "timestamp": "2025-04-09T02:34:24.762535", "token_count": 3299, "tokens": 697, "workflow_chunk_info": { "is_truncated": false, "original_size": 6656, "processed_size": 6656, "workflow_hash": "89d3a942c529b44fbe0a91050c63fbe7" }, "workflow_hash": "89d3a942c529b44fbe0a91050c63fbe7" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow aims to extract, process, and store files from a Supabase storage, enabling an AI agent to chat with the files. It involves fetching files, downloading them, extracting content, splitting text, generating embeddings, and storing them in a vector database. Analyze this workflow: ```json { "meta": { "instanceId": "6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd" }, "nodes": [ { "id": "f577f6bd-b1a4-48ec-9329-7bccc3fc1463", "name": "Get All files", "type": "n8n-nodes-base.httpRequest", "position": [ 400, -100 ], "parameters": { "url": "=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/list/private", "method": "POST", "options": {}, "jsonBody": "={\n \"prefix\": \"\",\n \"limit\": 100,\n \"offset\": 0,\n \"sortBy\": {\n \"column\": \"name\",\n \"order\": \"asc\"\n }\n}", "sendBody": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "nodeCredentialType": "supabaseApi" }, "credentials": { "supabaseApi": { "id": "t8AQJzvZvrOMDLec", "name": "Supabase account My Airtable Gen" } }, "typeVersion": 4.2 }, { "id": "10693bc8-560d-4cf6-8bd0-2fe3f4d863d1", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 1780, 100 ], "parameters": { "options": { "metadata": { "metadataValues": [ { "name": "=file_id", "value": "={{ $json.id }}" } ] } }, "jsonData": "={{ $('Merge').item.json.data ?? $('Merge').item.json.text }}", "jsonMode": "expressionData" }, "typeVersion": 1 }, { "id": "49428060-e707-4269-8344-77b301f56f7c", "name": "Recursive Character Text Splitter", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 1780, 280 ], "parameters": { "options": {}, "chunkSize": 500, "chunkOverlap": 200 }, "typeVersion": 1 }, { "id": "08742063-e235-4874-a128-b352786b19ce", "name": "Extract Document PDF", "type": "n8n-nodes-base.extractFromFile", "position": [ 1240, 0 ], "parameters": { "options": {}, "operation": "pdf" }, "typeVersion": 1, "alwaysOutputData": false }, { "id": "21f19360-d7ce-4106-ae5a-aa0f15b7c4aa", "name": "Embeddings OpenAI", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 1600, 80 ], "parameters": { "model": "text-embedding-3-small", "options": {} }, "credentials": { "openAiApi": { "id": "fLfRtaXbR0EVD0pl", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "4147409f-8686-418f-b979-04f8c8e7fe42", "name": "Create File record2", "type": "n8n-nodes-base.supabase", "position": [ 1540, -100 ], "parameters": { "tableId": "files", "fieldsUi": { "fieldValues": [ { "fieldId": "name", "fieldValue": "={{ $('Loop Over Items').item.json.name }}" }, { "fieldId": "storage_id", "fieldValue": "={{ $('Loop Over Items').item.json.id }}" } ] } }, "credentials": { "supabaseApi": { "id": "t8AQJzvZvrOMDLec", "name": "Supabase account My Airtable Gen" } }, "typeVersion": 1 }, { "id": "016f1afe-172b-4609-b451-8d67609214d3", "name": "If", "type": "n8n-nodes-base.if", "position": [ 720, -100 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ \n !$('Aggregate').item.json.data || \n !Array.isArray($('Aggregate').item.json.data) || \n !$('Aggregate').item.json.data.some(item => \n item.storage_id === $('Loop Over Items').item.json.id \n ) \n}}", "rightValue": "" }, { "id": "c3c0af88-9aea-4539-8948-1b69e601c27c", "operator": { "type": "string", "operation": "notEquals" }, "leftValue": "={{ $json.name }}", "rightValue": ".emptyFolderPlaceholder" } ] } }, "typeVersion": 2.2 }, { "id": "75e8a7db-8c4a-4ad8-b902-062cbc93e1eb", "name": "Get All Files", "type": "n8n-nodes-base.supabase", "position": [ 20, -100 ], "parameters": { "tableId": "files", "operation": "getAll" }, "credentials": { "supabaseApi": { "id": "t8AQJzvZvrOMDLec", "name": "Supabase account My Airtable Gen" } }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "b22a3bab-f615-4d8a-8832-ce25b1a385fe", "name": "Download", "type": "n8n-nodes-base.httpRequest", "position": [ 900, -100 ], "parameters": { "url": "=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/private/{{ $json.name }}", "options": {}, "authentication": "predefinedCredentialType", "nodeCredentialType": "supabaseApi" }, "credentials": { "supabaseApi": { "id": "t8AQJzvZvrOMDLec", "name": "Supabase account My Airtable Gen" } }, "typeVersion": 4.2 }, { "id": "50d1fede-4bd0-4cd4-b74a-7d689fe211cc", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ 560, -100 ], "parameters": { "options": {}, "batchSize": "=1" }, "typeVersion": 3 }, { "id": "f9c23b5e-0b40-4886-b54f-59fb46132d3f", "name": "When clicking β€˜Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ -160, -100 ], "parameters": {}, "typeVersion": 1 }, { "id": "0a0ec290-2c3d-40ba-8d03-6abf75202e73", "name": "Aggregate", "type": "n8n-nodes-base.aggregate", "position": [ 220, -100 ], "parameters": { "options": {}, "aggregate": "aggregateAllItemData" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "32b3e2e1-2d25-4dd1-93e8-3f693beb7b6f", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 800, -1020 ], "webhookId": "3c40d311-7996-4ed4-b2fa-c73bea5f4cf5", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "79073b5c-a4ad-45a6-bbfa-e900a05bfde3", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 940, -820 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "zJhr5piyEwVnWtaI", "name": "OpenAi club" } }, "typeVersion": 1 }, { "id": "f8663483-76d5-4fc8-ad07-7eec815ff7a6", "name": "Embeddings OpenAI2", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 1020, -540 ], "parameters": { "model": "text-embedding-3-small", "options": {} }, "credentials": { "openAiApi": { "id": "SphXAX7rlwRLkiox", "name": "Test club key" } }, "typeVersion": 1 }, { "id": "a1458799-d379-46de-93e6-a5ba0c665163", "name": "OpenAI Chat Model2", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 1300, -680 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "SphXAX7rlwRLkiox", "name": "Test club key" } }, "typeVersion": 1 }, { "id": "d6eeda2f-c984-406d-a625-726840308413", "name": "Vector Store Tool1", "type": "@n8n/n8n-nodes-langchain.toolVectorStore", "position": [ 1100, -820 ], "parameters": { "name": "knowledge_base", "topK": 8, "description": "Retrieve data about user request" }, "typeVersion": 1 }, { "id": "e1d9a348-7d44-4ad1-adbd-2c9a31e06876", "name": "Switch", "type": "n8n-nodes-base.switch", "position": [ 1060, -100 ], "parameters": { "rules": { "values": [ { "outputKey": "txt", "conditions": { "options": { "version": 1, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{$binary.data?.fileExtension == undefined }}", "rightValue": "txt" } ] }, "renameOutput": true }, { "outputKey": "pdf", "conditions": { "options": { "version": 1, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "bf04cbec-dd86-4607-988f-4c96b6fd4b58", "operator": { "type":
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd\"\n },\n \"nodes\": [\n {\n \"id\": \"f577f6bd-b1a4-48ec-9329-7bccc3fc1463\",\n \"name\": \"Get All files\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 400,\n -100\n ],\n \"parameters\": {\n \"url\": \"=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/list/private\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"prefix\\\": \\\"\\\",\\n \\\"limit\\\": 100,\\n \\\"offset\\\": 0,\\n \\\"sortBy\\\": {\\n \\\"column\\\": \\\"name\\\",\\n \\\"order\\\": \\\"asc\\\"\\n }\\n}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"supabaseApi\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"10693bc8-560d-4cf6-8bd0-2fe3f4d863d1\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 1780,\n 100\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"=file_id\",\n \"value\": \"={{ $json.id }}\"\n }\n ]\n }\n },\n \"jsonData\": \"={{ $('Merge').item.json.data ?? $('Merge').item.json.text }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"49428060-e707-4269-8344-77b301f56f7c\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 1780,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 500,\n \"chunkOverlap\": 200\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"08742063-e235-4874-a128-b352786b19ce\",\n \"name\": \"Extract Document PDF\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n 1240,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": false\n },\n {\n \"id\": \"21f19360-d7ce-4106-ae5a-aa0f15b7c4aa\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1600,\n 80\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"fLfRtaXbR0EVD0pl\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4147409f-8686-418f-b979-04f8c8e7fe42\",\n \"name\": \"Create File record2\",\n \"type\": \"n8n-nodes-base.supabase\",\n \"position\": [\n 1540,\n -100\n ],\n \"parameters\": {\n \"tableId\": \"files\",\n \"fieldsUi\": {\n \"fieldValues\": [\n {\n \"fieldId\": \"name\",\n \"fieldValue\": \"={{ $('Loop Over Items').item.json.name }}\"\n },\n {\n \"fieldId\": \"storage_id\",\n \"fieldValue\": \"={{ $('Loop Over Items').item.json.id }}\"\n }\n ]\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"016f1afe-172b-4609-b451-8d67609214d3\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 720,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ \\n !$('Aggregate').item.json.data || \\n !Array.isArray($('Aggregate').item.json.data) || \\n !$('Aggregate').item.json.data.some(item => \\n item.storage_id === $('Loop Over Items').item.json.id \\n ) \\n}}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"c3c0af88-9aea-4539-8948-1b69e601c27c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.name }}\",\n \"rightValue\": \".emptyFolderPlaceholder\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"75e8a7db-8c4a-4ad8-b902-062cbc93e1eb\",\n \"name\": \"Get All Files\",\n \"type\": \"n8n-nodes-base.supabase\",\n \"position\": [\n 20,\n -100\n ],\n \"parameters\": {\n \"tableId\": \"files\",\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"b22a3bab-f615-4d8a-8832-ce25b1a385fe\",\n \"name\": \"Download\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 900,\n -100\n ],\n \"parameters\": {\n \"url\": \"=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/private/{{ $json.name }}\",\n \"options\": {},\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"supabaseApi\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"50d1fede-4bd0-4cd4-b74a-7d689fe211cc\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 560,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": \"=1\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f9c23b5e-0b40-4886-b54f-59fb46132d3f\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -160,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a0ec290-2c3d-40ba-8d03-6abf75202e73\",\n \"name\": \"Aggregate\",\n \"type\": \"n8n-nodes-base.aggregate\",\n \"position\": [\n 220,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"aggregate\": \"aggregateAllItemData\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"32b3e2e1-2d25-4dd1-93e8-3f693beb7b6f\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 800,\n -1020\n ],\n \"webhookId\": \"3c40d311-7996-4ed4-b2fa-c73bea5f4cf5\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"79073b5c-a4ad-45a6-bbfa-e900a05bfde3\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 940,\n -820\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"zJhr5piyEwVnWtaI\",\n \"name\": \"OpenAi club\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f8663483-76d5-4fc8-ad07-7eec815ff7a6\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1020,\n -540\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"SphXAX7rlwRLkiox\",\n \"name\": \"Test club key\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a1458799-d379-46de-93e6-a5ba0c665163\",\n \"name\": \"OpenAI Chat Model2\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1300,\n -680\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"SphXAX7rlwRLkiox\",\n \"name\": \"Test club key\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d6eeda2f-c984-406d-a625-726840308413\",\n \"name\": \"Vector Store Tool1\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 1100,\n -820\n ],\n \"parameters\": {\n \"name\": \"knowledge_base\",\n \"topK\": 8,\n \"description\": \"Retrieve data about user request\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e1d9a348-7d44-4ad1-adbd-2c9a31e06876\",\n \"name\": \"Switch\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 1060,\n -100\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"txt\",\n \"conditions\": {\n \"options\": {\n \"version\": 1,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{$binary.data?.fileExtension == undefined }}\",\n \"rightValue\": \"txt\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"pdf\",\n \"conditions\": {\n \"options\": {\n \"version\": 1,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"bf04cbec-dd86-4607-988f-4c96b6fd4b58\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{$binary.data.fileExtension }}\",\n \"rightValue\": \"pdf\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.1\n },\n {\n \"id\": \"d38afb92-87ae-4e2a-a712-ec24b1efd105\",\n \"name\": \"Insert into Supabase Vectorstore\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreSupabase\",\n \"position\": [\n 1700,\n -100\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {\n \"queryName\": \"match_documents\"\n },\n \"tableName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"documents\",\n \"cachedResultName\": \"documents\"\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a903b2e-cab0-4798-b820-ec08d6a71ddd\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1380,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 3\n },\n {\n \"id\": \"3afd552e-4995-493e-9cd5-ef496dfe359f\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1020,\n -1020\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"d9688acc-311b-42fd-afa8-2c0e493be34b\",\n \"name\": \"Supabase Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreSupabase\",\n \"position\": [\n 1020,\n -660\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"file_id\",\n \"value\": \"300b0128-0955-4058-b0d3-a9aefe728432\"\n }\n ]\n }\n },\n \"tableName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"documents\",\n \"cachedResultName\": \"documents\"\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"66df007c-0418-4551-950e-32e7d79840bd\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n -220\n ],\n \"parameters\": {\n \"height\": 89.3775420487804,\n \"content\": \"### Replace Storage name, database ID and credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b164b520-20dd-44a4-aa3b-647391786b20\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -20,\n -220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8688c219-5af4-4e54-9fd1-91851829445b\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1540,\n -220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"45c6ece4-f849-4496-8149-31385f5e36a4\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n -220\n ],\n \"parameters\": {\n \"height\": 89.3775420487804,\n \"content\": \"### Replace Storage name, database ID and credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2ca07cb0-b5f4-4761-b954-faf2131872d9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1500,\n 220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d682dae-6f88-42f0-a717-affffd37d882\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1140,\n -520\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"796b5dca-d60e-43a9-afe8-194244643557\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -520,\n -940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 330.5152611046425,\n \"height\": 239.5888196628349,\n \"content\": \"### ... or watch set up video [10 min]\\n[![Youtube Thumbnail](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773273/Youtube%20Thumbs/Chat%20With%20FIles.png)](https://www.youtube.com/watch?v=glWUkdZe_3w)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eba121de-a3f7-4ba5-8396-f7d64e648322\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -820,\n -1460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 636.2128494576581,\n \"height\": 497.1532689930921,\n \"content\": \"![5min Logo](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773200/Skool%20Assets/ejm3hqnvhgwpnu2fv92s.png)\\n## AI Agent To Chat With Files In Supabase Storage\\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\\n\\nManually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.\\n\\nThe workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:\\n- Fetching and comparing files to avoid duplicate processing.\\n- Handling file downloads and extracting content based on the file type.\\n- Converting documents into vectorized data for contextual information retrieval.\\n- Storing and querying vectorized data from a Supabase vector store.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"df054036-d6b9-4f53-86cb-85ad96f07d0e\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -820,\n -940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 280.2462120317618,\n \"height\": 545.9087885077763,\n \"content\": \"### Set up steps\\n\\n1. **Fetch File List from Supabase**:\\n - Use Supabase to retrieve the stored file list from a specified bucket.\\n - Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.\\n\\n2. **Compare and Filter Files**:\\n - Aggregate the files retrieved from storage and compare them to the existing list in the Supabase `files` table.\\n - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.\\n\\n3. **Handle File Downloads**:\\n - Download new files using detailed storage configurations for public/private access.\\n - Adjust the storage settings and GET requests to match your Supabase setup.\\n\\n4. **File Type Processing**:\\n - Use a Switch node to target specific file types (e.g., PDFs or text files).\\n - Employ relevant tools to process the content:\\n - For PDFs, extract embedded content.\\n - For text files, directly process the text data.\\n\\n5. **Content Chunking**:\\n - Break large text data into smaller chunks using the Text Splitter node.\\n - Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.\\n\\n6. **Vector Embedding Creation**:\\n - Generate vectorized embeddings for the processed content using OpenAI's embedding tools.\\n - Ensure metadata, such as file ID, is included for easy data retrieval.\\n\\n7. **Store Vectorized Data**:\\n - Save the vectorized information into a dedicated Supabase vector store.\\n - Use the default schema and table provided by Supabase for seamless setup.\\n\\n8. **AI Chatbot Integration**:\\n - Add a chatbot node to handle user input and retrieve relevant document chunks.\\n - Use metadata like file ID for targeted queries, especially when multiple documents are involved.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"450a1e49-4be9-451a-9d05-2860e29c3695\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 540,\n -1160\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 951.7421645394404,\n \"height\": 809.7437181509877,\n \"content\": \"## Scenario 2 - AI agent\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c3814c5d-8881-4598-897e-268019bee1bc\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n -280\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 2304.723519246249,\n \"height\": 739.2522526116408,\n \"content\": \"## Scenario 1 - Flow for adding new files from Supabase storage\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Download\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Create File record2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Switch\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Extract Document PDF\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download\": {\n \"main\": [\n [\n {\n \"node\": \"Switch\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Aggregate\": {\n \"main\": [\n [\n {\n \"node\": \"Get All files\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get All Files\": {\n \"main\": [\n [\n {\n \"node\": \"Aggregate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get All files\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n null,\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Supabase Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model2\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool1\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vector Store Tool1\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create File record2\": {\n \"main\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract Document PDF\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Supabase Vector Store\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool1\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Insert into Supabase Vectorstore\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Get All Files\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
2
0
3
true
combined_workflows.json
{ "input": "This workflow aims to extract, process, and store files from a Supabase storage, enabling an AI agent to chat with the files. It involves fetching files, downloading them, extracting content, splitting text, generating embeddings, and storing them in a vector database.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 16589, "processed_size": 16589, "processed_timestamp": "2025-04-09T03:08:36.532962", "timestamp": "2025-04-09T02:34:24.802880", "token_count": 4095, "tokens": 1553, "workflow_chunk_info": { "is_truncated": false, "original_size": 16589, "processed_size": 16589, "workflow_hash": "2f1e365c1aefa53d4f27f919ae641f7c" }, "workflow_hash": "2f1e365c1aefa53d4f27f919ae641f7c" }
"singleValue": true }, "leftValue": "={{$binary.data?.fileExtension == undefined }}", "rightValue": "txt" } ] }, "renameOutput": true }, { "outputKey": "pdf", "conditions": { "options": { "version": 1, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "bf04cbec-dd86-4607-988f-4c96b6fd4b58", "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{$binary.data.fileExtension }}", "rightValue": "pdf" } ] }, "renameOutput": true } ] }, "options": {} }, "typeVersion": 3.1 }, { "id": "d38afb92-87ae-4e2a-a712-ec24b1efd105", "name": "Insert into Supabase Vectorstore", "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase", "position": [ 1700, -100 ], "parameters": { "mode": "insert", "options": { "queryName": "match_documents" }, "tableName": { "__rl": true, "mode": "list", "value": "documents", "cachedResultName": "documents" } }, "credentials": { "supabaseApi": { "id": "t8AQJzvZvrOMDLec", "name": "Supabase account My Airtable Gen" } }, "typeVersion": 1 }, { "id": "1a903b2e-cab0-4798-b820-ec08d6a71ddd", "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 1380, -100 ], "parameters": {}, "typeVersion": 3 }, { "id": "3afd552e-4995-493e-9cd5-ef496dfe359f", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 1020, -1020 ], "parameters": { "options": {} }, "typeVersion": 1.7 }, { "id": "d9688acc-311b-42fd-afa8-2c0e493be34b", "name": "Supabase Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase", "position": [ 1020, -660 ], "parameters": { "options": { "metadata": { "metadataValues": [ { "name": "file_id", "value": "300b0128-0955-4058-b0d3-a9aefe728432" } ] } }, "tableName": { "__rl": true, "mode": "list", "value": "documents", "cachedResultName": "documents" } }, "credentials": { "supabaseApi": { "id": "t8AQJzvZvrOMDLec", "name": "Supabase account My Airtable Gen" } }, "typeVersion": 1 }, { "id": "66df007c-0418-4551-950e-32e7d79840bd", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 340, -220 ], "parameters": { "height": 89.3775420487804, "content": "### Replace Storage name, database ID and credentials." }, "typeVersion": 1 }, { "id": "b164b520-20dd-44a4-aa3b-647391786b20", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -20, -220 ], "parameters": { "height": 80, "content": "### Replace credentials." }, "typeVersion": 1 }, { "id": "8688c219-5af4-4e54-9fd1-91851829445b", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1540, -220 ], "parameters": { "height": 80, "content": "### Replace credentials." }, "typeVersion": 1 }, { "id": "45c6ece4-f849-4496-8149-31385f5e36a4", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 840, -220 ], "parameters": { "height": 89.3775420487804, "content": "### Replace Storage name, database ID and credentials." }, "typeVersion": 1 }, { "id": "2ca07cb0-b5f4-4761-b954-faf2131872d9", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1500, 220 ], "parameters": { "height": 80, "content": "### Replace credentials." }, "typeVersion": 1 }, { "id": "8d682dae-6f88-42f0-a717-affffd37d882", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1140, -520 ], "parameters": { "height": 80, "content": "### Replace credentials." }, "typeVersion": 1 }, { "id": "796b5dca-d60e-43a9-afe8-194244643557", "name": "Sticky Note9", "type": "n8n-nodes-base.stickyNote", "position": [ -520, -940 ], "parameters": { "color": 7, "width": 330.5152611046425, "height": 239.5888196628349, "content": "### ... or watch set up video [10 min]\n[![Youtube Thumbnail](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773273/Youtube%20Thumbs/Chat%20With%20FIles.png)](https://www.youtube.com/watch?v=glWUkdZe_3w)\n" }, "typeVersion": 1 }, { "id": "eba121de-a3f7-4ba5-8396-f7d64e648322", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ -820, -1460 ], "parameters": { "color": 7, "width": 636.2128494576581, "height": 497.1532689930921, "content": "![5min Logo](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773200/Skool%20Assets/ejm3hqnvhgwpnu2fv92s.png)\n## AI Agent To Chat With Files In Supabase Storage\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nManually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.\n\nThe workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:\n- Fetching and comparing files to avoid duplicate processing.\n- Handling file downloads and extracting content based on the file type.\n- Converting documents into vectorized data for contextual information retrieval.\n- Storing and querying vectorized data from a Supabase vector store.\n\n" }, "typeVersion": 1 }, { "id": "df054036-d6b9-4f53-86cb-85ad96f07d0e", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -820, -940 ], "parameters": { "color": 7, "width": 280.2462120317618, "height": 545.9087885077763, "content": "### Set up steps\n\n1. **Fetch File List from Supabase**:\n - Use Supabase to retrieve the stored file list from a specified bucket.\n - Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.\n\n2. **Compare and Filter Files**:\n - Aggregate the files retrieved from storage and compare them to the existing list in the Supabase `files` table.\n - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.\n\n3. **Handle File Downloads**:\n - Download new files using detailed storage configurations for public/private access.\n - Adjust the storage settings and GET requests to match your Supabase setup.\n\n4. **File Type Processing**:\n - Use a Switch node to target specific file types (e.g., PDFs or text files).\n - Employ relevant tools to process the content:\n - For PDFs, extract embedded content.\n - For text files, directly process the text data.\n\n5. **Content Chunking**:\n - Break large text data into smaller chunks using the Text Splitter node.\n - Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.\n\n6. **Vector Embedding Creation**:\n - Generate vectorized embeddings for the processed content using OpenAI's embedding tools.\n - Ensure metadata, such as file ID, is included for easy data retrieval.\n\n7. **Store Vectorized Data**:\n - Save the vectorized information into a dedicated Supabase vector store.\n - Use the default schema and table provided by Supabase for seamless setup.\n\n8. **AI Chatbot Integration**:\n - Add a chatbot node to handle user input and retrieve relevant document chunks.\n - Use metadata like file ID for targeted queries, especially when multiple documents are involved." }, "typeVersion": 1 }, { "id": "450a1e49-4be9-451a-9d05-2860e29c3695", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ 540, -1160 ], "parameters": { "color": 5, "width": 951.7421645394404, "height": 809.7437181509877, "content": "## Scenario 2 - AI agent" }, "typeVersion": 1 }, { "id": "c3814c5d-8881-4598-897e-268019bee1bc", "name": "Sticky Note10", "type": "n8n-nodes-base.stickyNote", "position": [ -260, -280 ], "parameters": { "color": 5, "width": 2304.723519246249, "height": 739.2522526116408, "content": "## Scenario 1 - Flow for adding new files from Supabase storage" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "If": { "main": [ [ { "node": "Download", "type": "main", "index": 0 } ], [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Merge": { "main": [ [ { "node": "Create File record2", "type": "main", "index": 0 } ] ] }, "Switch": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ], [ { "node": "Extract Document PDF", "type": "main", "index": 0 } ] ] }, "Download": { "main": [ [ { "node": "Switch", "type": "main", "index": 0 } ] ] }, "Aggregate": { "main": [ [ { "node": "Get All files", "type": "main", "index": 0 } ] ] }, "Get All Files": { "main": [ [ { "node": "Aggregate", "type": "main", "index": 0 } ] ] }, "Get All files": { "
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd\"\n },\n \"nodes\": [\n {\n \"id\": \"f577f6bd-b1a4-48ec-9329-7bccc3fc1463\",\n \"name\": \"Get All files\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 400,\n -100\n ],\n \"parameters\": {\n \"url\": \"=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/list/private\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"prefix\\\": \\\"\\\",\\n \\\"limit\\\": 100,\\n \\\"offset\\\": 0,\\n \\\"sortBy\\\": {\\n \\\"column\\\": \\\"name\\\",\\n \\\"order\\\": \\\"asc\\\"\\n }\\n}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"supabaseApi\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"10693bc8-560d-4cf6-8bd0-2fe3f4d863d1\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 1780,\n 100\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"=file_id\",\n \"value\": \"={{ $json.id }}\"\n }\n ]\n }\n },\n \"jsonData\": \"={{ $('Merge').item.json.data ?? $('Merge').item.json.text }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"49428060-e707-4269-8344-77b301f56f7c\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 1780,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 500,\n \"chunkOverlap\": 200\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"08742063-e235-4874-a128-b352786b19ce\",\n \"name\": \"Extract Document PDF\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n 1240,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": false\n },\n {\n \"id\": \"21f19360-d7ce-4106-ae5a-aa0f15b7c4aa\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1600,\n 80\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"fLfRtaXbR0EVD0pl\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4147409f-8686-418f-b979-04f8c8e7fe42\",\n \"name\": \"Create File record2\",\n \"type\": \"n8n-nodes-base.supabase\",\n \"position\": [\n 1540,\n -100\n ],\n \"parameters\": {\n \"tableId\": \"files\",\n \"fieldsUi\": {\n \"fieldValues\": [\n {\n \"fieldId\": \"name\",\n \"fieldValue\": \"={{ $('Loop Over Items').item.json.name }}\"\n },\n {\n \"fieldId\": \"storage_id\",\n \"fieldValue\": \"={{ $('Loop Over Items').item.json.id }}\"\n }\n ]\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"016f1afe-172b-4609-b451-8d67609214d3\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 720,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ \\n !$('Aggregate').item.json.data || \\n !Array.isArray($('Aggregate').item.json.data) || \\n !$('Aggregate').item.json.data.some(item => \\n item.storage_id === $('Loop Over Items').item.json.id \\n ) \\n}}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"c3c0af88-9aea-4539-8948-1b69e601c27c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.name }}\",\n \"rightValue\": \".emptyFolderPlaceholder\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"75e8a7db-8c4a-4ad8-b902-062cbc93e1eb\",\n \"name\": \"Get All Files\",\n \"type\": \"n8n-nodes-base.supabase\",\n \"position\": [\n 20,\n -100\n ],\n \"parameters\": {\n \"tableId\": \"files\",\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"b22a3bab-f615-4d8a-8832-ce25b1a385fe\",\n \"name\": \"Download\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 900,\n -100\n ],\n \"parameters\": {\n \"url\": \"=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/private/{{ $json.name }}\",\n \"options\": {},\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"supabaseApi\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"50d1fede-4bd0-4cd4-b74a-7d689fe211cc\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 560,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": \"=1\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f9c23b5e-0b40-4886-b54f-59fb46132d3f\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -160,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a0ec290-2c3d-40ba-8d03-6abf75202e73\",\n \"name\": \"Aggregate\",\n \"type\": \"n8n-nodes-base.aggregate\",\n \"position\": [\n 220,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"aggregate\": \"aggregateAllItemData\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"32b3e2e1-2d25-4dd1-93e8-3f693beb7b6f\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 800,\n -1020\n ],\n \"webhookId\": \"3c40d311-7996-4ed4-b2fa-c73bea5f4cf5\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"79073b5c-a4ad-45a6-bbfa-e900a05bfde3\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 940,\n -820\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"zJhr5piyEwVnWtaI\",\n \"name\": \"OpenAi club\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f8663483-76d5-4fc8-ad07-7eec815ff7a6\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1020,\n -540\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"SphXAX7rlwRLkiox\",\n \"name\": \"Test club key\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a1458799-d379-46de-93e6-a5ba0c665163\",\n \"name\": \"OpenAI Chat Model2\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1300,\n -680\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"SphXAX7rlwRLkiox\",\n \"name\": \"Test club key\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d6eeda2f-c984-406d-a625-726840308413\",\n \"name\": \"Vector Store Tool1\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 1100,\n -820\n ],\n \"parameters\": {\n \"name\": \"knowledge_base\",\n \"topK\": 8,\n \"description\": \"Retrieve data about user request\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e1d9a348-7d44-4ad1-adbd-2c9a31e06876\",\n \"name\": \"Switch\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 1060,\n -100\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"txt\",\n \"conditions\": {\n \"options\": {\n \"version\": 1,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{$binary.data?.fileExtension == undefined }}\",\n \"rightValue\": \"txt\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"pdf\",\n \"conditions\": {\n \"options\": {\n \"version\": 1,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"bf04cbec-dd86-4607-988f-4c96b6fd4b58\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{$binary.data.fileExtension }}\",\n \"rightValue\": \"pdf\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.1\n },\n {\n \"id\": \"d38afb92-87ae-4e2a-a712-ec24b1efd105\",\n \"name\": \"Insert into Supabase Vectorstore\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreSupabase\",\n \"position\": [\n 1700,\n -100\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {\n \"queryName\": \"match_documents\"\n },\n \"tableName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"documents\",\n \"cachedResultName\": \"documents\"\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a903b2e-cab0-4798-b820-ec08d6a71ddd\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1380,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 3\n },\n {\n \"id\": \"3afd552e-4995-493e-9cd5-ef496dfe359f\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1020,\n -1020\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"d9688acc-311b-42fd-afa8-2c0e493be34b\",\n \"name\": \"Supabase Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreSupabase\",\n \"position\": [\n 1020,\n -660\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"file_id\",\n \"value\": \"300b0128-0955-4058-b0d3-a9aefe728432\"\n }\n ]\n }\n },\n \"tableName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"documents\",\n \"cachedResultName\": \"documents\"\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"66df007c-0418-4551-950e-32e7d79840bd\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n -220\n ],\n \"parameters\": {\n \"height\": 89.3775420487804,\n \"content\": \"### Replace Storage name, database ID and credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b164b520-20dd-44a4-aa3b-647391786b20\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -20,\n -220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8688c219-5af4-4e54-9fd1-91851829445b\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1540,\n -220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"45c6ece4-f849-4496-8149-31385f5e36a4\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n -220\n ],\n \"parameters\": {\n \"height\": 89.3775420487804,\n \"content\": \"### Replace Storage name, database ID and credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2ca07cb0-b5f4-4761-b954-faf2131872d9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1500,\n 220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d682dae-6f88-42f0-a717-affffd37d882\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1140,\n -520\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"796b5dca-d60e-43a9-afe8-194244643557\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -520,\n -940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 330.5152611046425,\n \"height\": 239.5888196628349,\n \"content\": \"### ... or watch set up video [10 min]\\n[![Youtube Thumbnail](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773273/Youtube%20Thumbs/Chat%20With%20FIles.png)](https://www.youtube.com/watch?v=glWUkdZe_3w)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eba121de-a3f7-4ba5-8396-f7d64e648322\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -820,\n -1460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 636.2128494576581,\n \"height\": 497.1532689930921,\n \"content\": \"![5min Logo](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773200/Skool%20Assets/ejm3hqnvhgwpnu2fv92s.png)\\n## AI Agent To Chat With Files In Supabase Storage\\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\\n\\nManually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.\\n\\nThe workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:\\n- Fetching and comparing files to avoid duplicate processing.\\n- Handling file downloads and extracting content based on the file type.\\n- Converting documents into vectorized data for contextual information retrieval.\\n- Storing and querying vectorized data from a Supabase vector store.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"df054036-d6b9-4f53-86cb-85ad96f07d0e\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -820,\n -940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 280.2462120317618,\n \"height\": 545.9087885077763,\n \"content\": \"### Set up steps\\n\\n1. **Fetch File List from Supabase**:\\n - Use Supabase to retrieve the stored file list from a specified bucket.\\n - Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.\\n\\n2. **Compare and Filter Files**:\\n - Aggregate the files retrieved from storage and compare them to the existing list in the Supabase `files` table.\\n - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.\\n\\n3. **Handle File Downloads**:\\n - Download new files using detailed storage configurations for public/private access.\\n - Adjust the storage settings and GET requests to match your Supabase setup.\\n\\n4. **File Type Processing**:\\n - Use a Switch node to target specific file types (e.g., PDFs or text files).\\n - Employ relevant tools to process the content:\\n - For PDFs, extract embedded content.\\n - For text files, directly process the text data.\\n\\n5. **Content Chunking**:\\n - Break large text data into smaller chunks using the Text Splitter node.\\n - Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.\\n\\n6. **Vector Embedding Creation**:\\n - Generate vectorized embeddings for the processed content using OpenAI's embedding tools.\\n - Ensure metadata, such as file ID, is included for easy data retrieval.\\n\\n7. **Store Vectorized Data**:\\n - Save the vectorized information into a dedicated Supabase vector store.\\n - Use the default schema and table provided by Supabase for seamless setup.\\n\\n8. **AI Chatbot Integration**:\\n - Add a chatbot node to handle user input and retrieve relevant document chunks.\\n - Use metadata like file ID for targeted queries, especially when multiple documents are involved.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"450a1e49-4be9-451a-9d05-2860e29c3695\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 540,\n -1160\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 951.7421645394404,\n \"height\": 809.7437181509877,\n \"content\": \"## Scenario 2 - AI agent\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c3814c5d-8881-4598-897e-268019bee1bc\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n -280\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 2304.723519246249,\n \"height\": 739.2522526116408,\n \"content\": \"## Scenario 1 - Flow for adding new files from Supabase storage\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Download\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Create File record2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Switch\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Extract Document PDF\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download\": {\n \"main\": [\n [\n {\n \"node\": \"Switch\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Aggregate\": {\n \"main\": [\n [\n {\n \"node\": \"Get All files\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get All Files\": {\n \"main\": [\n [\n {\n \"node\": \"Aggregate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get All files\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n null,\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Supabase Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model2\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool1\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vector Store Tool1\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create File record2\": {\n \"main\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract Document PDF\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Supabase Vector Store\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool1\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Insert into Supabase Vectorstore\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Get All Files\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
2
1
3
true
combined_workflows.json
{ "input": "This workflow aims to extract, process, and store files from a Supabase storage, enabling an AI agent to chat with the files. It involves fetching files, downloading them, extracting content, splitting text, generating embeddings, and storing them in a vector database.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 16589, "processed_size": 16589, "processed_timestamp": "2025-04-09T03:08:36.550962", "timestamp": "2025-04-09T02:34:24.802880", "token_count": 4097, "tokens": 1553, "workflow_chunk_info": { "is_truncated": false, "original_size": 16589, "processed_size": 16589, "workflow_hash": "2f1e365c1aefa53d4f27f919ae641f7c" }, "workflow_hash": "2f1e365c1aefa53d4f27f919ae641f7c" }
type": "main", "index": 0 } ] ] }, "Download": { "main": [ [ { "node": "Switch", "type": "main", "index": 0 } ] ] }, "Aggregate": { "main": [ [ { "node": "Get All files", "type": "main", "index": 0 } ] ] }, "Get All Files": { "main": [ [ { "node": "Aggregate", "type": "main", "index": 0 } ] ] }, "Get All files": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Loop Over Items": { "main": [ null, [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Embeddings OpenAI": { "ai_embedding": [ [ { "node": "Insert into Supabase Vectorstore", "type": "ai_embedding", "index": 0 } ] ] }, "Embeddings OpenAI2": { "ai_embedding": [ [ { "node": "Supabase Vector Store", "type": "ai_embedding", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "OpenAI Chat Model2": { "ai_languageModel": [ [ { "node": "Vector Store Tool1", "type": "ai_languageModel", "index": 0 } ] ] }, "Vector Store Tool1": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Create File record2": { "main": [ [ { "node": "Insert into Supabase Vectorstore", "type": "main", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Insert into Supabase Vectorstore", "type": "ai_document", "index": 0 } ] ] }, "Extract Document PDF": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "Supabase Vector Store": { "ai_vectorStore": [ [ { "node": "Vector Store Tool1", "type": "ai_vectorStore", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Insert into Supabase Vectorstore": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Recursive Character Text Splitter": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] }, "When clicking β€˜Test workflow’": { "main": [ [ { "node": "Get All Files", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd\"\n },\n \"nodes\": [\n {\n \"id\": \"f577f6bd-b1a4-48ec-9329-7bccc3fc1463\",\n \"name\": \"Get All files\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 400,\n -100\n ],\n \"parameters\": {\n \"url\": \"=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/list/private\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"prefix\\\": \\\"\\\",\\n \\\"limit\\\": 100,\\n \\\"offset\\\": 0,\\n \\\"sortBy\\\": {\\n \\\"column\\\": \\\"name\\\",\\n \\\"order\\\": \\\"asc\\\"\\n }\\n}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"supabaseApi\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"10693bc8-560d-4cf6-8bd0-2fe3f4d863d1\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 1780,\n 100\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"=file_id\",\n \"value\": \"={{ $json.id }}\"\n }\n ]\n }\n },\n \"jsonData\": \"={{ $('Merge').item.json.data ?? $('Merge').item.json.text }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"49428060-e707-4269-8344-77b301f56f7c\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 1780,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 500,\n \"chunkOverlap\": 200\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"08742063-e235-4874-a128-b352786b19ce\",\n \"name\": \"Extract Document PDF\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n 1240,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": false\n },\n {\n \"id\": \"21f19360-d7ce-4106-ae5a-aa0f15b7c4aa\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1600,\n 80\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"fLfRtaXbR0EVD0pl\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4147409f-8686-418f-b979-04f8c8e7fe42\",\n \"name\": \"Create File record2\",\n \"type\": \"n8n-nodes-base.supabase\",\n \"position\": [\n 1540,\n -100\n ],\n \"parameters\": {\n \"tableId\": \"files\",\n \"fieldsUi\": {\n \"fieldValues\": [\n {\n \"fieldId\": \"name\",\n \"fieldValue\": \"={{ $('Loop Over Items').item.json.name }}\"\n },\n {\n \"fieldId\": \"storage_id\",\n \"fieldValue\": \"={{ $('Loop Over Items').item.json.id }}\"\n }\n ]\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"016f1afe-172b-4609-b451-8d67609214d3\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 720,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ \\n !$('Aggregate').item.json.data || \\n !Array.isArray($('Aggregate').item.json.data) || \\n !$('Aggregate').item.json.data.some(item => \\n item.storage_id === $('Loop Over Items').item.json.id \\n ) \\n}}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"c3c0af88-9aea-4539-8948-1b69e601c27c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.name }}\",\n \"rightValue\": \".emptyFolderPlaceholder\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"75e8a7db-8c4a-4ad8-b902-062cbc93e1eb\",\n \"name\": \"Get All Files\",\n \"type\": \"n8n-nodes-base.supabase\",\n \"position\": [\n 20,\n -100\n ],\n \"parameters\": {\n \"tableId\": \"files\",\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"b22a3bab-f615-4d8a-8832-ce25b1a385fe\",\n \"name\": \"Download\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 900,\n -100\n ],\n \"parameters\": {\n \"url\": \"=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/private/{{ $json.name }}\",\n \"options\": {},\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"supabaseApi\"\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"50d1fede-4bd0-4cd4-b74a-7d689fe211cc\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 560,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": \"=1\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f9c23b5e-0b40-4886-b54f-59fb46132d3f\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -160,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a0ec290-2c3d-40ba-8d03-6abf75202e73\",\n \"name\": \"Aggregate\",\n \"type\": \"n8n-nodes-base.aggregate\",\n \"position\": [\n 220,\n -100\n ],\n \"parameters\": {\n \"options\": {},\n \"aggregate\": \"aggregateAllItemData\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"32b3e2e1-2d25-4dd1-93e8-3f693beb7b6f\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 800,\n -1020\n ],\n \"webhookId\": \"3c40d311-7996-4ed4-b2fa-c73bea5f4cf5\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"79073b5c-a4ad-45a6-bbfa-e900a05bfde3\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 940,\n -820\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"zJhr5piyEwVnWtaI\",\n \"name\": \"OpenAi club\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f8663483-76d5-4fc8-ad07-7eec815ff7a6\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1020,\n -540\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"SphXAX7rlwRLkiox\",\n \"name\": \"Test club key\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a1458799-d379-46de-93e6-a5ba0c665163\",\n \"name\": \"OpenAI Chat Model2\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1300,\n -680\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"SphXAX7rlwRLkiox\",\n \"name\": \"Test club key\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d6eeda2f-c984-406d-a625-726840308413\",\n \"name\": \"Vector Store Tool1\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 1100,\n -820\n ],\n \"parameters\": {\n \"name\": \"knowledge_base\",\n \"topK\": 8,\n \"description\": \"Retrieve data about user request\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e1d9a348-7d44-4ad1-adbd-2c9a31e06876\",\n \"name\": \"Switch\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 1060,\n -100\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"txt\",\n \"conditions\": {\n \"options\": {\n \"version\": 1,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{$binary.data?.fileExtension == undefined }}\",\n \"rightValue\": \"txt\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"pdf\",\n \"conditions\": {\n \"options\": {\n \"version\": 1,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"bf04cbec-dd86-4607-988f-4c96b6fd4b58\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{$binary.data.fileExtension }}\",\n \"rightValue\": \"pdf\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.1\n },\n {\n \"id\": \"d38afb92-87ae-4e2a-a712-ec24b1efd105\",\n \"name\": \"Insert into Supabase Vectorstore\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreSupabase\",\n \"position\": [\n 1700,\n -100\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {\n \"queryName\": \"match_documents\"\n },\n \"tableName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"documents\",\n \"cachedResultName\": \"documents\"\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a903b2e-cab0-4798-b820-ec08d6a71ddd\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1380,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 3\n },\n {\n \"id\": \"3afd552e-4995-493e-9cd5-ef496dfe359f\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1020,\n -1020\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"d9688acc-311b-42fd-afa8-2c0e493be34b\",\n \"name\": \"Supabase Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreSupabase\",\n \"position\": [\n 1020,\n -660\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"file_id\",\n \"value\": \"300b0128-0955-4058-b0d3-a9aefe728432\"\n }\n ]\n }\n },\n \"tableName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"documents\",\n \"cachedResultName\": \"documents\"\n }\n },\n \"credentials\": {\n \"supabaseApi\": {\n \"id\": \"t8AQJzvZvrOMDLec\",\n \"name\": \"Supabase account My Airtable Gen\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"66df007c-0418-4551-950e-32e7d79840bd\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n -220\n ],\n \"parameters\": {\n \"height\": 89.3775420487804,\n \"content\": \"### Replace Storage name, database ID and credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b164b520-20dd-44a4-aa3b-647391786b20\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -20,\n -220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8688c219-5af4-4e54-9fd1-91851829445b\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1540,\n -220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"45c6ece4-f849-4496-8149-31385f5e36a4\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n -220\n ],\n \"parameters\": {\n \"height\": 89.3775420487804,\n \"content\": \"### Replace Storage name, database ID and credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2ca07cb0-b5f4-4761-b954-faf2131872d9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1500,\n 220\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d682dae-6f88-42f0-a717-affffd37d882\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1140,\n -520\n ],\n \"parameters\": {\n \"height\": 80,\n \"content\": \"### Replace credentials.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"796b5dca-d60e-43a9-afe8-194244643557\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -520,\n -940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 330.5152611046425,\n \"height\": 239.5888196628349,\n \"content\": \"### ... or watch set up video [10 min]\\n[![Youtube Thumbnail](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773273/Youtube%20Thumbs/Chat%20With%20FIles.png)](https://www.youtube.com/watch?v=glWUkdZe_3w)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eba121de-a3f7-4ba5-8396-f7d64e648322\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -820,\n -1460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 636.2128494576581,\n \"height\": 497.1532689930921,\n \"content\": \"![5min Logo](https://res.cloudinary.com/de9jgixzm/image/upload/v1739773200/Skool%20Assets/ejm3hqnvhgwpnu2fv92s.png)\\n## AI Agent To Chat With Files In Supabase Storage\\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\\n\\nManually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.\\n\\nThe workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:\\n- Fetching and comparing files to avoid duplicate processing.\\n- Handling file downloads and extracting content based on the file type.\\n- Converting documents into vectorized data for contextual information retrieval.\\n- Storing and querying vectorized data from a Supabase vector store.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"df054036-d6b9-4f53-86cb-85ad96f07d0e\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -820,\n -940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 280.2462120317618,\n \"height\": 545.9087885077763,\n \"content\": \"### Set up steps\\n\\n1. **Fetch File List from Supabase**:\\n - Use Supabase to retrieve the stored file list from a specified bucket.\\n - Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.\\n\\n2. **Compare and Filter Files**:\\n - Aggregate the files retrieved from storage and compare them to the existing list in the Supabase `files` table.\\n - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.\\n\\n3. **Handle File Downloads**:\\n - Download new files using detailed storage configurations for public/private access.\\n - Adjust the storage settings and GET requests to match your Supabase setup.\\n\\n4. **File Type Processing**:\\n - Use a Switch node to target specific file types (e.g., PDFs or text files).\\n - Employ relevant tools to process the content:\\n - For PDFs, extract embedded content.\\n - For text files, directly process the text data.\\n\\n5. **Content Chunking**:\\n - Break large text data into smaller chunks using the Text Splitter node.\\n - Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.\\n\\n6. **Vector Embedding Creation**:\\n - Generate vectorized embeddings for the processed content using OpenAI's embedding tools.\\n - Ensure metadata, such as file ID, is included for easy data retrieval.\\n\\n7. **Store Vectorized Data**:\\n - Save the vectorized information into a dedicated Supabase vector store.\\n - Use the default schema and table provided by Supabase for seamless setup.\\n\\n8. **AI Chatbot Integration**:\\n - Add a chatbot node to handle user input and retrieve relevant document chunks.\\n - Use metadata like file ID for targeted queries, especially when multiple documents are involved.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"450a1e49-4be9-451a-9d05-2860e29c3695\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 540,\n -1160\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 951.7421645394404,\n \"height\": 809.7437181509877,\n \"content\": \"## Scenario 2 - AI agent\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c3814c5d-8881-4598-897e-268019bee1bc\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n -280\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 2304.723519246249,\n \"height\": 739.2522526116408,\n \"content\": \"## Scenario 1 - Flow for adding new files from Supabase storage\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Download\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Create File record2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Switch\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Extract Document PDF\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download\": {\n \"main\": [\n [\n {\n \"node\": \"Switch\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Aggregate\": {\n \"main\": [\n [\n {\n \"node\": \"Get All files\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get All Files\": {\n \"main\": [\n [\n {\n \"node\": \"Aggregate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get All files\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n null,\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Supabase Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model2\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool1\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vector Store Tool1\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create File record2\": {\n \"main\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert into Supabase Vectorstore\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract Document PDF\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Supabase Vector Store\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool1\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Insert into Supabase Vectorstore\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Get All Files\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
2
2
3
true
combined_workflows.json
{ "input": "This workflow aims to extract, process, and store files from a Supabase storage, enabling an AI agent to chat with the files. It involves fetching files, downloading them, extracting content, splitting text, generating embeddings, and storing them in a vector database.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 16589, "processed_size": 16589, "processed_timestamp": "2025-04-09T03:08:36.559963", "timestamp": "2025-04-09T02:34:24.802880", "token_count": 1170, "tokens": 1553, "workflow_chunk_info": { "is_truncated": false, "original_size": 16589, "processed_size": 16589, "workflow_hash": "2f1e365c1aefa53d4f27f919ae641f7c" }, "workflow_hash": "2f1e365c1aefa53d4f27f919ae641f7c" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow backs up n8n workflow data to Google Drive. Analyze this workflow: ```json { "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 320, 170 ], "parameters": {}, "typeVersion": 1 }, { "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 960, 320 ], "parameters": { "mode": "mergeByIndex" }, "typeVersion": 1 }, { "name": "Move Binary Data", "type": "n8n-nodes-base.moveBinaryData", "position": [ 1260, 320 ], "parameters": { "mode": "jsonToBinary", "options": { "useRawData": false } }, "typeVersion": 1 }, { "name": "Map", "type": "n8n-nodes-base.function", "position": [ 710, 320 ], "parameters": { "functionCode": "return items[0].json.data.map(item => {\n return {json: item}\n});" }, "typeVersion": 1 }, { "name": "Get Workflow", "type": "n8n-nodes-base.httpRequest", "notes": "Don't forget to add your credentials for your n8n instance in this Node. Use Basic Auth for this. ", "position": [ 830, 460 ], "parameters": { "url": "=http://localhost:5678/rest/workflows/{{$node[\"Map\"].data[\"id\"]}}", "options": {}, "authentication": "basicAuth" }, "credentials": { "httpBasicAuth": "n8n Creds" }, "notesInFlow": false, "typeVersion": 1 }, { "name": "Get Workflow List", "type": "n8n-nodes-base.httpRequest", "notes": "Don't forget to add your credentials for your n8n instance in this Node. Use Basic Auth for this. ", "position": [ 520, 320 ], "parameters": { "url": "http://localhost:5678/rest/workflows", "options": {}, "authentication": "basicAuth" }, "credentials": { "httpBasicAuth": "n8n Creds" }, "typeVersion": 1 }, { "name": "FunctionItem", "type": "n8n-nodes-base.functionItem", "position": [ 1110, 320 ], "parameters": { "functionCode": "item = item.data;\nreturn item;" }, "typeVersion": 1 }, { "name": "Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ 1450, 320 ], "parameters": { "name": "={{$node[\"Merge\"].data[\"name\"]}}.json", "parents": [ "Delete this text and put id for folder you want to upload into in this field. The folder ID can be found by opening the folder in your browser and copying the portion after https://drive.google.com/drive/u/0/folders/" ], "binaryData": true, "resolveData": true }, "credentials": { "googleApi": "test" }, "typeVersion": 1 }, { "name": "Run Daily at 2:30am", "type": "n8n-nodes-base.cron", "position": [ 330, 320 ], "parameters": { "triggerTimes": { "item": [ { "hour": 2, "minute": 30 } ] } }, "typeVersion": 1 } ], "connections": { "Map": { "main": [ [ { "node": "Get Workflow", "type": "main", "index": 0 }, { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Merge": { "main": [ [ { "node": "FunctionItem", "type": "main", "index": 0 } ] ] }, "FunctionItem": { "main": [ [ { "node": "Move Binary Data", "type": "main", "index": 0 } ] ] }, "Get Workflow": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "Move Binary Data": { "main": [ [ { "node": "Google Drive", "type": "main", "index": 0 } ] ] }, "Get Workflow List": { "main": [ [ { "node": "Map", "type": "main", "index": 0 } ] ] }, "Run Daily at 2:30am": { "main": [ [ { "node": "Get Workflow List", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Get Workflow List", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"On clicking 'execute'\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 320,\n 170\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 960,\n 320\n ],\n \"parameters\": {\n \"mode\": \"mergeByIndex\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Move Binary Data\",\n \"type\": \"n8n-nodes-base.moveBinaryData\",\n \"position\": [\n 1260,\n 320\n ],\n \"parameters\": {\n \"mode\": \"jsonToBinary\",\n \"options\": {\n \"useRawData\": false\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Map\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 710,\n 320\n ],\n \"parameters\": {\n \"functionCode\": \"return items[0].json.data.map(item => {\\n return {json: item}\\n});\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get Workflow\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"Don't forget to add your credentials for your n8n instance in this Node. Use Basic Auth for this. \",\n \"position\": [\n 830,\n 460\n ],\n \"parameters\": {\n \"url\": \"=http://localhost:5678/rest/workflows/{{$node[\\\"Map\\\"].data[\\\"id\\\"]}}\",\n \"options\": {},\n \"authentication\": \"basicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": \"n8n Creds\"\n },\n \"notesInFlow\": false,\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get Workflow List\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"Don't forget to add your credentials for your n8n instance in this Node. Use Basic Auth for this. \",\n \"position\": [\n 520,\n 320\n ],\n \"parameters\": {\n \"url\": \"http://localhost:5678/rest/workflows\",\n \"options\": {},\n \"authentication\": \"basicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": \"n8n Creds\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"FunctionItem\",\n \"type\": \"n8n-nodes-base.functionItem\",\n \"position\": [\n 1110,\n 320\n ],\n \"parameters\": {\n \"functionCode\": \"item = item.data;\\nreturn item;\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n 1450,\n 320\n ],\n \"parameters\": {\n \"name\": \"={{$node[\\\"Merge\\\"].data[\\\"name\\\"]}}.json\",\n \"parents\": [\n \"Delete this text and put id for folder you want to upload into in this field. The folder ID can be found by opening the folder in your browser and copying the portion after https://drive.google.com/drive/u/0/folders/\"\n ],\n \"binaryData\": true,\n \"resolveData\": true\n },\n \"credentials\": {\n \"googleApi\": \"test\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Run Daily at 2:30am\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n 330,\n 320\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"hour\": 2,\n \"minute\": 30\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Map\": {\n \"main\": [\n [\n {\n \"node\": \"Get Workflow\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"FunctionItem\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"FunctionItem\": {\n \"main\": [\n [\n {\n \"node\": \"Move Binary Data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Move Binary Data\": {\n \"main\": [\n [\n {\n \"node\": \"Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Workflow List\": {\n \"main\": [\n [\n {\n \"node\": \"Map\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Run Daily at 2:30am\": {\n \"main\": [\n [\n {\n \"node\": \"Get Workflow List\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"On clicking 'execute'\": {\n \"main\": [\n [\n {\n \"node\": \"Get Workflow List\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
3
0
1
false
combined_workflows.json
{ "input": "The workflow backs up n8n workflow data to Google Drive.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 3053, "processed_size": 3053, "processed_timestamp": "2025-04-09T03:08:36.616969", "timestamp": "2025-04-09T02:34:25.222378", "token_count": 1725, "tokens": 325, "workflow_chunk_info": { "is_truncated": false, "original_size": 3053, "processed_size": 3053, "workflow_hash": "22622da484f01b789b407668963dd845" }, "workflow_hash": "22622da484f01b789b407668963dd845" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to validate if a given photo meets the criteria for a UK passport photo using an AI vision model. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9" }, "nodes": [ { "id": "6c78b4c7-993b-410d-93e7-e11b3052e53b", "name": "When clicking β€˜Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ 0, 420 ], "parameters": {}, "typeVersion": 1 }, { "id": "c2ab6497-6d6d-483b-bd43-494ae95394c0", "name": "Structured Output Parser", "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "position": [ 1440, 600 ], "parameters": { "schemaType": "manual", "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"is_valid\": { \"type\": \"boolean\" },\n \"photo_description\": {\n \"type\": \"string\",\n \"description\": \"describe the appearance of the person(s), object(s) if any and the background in the image. Mention any colours of each if possible.\"\n },\n\t\t\"reasons\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n\t}\n}" }, "typeVersion": 1.2 }, { "id": "b23f5298-17c7-49ac-a8ca-78e006b2d294", "name": "Photo URLs", "type": "n8n-nodes-base.set", "position": [ 360, 380 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "6baa3e08-8957-454e-8ee9-d5414a0ff990", "name": "data", "type": "array", "value": "={{\n[\n{\n \"name\": \"portrait_1\",\n \"url\": \"https://drive.google.com/file/d/1zs963iFkO-3g2rKak8Hcy555h55D8gjF/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_2\",\n \"url\": \"https://drive.google.com/file/d/19FyDcs68dZauQSEf6SEulJMag51SPsFy/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_3\",\n \"url\": \"https://drive.google.com/file/d/1gbXjfNYE7Tvuw_riFmHMKoqPPu696VfW/view?usp=sharing\",\n\n},\n{\n \"name\": \"portrait_4\",\n \"url\": \"https://drive.google.com/file/d/1s19hYdxgfMkrnU25l6YIDq-myQr1tQMa/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_5\",\n \"url\": \"https://drive.google.com/file/d/193FqIXJWAKj6O2SmOj3cLBfypHBkgdI5/view?usp=sharing\"\n}\n]\n}}" } ] } }, "typeVersion": 3.4 }, { "id": "8d445f73-dff7-485b-87e2-5b64da09cbf0", "name": "Photos To List", "type": "n8n-nodes-base.splitOut", "position": [ 520, 380 ], "parameters": { "options": {}, "fieldToSplitOut": "data" }, "typeVersion": 1 }, { "id": "7fb3b829-88a7-42ec-abfd-3ddaa042c916", "name": "Download Photos", "type": "n8n-nodes-base.googleDrive", "position": [ 680, 380 ], "parameters": { "fileId": { "__rl": true, "mode": "url", "value": "={{ $json.url }}" }, "options": {}, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "yOwz41gMQclOadgu", "name": "Google Drive account" } }, "typeVersion": 3 }, { "id": "b8644f6d-691f-49bc-b0fe-33a68c59638d", "name": "Resize For AI", "type": "n8n-nodes-base.editImage", "position": [ 1060, 440 ], "parameters": { "width": 1024, "height": 1024, "options": {}, "operation": "resize", "resizeOption": "onlyIfLarger" }, "typeVersion": 1 }, { "id": "ecb266f2-0d2d-4cbe-a641-26735f0bdf18", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 280, 180 ], "parameters": { "color": 7, "width": 594, "height": 438, "content": "## 1. Import Photos To Validate\n[Read more about using Google Drive](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledrive)\n\nIn this demonstration, we'll import 5 different portraits to test our AI vision model. For convenience, we'll use Google Drive but feel free to swap this out for other sources such as other storage or by using webhooks." }, "typeVersion": 1 }, { "id": "a1034923-0905-4cdd-a6bf-21d28aa3dd71", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 900, 180 ], "parameters": { "color": 7, "width": 774, "height": 589.25, "content": "## 2. Verify Passport Photo Validity Using AI Vision Model\n[Learn more about Basic LLM Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\n\nVerifying if a photo is suitable for a passport photo is a great use-case for AI vision and to automate the process is an equally great use-case for using n8n. Here's we've pasted in the UK governments guidelines copied from gov.uk and have asked the AI to validate the incoming photos following those rules. A structured output parser is used to simplify the AI response which can be used to update a database or backend of your choosing." }, "typeVersion": 1 }, { "id": "af231ee5-adff-4d27-ba5f-8c04ddd4892d", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -140, 0 ], "parameters": { "width": 386, "height": 610.0104651162792, "content": "## Try It Out!\n\n### This workflow takes a portrait and verifies if it makes for a valid passport photo. It achieves this by using an AI vision model following the UK government guidance.\n\nOpenAI's vision model was found to perform well for understanding photographs and so is recommended for this type of workflow. However, any capable vision model should work.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!" }, "typeVersion": 1 }, { "id": "e07e1655-2683-4e21-b2b7-e0c0bfb569c0", "name": "Passport Photo Validator", "type": "@n8n/n8n-nodes-langchain.chainLlm", "position": [ 1240, 440 ], "parameters": { "text": "Assess if the image is a valid according to the passport photo criteria as set by the UK Government.", "messages": { "messageValues": [ { "message": "=You help verify passport photo validity.\n\n## Rules for digital photos\nhttps://www.gov.uk/photos-for-passports\n\n### The quality of your digital photo\nYour photo must be:\n* clear and in focus\n* in colour\n* unaltered by computer software\n* at least 600 pixels wide and 750 pixels tall\n* at least 50KB and no more than 10MB\n\n### What your digital photo must show\nThe digital photo must:\n* contain no other objects or people\n* be taken against a plain white or light-coloured background\n* be in clear contrast to the background\n* not have β€˜red eye’\n* If you’re using a photo taken on your own device, include your head, shoulders and upper body. Do not crop your photo - it will be done for you.\n\nIn your photo you must:\n* be facing forwards and looking straight at the camera\n* have a plain expression and your mouth closed\n* have your eyes open and visible\n* not have hair in front of your eyes\n* not have a head covering (unless it’s for religious or medical reasons)\n* not have anything covering your face\n* not have any shadows on your face or behind you - shadows on light background are okay\n* Do not wear glasses in your photo unless you have to do so. If you must wear glasses, they cannot be sunglasses or tinted glasses, and you must make sure your eyes are not covered by the frames or any glare, reflection or shadow.\n\n### Photos of babies and children\n* Children must be on their own in the picture. Babies must not be holding toys or using dummies.\n* Children under 6 do not have to be looking directly at the camera or have a plain expression.\n* Children under one do not have to have their eyes open. You can support their head with your hand, but your hand must not be visible in the photo.\n* Children under one should lie on a plain light-coloured sheet. Take the photo from above.\n\n" }, { "type": "HumanMessagePromptTemplate", "messageType": "imageBinary" } ] }, "promptType": "define", "hasOutputParser": true }, "typeVersion": 1.4 }, { "id": "0a36ba22-90b2-4abf-943b-c1cc8e7317d5", "name": "Google Gemini Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", "position": [ 1240, 600 ], "parameters": { "options": {}, "modelName": "models/gemini-1.5-pro-latest" }, "credentials": { "googlePalmApi": { "id": "dSxo6ns5wn658r8N", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Photo URLs": { "main": [ [ { "node": "Photos To List", "type": "main", "index": 0 } ] ] }, "Resize For AI": { "main": [ [ { "node": "Passport Photo Validator", "type": "main", "index": 0 } ] ] }, "Photos To List": { "main": [ [ { "node": "Download Photos", "type": "main", "index": 0 } ] ] }, "Download Photos": { "main": [ [ { "node": "Resize For AI", "type": "main", "index": 0 } ] ] }, "Google Gemini Chat Model": { "ai_languageModel": [ [ { "node": "Passport Photo Validator", "type": "ai_languageModel", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": "Passport Photo Validator", "type": "ai_outputParser", "index": 0 } ] ] }, "When clicking β€˜Test workflow’": { "main": [ [ { "node": "Photo URLs", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\"\n },\n \"nodes\": [\n {\n \"id\": \"6c78b4c7-993b-410d-93e7-e11b3052e53b\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 0,\n 420\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"c2ab6497-6d6d-483b-bd43-494ae95394c0\",\n \"name\": \"Structured Output Parser\",\n \"type\": \"@n8n/n8n-nodes-langchain.outputParserStructured\",\n \"position\": [\n 1440,\n 600\n ],\n \"parameters\": {\n \"schemaType\": \"manual\",\n \"inputSchema\": \"{\\n\\t\\\"type\\\": \\\"object\\\",\\n\\t\\\"properties\\\": {\\n\\t\\t\\\"is_valid\\\": { \\\"type\\\": \\\"boolean\\\" },\\n \\\"photo_description\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"describe the appearance of the person(s), object(s) if any and the background in the image. Mention any colours of each if possible.\\\"\\n },\\n\\t\\t\\\"reasons\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": { \\\"type\\\": \\\"string\\\" }\\n }\\n\\t}\\n}\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"b23f5298-17c7-49ac-a8ca-78e006b2d294\",\n \"name\": \"Photo URLs\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 360,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"6baa3e08-8957-454e-8ee9-d5414a0ff990\",\n \"name\": \"data\",\n \"type\": \"array\",\n \"value\": \"={{\\n[\\n{\\n \\\"name\\\": \\\"portrait_1\\\",\\n \\\"url\\\": \\\"https://drive.google.com/file/d/1zs963iFkO-3g2rKak8Hcy555h55D8gjF/view?usp=sharing\\\"\\n},\\n{\\n \\\"name\\\": \\\"portrait_2\\\",\\n \\\"url\\\": \\\"https://drive.google.com/file/d/19FyDcs68dZauQSEf6SEulJMag51SPsFy/view?usp=sharing\\\"\\n},\\n{\\n \\\"name\\\": \\\"portrait_3\\\",\\n \\\"url\\\": \\\"https://drive.google.com/file/d/1gbXjfNYE7Tvuw_riFmHMKoqPPu696VfW/view?usp=sharing\\\",\\n\\n},\\n{\\n \\\"name\\\": \\\"portrait_4\\\",\\n \\\"url\\\": \\\"https://drive.google.com/file/d/1s19hYdxgfMkrnU25l6YIDq-myQr1tQMa/view?usp=sharing\\\"\\n},\\n{\\n \\\"name\\\": \\\"portrait_5\\\",\\n \\\"url\\\": \\\"https://drive.google.com/file/d/193FqIXJWAKj6O2SmOj3cLBfypHBkgdI5/view?usp=sharing\\\"\\n}\\n]\\n}}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"8d445f73-dff7-485b-87e2-5b64da09cbf0\",\n \"name\": \"Photos To List\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 520,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"data\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7fb3b829-88a7-42ec-abfd-3ddaa042c916\",\n \"name\": \"Download Photos\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n 680,\n 380\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"={{ $json.url }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"yOwz41gMQclOadgu\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"b8644f6d-691f-49bc-b0fe-33a68c59638d\",\n \"name\": \"Resize For AI\",\n \"type\": \"n8n-nodes-base.editImage\",\n \"position\": [\n 1060,\n 440\n ],\n \"parameters\": {\n \"width\": 1024,\n \"height\": 1024,\n \"options\": {},\n \"operation\": \"resize\",\n \"resizeOption\": \"onlyIfLarger\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ecb266f2-0d2d-4cbe-a641-26735f0bdf18\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 280,\n 180\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 594,\n \"height\": 438,\n \"content\": \"## 1. Import Photos To Validate\\n[Read more about using Google Drive](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledrive)\\n\\nIn this demonstration, we'll import 5 different portraits to test our AI vision model. For convenience, we'll use Google Drive but feel free to swap this out for other sources such as other storage or by using webhooks.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a1034923-0905-4cdd-a6bf-21d28aa3dd71\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 900,\n 180\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 774,\n \"height\": 589.25,\n \"content\": \"## 2. Verify Passport Photo Validity Using AI Vision Model\\n[Learn more about Basic LLM Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\\n\\nVerifying if a photo is suitable for a passport photo is a great use-case for AI vision and to automate the process is an equally great use-case for using n8n. Here's we've pasted in the UK governments guidelines copied from gov.uk and have asked the AI to validate the incoming photos following those rules. A structured output parser is used to simplify the AI response which can be used to update a database or backend of your choosing.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"af231ee5-adff-4d27-ba5f-8c04ddd4892d\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -140,\n 0\n ],\n \"parameters\": {\n \"width\": 386,\n \"height\": 610.0104651162792,\n \"content\": \"## Try It Out!\\n\\n### This workflow takes a portrait and verifies if it makes for a valid passport photo. It achieves this by using an AI vision model following the UK government guidance.\\n\\nOpenAI's vision model was found to perform well for understanding photographs and so is recommended for this type of workflow. However, any capable vision model should work.\\n\\n### Need Help?\\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e07e1655-2683-4e21-b2b7-e0c0bfb569c0\",\n \"name\": \"Passport Photo Validator\",\n \"type\": \"@n8n/n8n-nodes-langchain.chainLlm\",\n \"position\": [\n 1240,\n 440\n ],\n \"parameters\": {\n \"text\": \"Assess if the image is a valid according to the passport photo criteria as set by the UK Government.\",\n \"messages\": {\n \"messageValues\": [\n {\n \"message\": \"=You help verify passport photo validity.\\n\\n## Rules for digital photos\\nhttps://www.gov.uk/photos-for-passports\\n\\n### The quality of your digital photo\\nYour photo must be:\\n* clear and in focus\\n* in colour\\n* unaltered by computer software\\n* at least 600 pixels wide and 750 pixels tall\\n* at least 50KB and no more than 10MB\\n\\n### What your digital photo must show\\nThe digital photo must:\\n* contain no other objects or people\\n* be taken against a plain white or light-coloured background\\n* be in clear contrast to the background\\n* not have β€˜red eye’\\n* If you’re using a photo taken on your own device, include your head, shoulders and upper body. Do not crop your photo - it will be done for you.\\n\\nIn your photo you must:\\n* be facing forwards and looking straight at the camera\\n* have a plain expression and your mouth closed\\n* have your eyes open and visible\\n* not have hair in front of your eyes\\n* not have a head covering (unless it’s for religious or medical reasons)\\n* not have anything covering your face\\n* not have any shadows on your face or behind you - shadows on light background are okay\\n* Do not wear glasses in your photo unless you have to do so. If you must wear glasses, they cannot be sunglasses or tinted glasses, and you must make sure your eyes are not covered by the frames or any glare, reflection or shadow.\\n\\n### Photos of babies and children\\n* Children must be on their own in the picture. Babies must not be holding toys or using dummies.\\n* Children under 6 do not have to be looking directly at the camera or have a plain expression.\\n* Children under one do not have to have their eyes open. You can support their head with your hand, but your hand must not be visible in the photo.\\n* Children under one should lie on a plain light-coloured sheet. Take the photo from above.\\n\\n\"\n },\n {\n \"type\": \"HumanMessagePromptTemplate\",\n \"messageType\": \"imageBinary\"\n }\n ]\n },\n \"promptType\": \"define\",\n \"hasOutputParser\": true\n },\n \"typeVersion\": 1.4\n },\n {\n \"id\": \"0a36ba22-90b2-4abf-943b-c1cc8e7317d5\",\n \"name\": \"Google Gemini Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatGoogleGemini\",\n \"position\": [\n 1240,\n 600\n ],\n \"parameters\": {\n \"options\": {},\n \"modelName\": \"models/gemini-1.5-pro-latest\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"dSxo6ns5wn658r8N\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Photo URLs\": {\n \"main\": [\n [\n {\n \"node\": \"Photos To List\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Resize For AI\": {\n \"main\": [\n [\n {\n \"node\": \"Passport Photo Validator\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Photos To List\": {\n \"main\": [\n [\n {\n \"node\": \"Download Photos\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download Photos\": {\n \"main\": [\n [\n {\n \"node\": \"Resize For AI\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Gemini Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Passport Photo Validator\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Structured Output Parser\": {\n \"ai_outputParser\": [\n [\n {\n \"node\": \"Passport Photo Validator\",\n \"type\": \"ai_outputParser\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Photo URLs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
4
0
1
false
combined_workflows.json
{ "input": "The workflow's goal is to validate if a given photo meets the criteria for a UK passport photo using an AI vision model.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8473, "processed_size": 8473, "processed_timestamp": "2025-04-09T03:08:36.647966", "timestamp": "2025-04-09T02:34:25.554054", "token_count": 3894, "tokens": 935, "workflow_chunk_info": { "is_truncated": false, "original_size": 8473, "processed_size": 8473, "workflow_hash": "a0d1744d89e887ad3e162ec099adf7ca" }, "workflow_hash": "a0d1744d89e887ad3e162ec099adf7ca" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow monitors website uptime, logs status changes, sends alerts via email and Slack, and updates a Google Sheet. Analyze this workflow: ```json { "meta": { "instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e" }, "nodes": [ { "id": "acb0acd0-9bb6-4491-a1ca-4aa9a7820bbc", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 1440, 420 ], "parameters": { "rule": { "interval": [ { "field": "hours", "hoursInterval": 6 } ] } }, "typeVersion": 1.2 }, { "id": "c6bb51c4-aec4-4a6d-ade2-1080bbbb6fb3", "name": "Calculate Status", "type": "n8n-nodes-base.set", "position": [ 2367, 460 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "b0cbcff5-bfcf-46a5-a386-65c4dd56c42f", "name": "date", "type": "string", "value": "={{ $json.headers.date }}" }, { "id": "8c4155e4-bcc6-41dd-9582-346a57a7b997", "name": "Property", "type": "string", "value": "={{ $json.Property }}" }, { "id": "f0320678-d352-486f-a633-9980c4fc73b2", "name": "UP_FROM_UP", "type": "boolean", "value": "={{ $json.statusCode < 400 && $json.Status === 'UP' }}" }, { "id": "61783eb6-a683-44c9-aa0c-5fc5247da9fa", "name": "DOWN_FROM_DOWN", "type": "boolean", "value": "={{ $json.statusCode >= 400 && $json.Status === 'DOWN' }}" }, { "id": "1052a69e-4456-445d-bdd9-2765b334cf64", "name": "UP_FROM_DOWN", "type": "boolean", "value": "={{ $json.statusCode < 400 && $json.Status === 'DOWN' }}" }, { "id": "9af72278-5b29-406a-b4c5-f47f3d805063", "name": "DOWN_FROM_UP", "type": "boolean", "value": "={{ $json.statusCode >= 400 && $json.Status === 'UP' }}" } ] } }, "typeVersion": 3.3 }, { "id": "50307dca-fa88-4a19-91a4-456866e529d4", "name": "Get Sites", "type": "n8n-nodes-base.googleSheets", "position": [ 1700, 420 ], "parameters": { "options": {}, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit#gid=0", "cachedResultName": "dashboard" }, "documentId": { "__rl": true, "mode": "list", "value": "1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk", "cachedResultName": "n8n uptime" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "XHvC7jIRR8A2TlUl", "name": "Google Sheets account" } }, "typeVersion": 4.3 }, { "id": "4b0cb0cc-282b-4be9-a4ca-0c4eb10d896e", "name": "Send Chat Alert", "type": "n8n-nodes-base.slack", "position": [ 3100, 340 ], "parameters": { "text": "=From: n8n uptime\nDate: {{ $('Calculate Status').item.json[\"date\"] }}\n\n{{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\"DOWN_FROM_UP\"] ? 'DOWN' : 'UP' }}", "select": "channel", "channelId": { "__rl": true, "mode": "list", "value": "C06RS1WPUQ6", "cachedResultName": "general" }, "otherOptions": {} }, "credentials": { "slackApi": { "id": "VfK3js0YdqBdQLGP", "name": "Slack account" } }, "typeVersion": 2.1 }, { "id": "ab303995-bd82-4aef-8fe1-ce808c4dbd33", "name": "Send Email Alert", "type": "n8n-nodes-base.gmail", "position": [ 2940, 340 ], "parameters": { "sendTo": "no-reply@example.com", "message": "=From: n8n uptime\nDate: {{ $('Calculate Status').item.json[\"date\"] }}\n\n{{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\"DOWN_FROM_UP\"] ? 'DOWN' : 'UP' }}", "options": { "senderName": "n8n uptime", "appendAttribution": false }, "subject": "=n8n uptime: {{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\"DOWN_FROM_UP\"] ? 'DOWN' : 'UP' }}", "emailType": "text" }, "credentials": { "gmailOAuth2": { "id": "Sf5Gfl9NiFTNXFWb", "name": "Gmail account" } }, "typeVersion": 2.1 }, { "id": "63343e68-be07-4d89-8363-140299dcf0b6", "name": "Log Uptime Event", "type": "n8n-nodes-base.googleSheets", "position": [ 2940, 520 ], "parameters": { "columns": { "value": { "date": "={{ $json.date }}", "period": "={{ new Date($json.date).format(\"yyyy-MM\") }}" }, "schema": [ { "id": "period", "type": "string", "display": true, "removed": false, "required": false, "displayName": "period", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "date", "type": "string", "display": true, "required": false, "displayName": "date", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "Property", "type": "string", "display": true, "required": false, "displayName": "Property", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "UP_FROM_UP", "type": "string", "display": true, "required": false, "displayName": "UP_FROM_UP", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "DOWN_FROM_DOWN", "type": "string", "display": true, "required": false, "displayName": "DOWN_FROM_DOWN", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "UP_FROM_DOWN", "type": "string", "display": true, "required": false, "displayName": "UP_FROM_DOWN", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "DOWN_FROM_UP", "type": "string", "display": true, "required": false, "displayName": "DOWN_FROM_UP", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [] }, "options": {}, "operation": "append", "sheetName": { "__rl": true, "mode": "name", "value": "={{ $('Calculate Status').item.json.Property }}" }, "documentId": { "__rl": true, "mode": "list", "value": "1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk", "cachedResultName": "n8n uptime" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "XHvC7jIRR8A2TlUl", "name": "Google Sheets account" } }, "typeVersion": 4.3 }, { "id": "fe97a18b-902c-4fab-bf73-69b5b9e41a11", "name": "Update Site Status", "type": "n8n-nodes-base.googleSheets", "position": [ 3100, 520 ], "parameters": { "columns": { "value": { "Status": "={{ $json[\"DOWN_FROM_UP\"] || $json[\"DOWN_FROM_DOWN\"] ? 'DOWN' : 'UP' }}", "Property": "={{ $json.Property }}" }, "schema": [ { "id": "Property", "type": "string", "display": true, "removed": false, "required": false, "displayName": "Property", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "Status", "type": "string", "display": true, "required": false, "displayName": "Status", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [ "Property" ] }, "options": {}, "operation": "appendOrUpdate", "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit#gid=0", "cachedResultName": "dashboard" }, "documentId": { "__rl": true, "mode": "list", "value": "1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk", "cachedResultName": "n8n uptime" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "XHvC7jIRR8A2TlUl", "name": "Google Sheets account" } }, "typeVersion": 4.3 }, { "id": "b37537d1-eedf-446e-a5ed-2ef7388fd7bc", "name": "Perform Site Test", "type": "n8n-nodes-base.httpRequest", "position": [ 2207, 460 ], "parameters": { "url": "={{ $json.Property }}", "options": { "response": { "response": { "neverError": true, "fullResponse": true } } }, "sendHeaders": true, "headerParameters": { "parameters": [ {} ] } }, "typeVersion": 4.2 }, { "id": "22efcca8-81a8-4128-a03f-efd394e41977", "name": "For Each Site...", "type": "n8n-nodes-base.splitInBatches", "position": [ 2007, 460 ], "parameters": { "options": {} }, "typeVersion": 3 }, { "id": "b74d0b2c-8b08-42fe-a78f
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e\"\n },\n \"nodes\": [\n {\n \"id\": \"acb0acd0-9bb6-4491-a1ca-4aa9a7820bbc\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 1440,\n 420\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"hours\",\n \"hoursInterval\": 6\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"c6bb51c4-aec4-4a6d-ade2-1080bbbb6fb3\",\n \"name\": \"Calculate Status\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2367,\n 460\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"b0cbcff5-bfcf-46a5-a386-65c4dd56c42f\",\n \"name\": \"date\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers.date }}\"\n },\n {\n \"id\": \"8c4155e4-bcc6-41dd-9582-346a57a7b997\",\n \"name\": \"Property\",\n \"type\": \"string\",\n \"value\": \"={{ $json.Property }}\"\n },\n {\n \"id\": \"f0320678-d352-486f-a633-9980c4fc73b2\",\n \"name\": \"UP_FROM_UP\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode < 400 && $json.Status === 'UP' }}\"\n },\n {\n \"id\": \"61783eb6-a683-44c9-aa0c-5fc5247da9fa\",\n \"name\": \"DOWN_FROM_DOWN\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode >= 400 && $json.Status === 'DOWN' }}\"\n },\n {\n \"id\": \"1052a69e-4456-445d-bdd9-2765b334cf64\",\n \"name\": \"UP_FROM_DOWN\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode < 400 && $json.Status === 'DOWN' }}\"\n },\n {\n \"id\": \"9af72278-5b29-406a-b4c5-f47f3d805063\",\n \"name\": \"DOWN_FROM_UP\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode >= 400 && $json.Status === 'UP' }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.3\n },\n {\n \"id\": \"50307dca-fa88-4a19-91a4-456866e529d4\",\n \"name\": \"Get Sites\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 1700,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit#gid=0\",\n \"cachedResultName\": \"dashboard\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk\",\n \"cachedResultName\": \"n8n uptime\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.3\n },\n {\n \"id\": \"4b0cb0cc-282b-4be9-a4ca-0c4eb10d896e\",\n \"name\": \"Send Chat Alert\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 3100,\n 340\n ],\n \"parameters\": {\n \"text\": \"=From: n8n uptime\\nDate: {{ $('Calculate Status').item.json[\\\"date\\\"] }}\\n\\n{{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\\\"DOWN_FROM_UP\\\"] ? 'DOWN' : 'UP' }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"C06RS1WPUQ6\",\n \"cachedResultName\": \"general\"\n },\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"VfK3js0YdqBdQLGP\",\n \"name\": \"Slack account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"ab303995-bd82-4aef-8fe1-ce808c4dbd33\",\n \"name\": \"Send Email Alert\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 2940,\n 340\n ],\n \"parameters\": {\n \"sendTo\": \"no-reply@example.com\",\n \"message\": \"=From: n8n uptime\\nDate: {{ $('Calculate Status').item.json[\\\"date\\\"] }}\\n\\n{{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\\\"DOWN_FROM_UP\\\"] ? 'DOWN' : 'UP' }}\",\n \"options\": {\n \"senderName\": \"n8n uptime\",\n \"appendAttribution\": false\n },\n \"subject\": \"=n8n uptime: {{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\\\"DOWN_FROM_UP\\\"] ? 'DOWN' : 'UP' }}\",\n \"emailType\": \"text\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"Sf5Gfl9NiFTNXFWb\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"63343e68-be07-4d89-8363-140299dcf0b6\",\n \"name\": \"Log Uptime Event\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 2940,\n 520\n ],\n \"parameters\": {\n \"columns\": {\n \"value\": {\n \"date\": \"={{ $json.date }}\",\n \"period\": \"={{ new Date($json.date).format(\\\"yyyy-MM\\\") }}\"\n },\n \"schema\": [\n {\n \"id\": \"period\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"period\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"Property\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"Property\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"UP_FROM_UP\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"UP_FROM_UP\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"DOWN_FROM_DOWN\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"DOWN_FROM_DOWN\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"UP_FROM_DOWN\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"UP_FROM_DOWN\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"DOWN_FROM_UP\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"DOWN_FROM_UP\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": []\n },\n \"options\": {},\n \"operation\": \"append\",\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"={{ $('Calculate Status').item.json.Property }}\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk\",\n \"cachedResultName\": \"n8n uptime\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.3\n },\n {\n \"id\": \"fe97a18b-902c-4fab-bf73-69b5b9e41a11\",\n \"name\": \"Update Site Status\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 3100,\n 520\n ],\n \"parameters\": {\n \"columns\": {\n \"value\": {\n \"Status\": \"={{ $json[\\\"DOWN_FROM_UP\\\"] || $json[\\\"DOWN_FROM_DOWN\\\"] ? 'DOWN' : 'UP' }}\",\n \"Property\": \"={{ $json.Property }}\"\n },\n \"schema\": [\n {\n \"id\": \"Property\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"Property\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"Status\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"Status\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"Property\"\n ]\n },\n \"options\": {},\n \"operation\": \"appendOrUpdate\",\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit#gid=0\",\n \"cachedResultName\": \"dashboard\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk\",\n \"cachedResultName\": \"n8n uptime\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.3\n },\n {\n \"id\": \"b37537d1-eedf-446e-a5ed-2ef7388fd7bc\",\n \"name\": \"Perform Site Test\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2207,\n 460\n ],\n \"parameters\": {\n \"url\": \"={{ $json.Property }}\",\n \"options\": {\n \"response\": {\n \"response\": {\n \"neverError\": true,\n \"fullResponse\": true\n }\n }\n },\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"22efcca8-81a8-4128-a03f-efd394e41977\",\n \"name\": \"For Each Site...\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 2007,\n 460\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"b74d0b2c-8b08-42fe-a78f-103d4ea3b60f\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1375.3365733151754,\n 160\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 533.3167991131336,\n \"height\": 451.46281790887826,\n \"content\": \"## 1. Setting a Schedule\\n[Read more about Scheduling Workflows](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/)\\n\\nSince we expect downtime to be a rare occurance, our monitor should only check infrequently during the day. We'll use a schedule trigger for this purpose.\\n\\nOnce the schdule activates, we'll pull a list of sites to check from our google sheet.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6c570ff2-aa08-4458-b2da-7632d516c4e3\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1940,\n 247.83581204342858\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 596.6620781418152,\n \"height\": 464.2968162619932,\n \"content\": \"## 2. Perform Site Checks\\n[Read more about using HTTP requests](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)\\n\\nn8n makes it easy to communicate with external websites by offering a powerful HTTP request node which can handle GET and POST requests as well as pagination.\\n\\nHere, we're only interested in the status code of our requests.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d1f67650-1409-43b1-b197-0e5a821d8b6f\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2580,\n 117.20168629145996\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 720.3351531809235,\n \"height\": 600.2604061412927,\n \"content\": \"## 3. Sending Alerts and Logging Results\\n[Read more about using Switch for powerful control flow](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch)\\n\\nThe switch node is powerful control flow tool that makes your workflows smart. Here, we're able to use Switch to trigger alert notifications whenever we have DOWN status or whenever we get a status change.\\n\\nWe store the event in our Sites Google Sheet and update the site's status which will be used to calculate our state on the next scheduled run.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"244291de-7ce1-48c9-9d7a-c04fc7d069ab\",\n \"name\": \"Status Router\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 2640,\n 520\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"UP_FROM_UP\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.UP_FROM_UP }}\",\n \"rightValue\": 200\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"UP_FROM_DOWN\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"f50ae8d6-4359-4163-aedb-fddf100ad676\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.UP_FROM_DOWN }}\",\n \"rightValue\": 200\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"DOWN_FROM_DOWN\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"417e93d8-08b7-468d-a3bb-f0d395b3026a\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.DOWN_FROM_DOWN }}\",\n \"rightValue\": \"\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"DOWN_FROM_UP\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"7191e7cb-f2e1-4288-aa68-21f6efefafc5\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.DOWN_FROM_UP }}\",\n \"rightValue\": \"\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"a2a683fa-1fa5-4595-856a-de4f717eadf0\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1063.07390978683,\n 160\n ],\n \"parameters\": {\n \"width\": 276.590892958905,\n \"height\": 299.942498076894,\n \"content\": \"## Try It Out!\\n### Thie workflow showcases how you can build a simple website monitoring service using Scheduled Triggers and the HTTP Requests node. \\n\\n### Need Help?\\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\\n\\nHappy Hacking!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"704ce21f-6b96-4dc5-a27f-fca4b326efd1\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1620,\n 380\n ],\n \"parameters\": {\n \"width\": 262.6069985025353,\n \"height\": 379.4991553144906,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n### 🚨Google Sheet Required!\\nYou'll need the following columns:\\n* **Property** - the website address to monitor\\n* **Status** - either one of \\\"UP\\\" or \\\"DOWN\\\"\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Get Sites\": {\n \"main\": [\n [\n {\n \"node\": \"For Each Site...\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Status Router\": {\n \"main\": [\n [\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send Email Alert\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Send Email Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send Email Alert\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Calculate Status\": {\n \"main\": [\n [\n {\n \"node\": \"Status Router\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"For Each Site...\": {\n \"main\": [\n null,\n [\n {\n \"node\": \"Perform Site Test\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Log Uptime Event\": {\n \"main\": [\n [\n {\n \"node\": \"Update Site Status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get Sites\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Email Alert\": {\n \"main\": [\n [\n {\n \"node\": \"Send Chat Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Perform Site Test\": {\n \"main\": [\n [\n {\n \"node\": \"Calculate Status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Site Status\": {\n \"main\": [\n [\n {\n \"node\": \"For Each Site...\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
5
0
2
true
combined_workflows.json
{ "input": "This workflow monitors website uptime, logs status changes, sends alerts via email and Slack, and updates a Google Sheet.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 13308, "processed_size": 13308, "processed_timestamp": "2025-04-09T03:08:36.865618", "timestamp": "2025-04-09T02:34:25.977282", "token_count": 4095, "tokens": 1213, "workflow_chunk_info": { "is_truncated": false, "original_size": 13308, "processed_size": 13308, "workflow_hash": "9d743a2e9b1cb7d349cdb07e06168a3e" }, "workflow_hash": "9d743a2e9b1cb7d349cdb07e06168a3e" }
}, "sendHeaders": true, "headerParameters": { "parameters": [ {} ] } }, "typeVersion": 4.2 }, { "id": "22efcca8-81a8-4128-a03f-efd394e41977", "name": "For Each Site...", "type": "n8n-nodes-base.splitInBatches", "position": [ 2007, 460 ], "parameters": { "options": {} }, "typeVersion": 3 }, { "id": "b74d0b2c-8b08-42fe-a78f-103d4ea3b60f", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1375.3365733151754, 160 ], "parameters": { "color": 7, "width": 533.3167991131336, "height": 451.46281790887826, "content": "## 1. Setting a Schedule\n[Read more about Scheduling Workflows](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/)\n\nSince we expect downtime to be a rare occurance, our monitor should only check infrequently during the day. We'll use a schedule trigger for this purpose.\n\nOnce the schdule activates, we'll pull a list of sites to check from our google sheet." }, "typeVersion": 1 }, { "id": "6c570ff2-aa08-4458-b2da-7632d516c4e3", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1940, 247.83581204342858 ], "parameters": { "color": 7, "width": 596.6620781418152, "height": 464.2968162619932, "content": "## 2. Perform Site Checks\n[Read more about using HTTP requests](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)\n\nn8n makes it easy to communicate with external websites by offering a powerful HTTP request node which can handle GET and POST requests as well as pagination.\n\nHere, we're only interested in the status code of our requests." }, "typeVersion": 1 }, { "id": "d1f67650-1409-43b1-b197-0e5a821d8b6f", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 2580, 117.20168629145996 ], "parameters": { "color": 7, "width": 720.3351531809235, "height": 600.2604061412927, "content": "## 3. Sending Alerts and Logging Results\n[Read more about using Switch for powerful control flow](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch)\n\nThe switch node is powerful control flow tool that makes your workflows smart. Here, we're able to use Switch to trigger alert notifications whenever we have DOWN status or whenever we get a status change.\n\nWe store the event in our Sites Google Sheet and update the site's status which will be used to calculate our state on the next scheduled run." }, "typeVersion": 1 }, { "id": "244291de-7ce1-48c9-9d7a-c04fc7d069ab", "name": "Status Router", "type": "n8n-nodes-base.switch", "position": [ 2640, 520 ], "parameters": { "rules": { "values": [ { "outputKey": "UP_FROM_UP", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.UP_FROM_UP }}", "rightValue": 200 } ] }, "renameOutput": true }, { "outputKey": "UP_FROM_DOWN", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "f50ae8d6-4359-4163-aedb-fddf100ad676", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.UP_FROM_DOWN }}", "rightValue": 200 } ] }, "renameOutput": true }, { "outputKey": "DOWN_FROM_DOWN", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "417e93d8-08b7-468d-a3bb-f0d395b3026a", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.DOWN_FROM_DOWN }}", "rightValue": "" } ] }, "renameOutput": true }, { "outputKey": "DOWN_FROM_UP", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "7191e7cb-f2e1-4288-aa68-21f6efefafc5", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.DOWN_FROM_UP }}", "rightValue": "" } ] }, "renameOutput": true } ] }, "options": {} }, "typeVersion": 3 }, { "id": "a2a683fa-1fa5-4595-856a-de4f717eadf0", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 1063.07390978683, 160 ], "parameters": { "width": 276.590892958905, "height": 299.942498076894, "content": "## Try It Out!\n### Thie workflow showcases how you can build a simple website monitoring service using Scheduled Triggers and the HTTP Requests node. \n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!" }, "typeVersion": 1 }, { "id": "704ce21f-6b96-4dc5-a27f-fca4b326efd1", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1620, 380 ], "parameters": { "width": 262.6069985025353, "height": 379.4991553144906, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨Google Sheet Required!\nYou'll need the following columns:\n* **Property** - the website address to monitor\n* **Status** - either one of \"UP\" or \"DOWN\"" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Get Sites": { "main": [ [ { "node": "For Each Site...", "type": "main", "index": 0 } ] ] }, "Status Router": { "main": [ [ { "node": "Log Uptime Event", "type": "main", "index": 0 } ], [ { "node": "Send Email Alert", "type": "main", "index": 0 }, { "node": "Log Uptime Event", "type": "main", "index": 0 } ], [ { "node": "Log Uptime Event", "type": "main", "index": 0 }, { "node": "Send Email Alert", "type": "main", "index": 0 } ], [ { "node": "Send Email Alert", "type": "main", "index": 0 }, { "node": "Log Uptime Event", "type": "main", "index": 0 } ] ] }, "Calculate Status": { "main": [ [ { "node": "Status Router", "type": "main", "index": 0 } ] ] }, "For Each Site...": { "main": [ null, [ { "node": "Perform Site Test", "type": "main", "index": 0 } ] ] }, "Log Uptime Event": { "main": [ [ { "node": "Update Site Status", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Get Sites", "type": "main", "index": 0 } ] ] }, "Send Email Alert": { "main": [ [ { "node": "Send Chat Alert", "type": "main", "index": 0 } ] ] }, "Perform Site Test": { "main": [ [ { "node": "Calculate Status", "type": "main", "index": 0 } ] ] }, "Update Site Status": { "main": [ [ { "node": "For Each Site...", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e\"\n },\n \"nodes\": [\n {\n \"id\": \"acb0acd0-9bb6-4491-a1ca-4aa9a7820bbc\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 1440,\n 420\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"hours\",\n \"hoursInterval\": 6\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"c6bb51c4-aec4-4a6d-ade2-1080bbbb6fb3\",\n \"name\": \"Calculate Status\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2367,\n 460\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"b0cbcff5-bfcf-46a5-a386-65c4dd56c42f\",\n \"name\": \"date\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers.date }}\"\n },\n {\n \"id\": \"8c4155e4-bcc6-41dd-9582-346a57a7b997\",\n \"name\": \"Property\",\n \"type\": \"string\",\n \"value\": \"={{ $json.Property }}\"\n },\n {\n \"id\": \"f0320678-d352-486f-a633-9980c4fc73b2\",\n \"name\": \"UP_FROM_UP\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode < 400 && $json.Status === 'UP' }}\"\n },\n {\n \"id\": \"61783eb6-a683-44c9-aa0c-5fc5247da9fa\",\n \"name\": \"DOWN_FROM_DOWN\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode >= 400 && $json.Status === 'DOWN' }}\"\n },\n {\n \"id\": \"1052a69e-4456-445d-bdd9-2765b334cf64\",\n \"name\": \"UP_FROM_DOWN\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode < 400 && $json.Status === 'DOWN' }}\"\n },\n {\n \"id\": \"9af72278-5b29-406a-b4c5-f47f3d805063\",\n \"name\": \"DOWN_FROM_UP\",\n \"type\": \"boolean\",\n \"value\": \"={{ $json.statusCode >= 400 && $json.Status === 'UP' }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.3\n },\n {\n \"id\": \"50307dca-fa88-4a19-91a4-456866e529d4\",\n \"name\": \"Get Sites\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 1700,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit#gid=0\",\n \"cachedResultName\": \"dashboard\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk\",\n \"cachedResultName\": \"n8n uptime\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.3\n },\n {\n \"id\": \"4b0cb0cc-282b-4be9-a4ca-0c4eb10d896e\",\n \"name\": \"Send Chat Alert\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 3100,\n 340\n ],\n \"parameters\": {\n \"text\": \"=From: n8n uptime\\nDate: {{ $('Calculate Status').item.json[\\\"date\\\"] }}\\n\\n{{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\\\"DOWN_FROM_UP\\\"] ? 'DOWN' : 'UP' }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"C06RS1WPUQ6\",\n \"cachedResultName\": \"general\"\n },\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"VfK3js0YdqBdQLGP\",\n \"name\": \"Slack account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"ab303995-bd82-4aef-8fe1-ce808c4dbd33\",\n \"name\": \"Send Email Alert\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 2940,\n 340\n ],\n \"parameters\": {\n \"sendTo\": \"no-reply@example.com\",\n \"message\": \"=From: n8n uptime\\nDate: {{ $('Calculate Status').item.json[\\\"date\\\"] }}\\n\\n{{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\\\"DOWN_FROM_UP\\\"] ? 'DOWN' : 'UP' }}\",\n \"options\": {\n \"senderName\": \"n8n uptime\",\n \"appendAttribution\": false\n },\n \"subject\": \"=n8n uptime: {{ $('Calculate Status').item.json.Property }} is {{ $('Calculate Status').item.json[\\\"DOWN_FROM_UP\\\"] ? 'DOWN' : 'UP' }}\",\n \"emailType\": \"text\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"Sf5Gfl9NiFTNXFWb\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"63343e68-be07-4d89-8363-140299dcf0b6\",\n \"name\": \"Log Uptime Event\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 2940,\n 520\n ],\n \"parameters\": {\n \"columns\": {\n \"value\": {\n \"date\": \"={{ $json.date }}\",\n \"period\": \"={{ new Date($json.date).format(\\\"yyyy-MM\\\") }}\"\n },\n \"schema\": [\n {\n \"id\": \"period\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"period\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"Property\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"Property\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"UP_FROM_UP\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"UP_FROM_UP\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"DOWN_FROM_DOWN\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"DOWN_FROM_DOWN\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"UP_FROM_DOWN\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"UP_FROM_DOWN\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"DOWN_FROM_UP\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"DOWN_FROM_UP\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": []\n },\n \"options\": {},\n \"operation\": \"append\",\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"={{ $('Calculate Status').item.json.Property }}\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk\",\n \"cachedResultName\": \"n8n uptime\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.3\n },\n {\n \"id\": \"fe97a18b-902c-4fab-bf73-69b5b9e41a11\",\n \"name\": \"Update Site Status\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 3100,\n 520\n ],\n \"parameters\": {\n \"columns\": {\n \"value\": {\n \"Status\": \"={{ $json[\\\"DOWN_FROM_UP\\\"] || $json[\\\"DOWN_FROM_DOWN\\\"] ? 'DOWN' : 'UP' }}\",\n \"Property\": \"={{ $json.Property }}\"\n },\n \"schema\": [\n {\n \"id\": \"Property\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"Property\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"Status\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"Status\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"Property\"\n ]\n },\n \"options\": {},\n \"operation\": \"appendOrUpdate\",\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit#gid=0\",\n \"cachedResultName\": \"dashboard\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1t2RT3lxyxXj3X1y6klWvyhEJEazpkT3Hpi2ttEJRVT4/edit?usp=drivesdk\",\n \"cachedResultName\": \"n8n uptime\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.3\n },\n {\n \"id\": \"b37537d1-eedf-446e-a5ed-2ef7388fd7bc\",\n \"name\": \"Perform Site Test\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2207,\n 460\n ],\n \"parameters\": {\n \"url\": \"={{ $json.Property }}\",\n \"options\": {\n \"response\": {\n \"response\": {\n \"neverError\": true,\n \"fullResponse\": true\n }\n }\n },\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"22efcca8-81a8-4128-a03f-efd394e41977\",\n \"name\": \"For Each Site...\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 2007,\n 460\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"b74d0b2c-8b08-42fe-a78f-103d4ea3b60f\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1375.3365733151754,\n 160\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 533.3167991131336,\n \"height\": 451.46281790887826,\n \"content\": \"## 1. Setting a Schedule\\n[Read more about Scheduling Workflows](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/)\\n\\nSince we expect downtime to be a rare occurance, our monitor should only check infrequently during the day. We'll use a schedule trigger for this purpose.\\n\\nOnce the schdule activates, we'll pull a list of sites to check from our google sheet.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6c570ff2-aa08-4458-b2da-7632d516c4e3\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1940,\n 247.83581204342858\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 596.6620781418152,\n \"height\": 464.2968162619932,\n \"content\": \"## 2. Perform Site Checks\\n[Read more about using HTTP requests](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)\\n\\nn8n makes it easy to communicate with external websites by offering a powerful HTTP request node which can handle GET and POST requests as well as pagination.\\n\\nHere, we're only interested in the status code of our requests.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d1f67650-1409-43b1-b197-0e5a821d8b6f\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2580,\n 117.20168629145996\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 720.3351531809235,\n \"height\": 600.2604061412927,\n \"content\": \"## 3. Sending Alerts and Logging Results\\n[Read more about using Switch for powerful control flow](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch)\\n\\nThe switch node is powerful control flow tool that makes your workflows smart. Here, we're able to use Switch to trigger alert notifications whenever we have DOWN status or whenever we get a status change.\\n\\nWe store the event in our Sites Google Sheet and update the site's status which will be used to calculate our state on the next scheduled run.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"244291de-7ce1-48c9-9d7a-c04fc7d069ab\",\n \"name\": \"Status Router\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 2640,\n 520\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"UP_FROM_UP\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.UP_FROM_UP }}\",\n \"rightValue\": 200\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"UP_FROM_DOWN\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"f50ae8d6-4359-4163-aedb-fddf100ad676\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.UP_FROM_DOWN }}\",\n \"rightValue\": 200\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"DOWN_FROM_DOWN\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"417e93d8-08b7-468d-a3bb-f0d395b3026a\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.DOWN_FROM_DOWN }}\",\n \"rightValue\": \"\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"DOWN_FROM_UP\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"7191e7cb-f2e1-4288-aa68-21f6efefafc5\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.DOWN_FROM_UP }}\",\n \"rightValue\": \"\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"a2a683fa-1fa5-4595-856a-de4f717eadf0\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1063.07390978683,\n 160\n ],\n \"parameters\": {\n \"width\": 276.590892958905,\n \"height\": 299.942498076894,\n \"content\": \"## Try It Out!\\n### Thie workflow showcases how you can build a simple website monitoring service using Scheduled Triggers and the HTTP Requests node. \\n\\n### Need Help?\\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\\n\\nHappy Hacking!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"704ce21f-6b96-4dc5-a27f-fca4b326efd1\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1620,\n 380\n ],\n \"parameters\": {\n \"width\": 262.6069985025353,\n \"height\": 379.4991553144906,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n### 🚨Google Sheet Required!\\nYou'll need the following columns:\\n* **Property** - the website address to monitor\\n* **Status** - either one of \\\"UP\\\" or \\\"DOWN\\\"\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Get Sites\": {\n \"main\": [\n [\n {\n \"node\": \"For Each Site...\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Status Router\": {\n \"main\": [\n [\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send Email Alert\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Send Email Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send Email Alert\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Log Uptime Event\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Calculate Status\": {\n \"main\": [\n [\n {\n \"node\": \"Status Router\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"For Each Site...\": {\n \"main\": [\n null,\n [\n {\n \"node\": \"Perform Site Test\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Log Uptime Event\": {\n \"main\": [\n [\n {\n \"node\": \"Update Site Status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get Sites\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Email Alert\": {\n \"main\": [\n [\n {\n \"node\": \"Send Chat Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Perform Site Test\": {\n \"main\": [\n [\n {\n \"node\": \"Calculate Status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Site Status\": {\n \"main\": [\n [\n {\n \"node\": \"For Each Site...\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
5
1
2
true
combined_workflows.json
{ "input": "This workflow monitors website uptime, logs status changes, sends alerts via email and Slack, and updates a Google Sheet.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 13308, "processed_size": 13308, "processed_timestamp": "2025-04-09T03:08:36.891631", "timestamp": "2025-04-09T02:34:25.977282", "token_count": 3346, "tokens": 1213, "workflow_chunk_info": { "is_truncated": false, "original_size": 13308, "processed_size": 13308, "workflow_hash": "9d743a2e9b1cb7d349cdb07e06168a3e" }, "workflow_hash": "9d743a2e9b1cb7d349cdb07e06168a3e" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow aims to create a Slack bot that answers IT-related questions by using OpenAI to process user messages, storing conversation history, and retrieving information from a knowledge base. Analyze this workflow: ```json { "meta": { "instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7" }, "nodes": [ { "id": "96ef3bfe-a493-4377-b090-6b2d02d87480", "name": "Verify Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1420, 800 ], "parameters": { "options": { "responseCode": 200, "responseHeaders": { "entries": [ { "name": "Content-type", "value": "application/json" } ] } }, "respondWith": "json", "responseBody": "={\"challenge\":\"{{ $json.body.challenge }}\"}" }, "typeVersion": 1 }, { "id": "38db6da6-13bf-47a1-b5cb-f06403b309ac", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 2120, 1220 ], "parameters": { "model": "gpt-4o", "options": {} }, "credentials": { "openAiApi": { "id": "QpFZ2EiM3WGl6Zr3", "name": "Marketing OpenAI" } }, "typeVersion": 1 }, { "id": "139b606d-29ae-480d-bde7-458ef45dba01", "name": "No Operation, do nothing", "type": "n8n-nodes-base.noOp", "position": [ 1840, 700 ], "parameters": {}, "typeVersion": 1 }, { "id": "64acd4c6-cd53-46e5-a29e-40884044b186", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 2800, 1220 ], "parameters": { "sessionKey": "={{ $('Receive DMs').item.json[\"body\"][\"event\"][\"channel\"] }}", "sessionIdType": "customKey", "contextWindowLength": 10 }, "typeVersion": 1.2 }, { "id": "e605864f-198e-4358-8333-50ed962d4e50", "name": "Check if Bot", "type": "n8n-nodes-base.if", "position": [ 1640, 800 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "89ed1b2a-5e42-4196-989d-f7f81df04b6d", "operator": { "type": "string", "operation": "notExists", "singleValue": true }, "leftValue": "={{ $json.body.event.user }}", "rightValue": "" } ] } }, "typeVersion": 2 }, { "id": "8479c41e-b251-4f32-8daa-421969c4c8b3", "name": "Send Initial Message", "type": "n8n-nodes-base.slack", "position": [ 2140, 820 ], "parameters": { "text": "On it! Let me check Confluence to see if there are any relevant links to answer your question. ", "select": "channel", "channelId": { "__rl": true, "mode": "id", "value": "={{ $('Receive DMs').item.json[\"body\"][\"event\"][\"channel\"] }}" }, "otherOptions": { "botProfile": { "imageValues": { "icon_url": "https://avatars.slack-edge.com/2024-08-30/7671440019297_d6ce97ff3ab5a3abf9c1_72.jpg", "profilePhotoType": "image" } }, "includeLinkToWorkflow": false } }, "credentials": { "slackApi": { "id": "OfRxDxHFIqk1q44a", "name": "helphub n8n labs auth" } }, "typeVersion": 2.1 }, { "id": "dcd325b1-1ee8-4133-9a6e-8b37bf20d056", "name": "Delete Initial Message", "type": "n8n-nodes-base.slack", "position": [ 2960, 760 ], "parameters": { "select": "channel", "channelId": { "__rl": true, "mode": "id", "value": "={{ $('Receive DMs').item.json[\"body\"][\"event\"][\"channel\"] }}" }, "operation": "delete", "timestamp": "={{ $('Send Initial Message').item.json[\"message_timestamp\"] }}" }, "credentials": { "slackApi": { "id": "OfRxDxHFIqk1q44a", "name": "helphub n8n labs auth" } }, "typeVersion": 2.1 }, { "id": "8d3ac15c-b0bc-459c-9523-685b7f498efb", "name": "Send Message", "type": "n8n-nodes-base.slack", "position": [ 3160, 760 ], "parameters": { "text": "={{ $('AI Agent').item.json.output.replace(/\\[(.+?)\\]\\((.+?)\\)/g, '<$2|$1>').replace(/\\*\\*(.+?)\\*\\*/g, '*$1*') }}", "select": "channel", "channelId": { "__rl": true, "mode": "id", "value": "={{ $('Receive DMs').item.json[\"body\"][\"event\"][\"channel\"] }}" }, "otherOptions": { "botProfile": { "imageValues": { "icon_url": "https://avatars.slack-edge.com/2024-08-30/7671440019297_d6ce97ff3ab5a3abf9c1_72.jpg", "profilePhotoType": "image" } }, "includeLinkToWorkflow": false } }, "credentials": { "slackApi": { "id": "OfRxDxHFIqk1q44a", "name": "helphub n8n labs auth" } }, "typeVersion": 2.1 }, { "id": "02afa6b3-c528-4925-8b92-7b708b10e7ca", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1160, 460 ], "parameters": { "color": 7, "width": 414.5626477541374, "height": 516.5011820330969, "content": "![Imgur](https://i.imgur.com/iKyMV0N.png)\n## Webhook Trigger\nThe first node receives all messages from Slack API via Subscription Events API. You can find more information about setting up the subscription events API by [clicking here](https://api.slack.com/apis/connections/events-api). The second node responds to the periodic security challenges that Slack sends to ensure the N8n webhook is still active. " }, "typeVersion": 1 }, { "id": "a8caa088-80dd-44a8-8c61-7a03a37de386", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1600, 460 ], "parameters": { "color": 7, "width": 403.49881796690335, "height": 517.6832151300242, "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n## Check for Bot Responses\nIf the message received is from a Bot instead of a real user, it will ignore the message." }, "typeVersion": 1 }, { "id": "17b51014-4f9d-4650-963b-8d8d944869ea", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 2900, 460 ], "parameters": { "color": 7, "width": 430.54373522458616, "height": 451.3947990543734, "content": "![Slack](https://i.imgur.com/iKyMV0N.png)\n## Delete Receipt and Send Response \nOnce the AI response is generated in response to the slack message, n8n delete's it's original *Message Received* message to avoid cluttering up the user's DMs, and then sends the final Slack message back to the user. " }, "typeVersion": 1 }, { "id": "494a9ada-18e9-48a6-86a9-5e72cc797ddf", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 2394.7517730496443, 460 ], "parameters": { "color": 7, "width": 488.1796690307332, "height": 723.5460992907797, "content": "![OpenAI](https://i.imgur.com/o89G0If.png)\n## Parse Response with AI Model \nThis workflow currently uses OpenAI to power it's responses, but you can open the AI Agent node below and set your own AI LLM using the n8n options offered. " }, "typeVersion": 1 }, { "id": "31bc923f-c981-45fd-827d-cede2ec3f3c3", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 2020, 460 ], "parameters": { "color": 7, "width": 356.5484633569741, "height": 516.5011820330968, "content": "![Slack](https://i.imgur.com/iKyMV0N.png)\n## Response Received\nOnce N8n sees that the messaged received is from a user, it will respond right away to acknowledge a message was received. You can edit the message by opening the node below. " }, "typeVersion": 1 }, { "id": "e81d6b07-9ac0-4848-ab7f-57a588103ce5", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 2980, 1200 ], "parameters": { "color": 7, "width": 951.1571908442271, "height": 467.66775526888296, "content": "![n8n](https://i.imgur.com/FWJX4km.png)\n## Build n8n workflow to query Knowledge Base\nBuilding your own tools for an AI Agent to use is simple and straightforward, but requires that you build a second workflow and then connect it to this one by inputting the workflow ID from the workflow URL in the *Custom n8n KB Tool* sub node. \n\nThis gives you the freedom to work with any tool, whether n8n has support for it or not. In this sample build, we have connected the AI agent to Confluence, which does not have a native built in n8n node. For this we use the HTTP request node and pointed it to Confluence's search api. It then returns a response that the AI agent uses to generate a final slack message response to the user. " }, "typeVersion": 1 }, { "id": "890aeb96-1721-4cb4-a609-5409b30d5f6c", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 2320, 1200 ], "parameters": { "color": 7, "width": 644.582152697438, "height": 318.6662788502134, "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n\n## Remembers the last 5 messages that a user sent
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7\"\n },\n \"nodes\": [\n {\n \"id\": \"96ef3bfe-a493-4377-b090-6b2d02d87480\",\n \"name\": \"Verify Webhook\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1420,\n 800\n ],\n \"parameters\": {\n \"options\": {\n \"responseCode\": 200,\n \"responseHeaders\": {\n \"entries\": [\n {\n \"name\": \"Content-type\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"respondWith\": \"json\",\n \"responseBody\": \"={\\\"challenge\\\":\\\"{{ $json.body.challenge }}\\\"}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"38db6da6-13bf-47a1-b5cb-f06403b309ac\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 2120,\n 1220\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"139b606d-29ae-480d-bde7-458ef45dba01\",\n \"name\": \"No Operation, do nothing\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1840,\n 700\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"64acd4c6-cd53-46e5-a29e-40884044b186\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 2800,\n 1220\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\",\n \"sessionIdType\": \"customKey\",\n \"contextWindowLength\": 10\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"e605864f-198e-4358-8333-50ed962d4e50\",\n \"name\": \"Check if Bot\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1640,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"89ed1b2a-5e42-4196-989d-f7f81df04b6d\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notExists\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.body.event.user }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"8479c41e-b251-4f32-8daa-421969c4c8b3\",\n \"name\": \"Send Initial Message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 2140,\n 820\n ],\n \"parameters\": {\n \"text\": \"On it! Let me check Confluence to see if there are any relevant links to answer your question. \",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\"\n },\n \"otherOptions\": {\n \"botProfile\": {\n \"imageValues\": {\n \"icon_url\": \"https://avatars.slack-edge.com/2024-08-30/7671440019297_d6ce97ff3ab5a3abf9c1_72.jpg\",\n \"profilePhotoType\": \"image\"\n }\n },\n \"includeLinkToWorkflow\": false\n }\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"OfRxDxHFIqk1q44a\",\n \"name\": \"helphub n8n labs auth\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"dcd325b1-1ee8-4133-9a6e-8b37bf20d056\",\n \"name\": \"Delete Initial Message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 2960,\n 760\n ],\n \"parameters\": {\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\"\n },\n \"operation\": \"delete\",\n \"timestamp\": \"={{ $('Send Initial Message').item.json[\\\"message_timestamp\\\"] }}\"\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"OfRxDxHFIqk1q44a\",\n \"name\": \"helphub n8n labs auth\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"8d3ac15c-b0bc-459c-9523-685b7f498efb\",\n \"name\": \"Send Message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 3160,\n 760\n ],\n \"parameters\": {\n \"text\": \"={{ $('AI Agent').item.json.output.replace(/\\\\[(.+?)\\\\]\\\\((.+?)\\\\)/g, '<$2|$1>').replace(/\\\\*\\\\*(.+?)\\\\*\\\\*/g, '*$1*') }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\"\n },\n \"otherOptions\": {\n \"botProfile\": {\n \"imageValues\": {\n \"icon_url\": \"https://avatars.slack-edge.com/2024-08-30/7671440019297_d6ce97ff3ab5a3abf9c1_72.jpg\",\n \"profilePhotoType\": \"image\"\n }\n },\n \"includeLinkToWorkflow\": false\n }\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"OfRxDxHFIqk1q44a\",\n \"name\": \"helphub n8n labs auth\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"02afa6b3-c528-4925-8b92-7b708b10e7ca\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 414.5626477541374,\n \"height\": 516.5011820330969,\n \"content\": \"![Imgur](https://i.imgur.com/iKyMV0N.png)\\n## Webhook Trigger\\nThe first node receives all messages from Slack API via Subscription Events API. You can find more information about setting up the subscription events API by [clicking here](https://api.slack.com/apis/connections/events-api). The second node responds to the periodic security challenges that Slack sends to ensure the N8n webhook is still active. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a8caa088-80dd-44a8-8c61-7a03a37de386\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1600,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 403.49881796690335,\n \"height\": 517.6832151300242,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n## Check for Bot Responses\\nIf the message received is from a Bot instead of a real user, it will ignore the message.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"17b51014-4f9d-4650-963b-8d8d944869ea\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2900,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 430.54373522458616,\n \"height\": 451.3947990543734,\n \"content\": \"![Slack](https://i.imgur.com/iKyMV0N.png)\\n## Delete Receipt and Send Response \\nOnce the AI response is generated in response to the slack message, n8n delete's it's original *Message Received* message to avoid cluttering up the user's DMs, and then sends the final Slack message back to the user. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"494a9ada-18e9-48a6-86a9-5e72cc797ddf\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2394.7517730496443,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 488.1796690307332,\n \"height\": 723.5460992907797,\n \"content\": \"![OpenAI](https://i.imgur.com/o89G0If.png)\\n## Parse Response with AI Model \\nThis workflow currently uses OpenAI to power it's responses, but you can open the AI Agent node below and set your own AI LLM using the n8n options offered. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"31bc923f-c981-45fd-827d-cede2ec3f3c3\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2020,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 356.5484633569741,\n \"height\": 516.5011820330968,\n \"content\": \"![Slack](https://i.imgur.com/iKyMV0N.png)\\n## Response Received\\nOnce N8n sees that the messaged received is from a user, it will respond right away to acknowledge a message was received. You can edit the message by opening the node below. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e81d6b07-9ac0-4848-ab7f-57a588103ce5\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2980,\n 1200\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 951.1571908442271,\n \"height\": 467.66775526888296,\n \"content\": \"![n8n](https://i.imgur.com/FWJX4km.png)\\n## Build n8n workflow to query Knowledge Base\\nBuilding your own tools for an AI Agent to use is simple and straightforward, but requires that you build a second workflow and then connect it to this one by inputting the workflow ID from the workflow URL in the *Custom n8n KB Tool* sub node. \\n\\nThis gives you the freedom to work with any tool, whether n8n has support for it or not. In this sample build, we have connected the AI agent to Confluence, which does not have a native built in n8n node. For this we use the HTTP request node and pointed it to Confluence's search api. It then returns a response that the AI agent uses to generate a final slack message response to the user. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"890aeb96-1721-4cb4-a609-5409b30d5f6c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2320,\n 1200\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 644.582152697438,\n \"height\": 318.6662788502134,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n\\n## Remembers the last 5 messages that a user sent\\nBecause we are passing the channel ID of the user to the memory module, n8n is storing the last 5 slack messages sent to it per slack channel. This means that it will remember all your users conversations separately from one another and not get confused by different requests from different users. You can increase the memory storage by using a different storage medium and increase the number of prompts and responses it should remember. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1fa61c12-70d1-4d7e-8564-a2a574804243\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1660,\n 1200\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 644.582152697438,\n \"height\": 318.6662788502134,\n \"content\": \"![OpenAI](https://i.imgur.com/o89G0If.png)\\n\\n## Change the AI Agents LLM\\nTo change the model used, simply delete the ChatGPT model and replace with a different supported model by hitting the plus sign under model in the AI Agent.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fecd81da-4723-4886-8d6f-9729623028a9\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 460\n ],\n \"parameters\": {\n \"width\": 675.1724774900403,\n \"height\": 994.2389415638766,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n# Streamline IT Inquiries with n8n & AI!\\n\\n## Introducing the IT Ops AI SlackBot Workflow---a sophisticated solution designed to automate and optimize the management of IT-related inquiries via Slack.\\n\\nWhen an employee messages the IT department slack app, the workflow kicks off with the \\\"Receive DMs\\\" node, which captures incoming messages and ensures a secure and active communication line by responding to Slack's webhook challenges.\\n\\n**How It Works:**\\n\\n- Verify Webhook: Responds to slacks challenge and respond requests to ensure is still active.\\n- Check if bot: Checks whether the message sender is a bot to prevent unnecessary processing.\\n- Send Initial Message: Sends a quick confirmation, like \\\"On it!\\\", to let the user know their query is being handled.\\n- AI-Driven Responses: Employs the \\\"AI Agent\\\" node with OpenAI to craft relevant replies based on the conversation history maintained by the \\\"Window Buffer Memory\\\" node.\\n- Knowledge Integration tool: Uses a custom Knowledge Base tool to fetch pertinent information from confluence, enhancing the quality of responses.\\n- Cleanup and Reply: Deletes the initial acknowledgment to tidy up before sending the final detailed response back to the user.\\n\\n\\n**Get Started:**\\n- Ensure your [Slack](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.slack) and [OpenAI](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=@n8n/n8n-nodes-langchain.lmChatOpenAi) integrations are properly set up.\\n- Customize the workflow to align with your IT department's protocols.\\n\\n\\n**Need Help?**\\n- Join the discussion on our Forum or check out resources on Discord!\\n\\n\\nDeploy this workflow to improve response times and enhance the efficiency of your IT support services.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"16b79887-8218-4056-8add-39ebee6166bd\",\n \"name\": \"Receive DMs\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 1200,\n 800\n ],\n \"webhookId\": \"44c26a10-d54a-46ce-a522-5d83e8a854be\",\n \"parameters\": {\n \"path\": \"44c26a10-d54a-46ce-a522-5d83e8a854be\",\n \"options\": {},\n \"httpMethod\": \"POST\",\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"201b5399-6fff-48ca-81f0-a5cfc02c46d5\",\n \"name\": \"Call Confluence Workflow Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 3380,\n 1280\n ],\n \"parameters\": {\n \"name\": \"confluence_kb_search\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"Pxzc65WaCPn2yB5I\",\n \"cachedResultName\": \"KB Tool - Confluence KB\"\n },\n \"description\": \"Call this tool to search n8n-labs confluence knowledge base. The input should be the user prompt reduced into 1 to 3 keywords to use for a KB search. These words should be words that are most likely to be contained in the text of a KB article that is helpful based on the user prompt. The words should be the only response and they should just be separated by a space.\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"41026e03-5844-4e57-86bf-fc7e586265a4\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 2500,\n 820\n ],\n \"parameters\": {\n \"text\": \"={{ $('Receive DMs').item.json.body.event.text }}\",\n \"options\": {\n \"humanMessage\": \"TOOLS\\n------\\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\\n\\n{tools}\\n\\nIf no response is given for a given tool or the response is an error, then do not reference the tool results and instead ask for more context. \\n\\nThe tools currently search Notion and returns back a list of results. Please try to respond using the most relevant result URL to guide the user to the right answer. \\n\\nIf you are not sure, let the user know you were unable to find a notion page for them to help, but give them the top results that are relevant to their request.\\n\\nPlease summarize the results and return all the URLs exactly as you get them from the tool. Please format all links you send in this format: <url|name of url> \\nAdditionally, here are other formatting layouts to use: \\n_italic_ will produce italicized text\\n*bold* will produce bold text\\n~strike~ will produce strikethrough text\\n\\n{format_instructions}\\n\\nUSER'S INPUT\\n--------------------\\nHere is the user's input (remember to respond with a slack flavored (see above for more details) code snippet of a json blob with a single action, and NOTHING else):\\n\\n{{input}}\\n\",\n \"maxIterations\": 2,\n \"systemMessage\": \"You are Knowledge Ninja, a specialized IT support tool developed to streamline interactions between employees and the IT department and the company knowledge base. \\n\\nDesigned with efficiency in mind, Knowledge Ninja is equipped to handle a variety of IT-related queries, from sales competition analysis to troubleshooting to more complex technical guidance.\\n\\nAs a dynamic knowledge tool, Knowledge Ninja utilizes a comprehensive internal knowledge base that can be tailored to your organization's specific IT infrastructure and policies. \\n\\nThis allows it to deliver precise and contextually relevant information swiftly, enhancing the support process.\\n\\nKnowledge Ninja is continuously updated to reflect the latest IT standards and practices, ensuring that the guidance it provides is both accurate and up-to-date. \\n\\nIts capabilities include understanding detailed queries, providing step-by-step troubleshooting instructions, and clarifying IT policies.\\n\\nPlease format all links you send in this format: <url|name of url> \\nAdditionally, here are other formatting layouts to use: \\n_italic_ will produce italicized text\\n*bold* will produce bold text\\n~strike~ will produce strikethrough text\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.5\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Delete Initial Message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Receive DMs\": {\n \"main\": [\n [\n {\n \"node\": \"Verify Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Bot\": {\n \"main\": [\n [\n {\n \"node\": \"No Operation, do nothing\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send Initial Message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Verify Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Bot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Initial Message\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Delete Initial Message\": {\n \"main\": [\n [\n {\n \"node\": \"Send Message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Call Confluence Workflow Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
6
0
2
true
combined_workflows.json
{ "input": "This workflow aims to create a Slack bot that answers IT-related questions by using OpenAI to process user messages, storing conversation history, and retrieving information from a knowledge base.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 15742, "processed_size": 15742, "processed_timestamp": "2025-04-09T03:08:36.996613", "timestamp": "2025-04-09T02:34:26.372126", "token_count": 4095, "tokens": 1756, "workflow_chunk_info": { "is_truncated": false, "original_size": 15742, "processed_size": 15742, "workflow_hash": "d35fb19575cdc073760f48e696d42019" }, "workflow_hash": "d35fb19575cdc073760f48e696d42019" }
{ "id": "890aeb96-1721-4cb4-a609-5409b30d5f6c", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 2320, 1200 ], "parameters": { "color": 7, "width": 644.582152697438, "height": 318.6662788502134, "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n\n## Remembers the last 5 messages that a user sent\nBecause we are passing the channel ID of the user to the memory module, n8n is storing the last 5 slack messages sent to it per slack channel. This means that it will remember all your users conversations separately from one another and not get confused by different requests from different users. You can increase the memory storage by using a different storage medium and increase the number of prompts and responses it should remember. " }, "typeVersion": 1 }, { "id": "1fa61c12-70d1-4d7e-8564-a2a574804243", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 1660, 1200 ], "parameters": { "color": 7, "width": 644.582152697438, "height": 318.6662788502134, "content": "![OpenAI](https://i.imgur.com/o89G0If.png)\n\n## Change the AI Agents LLM\nTo change the model used, simply delete the ChatGPT model and replace with a different supported model by hitting the plus sign under model in the AI Agent." }, "typeVersion": 1 }, { "id": "fecd81da-4723-4886-8d6f-9729623028a9", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ 460, 460 ], "parameters": { "width": 675.1724774900403, "height": 994.2389415638766, "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n# Streamline IT Inquiries with n8n & AI!\n\n## Introducing the IT Ops AI SlackBot Workflow---a sophisticated solution designed to automate and optimize the management of IT-related inquiries via Slack.\n\nWhen an employee messages the IT department slack app, the workflow kicks off with the \"Receive DMs\" node, which captures incoming messages and ensures a secure and active communication line by responding to Slack's webhook challenges.\n\n**How It Works:**\n\n- Verify Webhook: Responds to slacks challenge and respond requests to ensure is still active.\n- Check if bot: Checks whether the message sender is a bot to prevent unnecessary processing.\n- Send Initial Message: Sends a quick confirmation, like \"On it!\", to let the user know their query is being handled.\n- AI-Driven Responses: Employs the \"AI Agent\" node with OpenAI to craft relevant replies based on the conversation history maintained by the \"Window Buffer Memory\" node.\n- Knowledge Integration tool: Uses a custom Knowledge Base tool to fetch pertinent information from confluence, enhancing the quality of responses.\n- Cleanup and Reply: Deletes the initial acknowledgment to tidy up before sending the final detailed response back to the user.\n\n\n**Get Started:**\n- Ensure your [Slack](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.slack) and [OpenAI](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=@n8n/n8n-nodes-langchain.lmChatOpenAi) integrations are properly set up.\n- Customize the workflow to align with your IT department's protocols.\n\n\n**Need Help?**\n- Join the discussion on our Forum or check out resources on Discord!\n\n\nDeploy this workflow to improve response times and enhance the efficiency of your IT support services." }, "typeVersion": 1 }, { "id": "16b79887-8218-4056-8add-39ebee6166bd", "name": "Receive DMs", "type": "n8n-nodes-base.webhook", "position": [ 1200, 800 ], "webhookId": "44c26a10-d54a-46ce-a522-5d83e8a854be", "parameters": { "path": "44c26a10-d54a-46ce-a522-5d83e8a854be", "options": {}, "httpMethod": "POST", "responseMode": "responseNode" }, "typeVersion": 2 }, { "id": "201b5399-6fff-48ca-81f0-a5cfc02c46d5", "name": "Call Confluence Workflow Tool", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 3380, 1280 ], "parameters": { "name": "confluence_kb_search", "workflowId": { "__rl": true, "mode": "list", "value": "Pxzc65WaCPn2yB5I", "cachedResultName": "KB Tool - Confluence KB" }, "description": "Call this tool to search n8n-labs confluence knowledge base. The input should be the user prompt reduced into 1 to 3 keywords to use for a KB search. These words should be words that are most likely to be contained in the text of a KB article that is helpful based on the user prompt. The words should be the only response and they should just be separated by a space." }, "typeVersion": 1.2 }, { "id": "41026e03-5844-4e57-86bf-fc7e586265a4", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 2500, 820 ], "parameters": { "text": "={{ $('Receive DMs').item.json.body.event.text }}", "options": { "humanMessage": "TOOLS\n------\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\n\n{tools}\n\nIf no response is given for a given tool or the response is an error, then do not reference the tool results and instead ask for more context. \n\nThe tools currently search Notion and returns back a list of results. Please try to respond using the most relevant result URL to guide the user to the right answer. \n\nIf you are not sure, let the user know you were unable to find a notion page for them to help, but give them the top results that are relevant to their request.\n\nPlease summarize the results and return all the URLs exactly as you get them from the tool. Please format all links you send in this format: <url|name of url> \nAdditionally, here are other formatting layouts to use: \n_italic_ will produce italicized text\n*bold* will produce bold text\n~strike~ will produce strikethrough text\n\n{format_instructions}\n\nUSER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a slack flavored (see above for more details) code snippet of a json blob with a single action, and NOTHING else):\n\n{{input}}\n", "maxIterations": 2, "systemMessage": "You are Knowledge Ninja, a specialized IT support tool developed to streamline interactions between employees and the IT department and the company knowledge base. \n\nDesigned with efficiency in mind, Knowledge Ninja is equipped to handle a variety of IT-related queries, from sales competition analysis to troubleshooting to more complex technical guidance.\n\nAs a dynamic knowledge tool, Knowledge Ninja utilizes a comprehensive internal knowledge base that can be tailored to your organization's specific IT infrastructure and policies. \n\nThis allows it to deliver precise and contextually relevant information swiftly, enhancing the support process.\n\nKnowledge Ninja is continuously updated to reflect the latest IT standards and practices, ensuring that the guidance it provides is both accurate and up-to-date. \n\nIts capabilities include understanding detailed queries, providing step-by-step troubleshooting instructions, and clarifying IT policies.\n\nPlease format all links you send in this format: <url|name of url> \nAdditionally, here are other formatting layouts to use: \n_italic_ will produce italicized text\n*bold* will produce bold text\n~strike~ will produce strikethrough text" }, "promptType": "define" }, "typeVersion": 1.5 } ], "pinData": {}, "connections": { "AI Agent": { "main": [ [ { "node": "Delete Initial Message", "type": "main", "index": 0 } ] ] }, "Receive DMs": { "main": [ [ { "node": "Verify Webhook", "type": "main", "index": 0 } ] ] }, "Check if Bot": { "main": [ [ { "node": "No Operation, do nothing", "type": "main", "index": 0 } ], [ { "node": "Send Initial Message", "type": "main", "index": 0 } ] ] }, "Verify Webhook": { "main": [ [ { "node": "Check if Bot", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Send Initial Message": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Delete Initial Message": { "main": [ [ { "node": "Send Message", "type": "main", "index": 0 } ] ] }, "Call Confluence Workflow Tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7\"\n },\n \"nodes\": [\n {\n \"id\": \"96ef3bfe-a493-4377-b090-6b2d02d87480\",\n \"name\": \"Verify Webhook\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1420,\n 800\n ],\n \"parameters\": {\n \"options\": {\n \"responseCode\": 200,\n \"responseHeaders\": {\n \"entries\": [\n {\n \"name\": \"Content-type\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"respondWith\": \"json\",\n \"responseBody\": \"={\\\"challenge\\\":\\\"{{ $json.body.challenge }}\\\"}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"38db6da6-13bf-47a1-b5cb-f06403b309ac\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 2120,\n 1220\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"139b606d-29ae-480d-bde7-458ef45dba01\",\n \"name\": \"No Operation, do nothing\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1840,\n 700\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"64acd4c6-cd53-46e5-a29e-40884044b186\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 2800,\n 1220\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\",\n \"sessionIdType\": \"customKey\",\n \"contextWindowLength\": 10\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"e605864f-198e-4358-8333-50ed962d4e50\",\n \"name\": \"Check if Bot\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1640,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"89ed1b2a-5e42-4196-989d-f7f81df04b6d\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notExists\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.body.event.user }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"8479c41e-b251-4f32-8daa-421969c4c8b3\",\n \"name\": \"Send Initial Message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 2140,\n 820\n ],\n \"parameters\": {\n \"text\": \"On it! Let me check Confluence to see if there are any relevant links to answer your question. \",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\"\n },\n \"otherOptions\": {\n \"botProfile\": {\n \"imageValues\": {\n \"icon_url\": \"https://avatars.slack-edge.com/2024-08-30/7671440019297_d6ce97ff3ab5a3abf9c1_72.jpg\",\n \"profilePhotoType\": \"image\"\n }\n },\n \"includeLinkToWorkflow\": false\n }\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"OfRxDxHFIqk1q44a\",\n \"name\": \"helphub n8n labs auth\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"dcd325b1-1ee8-4133-9a6e-8b37bf20d056\",\n \"name\": \"Delete Initial Message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 2960,\n 760\n ],\n \"parameters\": {\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\"\n },\n \"operation\": \"delete\",\n \"timestamp\": \"={{ $('Send Initial Message').item.json[\\\"message_timestamp\\\"] }}\"\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"OfRxDxHFIqk1q44a\",\n \"name\": \"helphub n8n labs auth\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"8d3ac15c-b0bc-459c-9523-685b7f498efb\",\n \"name\": \"Send Message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 3160,\n 760\n ],\n \"parameters\": {\n \"text\": \"={{ $('AI Agent').item.json.output.replace(/\\\\[(.+?)\\\\]\\\\((.+?)\\\\)/g, '<$2|$1>').replace(/\\\\*\\\\*(.+?)\\\\*\\\\*/g, '*$1*') }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Receive DMs').item.json[\\\"body\\\"][\\\"event\\\"][\\\"channel\\\"] }}\"\n },\n \"otherOptions\": {\n \"botProfile\": {\n \"imageValues\": {\n \"icon_url\": \"https://avatars.slack-edge.com/2024-08-30/7671440019297_d6ce97ff3ab5a3abf9c1_72.jpg\",\n \"profilePhotoType\": \"image\"\n }\n },\n \"includeLinkToWorkflow\": false\n }\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"OfRxDxHFIqk1q44a\",\n \"name\": \"helphub n8n labs auth\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"02afa6b3-c528-4925-8b92-7b708b10e7ca\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 414.5626477541374,\n \"height\": 516.5011820330969,\n \"content\": \"![Imgur](https://i.imgur.com/iKyMV0N.png)\\n## Webhook Trigger\\nThe first node receives all messages from Slack API via Subscription Events API. You can find more information about setting up the subscription events API by [clicking here](https://api.slack.com/apis/connections/events-api). The second node responds to the periodic security challenges that Slack sends to ensure the N8n webhook is still active. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a8caa088-80dd-44a8-8c61-7a03a37de386\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1600,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 403.49881796690335,\n \"height\": 517.6832151300242,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n## Check for Bot Responses\\nIf the message received is from a Bot instead of a real user, it will ignore the message.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"17b51014-4f9d-4650-963b-8d8d944869ea\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2900,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 430.54373522458616,\n \"height\": 451.3947990543734,\n \"content\": \"![Slack](https://i.imgur.com/iKyMV0N.png)\\n## Delete Receipt and Send Response \\nOnce the AI response is generated in response to the slack message, n8n delete's it's original *Message Received* message to avoid cluttering up the user's DMs, and then sends the final Slack message back to the user. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"494a9ada-18e9-48a6-86a9-5e72cc797ddf\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2394.7517730496443,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 488.1796690307332,\n \"height\": 723.5460992907797,\n \"content\": \"![OpenAI](https://i.imgur.com/o89G0If.png)\\n## Parse Response with AI Model \\nThis workflow currently uses OpenAI to power it's responses, but you can open the AI Agent node below and set your own AI LLM using the n8n options offered. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"31bc923f-c981-45fd-827d-cede2ec3f3c3\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2020,\n 460\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 356.5484633569741,\n \"height\": 516.5011820330968,\n \"content\": \"![Slack](https://i.imgur.com/iKyMV0N.png)\\n## Response Received\\nOnce N8n sees that the messaged received is from a user, it will respond right away to acknowledge a message was received. You can edit the message by opening the node below. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e81d6b07-9ac0-4848-ab7f-57a588103ce5\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2980,\n 1200\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 951.1571908442271,\n \"height\": 467.66775526888296,\n \"content\": \"![n8n](https://i.imgur.com/FWJX4km.png)\\n## Build n8n workflow to query Knowledge Base\\nBuilding your own tools for an AI Agent to use is simple and straightforward, but requires that you build a second workflow and then connect it to this one by inputting the workflow ID from the workflow URL in the *Custom n8n KB Tool* sub node. \\n\\nThis gives you the freedom to work with any tool, whether n8n has support for it or not. In this sample build, we have connected the AI agent to Confluence, which does not have a native built in n8n node. For this we use the HTTP request node and pointed it to Confluence's search api. It then returns a response that the AI agent uses to generate a final slack message response to the user. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"890aeb96-1721-4cb4-a609-5409b30d5f6c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2320,\n 1200\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 644.582152697438,\n \"height\": 318.6662788502134,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n\\n## Remembers the last 5 messages that a user sent\\nBecause we are passing the channel ID of the user to the memory module, n8n is storing the last 5 slack messages sent to it per slack channel. This means that it will remember all your users conversations separately from one another and not get confused by different requests from different users. You can increase the memory storage by using a different storage medium and increase the number of prompts and responses it should remember. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1fa61c12-70d1-4d7e-8564-a2a574804243\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1660,\n 1200\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 644.582152697438,\n \"height\": 318.6662788502134,\n \"content\": \"![OpenAI](https://i.imgur.com/o89G0If.png)\\n\\n## Change the AI Agents LLM\\nTo change the model used, simply delete the ChatGPT model and replace with a different supported model by hitting the plus sign under model in the AI Agent.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fecd81da-4723-4886-8d6f-9729623028a9\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 460\n ],\n \"parameters\": {\n \"width\": 675.1724774900403,\n \"height\": 994.2389415638766,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n# Streamline IT Inquiries with n8n & AI!\\n\\n## Introducing the IT Ops AI SlackBot Workflow---a sophisticated solution designed to automate and optimize the management of IT-related inquiries via Slack.\\n\\nWhen an employee messages the IT department slack app, the workflow kicks off with the \\\"Receive DMs\\\" node, which captures incoming messages and ensures a secure and active communication line by responding to Slack's webhook challenges.\\n\\n**How It Works:**\\n\\n- Verify Webhook: Responds to slacks challenge and respond requests to ensure is still active.\\n- Check if bot: Checks whether the message sender is a bot to prevent unnecessary processing.\\n- Send Initial Message: Sends a quick confirmation, like \\\"On it!\\\", to let the user know their query is being handled.\\n- AI-Driven Responses: Employs the \\\"AI Agent\\\" node with OpenAI to craft relevant replies based on the conversation history maintained by the \\\"Window Buffer Memory\\\" node.\\n- Knowledge Integration tool: Uses a custom Knowledge Base tool to fetch pertinent information from confluence, enhancing the quality of responses.\\n- Cleanup and Reply: Deletes the initial acknowledgment to tidy up before sending the final detailed response back to the user.\\n\\n\\n**Get Started:**\\n- Ensure your [Slack](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.slack) and [OpenAI](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=@n8n/n8n-nodes-langchain.lmChatOpenAi) integrations are properly set up.\\n- Customize the workflow to align with your IT department's protocols.\\n\\n\\n**Need Help?**\\n- Join the discussion on our Forum or check out resources on Discord!\\n\\n\\nDeploy this workflow to improve response times and enhance the efficiency of your IT support services.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"16b79887-8218-4056-8add-39ebee6166bd\",\n \"name\": \"Receive DMs\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 1200,\n 800\n ],\n \"webhookId\": \"44c26a10-d54a-46ce-a522-5d83e8a854be\",\n \"parameters\": {\n \"path\": \"44c26a10-d54a-46ce-a522-5d83e8a854be\",\n \"options\": {},\n \"httpMethod\": \"POST\",\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"201b5399-6fff-48ca-81f0-a5cfc02c46d5\",\n \"name\": \"Call Confluence Workflow Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 3380,\n 1280\n ],\n \"parameters\": {\n \"name\": \"confluence_kb_search\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"Pxzc65WaCPn2yB5I\",\n \"cachedResultName\": \"KB Tool - Confluence KB\"\n },\n \"description\": \"Call this tool to search n8n-labs confluence knowledge base. The input should be the user prompt reduced into 1 to 3 keywords to use for a KB search. These words should be words that are most likely to be contained in the text of a KB article that is helpful based on the user prompt. The words should be the only response and they should just be separated by a space.\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"41026e03-5844-4e57-86bf-fc7e586265a4\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 2500,\n 820\n ],\n \"parameters\": {\n \"text\": \"={{ $('Receive DMs').item.json.body.event.text }}\",\n \"options\": {\n \"humanMessage\": \"TOOLS\\n------\\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\\n\\n{tools}\\n\\nIf no response is given for a given tool or the response is an error, then do not reference the tool results and instead ask for more context. \\n\\nThe tools currently search Notion and returns back a list of results. Please try to respond using the most relevant result URL to guide the user to the right answer. \\n\\nIf you are not sure, let the user know you were unable to find a notion page for them to help, but give them the top results that are relevant to their request.\\n\\nPlease summarize the results and return all the URLs exactly as you get them from the tool. Please format all links you send in this format: <url|name of url> \\nAdditionally, here are other formatting layouts to use: \\n_italic_ will produce italicized text\\n*bold* will produce bold text\\n~strike~ will produce strikethrough text\\n\\n{format_instructions}\\n\\nUSER'S INPUT\\n--------------------\\nHere is the user's input (remember to respond with a slack flavored (see above for more details) code snippet of a json blob with a single action, and NOTHING else):\\n\\n{{input}}\\n\",\n \"maxIterations\": 2,\n \"systemMessage\": \"You are Knowledge Ninja, a specialized IT support tool developed to streamline interactions between employees and the IT department and the company knowledge base. \\n\\nDesigned with efficiency in mind, Knowledge Ninja is equipped to handle a variety of IT-related queries, from sales competition analysis to troubleshooting to more complex technical guidance.\\n\\nAs a dynamic knowledge tool, Knowledge Ninja utilizes a comprehensive internal knowledge base that can be tailored to your organization's specific IT infrastructure and policies. \\n\\nThis allows it to deliver precise and contextually relevant information swiftly, enhancing the support process.\\n\\nKnowledge Ninja is continuously updated to reflect the latest IT standards and practices, ensuring that the guidance it provides is both accurate and up-to-date. \\n\\nIts capabilities include understanding detailed queries, providing step-by-step troubleshooting instructions, and clarifying IT policies.\\n\\nPlease format all links you send in this format: <url|name of url> \\nAdditionally, here are other formatting layouts to use: \\n_italic_ will produce italicized text\\n*bold* will produce bold text\\n~strike~ will produce strikethrough text\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.5\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Delete Initial Message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Receive DMs\": {\n \"main\": [\n [\n {\n \"node\": \"Verify Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Bot\": {\n \"main\": [\n [\n {\n \"node\": \"No Operation, do nothing\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send Initial Message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Verify Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Bot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Initial Message\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Delete Initial Message\": {\n \"main\": [\n [\n {\n \"node\": \"Send Message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Call Confluence Workflow Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
6
1
2
true
combined_workflows.json
{ "input": "This workflow aims to create a Slack bot that answers IT-related questions by using OpenAI to process user messages, storing conversation history, and retrieving information from a knowledge base.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 15742, "processed_size": 15742, "processed_timestamp": "2025-04-09T03:08:37.004615", "timestamp": "2025-04-09T02:34:26.372126", "token_count": 3220, "tokens": 1756, "workflow_chunk_info": { "is_truncated": false, "original_size": 15742, "processed_size": 15742, "workflow_hash": "d35fb19575cdc073760f48e696d42019" }, "workflow_hash": "d35fb19575cdc073760f48e696d42019" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To send an email notification when a workflow encounters an error. Analyze this workflow: ```json { "nodes": [ { "name": "Error Trigger", "type": "n8n-nodes-base.errorTrigger", "position": [ 450, 300 ], "parameters": {}, "typeVersion": 1 }, { "name": "Gmail", "type": "n8n-nodes-base.gmail", "position": [ 650, 300 ], "parameters": { "toList": [ "recipient@email.com" ], "message": "=Workflow: {{$json[\"workflow\"][\"name\"]}}\nError: {{$json[\"execution\"][\"error\"][\"message\"]}}\nLast node executed: {{$json[\"execution\"][\"lastNodeExecuted\"]}}\nExecution URL: {{$json[\"execution\"][\"url\"]}}\nStacktrace:\n{{$json[\"execution\"][\"error\"][\"stack\"]}}", "subject": "=n8n Workflow Failure: {{$json[\"workflow\"][\"name\"]}}", "resource": "message", "additionalFields": {} }, "credentials": { "gmailOAuth2": "TBD" }, "typeVersion": 1 } ], "connections": { "Error Trigger": { "main": [ [ { "node": "Gmail", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"Error Trigger\",\n \"type\": \"n8n-nodes-base.errorTrigger\",\n \"position\": [\n 450,\n 300\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"Gmail\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 650,\n 300\n ],\n \"parameters\": {\n \"toList\": [\n \"recipient@email.com\"\n ],\n \"message\": \"=Workflow: {{$json[\\\"workflow\\\"][\\\"name\\\"]}}\\nError: {{$json[\\\"execution\\\"][\\\"error\\\"][\\\"message\\\"]}}\\nLast node executed: {{$json[\\\"execution\\\"][\\\"lastNodeExecuted\\\"]}}\\nExecution URL: {{$json[\\\"execution\\\"][\\\"url\\\"]}}\\nStacktrace:\\n{{$json[\\\"execution\\\"][\\\"error\\\"][\\\"stack\\\"]}}\",\n \"subject\": \"=n8n Workflow Failure: {{$json[\\\"workflow\\\"][\\\"name\\\"]}}\",\n \"resource\": \"message\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"gmailOAuth2\": \"TBD\"\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Error Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Gmail\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
7
0
1
false
combined_workflows.json
{ "input": "To send an email notification when a workflow encounters an error.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 829, "processed_size": 829, "processed_timestamp": "2025-04-09T03:08:37.008617", "timestamp": "2025-04-09T02:34:27.122180", "token_count": 539, "tokens": 56, "workflow_chunk_info": { "is_truncated": false, "original_size": 829, "processed_size": 829, "workflow_hash": "acaa9d22b286e373c07c390399a3b5eb" }, "workflow_hash": "acaa9d22b286e373c07c390399a3b5eb" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to automatically check for and notify the user via email about available software updates on a server daily. Analyze this workflow: ```json { "nodes": [ { "id": "4ca55c6e-cf2e-4239-82a9-88d0a201e761", "name": "List upgradable packages", "type": "n8n-nodes-base.ssh", "notes": "apt list --upgradable", "position": [ -280, 0 ], "parameters": { "command": "apt list --upgradable" }, "credentials": { "sshPassword": { "id": "Ps31IKTeseWFlA0g", "name": "SSH Password account" } }, "notesInFlow": true, "typeVersion": 1, "alwaysOutputData": false }, { "id": "ae1f0a55-31aa-494b-baa6-822dc606188e", "name": "Send Email through SMTP", "type": "n8n-nodes-base.emailSend", "position": [ 380, 0 ], "webhookId": "8073c571-b36f-4330-a510-ca2ff2924fbf", "parameters": { "html": "=The following packages can be updated on your server:\n\n{{ $json.htmlList }}\n\nPlease login and perform upgrade.", "options": {}, "subject": "Server needs updates", "toEmail": "change.me@example.com", "fromEmail": "change.me@example.com" }, "credentials": { "smtp": { "id": "uiNePdJaDng5a43S", "name": "SMTP account" } }, "typeVersion": 2.1 }, { "id": "e1d76671-d94c-40d5-9364-623db9319f11", "name": "Run workflow every day", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -540, 0 ], "parameters": { "rule": { "interval": [ {} ] } }, "typeVersion": 1.2 }, { "id": "ec4d722a-b88c-42da-971c-28ad5774596d", "name": "Format as HTML list", "type": "n8n-nodes-base.code", "position": [ -60, 0 ], "parameters": { "jsCode": "function formatStdoutAsHtmlList(stdoutData) {\n\n // Split the stdout into lines and map to HTML list items\n const htmlListItems = stdoutData.split('\\n').map((line) => {\n if (line.trim() && line !== \"Listing...\") { // Optionally skip empty lines or headers\n return `<li>${line.trim()}</li>`;\n }\n }).filter(item => item); // Remove any undefined items due to empty lines or skipped headers\n\n // Wrap the list items in a <ul> tag\n const htmlList = `<ul>${htmlListItems.join('')}</ul>`;\n\n // Return the formatted HTML list as part of an object\n return { \"htmlList\": htmlList };\n}\n\nreturn formatStdoutAsHtmlList($input.first().json.stdout);" }, "typeVersion": 2 }, { "id": "6f14eb02-c505-4f83-a5bb-68094e763fd9", "name": "Check if there are updates", "type": "n8n-nodes-base.if", "position": [ 140, 0 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "db66d892-26fb-406c-a0ac-2e4b8a60310a", "operator": { "type": "string", "operation": "notEquals" }, "leftValue": "={{ $json.htmlList }}", "rightValue": "<ul></ul>" } ] } }, "typeVersion": 2.2 }, { "id": "3924c696-5b0e-4ae2-b2e2-435fed344028", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -740, -180 ], "parameters": { "width": 300, "content": "## VPS upgrade notify \nThis workflow will everyday check if server has upgradable packages and inform you by email if there is." }, "typeVersion": 1 }, { "id": "bb8ade2a-4ffe-4c79-91eb-55af568eb1b1", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 380, -180 ], "parameters": { "width": 300, "content": "## Update email addresses\nUpdate From and To email addresses in this node to receive notifications" }, "typeVersion": 1 } ], "connections": { "Format as HTML list": { "main": [ [ { "node": "Check if there are updates", "type": "main", "index": 0 } ] ] }, "Run workflow every day": { "main": [ [ { "node": "List upgradable packages", "type": "main", "index": 0 } ] ] }, "Send Email through SMTP": { "main": [ [] ] }, "List upgradable packages": { "main": [ [ { "node": "Format as HTML list", "type": "main", "index": 0 } ] ] }, "Check if there are updates": { "main": [ [ { "node": "Send Email through SMTP", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"id\": \"4ca55c6e-cf2e-4239-82a9-88d0a201e761\",\n \"name\": \"List upgradable packages\",\n \"type\": \"n8n-nodes-base.ssh\",\n \"notes\": \"apt list --upgradable\",\n \"position\": [\n -280,\n 0\n ],\n \"parameters\": {\n \"command\": \"apt list --upgradable\"\n },\n \"credentials\": {\n \"sshPassword\": {\n \"id\": \"Ps31IKTeseWFlA0g\",\n \"name\": \"SSH Password account\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1,\n \"alwaysOutputData\": false\n },\n {\n \"id\": \"ae1f0a55-31aa-494b-baa6-822dc606188e\",\n \"name\": \"Send Email through SMTP\",\n \"type\": \"n8n-nodes-base.emailSend\",\n \"position\": [\n 380,\n 0\n ],\n \"webhookId\": \"8073c571-b36f-4330-a510-ca2ff2924fbf\",\n \"parameters\": {\n \"html\": \"=The following packages can be updated on your server:\\n\\n{{ $json.htmlList }}\\n\\nPlease login and perform upgrade.\",\n \"options\": {},\n \"subject\": \"Server needs updates\",\n \"toEmail\": \"change.me@example.com\",\n \"fromEmail\": \"change.me@example.com\"\n },\n \"credentials\": {\n \"smtp\": {\n \"id\": \"uiNePdJaDng5a43S\",\n \"name\": \"SMTP account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"e1d76671-d94c-40d5-9364-623db9319f11\",\n \"name\": \"Run workflow every day\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n -540,\n 0\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {}\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"ec4d722a-b88c-42da-971c-28ad5774596d\",\n \"name\": \"Format as HTML list\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n -60,\n 0\n ],\n \"parameters\": {\n \"jsCode\": \"function formatStdoutAsHtmlList(stdoutData) {\\n\\n // Split the stdout into lines and map to HTML list items\\n const htmlListItems = stdoutData.split('\\\\n').map((line) => {\\n if (line.trim() && line !== \\\"Listing...\\\") { // Optionally skip empty lines or headers\\n return `<li>${line.trim()}</li>`;\\n }\\n }).filter(item => item); // Remove any undefined items due to empty lines or skipped headers\\n\\n // Wrap the list items in a <ul> tag\\n const htmlList = `<ul>${htmlListItems.join('')}</ul>`;\\n\\n // Return the formatted HTML list as part of an object\\n return { \\\"htmlList\\\": htmlList };\\n}\\n\\nreturn formatStdoutAsHtmlList($input.first().json.stdout);\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"6f14eb02-c505-4f83-a5bb-68094e763fd9\",\n \"name\": \"Check if there are updates\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 140,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"db66d892-26fb-406c-a0ac-2e4b8a60310a\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.htmlList }}\",\n \"rightValue\": \"<ul></ul>\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"3924c696-5b0e-4ae2-b2e2-435fed344028\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -740,\n -180\n ],\n \"parameters\": {\n \"width\": 300,\n \"content\": \"## VPS upgrade notify \\nThis workflow will everyday check if server has upgradable packages and inform you by email if there is.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"bb8ade2a-4ffe-4c79-91eb-55af568eb1b1\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 380,\n -180\n ],\n \"parameters\": {\n \"width\": 300,\n \"content\": \"## Update email addresses\\nUpdate From and To email addresses in this node to receive notifications\"\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Format as HTML list\": {\n \"main\": [\n [\n {\n \"node\": \"Check if there are updates\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Run workflow every day\": {\n \"main\": [\n [\n {\n \"node\": \"List upgradable packages\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Email through SMTP\": {\n \"main\": [\n []\n ]\n },\n \"List upgradable packages\": {\n \"main\": [\n [\n {\n \"node\": \"Format as HTML list\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if there are updates\": {\n \"main\": [\n [\n {\n \"node\": \"Send Email through SMTP\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
8
0
1
false
combined_workflows.json
{ "input": "The workflow's goal is to automatically check for and notify the user via email about available software updates on a server daily.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 3653, "processed_size": 3653, "processed_timestamp": "2025-04-09T03:08:37.017613", "timestamp": "2025-04-09T02:34:27.196179", "token_count": 1970, "tokens": 378, "workflow_chunk_info": { "is_truncated": false, "original_size": 3653, "processed_size": 3653, "workflow_hash": "63863d404044a35e8a17cf7d2771b241" }, "workflow_hash": "63863d404044a35e8a17cf7d2771b241" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to upload an image, optimize it for size, and then store the optimized image's URL. It optionally generates the image using an AI model. Analyze this workflow: ```json { "meta": { "instanceId": "6b6a2db47bdf8371d21090c511052883cc9a3f6af5d0d9d567c702d74a18820e" }, "nodes": [ { "id": "6fb16611-0ee4-4c89-91ef-dc8a1e39406d", "name": "Upload Img to ImgBB for URL", "type": "n8n-nodes-base.httpRequest", "position": [ 120, 6220 ], "parameters": { "url": "https://api.imgbb.com/1/upload", "method": "POST", "options": {}, "sendBody": true, "contentType": "multipart-form-data", "sendHeaders": true, "authentication": "genericCredentialType", "bodyParameters": { "parameters": [ { "name": "image", "parameterType": "formBinaryData", "inputDataFieldName": "data" } ] }, "genericAuthType": "httpQueryAuth", "headerParameters": { "parameters": [ { "name": "Content-type", "value": "multipart/form-data" } ] } }, "notesInFlow": true, "typeVersion": 4.2 }, { "id": "e94ebd4f-4459-4705-8fc5-f7ebbc996add", "name": "ReSmush.it Image Optimisation", "type": "n8n-nodes-base.httpRequest", "position": [ 320, 6220 ], "parameters": { "url": "=http://api.resmush.it/ws.php?img={{ $json.data.url }}", "options": {} }, "notesInFlow": true, "typeVersion": 4.2 }, { "id": "e337dcf1-27d3-4f75-850b-f2c5bff48ed6", "name": "Store Optimised Image ImgBB", "type": "n8n-nodes-base.httpRequest", "position": [ 540, 6220 ], "parameters": { "url": "https://api.imgbb.com/1/upload", "method": "POST", "options": {}, "sendBody": true, "sendHeaders": true, "authentication": "genericCredentialType", "bodyParameters": { "parameters": [ { "name": "image", "value": "={{ $json.dest }}" } ] }, "genericAuthType": "httpQueryAuth", "headerParameters": { "parameters": [ { "name": "Content-type", "value": "application/x-www-form-urlencoded" } ] } }, "notesInFlow": true, "typeVersion": 4.2 }, { "id": "e51c199e-e435-4bbd-a977-dc96200729cc", "name": "Sticky Note50", "type": "n8n-nodes-base.stickyNote", "position": [ -343.4815115846739, 6060 ], "parameters": { "color": 7, "width": 415.48118604428106, "height": 320.9196076003899, "content": "**Image Prompt**\n\nPrompt takes input of image description from the `set image description` node and generates using OpenAI" }, "typeVersion": 1 }, { "id": "95a551f0-c164-4ac7-94e2-5aac4c5fc548", "name": "Sticky Note51", "type": "n8n-nodes-base.stickyNote", "position": [ 80, 6060 ], "parameters": { "color": 7, "width": 619.0692735087202, "height": 320.9196076003899, "content": "**Upload image to ImgBB, Optimise using ReSmush.it and store as URL**\n" }, "typeVersion": 1 }, { "id": "93737b01-cd2f-4f49-b611-f47782a9eed8", "name": "Sticky Note52", "type": "n8n-nodes-base.stickyNote", "position": [ -1160, 6020 ], "parameters": { "color": 4, "width": 773.6179704580734, "height": 875.8289847608302, "content": "## Convert Image Files (JPG, PNG, JPEG) to URLs and Reduce File Size\n\n## Use Case\nTransform and optimize images for web use:\n- You need to host local images online\n- You want to reduce image file sizes automatically\n- You need image URLs for web content\n- You want to generate and optimize AI-created images\n\n## What this Workflow Does\nThe workflow processes images through two services:\n- Uploads images to ImgBB for hosting and URL generation (free but need API key)\n- Optimizes images using ReSmush.it to reduce file size (free)\n- Optional: Creates images using OpenAI's image generation\n- Returns optimized image URLs ready for use\n\n## Setup\n1. Create an [ImgBB account](https://api.imgbb.com/) and get your API key\n2. Add your ImgBB API key to the HTTP Request node (key parameter)\n3. Optional: Configure OpenAI credentials for image generation\n4. Connect your image input source\n\n## How to Adjust it to Your Needs\n- Skip OpenAI nodes if using your own image files\n- Adjust image optimization parameters\n- Customize image hosting settings\n- Modify output format for your needs\n\n\nMade by Simon @ [automake.io](https://automake.io)" }, "typeVersion": 1 }, { "id": "8f4bfed3-820c-495d-9d5f-0dbdae7beb1a", "name": "Sticky Note53", "type": "n8n-nodes-base.stickyNote", "position": [ 80, 6400 ], "parameters": { "color": 3, "width": 620.0617659833041, "height": 218.46830740679286, "content": "**REQUIRED**\n\n**ImgBB - image hosting i.e. gives you an img url**\n1. [Create an ImgBB account](https://api.imgbb.com/) (free) and generate an api key\n2. Input the API key as Query Auth - `name`=key, `value`=your-own-api-key\n\n\n**ReSmush.it - image optimisation i.e. shrinks the file size of the image**\n1. No account or auth needed\n2. Url will pass from previous node" }, "typeVersion": 1 }, { "id": "085ef8b4-4762-4675-a1fd-6771f09628fb", "name": "Sticky Note54", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 6400 ], "parameters": { "color": 2, "width": 409.8920345317687, "height": 133.75846341937205, "content": "**OPTIONAL**\n`Set image description` to create an Image using OpenAI and your own prompt (requires: API credentials) or alternatively replace these nodes with your own image file" }, "typeVersion": 1 }, { "id": "ee6c01dd-94fd-4ebf-baf6-03360e01ffc0", "name": "Set image description", "type": "n8n-nodes-base.set", "position": [ -300, 6220 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9026b5d5-97ed-484e-a168-ac1c57a60fa1", "name": "description", "type": "string", "value": "=Balancing Autonomy and Human Interaction in AI Applications, featuring a person" } ] } }, "typeVersion": 3.4 }, { "id": "7bb7374c-a11e-4ac8-8ef7-ba506fa8619d", "name": "Generate Image", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ -100, 6220 ], "parameters": { "prompt": "=Create a minimalist professional illustration of {{ $json.description }} with these specifications:\n\n1. Visual Style:\n- Modern tech-focused minimalist design\n- Clean, uncluttered composition\n- Professional business aesthetic\n- Soft shadows and subtle depth\n- 2-3 primary colors maximum plus white space\n\n2. Core Elements:\n- Main icon/symbol representing {{ $json.description }} as focal point\n- Simple supporting elements representing key sections\n- Subtle connecting elements showing relationship\n- Plenty of white space (40% minimum)\n- No text overlay\n\n3. Technical Requirements:\n- High contrast for clarity\n- Crisp edges and smooth lines\n- Professional lighting from upper left\n- Matte finish\n- Square aspect ratio (1:1)", "options": {}, "resource": "image" }, "credentials": { "openAiApi": { "id": "gaOzEcyxSfqBNYsI", "name": "OpenAi account" } }, "typeVersion": 1.4 }, { "id": "87f80a8d-932a-46bc-b003-877883ba73c8", "name": "No Operation, do nothing", "type": "n8n-nodes-base.noOp", "position": [ 760, 6220 ], "parameters": {}, "typeVersion": 1 } ], "pinData": {}, "connections": { "Generate Image": { "main": [ [ { "node": "Upload Img to ImgBB for URL", "type": "main", "index": 0 } ] ] }, "Set image description": { "main": [ [ { "node": "Generate Image", "type": "main", "index": 0 } ] ] }, "Store Optimised Image ImgBB": { "main": [ [ { "node": "No Operation, do nothing", "type": "main", "index": 0 } ] ] }, "Upload Img to ImgBB for URL": { "main": [ [ { "node": "ReSmush.it Image Optimisation", "type": "main", "index": 0 } ] ] }, "ReSmush.it Image Optimisation": { "main": [ [ { "node": "Store Optimised Image ImgBB", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"6b6a2db47bdf8371d21090c511052883cc9a3f6af5d0d9d567c702d74a18820e\"\n },\n \"nodes\": [\n {\n \"id\": \"6fb16611-0ee4-4c89-91ef-dc8a1e39406d\",\n \"name\": \"Upload Img to ImgBB for URL\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 120,\n 6220\n ],\n \"parameters\": {\n \"url\": \"https://api.imgbb.com/1/upload\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"contentType\": \"multipart-form-data\",\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"image\",\n \"parameterType\": \"formBinaryData\",\n \"inputDataFieldName\": \"data\"\n }\n ]\n },\n \"genericAuthType\": \"httpQueryAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Content-type\",\n \"value\": \"multipart/form-data\"\n }\n ]\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e94ebd4f-4459-4705-8fc5-f7ebbc996add\",\n \"name\": \"ReSmush.it Image Optimisation\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 320,\n 6220\n ],\n \"parameters\": {\n \"url\": \"=http://api.resmush.it/ws.php?img={{ $json.data.url }}\",\n \"options\": {}\n },\n \"notesInFlow\": true,\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e337dcf1-27d3-4f75-850b-f2c5bff48ed6\",\n \"name\": \"Store Optimised Image ImgBB\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 540,\n 6220\n ],\n \"parameters\": {\n \"url\": \"https://api.imgbb.com/1/upload\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"image\",\n \"value\": \"={{ $json.dest }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpQueryAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Content-type\",\n \"value\": \"application/x-www-form-urlencoded\"\n }\n ]\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e51c199e-e435-4bbd-a977-dc96200729cc\",\n \"name\": \"Sticky Note50\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -343.4815115846739,\n 6060\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 415.48118604428106,\n \"height\": 320.9196076003899,\n \"content\": \"**Image Prompt**\\n\\nPrompt takes input of image description from the `set image description` node and generates using OpenAI\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"95a551f0-c164-4ac7-94e2-5aac4c5fc548\",\n \"name\": \"Sticky Note51\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 80,\n 6060\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 619.0692735087202,\n \"height\": 320.9196076003899,\n \"content\": \"**Upload image to ImgBB, Optimise using ReSmush.it and store as URL**\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"93737b01-cd2f-4f49-b611-f47782a9eed8\",\n \"name\": \"Sticky Note52\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1160,\n 6020\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 773.6179704580734,\n \"height\": 875.8289847608302,\n \"content\": \"## Convert Image Files (JPG, PNG, JPEG) to URLs and Reduce File Size\\n\\n## Use Case\\nTransform and optimize images for web use:\\n- You need to host local images online\\n- You want to reduce image file sizes automatically\\n- You need image URLs for web content\\n- You want to generate and optimize AI-created images\\n\\n## What this Workflow Does\\nThe workflow processes images through two services:\\n- Uploads images to ImgBB for hosting and URL generation (free but need API key)\\n- Optimizes images using ReSmush.it to reduce file size (free)\\n- Optional: Creates images using OpenAI's image generation\\n- Returns optimized image URLs ready for use\\n\\n## Setup\\n1. Create an [ImgBB account](https://api.imgbb.com/) and get your API key\\n2. Add your ImgBB API key to the HTTP Request node (key parameter)\\n3. Optional: Configure OpenAI credentials for image generation\\n4. Connect your image input source\\n\\n## How to Adjust it to Your Needs\\n- Skip OpenAI nodes if using your own image files\\n- Adjust image optimization parameters\\n- Customize image hosting settings\\n- Modify output format for your needs\\n\\n\\nMade by Simon @ [automake.io](https://automake.io)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8f4bfed3-820c-495d-9d5f-0dbdae7beb1a\",\n \"name\": \"Sticky Note53\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 80,\n 6400\n ],\n \"parameters\": {\n \"color\": 3,\n \"width\": 620.0617659833041,\n \"height\": 218.46830740679286,\n \"content\": \"**REQUIRED**\\n\\n**ImgBB - image hosting i.e. gives you an img url**\\n1. [Create an ImgBB account](https://api.imgbb.com/) (free) and generate an api key\\n2. Input the API key as Query Auth - `name`=key, `value`=your-own-api-key\\n\\n\\n**ReSmush.it - image optimisation i.e. shrinks the file size of the image**\\n1. No account or auth needed\\n2. Url will pass from previous node\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"085ef8b4-4762-4675-a1fd-6771f09628fb\",\n \"name\": \"Sticky Note54\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 6400\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 409.8920345317687,\n \"height\": 133.75846341937205,\n \"content\": \"**OPTIONAL**\\n`Set image description` to create an Image using OpenAI and your own prompt (requires: API credentials) or alternatively replace these nodes with your own image file\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ee6c01dd-94fd-4ebf-baf6-03360e01ffc0\",\n \"name\": \"Set image description\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -300,\n 6220\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9026b5d5-97ed-484e-a168-ac1c57a60fa1\",\n \"name\": \"description\",\n \"type\": \"string\",\n \"value\": \"=Balancing Autonomy and Human Interaction in AI Applications, featuring a person\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7bb7374c-a11e-4ac8-8ef7-ba506fa8619d\",\n \"name\": \"Generate Image\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n -100,\n 6220\n ],\n \"parameters\": {\n \"prompt\": \"=Create a minimalist professional illustration of {{ $json.description }} with these specifications:\\n\\n1. Visual Style:\\n- Modern tech-focused minimalist design\\n- Clean, uncluttered composition\\n- Professional business aesthetic\\n- Soft shadows and subtle depth\\n- 2-3 primary colors maximum plus white space\\n\\n2. Core Elements:\\n- Main icon/symbol representing {{ $json.description }} as focal point\\n- Simple supporting elements representing key sections\\n- Subtle connecting elements showing relationship\\n- Plenty of white space (40% minimum)\\n- No text overlay\\n\\n3. Technical Requirements:\\n- High contrast for clarity\\n- Crisp edges and smooth lines\\n- Professional lighting from upper left\\n- Matte finish\\n- Square aspect ratio (1:1)\",\n \"options\": {},\n \"resource\": \"image\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"gaOzEcyxSfqBNYsI\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.4\n },\n {\n \"id\": \"87f80a8d-932a-46bc-b003-877883ba73c8\",\n \"name\": \"No Operation, do nothing\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 760,\n 6220\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Generate Image\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Img to ImgBB for URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set image description\": {\n \"main\": [\n [\n {\n \"node\": \"Generate Image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Store Optimised Image ImgBB\": {\n \"main\": [\n [\n {\n \"node\": \"No Operation, do nothing\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload Img to ImgBB for URL\": {\n \"main\": [\n [\n {\n \"node\": \"ReSmush.it Image Optimisation\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"ReSmush.it Image Optimisation\": {\n \"main\": [\n [\n {\n \"node\": \"Store Optimised Image ImgBB\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
9
0
1
false
combined_workflows.json
{ "input": "The workflow's goal is to upload an image, optimize it for size, and then store the optimized image's URL. It optionally generates the image using an AI model.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7044, "processed_size": 7044, "processed_timestamp": "2025-04-09T03:08:37.034614", "timestamp": "2025-04-09T02:34:27.228599", "token_count": 3501, "tokens": 728, "workflow_chunk_info": { "is_truncated": false, "original_size": 7044, "processed_size": 7044, "workflow_hash": "77e14efe50e892be1e2a058a36023e62" }, "workflow_hash": "77e14efe50e892be1e2a058a36023e62" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow authenticates a user with Auth0, obtains an access token, and retrieves user information. Analyze this workflow: ```json { "id": "AS2Rj41p6OyA0xZK", "meta": { "instanceId": "7858a8e25b8fc4dae485c1ef345e6fe74effb1f5060433ef500b4c186c965c18", "templateCredsSetupCompleted": true }, "name": "Auth0 User Login", "tags": [], "nodes": [ { "id": "25022573-c99e-40d2-88e2-a0e7a9780181", "name": "Request Access Token", "type": "n8n-nodes-base.httpRequest", "position": [ 1260, 320 ], "parameters": { "url": "={{ $json.domain }}/oauth/token", "method": "POST", "options": {}, "jsonBody": "={\n \"grant_type\": \"authorization_code\",\n \"code\": \"{{ $json.query.code }}\",\n \"client_id\": \"{{ $json.client_id }}\",\n \"client_secret\": \"{{ $json.client_secret }}\",\n \"redirect_uri\": \"{{ $json.my_server }}\",\n \"audience\": \"{{ $json.domain }}/api/v2/\"\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "headerParameters": { "parameters": [ { "name": "content-type", "value": "application/x-www-form-urlencoded" } ] } }, "typeVersion": 4.2 }, { "id": "233d69ed-d835-4022-815e-e786706ec78a", "name": "Get Userinfo", "type": "n8n-nodes-base.httpRequest", "position": [ 1500, 320 ], "parameters": { "url": "={{ $('Set Application Details1').item.json.domain }}/userinfo", "options": {}, "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Authorization", "value": "=Bearer {{ $json.access_token }}" } ] } }, "typeVersion": 4.2 }, { "id": "860e8a20-f6a3-4c8e-be71-361e6f1f8641", "name": "If", "type": "n8n-nodes-base.if", "position": [ 720, 320 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "fa80ac35-7029-4507-b5ea-845bec07b672", "operator": { "type": "string", "operation": "exists", "singleValue": true }, "leftValue": "={{$json.query.code}}", "rightValue": "" } ] } }, "typeVersion": 2.1 }, { "id": "7c4e15c7-2ee0-4c54-8255-e7cc250e718a", "name": "No Code Found", "type": "n8n-nodes-base.stopAndError", "position": [ 880, 540 ], "parameters": { "errorMessage": "Couldn't get authorization code!" }, "typeVersion": 1 }, { "id": "2e0b2ff5-47ce-4199-bdd2-e31a4d32fd15", "name": "Open Auth Webpage", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1020, 40 ], "parameters": { "options": {}, "redirectURL": "={{ $json.domain }}/authorize?response_type=code&scope=openid+email+profile+image+name&client_id={{ $json.client_id }}&redirect_uri={{ $json.my_server }}/webhook/receive-token", "respondWith": "redirect" }, "typeVersion": 1.1 }, { "id": "d790ce47-725a-4a69-b66f-f7e80e2d9e5e", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1180, 80 ], "parameters": { "color": 6, "width": 238.05017098334866, "height": 140.50170983348636, "content": "### You can also add &connection=github to end of authorize URL in order to get user to login via Github, Facebook, etc" }, "typeVersion": 1 }, { "id": "1c5bb01a-0fed-4783-b18d-d8f7e818371c", "name": "Set Application Details", "type": "n8n-nodes-base.set", "position": [ 780, 40 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "003d523a-5e14-4a5a-aed6-f72c3fce6e6d", "name": "domain", "type": "string", "value": "" }, { "id": "7db513f3-55f6-4bab-92b0-e62d0b7f05a1", "name": "client_id", "type": "string", "value": "" }, { "id": "52da7d5d-6683-4cf9-a7de-c2ab2ce48f3d", "name": "my_server", "type": "string", "value": "" } ] }, "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "8ced9fb6-fd49-4d57-8d74-b04e45b6c216", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 80, -456.1003419666973 ], "parameters": { "color": 5, "width": 623.7263504769883, "height": 397.87914003146636, "content": "## 1. First, go to https://auth0.com and create a Single Page Application. From Dashboard/Applications, click on your new app settings. The first step is to add the following to allowed callback URLs:\nhttp://localhost:5678, http://localhost:5678/webhook/receive-token \n\n### (If you do not run n8n locally, replace localhost with your server where you run n8n. You must also replace it in **Set Application Details** 'my_server' field)\n\n## From the same settings page, retrieve the Domain, Client_ID, and Client_Secret of your application." }, "typeVersion": 1 }, { "id": "94155312-1230-4c13-9104-5e26a6f68e91", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1280, -40 ], "parameters": { "color": 6, "width": 437.4336297478876, "height": 107.35461655041311, "content": "### This step will return the authentication page to the user and let him login using gmail or by creating a new account." }, "typeVersion": 1 }, { "id": "9a7bcabf-1cc0-43e5-8f52-cc3f2781150f", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 420, -40 ], "parameters": { "width": 1296.8510714753793, "height": 256.53228919365705, "content": "## Step 1: Authentication\n" }, "typeVersion": 1 }, { "id": "7e7560d6-4c26-4e80-ad62-07a674e928f9", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 420, 260 ], "parameters": { "width": 1302.371850917427, "height": 444.78164181462137, "content": "## Step 2: Get Access Token\n" }, "typeVersion": 1 }, { "id": "97c8bc77-bc7d-4be2-9858-668c5e325f49", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 420, 560.9464093496792 ], "parameters": { "color": 6, "width": 327.74230574931124, "height": 144.40136786678917, "content": "### If Step 1 was successful, Auth0 will automatically call Step 2 in its callback with a code. This code is used to generate an access token which can verify the user is legitimate and email verified." }, "typeVersion": 1 }, { "id": "fe103ba1-8143-482c-846f-0f381ca2661a", "name": "Set Application Details1", "type": "n8n-nodes-base.set", "position": [ 1000, 320 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "003d523a-5e14-4a5a-aed6-f72c3fce6e6d", "name": "domain", "type": "string", "value": "" }, { "id": "7db513f3-55f6-4bab-92b0-e62d0b7f05a1", "name": "client_id", "type": "string", "value": "" }, { "id": "52da7d5d-6683-4cf9-a7de-c2ab2ce48f3d", "name": "my_server", "type": "string", "value": "" }, { "id": "d339dd3d-ed57-4b0f-81c6-a8f5f7c474fb", "name": "client_secret", "type": "string", "value": "" } ] }, "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "b3bb59b8-16fc-483d-ae8d-ec3e65c3326d", "name": "/login", "type": "n8n-nodes-base.webhook", "position": [ 540, 40 ], "webhookId": "046e2370-0ae1-4d64-be9b-cbb0545de323", "parameters": { "path": "login", "options": {}, "responseMode": "responseNode" }, "typeVersion": 2 }, { "id": "79825832-6d06-4a48-aa0a-bad3d52ab2c1", "name": "/receive-token", "type": "n8n-nodes-base.webhook", "position": [ 540, 320 ], "webhookId": "7bd9ea5a-c354-41c0-9d17-4a02ca8e3055", "parameters": { "path": "receive-token", "options": {}, "responseMode": "lastNode" }, "typeVersion": 2 }, { "id": "b9406ef0-3567-46da-9989-d7f458ad73fb", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 760, -460 ], "parameters": { "color": 5, "width": 426.62126002791706, "height": 393.48225931142105, "content": "## 2. Fill in Set Application Details and Set Application Details1\n\n## 3. **Login from https://<n8n server address>/webhook/login!**" }, "typeVersion": 1 } ], "active": true, "pinData": {}, "settings": { "executionOrder": "v1
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"AS2Rj41p6OyA0xZK\",\n \"meta\": {\n \"instanceId\": \"7858a8e25b8fc4dae485c1ef345e6fe74effb1f5060433ef500b4c186c965c18\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Auth0 User Login\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"25022573-c99e-40d2-88e2-a0e7a9780181\",\n \"name\": \"Request Access Token\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1260,\n 320\n ],\n \"parameters\": {\n \"url\": \"={{ $json.domain }}/oauth/token\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"grant_type\\\": \\\"authorization_code\\\",\\n \\\"code\\\": \\\"{{ $json.query.code }}\\\",\\n \\\"client_id\\\": \\\"{{ $json.client_id }}\\\",\\n \\\"client_secret\\\": \\\"{{ $json.client_secret }}\\\",\\n \\\"redirect_uri\\\": \\\"{{ $json.my_server }}\\\",\\n \\\"audience\\\": \\\"{{ $json.domain }}/api/v2/\\\"\\n}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"content-type\",\n \"value\": \"application/x-www-form-urlencoded\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"233d69ed-d835-4022-815e-e786706ec78a\",\n \"name\": \"Get Userinfo\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1500,\n 320\n ],\n \"parameters\": {\n \"url\": \"={{ $('Set Application Details1').item.json.domain }}/userinfo\",\n \"options\": {},\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"=Bearer {{ $json.access_token }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"860e8a20-f6a3-4c8e-be71-361e6f1f8641\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 720,\n 320\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"fa80ac35-7029-4507-b5ea-845bec07b672\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"exists\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{$json.query.code}}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"7c4e15c7-2ee0-4c54-8255-e7cc250e718a\",\n \"name\": \"No Code Found\",\n \"type\": \"n8n-nodes-base.stopAndError\",\n \"position\": [\n 880,\n 540\n ],\n \"parameters\": {\n \"errorMessage\": \"Couldn't get authorization code!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2e0b2ff5-47ce-4199-bdd2-e31a4d32fd15\",\n \"name\": \"Open Auth Webpage\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1020,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"redirectURL\": \"={{ $json.domain }}/authorize?response_type=code&scope=openid+email+profile+image+name&client_id={{ $json.client_id }}&redirect_uri={{ $json.my_server }}/webhook/receive-token\",\n \"respondWith\": \"redirect\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"d790ce47-725a-4a69-b66f-f7e80e2d9e5e\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1180,\n 80\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 238.05017098334866,\n \"height\": 140.50170983348636,\n \"content\": \"### You can also add &connection=github to end of authorize URL in order to get user to login via Github, Facebook, etc\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1c5bb01a-0fed-4783-b18d-d8f7e818371c\",\n \"name\": \"Set Application Details\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 780,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"003d523a-5e14-4a5a-aed6-f72c3fce6e6d\",\n \"name\": \"domain\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"7db513f3-55f6-4bab-92b0-e62d0b7f05a1\",\n \"name\": \"client_id\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"52da7d5d-6683-4cf9-a7de-c2ab2ce48f3d\",\n \"name\": \"my_server\",\n \"type\": \"string\",\n \"value\": \"\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"8ced9fb6-fd49-4d57-8d74-b04e45b6c216\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 80,\n -456.1003419666973\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 623.7263504769883,\n \"height\": 397.87914003146636,\n \"content\": \"## 1. First, go to https://auth0.com and create a Single Page Application. From Dashboard/Applications, click on your new app settings. The first step is to add the following to allowed callback URLs:\\nhttp://localhost:5678, http://localhost:5678/webhook/receive-token \\n\\n### (If you do not run n8n locally, replace localhost with your server where you run n8n. You must also replace it in **Set Application Details** 'my_server' field)\\n\\n## From the same settings page, retrieve the Domain, Client_ID, and Client_Secret of your application.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"94155312-1230-4c13-9104-5e26a6f68e91\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1280,\n -40\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 437.4336297478876,\n \"height\": 107.35461655041311,\n \"content\": \"### This step will return the authentication page to the user and let him login using gmail or by creating a new account.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9a7bcabf-1cc0-43e5-8f52-cc3f2781150f\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n -40\n ],\n \"parameters\": {\n \"width\": 1296.8510714753793,\n \"height\": 256.53228919365705,\n \"content\": \"## Step 1: Authentication\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7e7560d6-4c26-4e80-ad62-07a674e928f9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n 260\n ],\n \"parameters\": {\n \"width\": 1302.371850917427,\n \"height\": 444.78164181462137,\n \"content\": \"## Step 2: Get Access Token\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"97c8bc77-bc7d-4be2-9858-668c5e325f49\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n 560.9464093496792\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 327.74230574931124,\n \"height\": 144.40136786678917,\n \"content\": \"### If Step 1 was successful, Auth0 will automatically call Step 2 in its callback with a code. This code is used to generate an access token which can verify the user is legitimate and email verified.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fe103ba1-8143-482c-846f-0f381ca2661a\",\n \"name\": \"Set Application Details1\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1000,\n 320\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"003d523a-5e14-4a5a-aed6-f72c3fce6e6d\",\n \"name\": \"domain\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"7db513f3-55f6-4bab-92b0-e62d0b7f05a1\",\n \"name\": \"client_id\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"52da7d5d-6683-4cf9-a7de-c2ab2ce48f3d\",\n \"name\": \"my_server\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"d339dd3d-ed57-4b0f-81c6-a8f5f7c474fb\",\n \"name\": \"client_secret\",\n \"type\": \"string\",\n \"value\": \"\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"b3bb59b8-16fc-483d-ae8d-ec3e65c3326d\",\n \"name\": \"/login\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 540,\n 40\n ],\n \"webhookId\": \"046e2370-0ae1-4d64-be9b-cbb0545de323\",\n \"parameters\": {\n \"path\": \"login\",\n \"options\": {},\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"79825832-6d06-4a48-aa0a-bad3d52ab2c1\",\n \"name\": \"/receive-token\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 540,\n 320\n ],\n \"webhookId\": \"7bd9ea5a-c354-41c0-9d17-4a02ca8e3055\",\n \"parameters\": {\n \"path\": \"receive-token\",\n \"options\": {},\n \"responseMode\": \"lastNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"b9406ef0-3567-46da-9989-d7f458ad73fb\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 760,\n -460\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 426.62126002791706,\n \"height\": 393.48225931142105,\n \"content\": \"## 2. Fill in Set Application Details and Set Application Details1\\n\\n## 3. **Login from https://<n8n server address>/webhook/login!**\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"7d2f0dad-3951-49e2-9467-03124dbc52ba\",\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Set Application Details1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"No Code Found\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"/login\": {\n \"main\": [\n [\n {\n \"node\": \"Set Application Details\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"/receive-token\": {\n \"main\": [\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Request Access Token\": {\n \"main\": [\n [\n {\n \"node\": \"Get Userinfo\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Application Details\": {\n \"main\": [\n [\n {\n \"node\": \"Open Auth Webpage\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Application Details1\": {\n \"main\": [\n [\n {\n \"node\": \"Request Access Token\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
10
0
2
true
combined_workflows.json
{ "input": "This workflow authenticates a user with Auth0, obtains an access token, and retrieves user information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7892, "processed_size": 7892, "processed_timestamp": "2025-04-09T03:08:37.146616", "timestamp": "2025-04-09T02:34:27.287610", "token_count": 4095, "tokens": 724, "workflow_chunk_info": { "is_truncated": false, "original_size": 7892, "processed_size": 7892, "workflow_hash": "898e2ab9e779eb0d69c22499325ad223" }, "workflow_hash": "898e2ab9e779eb0d69c22499325ad223" }
Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 760, -460 ], "parameters": { "color": 5, "width": 426.62126002791706, "height": 393.48225931142105, "content": "## 2. Fill in Set Application Details and Set Application Details1\n\n## 3. **Login from https://<n8n server address>/webhook/login!**" }, "typeVersion": 1 } ], "active": true, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "7d2f0dad-3951-49e2-9467-03124dbc52ba", "connections": { "If": { "main": [ [ { "node": "Set Application Details1", "type": "main", "index": 0 } ], [ { "node": "No Code Found", "type": "main", "index": 0 } ] ] }, "/login": { "main": [ [ { "node": "Set Application Details", "type": "main", "index": 0 } ] ] }, "/receive-token": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Request Access Token": { "main": [ [ { "node": "Get Userinfo", "type": "main", "index": 0 } ] ] }, "Set Application Details": { "main": [ [ { "node": "Open Auth Webpage", "type": "main", "index": 0 } ] ] }, "Set Application Details1": { "main": [ [ { "node": "Request Access Token", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"AS2Rj41p6OyA0xZK\",\n \"meta\": {\n \"instanceId\": \"7858a8e25b8fc4dae485c1ef345e6fe74effb1f5060433ef500b4c186c965c18\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Auth0 User Login\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"25022573-c99e-40d2-88e2-a0e7a9780181\",\n \"name\": \"Request Access Token\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1260,\n 320\n ],\n \"parameters\": {\n \"url\": \"={{ $json.domain }}/oauth/token\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"grant_type\\\": \\\"authorization_code\\\",\\n \\\"code\\\": \\\"{{ $json.query.code }}\\\",\\n \\\"client_id\\\": \\\"{{ $json.client_id }}\\\",\\n \\\"client_secret\\\": \\\"{{ $json.client_secret }}\\\",\\n \\\"redirect_uri\\\": \\\"{{ $json.my_server }}\\\",\\n \\\"audience\\\": \\\"{{ $json.domain }}/api/v2/\\\"\\n}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"content-type\",\n \"value\": \"application/x-www-form-urlencoded\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"233d69ed-d835-4022-815e-e786706ec78a\",\n \"name\": \"Get Userinfo\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1500,\n 320\n ],\n \"parameters\": {\n \"url\": \"={{ $('Set Application Details1').item.json.domain }}/userinfo\",\n \"options\": {},\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"=Bearer {{ $json.access_token }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"860e8a20-f6a3-4c8e-be71-361e6f1f8641\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 720,\n 320\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"fa80ac35-7029-4507-b5ea-845bec07b672\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"exists\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{$json.query.code}}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"7c4e15c7-2ee0-4c54-8255-e7cc250e718a\",\n \"name\": \"No Code Found\",\n \"type\": \"n8n-nodes-base.stopAndError\",\n \"position\": [\n 880,\n 540\n ],\n \"parameters\": {\n \"errorMessage\": \"Couldn't get authorization code!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2e0b2ff5-47ce-4199-bdd2-e31a4d32fd15\",\n \"name\": \"Open Auth Webpage\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1020,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"redirectURL\": \"={{ $json.domain }}/authorize?response_type=code&scope=openid+email+profile+image+name&client_id={{ $json.client_id }}&redirect_uri={{ $json.my_server }}/webhook/receive-token\",\n \"respondWith\": \"redirect\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"d790ce47-725a-4a69-b66f-f7e80e2d9e5e\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1180,\n 80\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 238.05017098334866,\n \"height\": 140.50170983348636,\n \"content\": \"### You can also add &connection=github to end of authorize URL in order to get user to login via Github, Facebook, etc\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1c5bb01a-0fed-4783-b18d-d8f7e818371c\",\n \"name\": \"Set Application Details\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 780,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"003d523a-5e14-4a5a-aed6-f72c3fce6e6d\",\n \"name\": \"domain\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"7db513f3-55f6-4bab-92b0-e62d0b7f05a1\",\n \"name\": \"client_id\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"52da7d5d-6683-4cf9-a7de-c2ab2ce48f3d\",\n \"name\": \"my_server\",\n \"type\": \"string\",\n \"value\": \"\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"8ced9fb6-fd49-4d57-8d74-b04e45b6c216\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 80,\n -456.1003419666973\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 623.7263504769883,\n \"height\": 397.87914003146636,\n \"content\": \"## 1. First, go to https://auth0.com and create a Single Page Application. From Dashboard/Applications, click on your new app settings. The first step is to add the following to allowed callback URLs:\\nhttp://localhost:5678, http://localhost:5678/webhook/receive-token \\n\\n### (If you do not run n8n locally, replace localhost with your server where you run n8n. You must also replace it in **Set Application Details** 'my_server' field)\\n\\n## From the same settings page, retrieve the Domain, Client_ID, and Client_Secret of your application.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"94155312-1230-4c13-9104-5e26a6f68e91\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1280,\n -40\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 437.4336297478876,\n \"height\": 107.35461655041311,\n \"content\": \"### This step will return the authentication page to the user and let him login using gmail or by creating a new account.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9a7bcabf-1cc0-43e5-8f52-cc3f2781150f\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n -40\n ],\n \"parameters\": {\n \"width\": 1296.8510714753793,\n \"height\": 256.53228919365705,\n \"content\": \"## Step 1: Authentication\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7e7560d6-4c26-4e80-ad62-07a674e928f9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n 260\n ],\n \"parameters\": {\n \"width\": 1302.371850917427,\n \"height\": 444.78164181462137,\n \"content\": \"## Step 2: Get Access Token\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"97c8bc77-bc7d-4be2-9858-668c5e325f49\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n 560.9464093496792\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 327.74230574931124,\n \"height\": 144.40136786678917,\n \"content\": \"### If Step 1 was successful, Auth0 will automatically call Step 2 in its callback with a code. This code is used to generate an access token which can verify the user is legitimate and email verified.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fe103ba1-8143-482c-846f-0f381ca2661a\",\n \"name\": \"Set Application Details1\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1000,\n 320\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"003d523a-5e14-4a5a-aed6-f72c3fce6e6d\",\n \"name\": \"domain\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"7db513f3-55f6-4bab-92b0-e62d0b7f05a1\",\n \"name\": \"client_id\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"52da7d5d-6683-4cf9-a7de-c2ab2ce48f3d\",\n \"name\": \"my_server\",\n \"type\": \"string\",\n \"value\": \"\"\n },\n {\n \"id\": \"d339dd3d-ed57-4b0f-81c6-a8f5f7c474fb\",\n \"name\": \"client_secret\",\n \"type\": \"string\",\n \"value\": \"\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"b3bb59b8-16fc-483d-ae8d-ec3e65c3326d\",\n \"name\": \"/login\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 540,\n 40\n ],\n \"webhookId\": \"046e2370-0ae1-4d64-be9b-cbb0545de323\",\n \"parameters\": {\n \"path\": \"login\",\n \"options\": {},\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"79825832-6d06-4a48-aa0a-bad3d52ab2c1\",\n \"name\": \"/receive-token\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 540,\n 320\n ],\n \"webhookId\": \"7bd9ea5a-c354-41c0-9d17-4a02ca8e3055\",\n \"parameters\": {\n \"path\": \"receive-token\",\n \"options\": {},\n \"responseMode\": \"lastNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"b9406ef0-3567-46da-9989-d7f458ad73fb\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 760,\n -460\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 426.62126002791706,\n \"height\": 393.48225931142105,\n \"content\": \"## 2. Fill in Set Application Details and Set Application Details1\\n\\n## 3. **Login from https://<n8n server address>/webhook/login!**\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"7d2f0dad-3951-49e2-9467-03124dbc52ba\",\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Set Application Details1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"No Code Found\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"/login\": {\n \"main\": [\n [\n {\n \"node\": \"Set Application Details\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"/receive-token\": {\n \"main\": [\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Request Access Token\": {\n \"main\": [\n [\n {\n \"node\": \"Get Userinfo\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Application Details\": {\n \"main\": [\n [\n {\n \"node\": \"Open Auth Webpage\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Application Details1\": {\n \"main\": [\n [\n {\n \"node\": \"Request Access Token\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
10
1
2
true
combined_workflows.json
{ "input": "This workflow authenticates a user with Auth0, obtains an access token, and retrieves user information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7892, "processed_size": 7892, "processed_timestamp": "2025-04-09T03:08:37.149612", "timestamp": "2025-04-09T02:34:27.287610", "token_count": 669, "tokens": 724, "workflow_chunk_info": { "is_truncated": false, "original_size": 7892, "processed_size": 7892, "workflow_hash": "898e2ab9e779eb0d69c22499325ad223" }, "workflow_hash": "898e2ab9e779eb0d69c22499325ad223" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow backs up n8n workflows to a GitHub repository daily. Analyze this workflow: ```json { "nodes": [ { "name": "GitHub Edit", "type": "n8n-nodes-base.github", "position": [ 1190, 610 ], "parameters": { "owner": "YOUR_USERNAME", "filePath": "={{$json[\"data\"][\"name\"]}}.json", "resource": "file", "operation": "edit", "repository": "REPO_NAME", "fileContent": "={{JSON.stringify($json[\"data\"])}}", "commitMessage": "=[N8N Backup] {{$json.data[\"name\"]}} ({{new Date(Date.now()).toLocaleDateString()}})" }, "credentials": { "githubApi": "GitHub@harshil1712" }, "typeVersion": 1 }, { "name": "Get Files", "type": "n8n-nodes-base.github", "position": [ 200, 500 ], "parameters": { "owner": "YOUR_USERNAME", "filePath": "/", "resource": "file", "operation": "get", "repository": "REPO", "asBinaryProperty": false }, "credentials": { "githubApi": "GitHub@harshil1712" }, "executeOnce": true, "typeVersion": 1, "alwaysOutputData": false }, { "name": "Transform", "type": "n8n-nodes-base.function", "position": [ 400, 500 ], "parameters": { "functionCode": "return items[0].json.map(item => {\n return {\n json: item\n }\n});\n" }, "typeVersion": 1 }, { "name": "Create file", "type": "n8n-nodes-base.github", "position": [ 1240, 280 ], "parameters": { "owner": "YOUR_USERNAME", "filePath": "={{$json[\"data\"][\"name\"]}}.json", "resource": "file", "repository": "REPO", "fileContent": "={{JSON.stringify($node['Merge'].json[\"data\"])}}", "commitMessage": "=[N8N Backup] {{$json.data[\"name\"]}}.json ({{new Date(Date.now()).toLocaleDateString()}})" }, "credentials": { "githubApi": "GitHub@harshil1712" }, "typeVersion": 1 }, { "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 930, 280 ], "parameters": { "mode": "removeKeyMatches", "propertyName1": "data.name", "propertyName2": "data.name" }, "typeVersion": 1 }, { "name": "Get workflows", "type": "n8n-nodes-base.httpRequest", "position": [ 200, 300 ], "parameters": { "url": "http://localhost:5678/rest/workflows", "options": {}, "authentication": "basicAuth" }, "credentials": { "httpBasicAuth": "n8n instance auth" }, "typeVersion": 1 }, { "name": "Get workflow data", "type": "n8n-nodes-base.httpRequest", "position": [ 600, 300 ], "parameters": { "url": "=http://localhost:5678/rest/workflows/{{$json[\"id\"]}}", "options": {}, "authentication": "basicAuth" }, "credentials": { "httpBasicAuth": "n8n instance auth" }, "typeVersion": 1 }, { "name": "Download Raw Content", "type": "n8n-nodes-base.httpRequest", "position": [ 600, 500 ], "parameters": { "url": "={{$json[\"download_url\"]}}", "options": {}, "authentication": "headerAuth", "responseFormat": "string" }, "credentials": { "httpHeaderAuth": "GitHub Token" }, "typeVersion": 1 }, { "name": "transform", "type": "n8n-nodes-base.function", "position": [ 390, 300 ], "parameters": { "functionCode": "const newItems = [];\nfor (item of items[0].json.data) {\n newItems.push({json: item});\n}\nreturn newItems;" }, "typeVersion": 1 }, { "name": "Daily at 23:59", "type": "n8n-nodes-base.cron", "position": [ -20, 300 ], "parameters": { "triggerTimes": { "item": [ { "hour": 23, "minute": 59 } ] } }, "typeVersion": 1 }, { "name": "Merge1", "type": "n8n-nodes-base.merge", "position": [ 970, 610 ], "parameters": { "mode": "removeKeyMatches", "propertyName1": "data.updatedAt", "propertyName2": "data.updatedAt" }, "typeVersion": 1 } ], "connections": { "Merge": { "main": [ [ { "node": "Create file", "type": "main", "index": 0 } ] ] }, "Merge1": { "main": [ [ { "node": "GitHub Edit", "type": "main", "index": 0 } ] ] }, "Get Files": { "main": [ [ { "node": "Transform", "type": "main", "index": 0 } ] ] }, "Transform": { "main": [ [ { "node": "Download Raw Content", "type": "main", "index": 0 } ] ] }, "transform": { "main": [ [ { "node": "Get workflow data", "type": "main", "index": 0 } ] ] }, "Get workflows": { "main": [ [ { "node": "transform", "type": "main", "index": 0 } ] ] }, "Daily at 23:59": { "main": [ [ { "node": "Get workflows", "type": "main", "index": 0 } ] ] }, "Get workflow data": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 }, { "node": "Merge1", "type": "main", "index": 0 } ] ] }, "Download Raw Content": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 }, { "node": "Merge1", "type": "main", "index": 1 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"GitHub Edit\",\n \"type\": \"n8n-nodes-base.github\",\n \"position\": [\n 1190,\n 610\n ],\n \"parameters\": {\n \"owner\": \"YOUR_USERNAME\",\n \"filePath\": \"={{$json[\\\"data\\\"][\\\"name\\\"]}}.json\",\n \"resource\": \"file\",\n \"operation\": \"edit\",\n \"repository\": \"REPO_NAME\",\n \"fileContent\": \"={{JSON.stringify($json[\\\"data\\\"])}}\",\n \"commitMessage\": \"=[N8N Backup] {{$json.data[\\\"name\\\"]}} ({{new Date(Date.now()).toLocaleDateString()}})\"\n },\n \"credentials\": {\n \"githubApi\": \"GitHub@harshil1712\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get Files\",\n \"type\": \"n8n-nodes-base.github\",\n \"position\": [\n 200,\n 500\n ],\n \"parameters\": {\n \"owner\": \"YOUR_USERNAME\",\n \"filePath\": \"/\",\n \"resource\": \"file\",\n \"operation\": \"get\",\n \"repository\": \"REPO\",\n \"asBinaryProperty\": false\n },\n \"credentials\": {\n \"githubApi\": \"GitHub@harshil1712\"\n },\n \"executeOnce\": true,\n \"typeVersion\": 1,\n \"alwaysOutputData\": false\n },\n {\n \"name\": \"Transform\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 400,\n 500\n ],\n \"parameters\": {\n \"functionCode\": \"return items[0].json.map(item => {\\n return {\\n json: item\\n }\\n});\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Create file\",\n \"type\": \"n8n-nodes-base.github\",\n \"position\": [\n 1240,\n 280\n ],\n \"parameters\": {\n \"owner\": \"YOUR_USERNAME\",\n \"filePath\": \"={{$json[\\\"data\\\"][\\\"name\\\"]}}.json\",\n \"resource\": \"file\",\n \"repository\": \"REPO\",\n \"fileContent\": \"={{JSON.stringify($node['Merge'].json[\\\"data\\\"])}}\",\n \"commitMessage\": \"=[N8N Backup] {{$json.data[\\\"name\\\"]}}.json ({{new Date(Date.now()).toLocaleDateString()}})\"\n },\n \"credentials\": {\n \"githubApi\": \"GitHub@harshil1712\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 930,\n 280\n ],\n \"parameters\": {\n \"mode\": \"removeKeyMatches\",\n \"propertyName1\": \"data.name\",\n \"propertyName2\": \"data.name\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get workflows\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 200,\n 300\n ],\n \"parameters\": {\n \"url\": \"http://localhost:5678/rest/workflows\",\n \"options\": {},\n \"authentication\": \"basicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": \"n8n instance auth\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get workflow data\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 600,\n 300\n ],\n \"parameters\": {\n \"url\": \"=http://localhost:5678/rest/workflows/{{$json[\\\"id\\\"]}}\",\n \"options\": {},\n \"authentication\": \"basicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": \"n8n instance auth\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Download Raw Content\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 600,\n 500\n ],\n \"parameters\": {\n \"url\": \"={{$json[\\\"download_url\\\"]}}\",\n \"options\": {},\n \"authentication\": \"headerAuth\",\n \"responseFormat\": \"string\"\n },\n \"credentials\": {\n \"httpHeaderAuth\": \"GitHub Token\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"transform\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 390,\n 300\n ],\n \"parameters\": {\n \"functionCode\": \"const newItems = [];\\nfor (item of items[0].json.data) {\\n newItems.push({json: item});\\n}\\nreturn newItems;\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Daily at 23:59\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n -20,\n 300\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"hour\": 23,\n \"minute\": 59\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Merge1\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 970,\n 610\n ],\n \"parameters\": {\n \"mode\": \"removeKeyMatches\",\n \"propertyName1\": \"data.updatedAt\",\n \"propertyName2\": \"data.updatedAt\"\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Create file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge1\": {\n \"main\": [\n [\n {\n \"node\": \"GitHub Edit\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Files\": {\n \"main\": [\n [\n {\n \"node\": \"Transform\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Transform\": {\n \"main\": [\n [\n {\n \"node\": \"Download Raw Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"transform\": {\n \"main\": [\n [\n {\n \"node\": \"Get workflow data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get workflows\": {\n \"main\": [\n [\n {\n \"node\": \"transform\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Daily at 23:59\": {\n \"main\": [\n [\n {\n \"node\": \"Get workflows\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get workflow data\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download Raw Content\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n },\n {\n \"node\": \"Merge1\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
11
0
1
false
combined_workflows.json
{ "input": "The workflow backs up n8n workflows to a GitHub repository daily.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 4050, "processed_size": 4050, "processed_timestamp": "2025-04-09T03:08:37.161612", "timestamp": "2025-04-09T02:35:28.141330", "token_count": 2277, "tokens": 354, "workflow_chunk_info": { "is_truncated": false, "original_size": 4050, "processed_size": 4050, "workflow_hash": "72d08964de8a138b6f2e45b44fa39293" }, "workflow_hash": "72d08964de8a138b6f2e45b44fa39293" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow backs up n8n workflows to a GitHub repository, checking for changes and updating the backup accordingly. Analyze this workflow: ```json { "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 0, 150 ], "parameters": {}, "typeVersion": 1 }, { "name": "dataArray", "type": "n8n-nodes-base.function", "position": [ 450, 300 ], "parameters": { "functionCode": "const newItems = [];\nfor (item of items[0].json.data) {\n newItems.push({json: item});\n}\nreturn newItems;" }, "typeVersion": 1 }, { "name": "N8N Workflows", "type": "n8n-nodes-base.httpRequest", "position": [ 300, 300 ], "parameters": { "url": "http://localhost:8443/rest/workflows", "options": {} }, "typeVersion": 1 }, { "name": "GitHub", "type": "n8n-nodes-base.github", "position": [ 800, 130 ], "parameters": { "owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}", "filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$json[\"name\"]}}.json", "resource": "file", "operation": "get", "repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}", "asBinaryProperty": false }, "credentials": { "githubApi": "GitHub" }, "typeVersion": 1, "continueOnFail": true, "alwaysOutputData": true }, { "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 1000, 300 ], "parameters": {}, "typeVersion": 1 }, { "name": "N8N Workflow Detail", "type": "n8n-nodes-base.httpRequest", "position": [ 800, 460 ], "parameters": { "url": "=http://localhost:8443/rest/workflows/{{$json[\"id\"]}}", "options": {} }, "typeVersion": 1 }, { "name": "github_status", "type": "n8n-nodes-base.switch", "position": [ 1300, 300 ], "parameters": { "rules": { "rules": [ { "value2": "same" }, { "output": 1, "value2": "different" }, { "output": 2, "value2": "new" } ] }, "value1": "={{$json[\"github_status\"]}}", "dataType": "string" }, "typeVersion": 1 }, { "name": "same", "type": "n8n-nodes-base.noOp", "position": [ 1500, 130 ], "parameters": {}, "typeVersion": 1 }, { "name": "different", "type": "n8n-nodes-base.noOp", "position": [ 1500, 300 ], "parameters": {}, "typeVersion": 1 }, { "name": "new", "type": "n8n-nodes-base.noOp", "position": [ 1500, 460 ], "parameters": {}, "typeVersion": 1 }, { "name": "GitHub Edit", "type": "n8n-nodes-base.github", "position": [ 1700, 180 ], "parameters": { "owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}", "filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json", "resource": "file", "operation": "edit", "repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}", "fileContent": "={{$node[\"isDiffOrNew\"].json[\"n8n_data_stringy\"]}}", "commitMessage": "=[N8N Backup] {{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json ({{$json[\"github_status\"]}})" }, "credentials": { "githubApi": "GitHub" }, "typeVersion": 1 }, { "name": "GitHub Create", "type": "n8n-nodes-base.github", "position": [ 1700, 460 ], "parameters": { "owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}", "filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json", "resource": "file", "repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}", "fileContent": "={{$node[\"isDiffOrNew\"].json[\"n8n_data_stringy\"]}}", "commitMessage": "=[N8N Backup] {{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json ({{$json[\"github_status\"]}})" }, "credentials": { "githubApi": "GitHub" }, "typeVersion": 1 }, { "name": "isDiffOrNew", "type": "n8n-nodes-base.function", "position": [ 1150, 300 ], "parameters": { "functionCode": "// File Returned with Content\nif (Object.keys(items[0].json).includes(\"content\")) {\n // Get JSON Objects\n var origWorkflow = eval(\"(\"+Buffer.from(items[0].json.content, 'base64').toString()+\")\");\n var n8nWorkflow = (items[1].json.data);\n \n // Order JSON Objects\n var orderedOriginal = {}\n var orderedActual = {}\n \n Object.keys(origWorkflow).sort().forEach(function(key) {\n orderedOriginal[key] = origWorkflow[key];\n });\n \n Object.keys(n8nWorkflow).sort().forEach(function(key) {\n orderedActual[key] = n8nWorkflow[key];\n });\n \n // Determine Difference\n if ( JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual) ) {\n items[0].json.github_status = \"same\";\n items[0].json.content_decoded = orderedOriginal;\n } else {\n items[0].json.github_status = \"different\";\n items[0].json.content_decoded = orderedOriginal;\n items[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n }\n// No File Returned / New Workflow\n} else {\n // Order JSON Object\n var n8nWorkflow = (items[1].json.data);\n var orderedActual = {}\n Object.keys(n8nWorkflow).sort().forEach(function(key) {\n orderedActual[key] = n8nWorkflow[key];\n });\n \n // Proper Formatting\n items[0].json.github_status = \"new\";\n items[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n}\n\n// Return Items\nreturn items;" }, "typeVersion": 1 }, { "name": "Daily @ 20:00", "type": "n8n-nodes-base.cron", "position": [ 0, 450 ], "parameters": { "triggerTimes": { "item": [ { "hour": 20, "minute": 11 } ] } }, "typeVersion": 1 }, { "name": "OneAtATime", "type": "n8n-nodes-base.splitInBatches", "position": [ 600, 300 ], "parameters": { "options": {}, "batchSize": 1 }, "typeVersion": 1 }, { "name": "Globals", "type": "n8n-nodes-base.set", "position": [ 150, 300 ], "parameters": { "values": { "string": [ { "name": "repo.owner", "value": "octocat" }, { "name": "repo.name", "value": "Hello-World" }, { "name": "repo.path", "value": "my-team/n8n/workflows/" } ] }, "options": {} }, "typeVersion": 1 } ], "connections": { "new": { "main": [ [ { "node": "GitHub Create", "type": "main", "index": 0 } ] ] }, "same": { "main": [ [ { "node": "OneAtATime", "type": "main", "index": 0 } ] ] }, "Merge": { "main": [ [ { "node": "isDiffOrNew", "type": "main", "index": 0 } ] ] }, "GitHub": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Globals": { "main": [ [ { "node": "N8N Workflows", "type": "main", "index": 0 } ] ] }, "dataArray": { "main": [ [ { "node": "OneAtATime", "type": "main", "index": 0 } ] ] }, "different": { "main": [ [ { "node": "GitHub Edit", "type": "main", "index": 0 } ] ] }, "OneAtATime": { "main": [ [ { "node": "GitHub", "type": "main", "index": 0 }, { "node": "N8N Workflow Detail", "type": "main", "index": 0 } ] ] }, "GitHub Edit": { "main": [ [ { "node": "OneAtATime", "type": "main", "index": 0 } ] ] }, "isDiffOrNew": { "main": [ [ { "node": "github_status", "type": "main", "index": 0 } ] ] }, "Daily @ 20:00": { "main": [ [ { "node": "Globals", "type": "main", "index": 0 } ] ] }, "GitHub Create": { "main": [ [ { "node": "OneAtATime", "type": "main", "index": 0 } ] ] }, "N8N Workflows": { "main": [ [ { "node": "dataArray", "type": "main", "index": 0 } ] ] }, "github_status": { "main": [ [ { "node": "same", "type": "main", "index": 0 } ], [ { "node": "different", "type": "main", "index": 0 } ], [ { "node": "new", "type": "main", "index": 0 } ] ] }, "N8N Workflow Detail": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Globals", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"On clicking 'execute'\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 0,\n 150\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"dataArray\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 450,\n 300\n ],\n \"parameters\": {\n \"functionCode\": \"const newItems = [];\\nfor (item of items[0].json.data) {\\n newItems.push({json: item});\\n}\\nreturn newItems;\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"N8N Workflows\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 300,\n 300\n ],\n \"parameters\": {\n \"url\": \"http://localhost:8443/rest/workflows\",\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"GitHub\",\n \"type\": \"n8n-nodes-base.github\",\n \"position\": [\n 800,\n 130\n ],\n \"parameters\": {\n \"owner\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"owner\\\"]}}\",\n \"filePath\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"path\\\"]}}{{$json[\\\"name\\\"]}}.json\",\n \"resource\": \"file\",\n \"operation\": \"get\",\n \"repository\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"name\\\"]}}\",\n \"asBinaryProperty\": false\n },\n \"credentials\": {\n \"githubApi\": \"GitHub\"\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true,\n \"alwaysOutputData\": true\n },\n {\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1000,\n 300\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"N8N Workflow Detail\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 800,\n 460\n ],\n \"parameters\": {\n \"url\": \"=http://localhost:8443/rest/workflows/{{$json[\\\"id\\\"]}}\",\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"github_status\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 1300,\n 300\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"same\"\n },\n {\n \"output\": 1,\n \"value2\": \"different\"\n },\n {\n \"output\": 2,\n \"value2\": \"new\"\n }\n ]\n },\n \"value1\": \"={{$json[\\\"github_status\\\"]}}\",\n \"dataType\": \"string\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"same\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1500,\n 130\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"different\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1500,\n 300\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"new\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1500,\n 460\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"GitHub Edit\",\n \"type\": \"n8n-nodes-base.github\",\n \"position\": [\n 1700,\n 180\n ],\n \"parameters\": {\n \"owner\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"owner\\\"]}}\",\n \"filePath\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"path\\\"]}}{{$node[\\\"N8N Workflow Detail\\\"].json[\\\"data\\\"][\\\"name\\\"]}}.json\",\n \"resource\": \"file\",\n \"operation\": \"edit\",\n \"repository\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"name\\\"]}}\",\n \"fileContent\": \"={{$node[\\\"isDiffOrNew\\\"].json[\\\"n8n_data_stringy\\\"]}}\",\n \"commitMessage\": \"=[N8N Backup] {{$node[\\\"N8N Workflow Detail\\\"].json[\\\"data\\\"][\\\"name\\\"]}}.json ({{$json[\\\"github_status\\\"]}})\"\n },\n \"credentials\": {\n \"githubApi\": \"GitHub\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"GitHub Create\",\n \"type\": \"n8n-nodes-base.github\",\n \"position\": [\n 1700,\n 460\n ],\n \"parameters\": {\n \"owner\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"owner\\\"]}}\",\n \"filePath\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"path\\\"]}}{{$node[\\\"N8N Workflow Detail\\\"].json[\\\"data\\\"][\\\"name\\\"]}}.json\",\n \"resource\": \"file\",\n \"repository\": \"={{$node[\\\"Globals\\\"].json[\\\"repo\\\"][\\\"name\\\"]}}\",\n \"fileContent\": \"={{$node[\\\"isDiffOrNew\\\"].json[\\\"n8n_data_stringy\\\"]}}\",\n \"commitMessage\": \"=[N8N Backup] {{$node[\\\"N8N Workflow Detail\\\"].json[\\\"data\\\"][\\\"name\\\"]}}.json ({{$json[\\\"github_status\\\"]}})\"\n },\n \"credentials\": {\n \"githubApi\": \"GitHub\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"isDiffOrNew\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1150,\n 300\n ],\n \"parameters\": {\n \"functionCode\": \"// File Returned with Content\\nif (Object.keys(items[0].json).includes(\\\"content\\\")) {\\n // Get JSON Objects\\n var origWorkflow = eval(\\\"(\\\"+Buffer.from(items[0].json.content, 'base64').toString()+\\\")\\\");\\n var n8nWorkflow = (items[1].json.data);\\n \\n // Order JSON Objects\\n var orderedOriginal = {}\\n var orderedActual = {}\\n \\n Object.keys(origWorkflow).sort().forEach(function(key) {\\n orderedOriginal[key] = origWorkflow[key];\\n });\\n \\n Object.keys(n8nWorkflow).sort().forEach(function(key) {\\n orderedActual[key] = n8nWorkflow[key];\\n });\\n \\n // Determine Difference\\n if ( JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual) ) {\\n items[0].json.github_status = \\\"same\\\";\\n items[0].json.content_decoded = orderedOriginal;\\n } else {\\n items[0].json.github_status = \\\"different\\\";\\n items[0].json.content_decoded = orderedOriginal;\\n items[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\\n }\\n// No File Returned / New Workflow\\n} else {\\n // Order JSON Object\\n var n8nWorkflow = (items[1].json.data);\\n var orderedActual = {}\\n Object.keys(n8nWorkflow).sort().forEach(function(key) {\\n orderedActual[key] = n8nWorkflow[key];\\n });\\n \\n // Proper Formatting\\n items[0].json.github_status = \\\"new\\\";\\n items[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\\n}\\n\\n// Return Items\\nreturn items;\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Daily @ 20:00\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n 0,\n 450\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"hour\": 20,\n \"minute\": 11\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"OneAtATime\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 600,\n 300\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": 1\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Globals\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 150,\n 300\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"repo.owner\",\n \"value\": \"octocat\"\n },\n {\n \"name\": \"repo.name\",\n \"value\": \"Hello-World\"\n },\n {\n \"name\": \"repo.path\",\n \"value\": \"my-team/n8n/workflows/\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"new\": {\n \"main\": [\n [\n {\n \"node\": \"GitHub Create\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"same\": {\n \"main\": [\n [\n {\n \"node\": \"OneAtATime\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"isDiffOrNew\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GitHub\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Globals\": {\n \"main\": [\n [\n {\n \"node\": \"N8N Workflows\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"dataArray\": {\n \"main\": [\n [\n {\n \"node\": \"OneAtATime\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"different\": {\n \"main\": [\n [\n {\n \"node\": \"GitHub Edit\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OneAtATime\": {\n \"main\": [\n [\n {\n \"node\": \"GitHub\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"N8N Workflow Detail\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GitHub Edit\": {\n \"main\": [\n [\n {\n \"node\": \"OneAtATime\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"isDiffOrNew\": {\n \"main\": [\n [\n {\n \"node\": \"github_status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Daily @ 20:00\": {\n \"main\": [\n [\n {\n \"node\": \"Globals\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GitHub Create\": {\n \"main\": [\n [\n {\n \"node\": \"OneAtATime\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"N8N Workflows\": {\n \"main\": [\n [\n {\n \"node\": \"dataArray\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"github_status\": {\n \"main\": [\n [\n {\n \"node\": \"same\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"different\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"new\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"N8N Workflow Detail\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"On clicking 'execute'\": {\n \"main\": [\n [\n {\n \"node\": \"Globals\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
12
0
1
false
combined_workflows.json
{ "input": "The workflow backs up n8n workflows to a GitHub repository, checking for changes and updating the backup accordingly.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6917, "processed_size": 6917, "processed_timestamp": "2025-04-09T03:08:37.185615", "timestamp": "2025-04-09T02:35:28.254001", "token_count": 3838, "tokens": 584, "workflow_chunk_info": { "is_truncated": false, "original_size": 6917, "processed_size": 6917, "workflow_hash": "dd231d1b80f0905738b94dcec672a995" }, "workflow_hash": "dd231d1b80f0905738b94dcec672a995" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow monitors SSL certificate expiry dates for a list of websites, sending an email alert when a certificate is about to expire. Analyze this workflow: ```json { "id": "Qj1307oyBx1hZJy5", "meta": { "instanceId": "1abe0e4c2be794795d12bf72aa530a426a6f87aabad209ed6619bcaf0f666fb0", "templateCredsSetupCompleted": true }, "name": "SSL Expiry Alert", "tags": [ { "id": "aqlZb2qfWiaT4Xr5", "name": "IT Ops", "createdAt": "2025-01-03T12:20:11.917Z", "updatedAt": "2025-01-03T12:20:11.917Z" }, { "id": "zJaZorWWcGpTp35U", "name": "DevOps", "createdAt": "2025-01-03T12:19:34.273Z", "updatedAt": "2025-01-03T12:19:34.273Z" } ], "nodes": [ { "id": "260b66a2-0841-4dc7-9666-acbc9317fd91", "name": "URLs to Monitor", "type": "n8n-nodes-base.googleSheets", "position": [ 1120, -120 ], "parameters": { "columns": { "value": { "URL": "={{ $json.result.host }}", "KnownExpiryDate": "={{ $json.result.valid_till }}" }, "schema": [ { "id": "Website ", "type": "string", "display": true, "removed": true, "required": false, "displayName": "Website ", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "URL", "type": "string", "display": true, "removed": false, "required": false, "displayName": "URL", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "KnownExpiryDate", "type": "string", "display": true, "required": false, "displayName": "KnownExpiryDate", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "row_number", "type": "string", "display": true, "removed": true, "readOnly": true, "required": false, "displayName": "row_number", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [ "URL" ] }, "options": {}, "operation": "update", "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VfsX4cW2oKQ3ZHUjBvGk--d1X7509c6__b6gPvA5VpI/edit#gid=0", "cachedResultName": "URLs to Check" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/1VfsX4cW2oKQ3ZHUjBvGk--d1X7509c6__b6gPvA5VpI/edit?gid=0#gid=0" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "I7vwmkFVGPrI7Os1", "name": "Vishal - Google Sheets" } }, "typeVersion": 4.5 }, { "id": "a2922f1b-9d29-4b66-9560-44207f3e14d2", "name": "Weekly Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 160, 140 ], "parameters": { "rule": { "interval": [ { "field": "weeks", "triggerAtDay": [ 1 ], "triggerAtHour": 8 } ] } }, "typeVersion": 1.2 }, { "id": "005564e9-5ecb-4ee9-aca0-69a660656b09", "name": "Fetch URLs", "type": "n8n-nodes-base.googleSheets", "position": [ 420, 140 ], "parameters": { "options": {}, "sheetName": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/1pnUfIkD90MUG99Fp0vRoAB-w-GPSAwRZw0-JsNl-h3s/edit?gid=0#gid=0" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/1pnUfIkD90MUG99Fp0vRoAB-w-GPSAwRZw0-JsNl-h3s/edit?usp=sharing" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "I7vwmkFVGPrI7Os1", "name": "Vishal - Google Sheets" } }, "typeVersion": 4.5 }, { "id": "943c561c-ca89-461c-a6fb-c3011baaf81a", "name": "Check SSL", "type": "n8n-nodes-base.httpRequest", "position": [ 680, 140 ], "parameters": { "url": "=https://ssl-checker.io/api/v1/check/{{ $json[\"URL\"].replace(/^https?:\\/\\//, \"\").replace(/\\/$/, \"\") }}", "options": {} }, "typeVersion": 4.2 }, { "id": "911fa691-decf-4572-a46e-d8644d3b2a35", "name": "Expiry Alert", "type": "n8n-nodes-base.if", "position": [ 1120, 220 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "ee6e2ce8-569a-4f1f-91b5-2c55f605a16b", "operator": { "type": "number", "operation": "lte" }, "leftValue": "={{ $json.result.days_left }}", "rightValue": 7 } ] } }, "typeVersion": 2.2 }, { "id": "8b59ebbb-0a87-40c2-be79-cc38431ebdbd", "name": "Send Alert Email", "type": "n8n-nodes-base.gmail", "position": [ 1440, 240 ], "webhookId": "cd6b6b20-e619-4526-aa69-64754e3d9035", "parameters": { "sendTo": "phanineeraj@quantana.com", "message": "=SSL Expiry - {{ $json.result.days_left }} Days Left - {{ $json.result.host }}", "options": { "appendAttribution": false }, "subject": "=SSL Expiry - {{ $json.result.days_left }} Days Left - {{ $json.result.host }}", "emailType": "text" }, "credentials": { "gmailOAuth2": { "id": "brYm5tKb5se1DyUw", "name": "Sabila Gmail" } }, "typeVersion": 2.1 }, { "id": "32eebd68-f0e6-467c-bf65-f2d513a60666", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 100, 0 ], "parameters": { "height": 329.860465116279, "content": "Triggers the workflow once a week." }, "typeVersion": 1 }, { "id": "3c0ed796-94a4-488c-9cb7-e3d46db63815", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 360, 0 ], "parameters": { "height": 327.0154373927959, "content": "Pulls the list of URLs to monitor from the Google Sheet. Ensure you clone the Google Sheet worksheet and update this node with its URL." }, "typeVersion": 1 }, { "id": "fdb2077c-7d6a-4255-b499-e90513a0de1d", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 620, 0 ], "parameters": { "height": 323.89365351629556, "content": "Uses SSL-Checker.io to verify the SSL certificate of each URL. Fetches details like the host, validity period, and days remaining until expiry." }, "typeVersion": 1 }, { "id": "5cc1644b-6abc-4299-8a25-9507b09d863f", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1060, -260 ], "parameters": { "height": 344.1852487135509, "content": "Updates the Google Sheet with SSL details, including the expiry date and certificate status." }, "typeVersion": 1 }, { "id": "1001a69e-8efc-4a8b-a97b-a1bc021ada35", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1060, 140 ], "parameters": { "height": 344.1852487135509, "content": "Checks if any SSL certificate is set to expire in 7 days or less." }, "typeVersion": 1 }, { "id": "ad9e359e-3d95-4e8c-97b0-d06475bb8883", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1360, 140 ], "parameters": { "height": 344.1852487135509, "content": "Sends an email alert if an SSL certificate is nearing expiry, including the host and days remaining." }, "typeVersion": 1 } ], "active": false, "pinData": {}, "settings": { "timezone": "Asia/Kolkata", "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": "rL70w0U4LV2l9a5b", "executionOrder": "v1" }, "versionId": "f60d6e6e-dace-497a-b58b-113993ec36e5", "connections": { "Check SSL": { "main": [ [ { "node": "URLs to Monitor", "type": "main", "index": 0 }, { "node": "Expiry Alert", "type": "main", "index": 0 } ] ] }, "Fetch URLs": { "main": [ [ { "node": "Check SSL", "type": "main", "index": 0 } ] ] }, "Expiry Alert": { "main": [ [ { "node": "Send Alert Email", "type": "main", "index": 0 } ] ] }, "Weekly Trigger": { "main": [ [ { "node": "Fetch URLs", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"Qj1307oyBx1hZJy5\",\n \"meta\": {\n \"instanceId\": \"1abe0e4c2be794795d12bf72aa530a426a6f87aabad209ed6619bcaf0f666fb0\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"SSL Expiry Alert\",\n \"tags\": [\n {\n \"id\": \"aqlZb2qfWiaT4Xr5\",\n \"name\": \"IT Ops\",\n \"createdAt\": \"2025-01-03T12:20:11.917Z\",\n \"updatedAt\": \"2025-01-03T12:20:11.917Z\"\n },\n {\n \"id\": \"zJaZorWWcGpTp35U\",\n \"name\": \"DevOps\",\n \"createdAt\": \"2025-01-03T12:19:34.273Z\",\n \"updatedAt\": \"2025-01-03T12:19:34.273Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"260b66a2-0841-4dc7-9666-acbc9317fd91\",\n \"name\": \"URLs to Monitor\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 1120,\n -120\n ],\n \"parameters\": {\n \"columns\": {\n \"value\": {\n \"URL\": \"={{ $json.result.host }}\",\n \"KnownExpiryDate\": \"={{ $json.result.valid_till }}\"\n },\n \"schema\": [\n {\n \"id\": \"Website \",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": true,\n \"required\": false,\n \"displayName\": \"Website \",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"URL\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"URL\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"KnownExpiryDate\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"KnownExpiryDate\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"row_number\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": true,\n \"readOnly\": true,\n \"required\": false,\n \"displayName\": \"row_number\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"URL\"\n ]\n },\n \"options\": {},\n \"operation\": \"update\",\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1VfsX4cW2oKQ3ZHUjBvGk--d1X7509c6__b6gPvA5VpI/edit#gid=0\",\n \"cachedResultName\": \"URLs to Check\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/1VfsX4cW2oKQ3ZHUjBvGk--d1X7509c6__b6gPvA5VpI/edit?gid=0#gid=0\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"I7vwmkFVGPrI7Os1\",\n \"name\": \"Vishal - Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"a2922f1b-9d29-4b66-9560-44207f3e14d2\",\n \"name\": \"Weekly Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 160,\n 140\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"weeks\",\n \"triggerAtDay\": [\n 1\n ],\n \"triggerAtHour\": 8\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"005564e9-5ecb-4ee9-aca0-69a660656b09\",\n \"name\": \"Fetch URLs\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 420,\n 140\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/1pnUfIkD90MUG99Fp0vRoAB-w-GPSAwRZw0-JsNl-h3s/edit?gid=0#gid=0\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/1pnUfIkD90MUG99Fp0vRoAB-w-GPSAwRZw0-JsNl-h3s/edit?usp=sharing\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"I7vwmkFVGPrI7Os1\",\n \"name\": \"Vishal - Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"943c561c-ca89-461c-a6fb-c3011baaf81a\",\n \"name\": \"Check SSL\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 680,\n 140\n ],\n \"parameters\": {\n \"url\": \"=https://ssl-checker.io/api/v1/check/{{ $json[\\\"URL\\\"].replace(/^https?:\\\\/\\\\//, \\\"\\\").replace(/\\\\/$/, \\\"\\\") }}\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"911fa691-decf-4572-a46e-d8644d3b2a35\",\n \"name\": \"Expiry Alert\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1120,\n 220\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"ee6e2ce8-569a-4f1f-91b5-2c55f605a16b\",\n \"operator\": {\n \"type\": \"number\",\n \"operation\": \"lte\"\n },\n \"leftValue\": \"={{ $json.result.days_left }}\",\n \"rightValue\": 7\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"8b59ebbb-0a87-40c2-be79-cc38431ebdbd\",\n \"name\": \"Send Alert Email\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 1440,\n 240\n ],\n \"webhookId\": \"cd6b6b20-e619-4526-aa69-64754e3d9035\",\n \"parameters\": {\n \"sendTo\": \"phanineeraj@quantana.com\",\n \"message\": \"=SSL Expiry - {{ $json.result.days_left }} Days Left - {{ $json.result.host }}\",\n \"options\": {\n \"appendAttribution\": false\n },\n \"subject\": \"=SSL Expiry - {{ $json.result.days_left }} Days Left - {{ $json.result.host }}\",\n \"emailType\": \"text\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"brYm5tKb5se1DyUw\",\n \"name\": \"Sabila Gmail\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"32eebd68-f0e6-467c-bf65-f2d513a60666\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 100,\n 0\n ],\n \"parameters\": {\n \"height\": 329.860465116279,\n \"content\": \"Triggers the workflow once a week.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3c0ed796-94a4-488c-9cb7-e3d46db63815\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 360,\n 0\n ],\n \"parameters\": {\n \"height\": 327.0154373927959,\n \"content\": \"Pulls the list of URLs to monitor from the Google Sheet. Ensure you clone the Google Sheet worksheet and update this node with its URL.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fdb2077c-7d6a-4255-b499-e90513a0de1d\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 620,\n 0\n ],\n \"parameters\": {\n \"height\": 323.89365351629556,\n \"content\": \"Uses SSL-Checker.io to verify the SSL certificate of each URL. Fetches details like the host, validity period, and days remaining until expiry.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5cc1644b-6abc-4299-8a25-9507b09d863f\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1060,\n -260\n ],\n \"parameters\": {\n \"height\": 344.1852487135509,\n \"content\": \"Updates the Google Sheet with SSL details, including the expiry date and certificate status.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1001a69e-8efc-4a8b-a97b-a1bc021ada35\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1060,\n 140\n ],\n \"parameters\": {\n \"height\": 344.1852487135509,\n \"content\": \"Checks if any SSL certificate is set to expire in 7 days or less.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ad9e359e-3d95-4e8c-97b0-d06475bb8883\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1360,\n 140\n ],\n \"parameters\": {\n \"height\": 344.1852487135509,\n \"content\": \"Sends an email alert if an SSL certificate is nearing expiry, including the host and days remaining.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"timezone\": \"Asia/Kolkata\",\n \"callerPolicy\": \"workflowsFromSameOwner\",\n \"errorWorkflow\": \"rL70w0U4LV2l9a5b\",\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"f60d6e6e-dace-497a-b58b-113993ec36e5\",\n \"connections\": {\n \"Check SSL\": {\n \"main\": [\n [\n {\n \"node\": \"URLs to Monitor\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Expiry Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Fetch URLs\": {\n \"main\": [\n [\n {\n \"node\": \"Check SSL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Expiry Alert\": {\n \"main\": [\n [\n {\n \"node\": \"Send Alert Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Weekly Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Fetch URLs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
13
0
1
false
combined_workflows.json
{ "input": "The workflow monitors SSL certificate expiry dates for a list of websites, sending an email alert when a certificate is about to expire.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6729, "processed_size": 6729, "processed_timestamp": "2025-04-09T03:08:37.203645", "timestamp": "2025-04-09T02:35:28.315314", "token_count": 3982, "tokens": 594, "workflow_chunk_info": { "is_truncated": false, "original_size": 6729, "processed_size": 6729, "workflow_hash": "eaf0a3b948654578b8dd8a65fdb34f6a" }, "workflow_hash": "eaf0a3b948654578b8dd8a65fdb34f6a" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow generates an HTML page based on a user's text query using OpenAI's structured output capabilities. Analyze this workflow: ```json { "id": "eXiaTDyKfXpMeyLh", "meta": { "instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167", "templateCredsSetupCompleted": true }, "name": "Dynamically generate HTML page from user request using OpenAI Structured Output", "tags": [], "nodes": [ { "id": "b1d9659f-4cd0-4f87-844d-32b2af1dcf13", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 2160, 380 ], "parameters": { "options": { "responseHeaders": { "entries": [ { "name": "Content-Type", "value": "text/html; charset=UTF-8" } ] } }, "respondWith": "text", "responseBody": "={{ $json.html }}" }, "typeVersion": 1.1 }, { "id": "5ca8ad3e-7702-4f07-af24-d38e94fdc4ec", "name": "Open AI - Using Structured Output", "type": "n8n-nodes-base.httpRequest", "position": [ 1240, 380 ], "parameters": { "url": "https://api.openai.com/v1/chat/completions", "method": "POST", "options": {}, "jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a user interface designer and copy writter. Your job is to help users visualize their website ideas. You design elegant and simple webs, with professional text. You use Tailwind framework\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.query.query }}\"\n }\n ],\n \"response_format\":\n{\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"ui\",\n \"description\": \"Dynamically generated UI\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the UI component\",\n \"enum\": [\n \"div\",\n \"span\",\n \"a\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"img\",\n \"button\",\n \"input\",\n \"textarea\",\n \"select\",\n \"option\",\n \"label\",\n \"form\",\n \"table\",\n \"thead\",\n \"tbody\",\n \"tr\",\n \"th\",\n \"td\",\n \"nav\",\n \"header\",\n \"footer\",\n \"section\",\n \"article\",\n \"aside\",\n \"main\",\n \"figure\",\n \"figcaption\",\n \"blockquote\",\n \"q\",\n \"hr\",\n \"code\",\n \"pre\",\n \"iframe\",\n \"video\",\n \"audio\",\n \"canvas\",\n \"svg\",\n \"path\",\n \"circle\",\n \"rect\",\n \"line\",\n \"polyline\",\n \"polygon\",\n \"g\",\n \"use\",\n \"symbol\"\n]\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The label of the UI component, used for buttons or form fields\"\n },\n \"children\": {\n \"type\": \"array\",\n \"description\": \"Nested UI components\",\n \"items\": {\n \"$ref\": \"#\"\n }\n },\n \"attributes\": {\n \"type\": \"array\",\n \"description\": \"Arbitrary attributes for the UI component, suitable for any element using Tailwind framework\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the attribute, for example onClick or className\"\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"The value of the attribute using the Tailwind framework classes\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"name\", \"value\"]\n }\n }\n },\n \"required\": [\"type\", \"label\", \"children\", \"attributes\"],\n \"additionalProperties\": false\n }\n }\n}\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] }, "nodeCredentialType": "openAiApi" }, "credentials": { "openAiApi": { "id": "WqzqjezKh8VtxdqA", "name": "OpenAi account - Baptiste" } }, "typeVersion": 4.2 }, { "id": "24e5ca73-a3b3-4096-8c66-d84838d89b0c", "name": "OpenAI - JSON to HTML", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 1420, 380 ], "parameters": { "modelId": { "__rl": true, "mode": "list", "value": "gpt-4o-mini", "cachedResultName": "GPT-4O-MINI" }, "options": { "temperature": 0.2 }, "messages": { "values": [ { "role": "system", "content": "You convert a JSON to HTML. \nThe JSON output has the following fields:\n- html: the page HTML\n- title: the page title" }, { "content": "={{ $json.choices[0].message.content }}" } ] }, "jsonOutput": true }, "credentials": { "openAiApi": { "id": "WqzqjezKh8VtxdqA", "name": "OpenAi account - Baptiste" } }, "typeVersion": 1.3 }, { "id": "c50bdc84-ba59-4f30-acf7-496cee25068d", "name": "Format the HTML result", "type": "n8n-nodes-base.html", "position": [ 1940, 380 ], "parameters": { "html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <title>{{ $json.message.content.title }}</title>\n</head>\n<body>\n{{ $json.message.content.html }}\n</body>\n</html>" }, "typeVersion": 1.2 }, { "id": "193093f4-b1ce-4964-ab10-c3208e343c69", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1134, 62 ], "parameters": { "color": 7, "width": 638, "height": 503, "content": "## Generate HTML from user query\n\n**HTTP Request node**\n- Send the user query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The response format is inspired by the [Structured Output defined in OpenAI Introduction post](https://openai.com/index/introducing-structured-outputs-in-the-api)\n- The output is a JSON containing HTML components and attributed\n\n\n**OpenAI node**\n- Format the response from the previous node from JSON format to HTML format" }, "typeVersion": 1 }, { "id": "0371156a-211f-4d92-82b1-f14fe60d4b6b", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 60 ], "parameters": { "color": 7, "width": 768, "height": 503, "content": "## Workflow: Dynamically generate an HTML page from a user request using OpenAI Structured Output\n\n**Overview**\n- This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.\n- The Structured Output could be used in a variety of cases. Essentially, it guarantees the output from the GPT will follow a defined structure (JSON object).\n- It uses Tailwind CSS to make it slightly nicer, but any\n\n**How it works**\n- Once active, go to the production URL and add what you'd like to build as the parameter \"query\"\n- Example: https://production_url.com?query=a%20signup%20form\n- OpenAI nodes will first output the UI as a JSON then convert it to HTML\n- Finally, the response is integrated in a HTML container and rendered to the user\n\n**Further thoughts**\n- Results are not yet amazing, it is hard to see the direct value of such an experiment\n- But it showcase the potential of the Structured Output. Being able to guarantee the output format is key to build robust AI applications." }, "typeVersion": 1 }, { "id": "06380781-5189-4d99-9ecd-d8913ce40fd5", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 820, 380 ], "webhookId": "d962c916-6369-431a-9d80-af6e6a50fdf5", "parameters": { "path": "d962c916-6369-431a-9d80-af6e6a50fdf5", "options": { "allowedOrigins": "*" }, "responseMode": "responseNode" }, "typeVersion": 2 } ], "active": true, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "d2307a2a-5427-4769-94a6-10eab703a788", "connections": { "Webhook": { "main": [ [ { "node": "Open AI - Using Structured Output", "type": "main", "index": 0 } ] ] }, "OpenAI - JSON to HTML": { "main": [ [ { "node": "Format the HTML result", "type": "main", "index": 0 } ] ] }, "Format the HTML result": { "main": [ [ { "node": "Respond to Webhook", "type": "main", "index": 0 } ] ] }, "Open AI - Using Structured Output": { "main": [ [ { "node": "OpenAI - JSON to HTML", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"eXiaTDyKfXpMeyLh\",\n \"meta\": {\n \"instanceId\": \"f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Dynamically generate HTML page from user request using OpenAI Structured Output\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"b1d9659f-4cd0-4f87-844d-32b2af1dcf13\",\n \"name\": \"Respond to Webhook\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 2160,\n 380\n ],\n \"parameters\": {\n \"options\": {\n \"responseHeaders\": {\n \"entries\": [\n {\n \"name\": \"Content-Type\",\n \"value\": \"text/html; charset=UTF-8\"\n }\n ]\n }\n },\n \"respondWith\": \"text\",\n \"responseBody\": \"={{ $json.html }}\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"5ca8ad3e-7702-4f07-af24-d38e94fdc4ec\",\n \"name\": \"Open AI - Using Structured Output\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1240,\n 380\n ],\n \"parameters\": {\n \"url\": \"https://api.openai.com/v1/chat/completions\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"model\\\": \\\"gpt-4o-2024-08-06\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"system\\\",\\n \\\"content\\\": \\\"You are a user interface designer and copy writter. Your job is to help users visualize their website ideas. You design elegant and simple webs, with professional text. You use Tailwind framework\\\"\\n },\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"{{ $json.query.query }}\\\"\\n }\\n ],\\n \\\"response_format\\\":\\n{\\n \\\"type\\\": \\\"json_schema\\\",\\n \\\"json_schema\\\": {\\n \\\"name\\\": \\\"ui\\\",\\n \\\"description\\\": \\\"Dynamically generated UI\\\",\\n \\\"strict\\\": true,\\n \\\"schema\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"type\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"The type of the UI component\\\",\\n \\\"enum\\\": [\\n \\\"div\\\",\\n \\\"span\\\",\\n \\\"a\\\",\\n \\\"p\\\",\\n \\\"h1\\\",\\n \\\"h2\\\",\\n \\\"h3\\\",\\n \\\"h4\\\",\\n \\\"h5\\\",\\n \\\"h6\\\",\\n \\\"ul\\\",\\n \\\"ol\\\",\\n \\\"li\\\",\\n \\\"img\\\",\\n \\\"button\\\",\\n \\\"input\\\",\\n \\\"textarea\\\",\\n \\\"select\\\",\\n \\\"option\\\",\\n \\\"label\\\",\\n \\\"form\\\",\\n \\\"table\\\",\\n \\\"thead\\\",\\n \\\"tbody\\\",\\n \\\"tr\\\",\\n \\\"th\\\",\\n \\\"td\\\",\\n \\\"nav\\\",\\n \\\"header\\\",\\n \\\"footer\\\",\\n \\\"section\\\",\\n \\\"article\\\",\\n \\\"aside\\\",\\n \\\"main\\\",\\n \\\"figure\\\",\\n \\\"figcaption\\\",\\n \\\"blockquote\\\",\\n \\\"q\\\",\\n \\\"hr\\\",\\n \\\"code\\\",\\n \\\"pre\\\",\\n \\\"iframe\\\",\\n \\\"video\\\",\\n \\\"audio\\\",\\n \\\"canvas\\\",\\n \\\"svg\\\",\\n \\\"path\\\",\\n \\\"circle\\\",\\n \\\"rect\\\",\\n \\\"line\\\",\\n \\\"polyline\\\",\\n \\\"polygon\\\",\\n \\\"g\\\",\\n \\\"use\\\",\\n \\\"symbol\\\"\\n]\\n },\\n \\\"label\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"The label of the UI component, used for buttons or form fields\\\"\\n },\\n \\\"children\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"description\\\": \\\"Nested UI components\\\",\\n \\\"items\\\": {\\n \\\"$ref\\\": \\\"#\\\"\\n }\\n },\\n \\\"attributes\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"description\\\": \\\"Arbitrary attributes for the UI component, suitable for any element using Tailwind framework\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"name\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"The name of the attribute, for example onClick or className\\\"\\n },\\n \\\"value\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"The value of the attribute using the Tailwind framework classes\\\"\\n }\\n },\\n \\\"additionalProperties\\\": false,\\n \\\"required\\\": [\\\"name\\\", \\\"value\\\"]\\n }\\n }\\n },\\n \\\"required\\\": [\\\"type\\\", \\\"label\\\", \\\"children\\\", \\\"attributes\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n }\\n}\\n}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Content-Type\",\n \"value\": \"application/json\"\n }\n ]\n },\n \"nodeCredentialType\": \"openAiApi\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"24e5ca73-a3b3-4096-8c66-d84838d89b0c\",\n \"name\": \"OpenAI - JSON to HTML\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 1420,\n 380\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {\n \"temperature\": 0.2\n },\n \"messages\": {\n \"values\": [\n {\n \"role\": \"system\",\n \"content\": \"You convert a JSON to HTML. \\nThe JSON output has the following fields:\\n- html: the page HTML\\n- title: the page title\"\n },\n {\n \"content\": \"={{ $json.choices[0].message.content }}\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"c50bdc84-ba59-4f30-acf7-496cee25068d\",\n \"name\": \"Format the HTML result\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n 1940,\n 380\n ],\n \"parameters\": {\n \"html\": \"<!DOCTYPE html>\\n\\n<html>\\n<head>\\n <meta charset=\\\"UTF-8\\\" />\\n <script src=\\\"https://cdn.tailwindcss.com\\\"></script>\\n <title>{{ $json.message.content.title }}</title>\\n</head>\\n<body>\\n{{ $json.message.content.html }}\\n</body>\\n</html>\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"193093f4-b1ce-4964-ab10-c3208e343c69\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1134,\n 62\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 638,\n \"height\": 503,\n \"content\": \"## Generate HTML from user query\\n\\n**HTTP Request node**\\n- Send the user query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\\n- The response format is inspired by the [Structured Output defined in OpenAI Introduction post](https://openai.com/index/introducing-structured-outputs-in-the-api)\\n- The output is a JSON containing HTML components and attributed\\n\\n\\n**OpenAI node**\\n- Format the response from the previous node from JSON format to HTML format\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0371156a-211f-4d92-82b1-f14fe60d4b6b\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 0,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 768,\n \"height\": 503,\n \"content\": \"## Workflow: Dynamically generate an HTML page from a user request using OpenAI Structured Output\\n\\n**Overview**\\n- This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.\\n- The Structured Output could be used in a variety of cases. Essentially, it guarantees the output from the GPT will follow a defined structure (JSON object).\\n- It uses Tailwind CSS to make it slightly nicer, but any\\n\\n**How it works**\\n- Once active, go to the production URL and add what you'd like to build as the parameter \\\"query\\\"\\n- Example: https://production_url.com?query=a%20signup%20form\\n- OpenAI nodes will first output the UI as a JSON then convert it to HTML\\n- Finally, the response is integrated in a HTML container and rendered to the user\\n\\n**Further thoughts**\\n- Results are not yet amazing, it is hard to see the direct value of such an experiment\\n- But it showcase the potential of the Structured Output. Being able to guarantee the output format is key to build robust AI applications.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"06380781-5189-4d99-9ecd-d8913ce40fd5\",\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 820,\n 380\n ],\n \"webhookId\": \"d962c916-6369-431a-9d80-af6e6a50fdf5\",\n \"parameters\": {\n \"path\": \"d962c916-6369-431a-9d80-af6e6a50fdf5\",\n \"options\": {\n \"allowedOrigins\": \"*\"\n },\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 2\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"d2307a2a-5427-4769-94a6-10eab703a788\",\n \"connections\": {\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Open AI - Using Structured Output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI - JSON to HTML\": {\n \"main\": [\n [\n {\n \"node\": \"Format the HTML result\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Format the HTML result\": {\n \"main\": [\n [\n {\n \"node\": \"Respond to Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Open AI - Using Structured Output\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI - JSON to HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
14
0
1
false
combined_workflows.json
{ "input": "This workflow generates an HTML page based on a user's text query using OpenAI's structured output capabilities.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8076, "processed_size": 8076, "processed_timestamp": "2025-04-09T03:08:37.221617", "timestamp": "2025-04-09T02:35:28.790024", "token_count": 3521, "tokens": 808, "workflow_chunk_info": { "is_truncated": false, "original_size": 8076, "processed_size": 8076, "workflow_hash": "0da138a3982ff19b58c1560be5306b3e" }, "workflow_hash": "0da138a3982ff19b58c1560be5306b3e" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow aims to create an AI-powered SQL agent that can generate and display charts based on user queries, enhancing data visualization capabilities. Analyze this workflow: ```json { "meta": { "instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "50695e7f-3334-4124-a46e-1b3819412e26", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 1260, 560 ], "parameters": { "model": "gpt-4o", "options": { "temperature": 0.1 } }, "credentials": { "openAiApi": { "id": "WqzqjezKh8VtxdqA", "name": "OpenAi account - Baptiste" } }, "typeVersion": 1 }, { "id": "2f07481d-3ca4-48ab-a8ff-59e9ab5c6062", "name": "Execute Workflow", "type": "n8n-nodes-base.executeWorkflow", "position": [ 2360, 280 ], "parameters": { "options": { "waitForSubWorkflow": true }, "workflowId": { "__rl": true, "mode": "id", "value": "={{ $workflow.id }}" } }, "typeVersion": 1.1 }, { "id": "49120164-4ffc-4fe0-8ee3-4ae13bda6c8d", "name": "Execute \"Generate a chart\" tool", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 1320, 1140 ], "parameters": {}, "typeVersion": 1 }, { "id": "0fc6eaf9-8521-44ec-987e-73644d0cba79", "name": "OpenAI - Generate Chart definition with Structured Output", "type": "n8n-nodes-base.httpRequest", "position": [ 1620, 1140 ], "parameters": { "url": "https://api.openai.com/v1/chat/completions", "method": "POST", "options": {}, "jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Based on the user request, generate a valid Chart.js definition. Important: - Be careful with the data scale and beginatzero that all data are visible. Example if ploted data 2 and 3 on a bar chart, the baseline should be 0. - Charts colors should be different only if there are multiple datasets. - Output valid JSON. In scales, min and max are numbers. Example: `{scales:{yAxes:[{ticks:{min:0,max:3}`\"\n },\n {\n \"role\": \"user\",\n \"content\": \"**User Request**: {{ $json.user_question }} \\n **Data to visualize**: {{ $json.output.replaceAll('\\n', \" \").replaceAll('\"', \"\") }}\"\n }\n ],\n \"response_format\": {\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"chart_configuration\",\n \"description\": \"Configuration schema for Chart.js charts\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\"bar\", \"line\", \"radar\", \"pie\", \"doughnut\", \"polarArea\", \"bubble\", \"scatter\", \"area\"]\n },\n \"data\": {\n \"type\": \"object\",\n \"properties\": {\n \"labels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"datasets\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\n \"type\": [\"string\", \"null\"]\n },\n \"data\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n },\n \"backgroundColor\": {\n \"type\": [\"array\", \"null\"],\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"borderColor\": {\n \"type\": [\"array\", \"null\"],\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"borderWidth\": {\n \"type\": [\"number\", \"null\"]\n }\n },\n \"required\": [\"data\", \"label\", \"backgroundColor\", \"borderColor\", \"borderWidth\"],\n \"additionalProperties\": false\n }\n }\n },\n \"required\": [\"labels\", \"datasets\"],\n \"additionalProperties\": false\n },\n \"options\": {\n \"type\": \"object\",\n \"properties\": {\n \"scales\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"yAxes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"ticks\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"max\": {\n \"type\": [\"number\", \"null\"]\n },\n \"min\": {\n \"type\": [\"number\", \"null\"]\n },\n \"stepSize\": {\n \"type\": [\"number\", \"null\"]\n },\n \"beginAtZero\": {\n \"type\": [\"boolean\", \"null\"]\n }\n },\n \"required\": [\"max\", \"min\", \"stepSize\", \"beginAtZero\"],\n \"additionalProperties\": false\n },\n \"stacked\": {\n \"type\": [\"boolean\", \"null\"]\n }\n },\n \"required\": [\"ticks\", \"stacked\"],\n \"additionalProperties\": false\n }},\n \"xAxes\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"stacked\": {\n \"type\": [\"boolean\", \"null\"]\n }\n },\n \"required\": [\"stacked\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"yAxes\", \"xAxes\"],\n \"additionalProperties\": false\n },\n \"plugins\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"title\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"display\": {\n \"type\": [\"boolean\", \"null\"]\n },\n \"text\": {\n \"type\": [\"string\", \"null\"]\n }\n },\n \"required\": [\"display\", \"text\"],\n \"additionalProperties\": false\n },\n \"legend\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"display\": {\n \"type\": [\"boolean\", \"null\"]\n },\n \"position\": {\n \"type\": [\"string\", \"null\"],\n \"enum\": [\"top\", \"left\", \"bottom\", \"right\", null]\n }\n },\n \"required\": [\"display\", \"position\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"title\", \"legend\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"scales\", \"plugins\"],\n \"additionalProperties\": false\n }\n },\n \"required\": [\"type\", \"data\", \"options\"],\n \"additionalProperties\": false\n}\n}\n}\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "headerParameters": { "parameters": [ { "name": "=Content-Type", "value": "application/json" } ] }, "nodeCredentialType": "openAiApi" }, "credentials": { "openAiApi": { "id": "WqzqjezKh8VtxdqA", "name": "OpenAi account - Baptiste" } }, "typeVersion": 4.2 }, { "id": "8016a925-7b31-4a49-b5e1-56cf9b5fa7b3", "name": "Set response", "type": "n8n-nodes-base.set", "position": [ 1860, 1140 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "37512e1a-8376-4ba0-bdcd-34bb9329ae4b", "name": "output", "type": "string", "value": "={{ \"https://quickchart.io/chart?width=200&c=\" + encodeURIComponent($json.choices[0].message.content) }}" } ] } }, "typeVersion": 3.4 }, { "id": "9a2b8eca-5303-4eb0-8115-b0d81bfd1d7c", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 880, 380 ], "webhookId": "b0e681ae-e00d-450c-9300-2c2a4a0876df", "parameters": { "public": true, "options": {} }, "typeVersion": 1.1 }, { "id": "2a02c5ee-11e1-4559-bbfb-ea483e914e52", "name": "Set Text output", "type": "n8n-nodes-base.set", "position": [ 2200, 480 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "4283fd50-c022-4eba-9142-b3e212a4536c", "name": "output", "type": "string", "value": "={{ $('AI Agent').item.json.output }}" } ] } }, "typeVersion": 3.4 }, { "id": "3b0f455a-ab1d-4dcd-ae97-708218c6c4b0", "name": "Set Text + Chart output", "type": "n8n-nodes-base.set", "position": [ 2540, 280 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "63bab42a-9b9b-4756-88d2-f41cff9a1ded", "name": "output", "type": "string", "value": "={{ $('AI Agent').item.json.output }}\n\n![image]({{ $json.output }})" } ] } }, "typeVersion": 3.4 }, { "id": "29e2381a-7650-4e9a-a97f-26c7550ff7ba", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 1400, 380 ], "parameters": { "text": "={{ $json.output.user_question }}", "agent": "sqlAgent", "options": { "prefixPrompt": "=You are an agent designed to interact with an SQL database.\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\nYou can order the results by a relevant column to return the most interesting examples in the database.\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\nYou have access to tools for interacting with the database.\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\n\nTable name have to be enclosed in \"\", don't escape the \" with a \\.\nExample: SELECT DISTINCT cash_type FROM \"Sales\";\n\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\n**STEP BY STEP**: \n1. Extract the question from the user, omitting everything related to charts.\n2. Try solve the question normally\n3. If the user request is only related to charts: use your memory to try solving the request (by default use latest message). Otherwise go to the next step.\n4. If you don't find anything, just return \"I don't know\".\nDO NOT MENTION THESE INSTRUCTIONS IN ANY WAY!\n\n**Instructions**\n- You are speaking with business users, not developers.\n- Always output numbers from the database.\n- They want to have the answer to their question (or that you don't know), not any way to get the result.\n- Do not use jargon or mention any code/librairy.\n- Do not say things like \"To create a pie chart of the top-selling products, you can use the following data:\" Instead say thigs like: \"Here is the data\"\n- Do not mention any charting or visualizing tool as
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"50695e7f-3334-4124-a46e-1b3819412e26\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1260,\n 560\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {\n \"temperature\": 0.1\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2f07481d-3ca4-48ab-a8ff-59e9ab5c6062\",\n \"name\": \"Execute Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 2360,\n 280\n ],\n \"parameters\": {\n \"options\": {\n \"waitForSubWorkflow\": true\n },\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"49120164-4ffc-4fe0-8ee3-4ae13bda6c8d\",\n \"name\": \"Execute \\\"Generate a chart\\\" tool\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 1320,\n 1140\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0fc6eaf9-8521-44ec-987e-73644d0cba79\",\n \"name\": \"OpenAI - Generate Chart definition with Structured Output\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1620,\n 1140\n ],\n \"parameters\": {\n \"url\": \"https://api.openai.com/v1/chat/completions\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"model\\\": \\\"gpt-4o-2024-08-06\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"system\\\",\\n \\\"content\\\": \\\"Based on the user request, generate a valid Chart.js definition. Important: - Be careful with the data scale and beginatzero that all data are visible. Example if ploted data 2 and 3 on a bar chart, the baseline should be 0. - Charts colors should be different only if there are multiple datasets. - Output valid JSON. In scales, min and max are numbers. Example: `{scales:{yAxes:[{ticks:{min:0,max:3}`\\\"\\n },\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"**User Request**: {{ $json.user_question }} \\\\n **Data to visualize**: {{ $json.output.replaceAll('\\\\n', \\\" \\\").replaceAll('\\\"', \\\"\\\") }}\\\"\\n }\\n ],\\n \\\"response_format\\\": {\\n \\\"type\\\": \\\"json_schema\\\",\\n \\\"json_schema\\\": {\\n \\\"name\\\": \\\"chart_configuration\\\",\\n \\\"description\\\": \\\"Configuration schema for Chart.js charts\\\",\\n \\\"strict\\\": true,\\n \\\"schema\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"type\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"enum\\\": [\\\"bar\\\", \\\"line\\\", \\\"radar\\\", \\\"pie\\\", \\\"doughnut\\\", \\\"polarArea\\\", \\\"bubble\\\", \\\"scatter\\\", \\\"area\\\"]\\n },\\n \\\"data\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"labels\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"datasets\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"label\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"]\\n },\\n \\\"data\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n },\\n \\\"backgroundColor\\\": {\\n \\\"type\\\": [\\\"array\\\", \\\"null\\\"],\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"borderColor\\\": {\\n \\\"type\\\": [\\\"array\\\", \\\"null\\\"],\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"borderWidth\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"data\\\", \\\"label\\\", \\\"backgroundColor\\\", \\\"borderColor\\\", \\\"borderWidth\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n }\\n },\\n \\\"required\\\": [\\\"labels\\\", \\\"datasets\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"options\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"scales\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"yAxes\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"ticks\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"max\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"min\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"stepSize\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"beginAtZero\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"max\\\", \\\"min\\\", \\\"stepSize\\\", \\\"beginAtZero\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"stacked\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"ticks\\\", \\\"stacked\\\"],\\n \\\"additionalProperties\\\": false\\n }},\\n \\\"xAxes\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"stacked\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"stacked\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"yAxes\\\", \\\"xAxes\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"plugins\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"title\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"display\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n },\\n \\\"text\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"display\\\", \\\"text\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"legend\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"display\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n },\\n \\\"position\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"],\\n \\\"enum\\\": [\\\"top\\\", \\\"left\\\", \\\"bottom\\\", \\\"right\\\", null]\\n }\\n },\\n \\\"required\\\": [\\\"display\\\", \\\"position\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"title\\\", \\\"legend\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"scales\\\", \\\"plugins\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"type\\\", \\\"data\\\", \\\"options\\\"],\\n \\\"additionalProperties\\\": false\\n}\\n}\\n}\\n}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"=Content-Type\",\n \"value\": \"application/json\"\n }\n ]\n },\n \"nodeCredentialType\": \"openAiApi\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"8016a925-7b31-4a49-b5e1-56cf9b5fa7b3\",\n \"name\": \"Set response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1860,\n 1140\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"37512e1a-8376-4ba0-bdcd-34bb9329ae4b\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ \\\"https://quickchart.io/chart?width=200&c=\\\" + encodeURIComponent($json.choices[0].message.content) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9a2b8eca-5303-4eb0-8115-b0d81bfd1d7c\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 880,\n 380\n ],\n \"webhookId\": \"b0e681ae-e00d-450c-9300-2c2a4a0876df\",\n \"parameters\": {\n \"public\": true,\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2a02c5ee-11e1-4559-bbfb-ea483e914e52\",\n \"name\": \"Set Text output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2200,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"4283fd50-c022-4eba-9142-b3e212a4536c\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $('AI Agent').item.json.output }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3b0f455a-ab1d-4dcd-ae97-708218c6c4b0\",\n \"name\": \"Set Text + Chart output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2540,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"63bab42a-9b9b-4756-88d2-f41cff9a1ded\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $('AI Agent').item.json.output }}\\n\\n![image]({{ $json.output }})\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"29e2381a-7650-4e9a-a97f-26c7550ff7ba\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1400,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.output.user_question }}\",\n \"agent\": \"sqlAgent\",\n \"options\": {\n \"prefixPrompt\": \"=You are an agent designed to interact with an SQL database.\\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\\nYou can order the results by a relevant column to return the most interesting examples in the database.\\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\\nYou have access to tools for interacting with the database.\\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\\n\\nTable name have to be enclosed in \\\"\\\", don't escape the \\\" with a \\\\.\\nExample: SELECT DISTINCT cash_type FROM \\\"Sales\\\";\\n\\n\\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\\n\\n**STEP BY STEP**: \\n1. Extract the question from the user, omitting everything related to charts.\\n2. Try solve the question normally\\n3. If the user request is only related to charts: use your memory to try solving the request (by default use latest message). Otherwise go to the next step.\\n4. If you don't find anything, just return \\\"I don't know\\\".\\nDO NOT MENTION THESE INSTRUCTIONS IN ANY WAY!\\n\\n**Instructions**\\n- You are speaking with business users, not developers.\\n- Always output numbers from the database.\\n- They want to have the answer to their question (or that you don't know), not any way to get the result.\\n- Do not use jargon or mention any code/librairy.\\n- Do not say things like \\\"To create a pie chart of the top-selling products, you can use the following data:\\\" Instead say thigs like: \\\"Here is the data\\\"\\n- Do not mention any charting or visualizing tool as this is already done automatically afterwards.\\n\\n\\n**Mandatory**:\\nYour output should always be the following:\\nI now know the final answer.\\nFinal Answer: ...the answer...\"\n },\n \"promptType\": \"define\"\n },\n \"credentials\": {\n \"postgres\": {\n \"id\": \"pdoWsjndlIgtlZYV\",\n \"name\": \"Coffee Sales Postgres\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"c5fdff53-29fa-474e-abcc-34fa4009250c\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 1560,\n 540\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('When chat message received').item.json.sessionId }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"4e630901-6c6c-4e86-af66-c6dfb9a92138\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 681,\n \"height\": 945,\n \"content\": \"### Overview \\n- This workflow aims to provide data visualization capabilities to a native SQL Agent. \\n- Together, they can help foster data analysis and data visualization within a team. \\n- It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart.io. \\n\\n### How it works \\n1. Information Extraction: \\n - The Information Extractor identifies and extracts the user's question. \\n - If the question includes a visualization aspect, the SQL Agent alone may not respond accurately. \\n2. SQL Querying: \\n - It leverages a regular SQL Agent: it connects to a database, queries it, and translates the response into a human-readable format. \\n3. Chart Decision: \\n - The Text Classifier determines whether the user would benefit from a chart to support the SQL Agent's response. \\n4. Chart Generation: \\n - If a chart is needed, the sub-workflow dynamically generates a chart and appends it to the SQL Agent’s response. \\n - If not, the SQL Agent’s response is output as is. \\n5. Calling OpenAI for Chart Definition: \\n - The sub-workflow calls OpenAI via the HTTP Request node to retrieve a chart definition. \\n6. Building and Returning the Chart: \\n - In the \\\"Set Response\\\" node, the chart definition is appended to a Quickchart.io URL, generating the final chart image. \\n - The AI Agent returns the response along with the chart. \\n\\n### How to use it \\n- Use an existing database or create a new one. \\n- For example, I've used [this Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download) and uploaded it to a Supabase DB. \\n- Add the PostgreSQL or MySQL credentials. \\n- Alternatively, you can use SQLite binary files (check [this template](https://n8n.io/workflows/2292-talk-to-your-sqlite-database-with-a-langchain-ai-agent/)). \\n- Activate the workflow. \\n- Start chatting with the AI SQL Agent. \\n- If the Text Classifier determines a chart would be useful, it will generate one in addition to the SQL Agent's response. \\n\\n### Notes \\n- The full Quickchart.io specifications have not been fully integrated, so there may be some glitches (e.g., radar graphs may not display properly due to size limitations). \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"36d7b17f-c7df-4a0a-8781-626dc1edddee\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1260,\n 800\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 769,\n \"height\": 523,\n \"content\": \"## Generate a Quickchart definition \\n[Original template](https://n8n.io/workflows/2400-ai-agent-with-charts-capabilities-using-openai-structured-output-and-quickchart/)\\n\\n**HTTP Request node**\\n- Send the chart query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\\n- The JSON structure is based on ChartJS and Quickchart.io definitions, that let us create nice looking graphs.\\n- The output is a JSON containing the chart definition that is passed to the next node.\\n\\n**Set Response node**\\n- Adds the chart definition at the end of a Quickchart.io URL ([see documentation](https://quickchart.io/documentation/usage/parameters/))\\n- Note that in the parameters, we specify the width to 250 in order to be properly displayed in the chart interface.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9ccea33b-c5d9-422e-a5b9-11efbc05ab1a\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 888,\n \"height\": 646,\n \"content\": \"### Information Extractor \\n- This Information Extractor is added to extract the user's question\\n- In some cases, if the question contains a visualization aspect, the SQL Agent may not responding accurately.\\n\\n### SQL Agent\\n- This SQL Agent is connected to a Database.\\n- It queries the Database for each user message.\\n- In this example, the prompt has been slightly changed to address an issue with querying a Supabase DB. Feel free to change the `Prefix Prompt` to suit your needs.\\n- This example uses the data from this [Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d8bf0767-faf0-4030-b325-08315188adcb\",\n \"name\": \"OpenAI Chat Model Classifier\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1900,\n 540\n ],\n \"parameters\": {\n \"options\": {\n \"temperature\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4bcd676f-44f3-4242-a5fd-7cf2098a3a64\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1760,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 948,\n \"height\": 646,\n \"content\": \"### Respond with a text only or also include a chart \\n- The text classifier determines if the response from the SQL Agent would benefit from a chart\\n- If it does, then it executes the subworkflow to dynamically generate a chart, and append the chart to the response from the SQL Agent\\n- If it doesn't, then the SQL Agent response is directly outputted. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"256cb28b-0d83-4f6d-bb11-33745c9efa4a\",\n \"name\": \"Text Classifier - Chart required?\",\n \"type\": \"@n8n/n8n-nodes-langchain.textClassifier\",\n \"position\": [\n 1800,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"inputText\": \"=**User Request**: {{ $('When chat message received').item.json.chatInput }}\\n**Data to visualize**: {{ $json.output }}\\n\",\n \"categories\": {\n \"categories\": [\n {\n \"category\": \"chart_required\",\n \"description\": \"If a chart can help the user understand the response (if there are multiple data to show) or if the user specifically request a chart. \"\n },\n {\n \"category\": \"chart_not_required\",\n \"description\": \"if a chart doesn't help the user understand the response (e.g a single data point that doesn't require visualization).\\n\\\"I don't know\\\" does fall into this category\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6df60db5-19c0-4585-a229-b56f4b9a2b29\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n 1020\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 680,\n \"height\": 720,\n \"content\": \"## Demo\\n![Demo SQL Agent](https://media.licdn.com/dms/image/v2/D4E22AQERT4FEXEUncw/feedshare-shrink_800/feedshare-shrink_800/0/1731433289953?e=1741824000&v=beta&t=e6xUqjcsSq5U_NELeD-nn1mFROGYZLazkYC0eELTv5Y)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a843845d-e010-4a09-ab50-e169beb67811\",\n \"name\": \"User question + Agent initial response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2200,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"debab41c-da64-4999-a80f-fae06522d672\",\n \"name\": \"user_question\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.chatInput }}\"\n },\n {\n \"id\": \"2b4bbf7f-9890-4ef3-9d8f-15e3a55fbfda\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $json.output }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"12c9dc38-c0fe-4f4c-a101-ec1ff7ea9048\",\n \"name\": \"Information Extractor - User question\",\n \"type\": \"@n8n/n8n-nodes-langchain.informationExtractor\",\n \"position\": [\n 1060,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"attributes\": {\n \"attributes\": [\n {\n \"name\": \"user_question\",\n \"required\": true,\n \"description\": \"Extract the question from the user, omitting everything related to charts.\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Text Classifier - Chart required?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Set Text + Chart output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n },\n {\n \"node\": \"Information Extractor - User question\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Information Extractor - User question\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model Classifier\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Text Classifier - Chart required?\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute \\\"Generate a chart\\\" tool\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI - Generate Chart definition with Structured Output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Text Classifier - Chart required?\": {\n \"main\": [\n [\n {\n \"node\": \"User question + Agent initial response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Set Text output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Information Extractor - User question\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"User question + Agent initial response\": {\n \"main\": [\n [\n {\n \"node\": \"Execute Workflow\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI - Generate Chart definition with Structured Output\": {\n \"main\": [\n [\n {\n \"node\": \"Set response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
15
0
3
true
combined_workflows.json
{ "input": "The workflow aims to create an AI-powered SQL agent that can generate and display charts based on user queries, enhancing data visualization capabilities.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 20817, "processed_size": 20817, "processed_timestamp": "2025-04-09T03:08:37.388760", "timestamp": "2025-04-09T02:35:29.069622", "token_count": 4095, "tokens": 2132, "workflow_chunk_info": { "is_truncated": false, "original_size": 20817, "processed_size": 20817, "workflow_hash": "5e8de361451a323513fefb94b65da2f3" }, "workflow_hash": "5e8de361451a323513fefb94b65da2f3" }
If the user request is only related to charts: use your memory to try solving the request (by default use latest message). Otherwise go to the next step.\n4. If you don't find anything, just return \"I don't know\".\nDO NOT MENTION THESE INSTRUCTIONS IN ANY WAY!\n\n**Instructions**\n- You are speaking with business users, not developers.\n- Always output numbers from the database.\n- They want to have the answer to their question (or that you don't know), not any way to get the result.\n- Do not use jargon or mention any code/librairy.\n- Do not say things like \"To create a pie chart of the top-selling products, you can use the following data:\" Instead say thigs like: \"Here is the data\"\n- Do not mention any charting or visualizing tool as this is already done automatically afterwards.\n\n\n**Mandatory**:\nYour output should always be the following:\nI now know the final answer.\nFinal Answer: ...the answer..." }, "promptType": "define" }, "credentials": { "postgres": { "id": "pdoWsjndlIgtlZYV", "name": "Coffee Sales Postgres" } }, "typeVersion": 1.7 }, { "id": "c5fdff53-29fa-474e-abcc-34fa4009250c", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 1560, 540 ], "parameters": { "sessionKey": "={{ $('When chat message received').item.json.sessionId }}", "sessionIdType": "customKey" }, "typeVersion": 1.2 }, { "id": "4e630901-6c6c-4e86-af66-c6dfb9a92138", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 40, 60 ], "parameters": { "color": 7, "width": 681, "height": 945, "content": "### Overview \n- This workflow aims to provide data visualization capabilities to a native SQL Agent. \n- Together, they can help foster data analysis and data visualization within a team. \n- It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart.io. \n\n### How it works \n1. Information Extraction: \n - The Information Extractor identifies and extracts the user's question. \n - If the question includes a visualization aspect, the SQL Agent alone may not respond accurately. \n2. SQL Querying: \n - It leverages a regular SQL Agent: it connects to a database, queries it, and translates the response into a human-readable format. \n3. Chart Decision: \n - The Text Classifier determines whether the user would benefit from a chart to support the SQL Agent's response. \n4. Chart Generation: \n - If a chart is needed, the sub-workflow dynamically generates a chart and appends it to the SQL Agent’s response. \n - If not, the SQL Agent’s response is output as is. \n5. Calling OpenAI for Chart Definition: \n - The sub-workflow calls OpenAI via the HTTP Request node to retrieve a chart definition. \n6. Building and Returning the Chart: \n - In the \"Set Response\" node, the chart definition is appended to a Quickchart.io URL, generating the final chart image. \n - The AI Agent returns the response along with the chart. \n\n### How to use it \n- Use an existing database or create a new one. \n- For example, I've used [this Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download) and uploaded it to a Supabase DB. \n- Add the PostgreSQL or MySQL credentials. \n- Alternatively, you can use SQLite binary files (check [this template](https://n8n.io/workflows/2292-talk-to-your-sqlite-database-with-a-langchain-ai-agent/)). \n- Activate the workflow. \n- Start chatting with the AI SQL Agent. \n- If the Text Classifier determines a chart would be useful, it will generate one in addition to the SQL Agent's response. \n\n### Notes \n- The full Quickchart.io specifications have not been fully integrated, so there may be some glitches (e.g., radar graphs may not display properly due to size limitations). " }, "typeVersion": 1 }, { "id": "36d7b17f-c7df-4a0a-8781-626dc1edddee", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1260, 800 ], "parameters": { "color": 7, "width": 769, "height": 523, "content": "## Generate a Quickchart definition \n[Original template](https://n8n.io/workflows/2400-ai-agent-with-charts-capabilities-using-openai-structured-output-and-quickchart/)\n\n**HTTP Request node**\n- Send the chart query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The JSON structure is based on ChartJS and Quickchart.io definitions, that let us create nice looking graphs.\n- The output is a JSON containing the chart definition that is passed to the next node.\n\n**Set Response node**\n- Adds the chart definition at the end of a Quickchart.io URL ([see documentation](https://quickchart.io/documentation/usage/parameters/))\n- Note that in the parameters, we specify the width to 250 in order to be properly displayed in the chart interface." }, "typeVersion": 1 }, { "id": "9ccea33b-c5d9-422e-a5b9-11efbc05ab1a", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 840, 60 ], "parameters": { "color": 7, "width": 888, "height": 646, "content": "### Information Extractor \n- This Information Extractor is added to extract the user's question\n- In some cases, if the question contains a visualization aspect, the SQL Agent may not responding accurately.\n\n### SQL Agent\n- This SQL Agent is connected to a Database.\n- It queries the Database for each user message.\n- In this example, the prompt has been slightly changed to address an issue with querying a Supabase DB. Feel free to change the `Prefix Prompt` to suit your needs.\n- This example uses the data from this [Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download)" }, "typeVersion": 1 }, { "id": "d8bf0767-faf0-4030-b325-08315188adcb", "name": "OpenAI Chat Model Classifier", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 1900, 540 ], "parameters": { "options": { "temperature": 0.2 } }, "credentials": { "openAiApi": { "id": "WqzqjezKh8VtxdqA", "name": "OpenAi account - Baptiste" } }, "typeVersion": 1 }, { "id": "4bcd676f-44f3-4242-a5fd-7cf2098a3a64", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1760, 60 ], "parameters": { "color": 7, "width": 948, "height": 646, "content": "### Respond with a text only or also include a chart \n- The text classifier determines if the response from the SQL Agent would benefit from a chart\n- If it does, then it executes the subworkflow to dynamically generate a chart, and append the chart to the response from the SQL Agent\n- If it doesn't, then the SQL Agent response is directly outputted. " }, "typeVersion": 1 }, { "id": "256cb28b-0d83-4f6d-bb11-33745c9efa4a", "name": "Text Classifier - Chart required?", "type": "@n8n/n8n-nodes-langchain.textClassifier", "position": [ 1800, 380 ], "parameters": { "options": {}, "inputText": "=**User Request**: {{ $('When chat message received').item.json.chatInput }}\n**Data to visualize**: {{ $json.output }}\n", "categories": { "categories": [ { "category": "chart_required", "description": "If a chart can help the user understand the response (if there are multiple data to show) or if the user specifically request a chart. " }, { "category": "chart_not_required", "description": "if a chart doesn't help the user understand the response (e.g a single data point that doesn't require visualization).\n\"I don't know\" does fall into this category" } ] } }, "typeVersion": 1 }, { "id": "6df60db5-19c0-4585-a229-b56f4b9a2b29", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 40, 1020 ], "parameters": { "color": 7, "width": 680, "height": 720, "content": "## Demo\n![Demo SQL Agent](https://media.licdn.com/dms/image/v2/D4E22AQERT4FEXEUncw/feedshare-shrink_800/feedshare-shrink_800/0/1731433289953?e=1741824000&v=beta&t=e6xUqjcsSq5U_NELeD-nn1mFROGYZLazkYC0eELTv5Y)" }, "typeVersion": 1 }, { "id": "a843845d-e010-4a09-ab50-e169beb67811", "name": "User question + Agent initial response", "type": "n8n-nodes-base.set", "position": [ 2200, 280 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "debab41c-da64-4999-a80f-fae06522d672", "name": "user_question", "type": "string", "value": "={{ $('When chat message received').item.json.chatInput }}" }, { "id": "2b4bbf7f-9890-4ef3-9d8f-15e3a55fbfda", "name": "output", "type": "string", "value": "={{ $json.output }}" } ] } }, "typeVersion": 3.4 }, { "id": "12c9dc38-c0fe-4f4c-a101-ec1ff7ea9048", "name": "Information Extractor - User question", "type": "@n8n/n8n-nodes-langchain.informationExtractor", "position": [ 1060, 380 ], "parameters": { "text": "={{ $json.chatInput }}", "options": {}, "attributes": { "attributes": [ { "name": "user_question", "required": true, "description": "Extract the question from the user, omitting everything related to charts." } ] } }, "typeVersion": 1 } ], "pinData": {}, "connections": { "AI Agent": { "main": [ [ { "node": "Text Classifier - Chart required?", "type": "main", "index": 0 } ] ] }, "Execute Workflow": { "main": [ [ { "node": "Set Text + Chart output", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 }, { "node": "Information Extractor - User question", "type": "ai_languageModel", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "Information Extractor - User question", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model Classifier": { "ai_languageModel": [ [ { "node": "Text Classifier - Chart required?", "type": "ai_languageModel", "index": 0 } ] ] }, "Execute \"Generate a chart\" tool": { "main": [ [ { "node": "OpenAI - Generate Chart definition with Structured Output", "type": "main", "index": 0 } ] ] }, "Text Classifier - Chart required?": { "main": [ [ { "node": "User question + Agent initial response", "type": "main", "index": 0 } ], [ { "node": "Set Text output", "type": "main", "index": 0 } ] ] }, "Information Extractor - User question": { "main": [ [ { "node": "AI Agent", "type": "main", "index":
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"50695e7f-3334-4124-a46e-1b3819412e26\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1260,\n 560\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {\n \"temperature\": 0.1\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2f07481d-3ca4-48ab-a8ff-59e9ab5c6062\",\n \"name\": \"Execute Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 2360,\n 280\n ],\n \"parameters\": {\n \"options\": {\n \"waitForSubWorkflow\": true\n },\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"49120164-4ffc-4fe0-8ee3-4ae13bda6c8d\",\n \"name\": \"Execute \\\"Generate a chart\\\" tool\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 1320,\n 1140\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0fc6eaf9-8521-44ec-987e-73644d0cba79\",\n \"name\": \"OpenAI - Generate Chart definition with Structured Output\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1620,\n 1140\n ],\n \"parameters\": {\n \"url\": \"https://api.openai.com/v1/chat/completions\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"model\\\": \\\"gpt-4o-2024-08-06\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"system\\\",\\n \\\"content\\\": \\\"Based on the user request, generate a valid Chart.js definition. Important: - Be careful with the data scale and beginatzero that all data are visible. Example if ploted data 2 and 3 on a bar chart, the baseline should be 0. - Charts colors should be different only if there are multiple datasets. - Output valid JSON. In scales, min and max are numbers. Example: `{scales:{yAxes:[{ticks:{min:0,max:3}`\\\"\\n },\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"**User Request**: {{ $json.user_question }} \\\\n **Data to visualize**: {{ $json.output.replaceAll('\\\\n', \\\" \\\").replaceAll('\\\"', \\\"\\\") }}\\\"\\n }\\n ],\\n \\\"response_format\\\": {\\n \\\"type\\\": \\\"json_schema\\\",\\n \\\"json_schema\\\": {\\n \\\"name\\\": \\\"chart_configuration\\\",\\n \\\"description\\\": \\\"Configuration schema for Chart.js charts\\\",\\n \\\"strict\\\": true,\\n \\\"schema\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"type\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"enum\\\": [\\\"bar\\\", \\\"line\\\", \\\"radar\\\", \\\"pie\\\", \\\"doughnut\\\", \\\"polarArea\\\", \\\"bubble\\\", \\\"scatter\\\", \\\"area\\\"]\\n },\\n \\\"data\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"labels\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"datasets\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"label\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"]\\n },\\n \\\"data\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n },\\n \\\"backgroundColor\\\": {\\n \\\"type\\\": [\\\"array\\\", \\\"null\\\"],\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"borderColor\\\": {\\n \\\"type\\\": [\\\"array\\\", \\\"null\\\"],\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"borderWidth\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"data\\\", \\\"label\\\", \\\"backgroundColor\\\", \\\"borderColor\\\", \\\"borderWidth\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n }\\n },\\n \\\"required\\\": [\\\"labels\\\", \\\"datasets\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"options\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"scales\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"yAxes\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"ticks\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"max\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"min\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"stepSize\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"beginAtZero\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"max\\\", \\\"min\\\", \\\"stepSize\\\", \\\"beginAtZero\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"stacked\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"ticks\\\", \\\"stacked\\\"],\\n \\\"additionalProperties\\\": false\\n }},\\n \\\"xAxes\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"stacked\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"stacked\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"yAxes\\\", \\\"xAxes\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"plugins\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"title\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"display\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n },\\n \\\"text\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"display\\\", \\\"text\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"legend\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"display\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n },\\n \\\"position\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"],\\n \\\"enum\\\": [\\\"top\\\", \\\"left\\\", \\\"bottom\\\", \\\"right\\\", null]\\n }\\n },\\n \\\"required\\\": [\\\"display\\\", \\\"position\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"title\\\", \\\"legend\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"scales\\\", \\\"plugins\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"type\\\", \\\"data\\\", \\\"options\\\"],\\n \\\"additionalProperties\\\": false\\n}\\n}\\n}\\n}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"=Content-Type\",\n \"value\": \"application/json\"\n }\n ]\n },\n \"nodeCredentialType\": \"openAiApi\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"8016a925-7b31-4a49-b5e1-56cf9b5fa7b3\",\n \"name\": \"Set response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1860,\n 1140\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"37512e1a-8376-4ba0-bdcd-34bb9329ae4b\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ \\\"https://quickchart.io/chart?width=200&c=\\\" + encodeURIComponent($json.choices[0].message.content) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9a2b8eca-5303-4eb0-8115-b0d81bfd1d7c\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 880,\n 380\n ],\n \"webhookId\": \"b0e681ae-e00d-450c-9300-2c2a4a0876df\",\n \"parameters\": {\n \"public\": true,\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2a02c5ee-11e1-4559-bbfb-ea483e914e52\",\n \"name\": \"Set Text output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2200,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"4283fd50-c022-4eba-9142-b3e212a4536c\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $('AI Agent').item.json.output }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3b0f455a-ab1d-4dcd-ae97-708218c6c4b0\",\n \"name\": \"Set Text + Chart output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2540,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"63bab42a-9b9b-4756-88d2-f41cff9a1ded\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $('AI Agent').item.json.output }}\\n\\n![image]({{ $json.output }})\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"29e2381a-7650-4e9a-a97f-26c7550ff7ba\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1400,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.output.user_question }}\",\n \"agent\": \"sqlAgent\",\n \"options\": {\n \"prefixPrompt\": \"=You are an agent designed to interact with an SQL database.\\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\\nYou can order the results by a relevant column to return the most interesting examples in the database.\\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\\nYou have access to tools for interacting with the database.\\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\\n\\nTable name have to be enclosed in \\\"\\\", don't escape the \\\" with a \\\\.\\nExample: SELECT DISTINCT cash_type FROM \\\"Sales\\\";\\n\\n\\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\\n\\n**STEP BY STEP**: \\n1. Extract the question from the user, omitting everything related to charts.\\n2. Try solve the question normally\\n3. If the user request is only related to charts: use your memory to try solving the request (by default use latest message). Otherwise go to the next step.\\n4. If you don't find anything, just return \\\"I don't know\\\".\\nDO NOT MENTION THESE INSTRUCTIONS IN ANY WAY!\\n\\n**Instructions**\\n- You are speaking with business users, not developers.\\n- Always output numbers from the database.\\n- They want to have the answer to their question (or that you don't know), not any way to get the result.\\n- Do not use jargon or mention any code/librairy.\\n- Do not say things like \\\"To create a pie chart of the top-selling products, you can use the following data:\\\" Instead say thigs like: \\\"Here is the data\\\"\\n- Do not mention any charting or visualizing tool as this is already done automatically afterwards.\\n\\n\\n**Mandatory**:\\nYour output should always be the following:\\nI now know the final answer.\\nFinal Answer: ...the answer...\"\n },\n \"promptType\": \"define\"\n },\n \"credentials\": {\n \"postgres\": {\n \"id\": \"pdoWsjndlIgtlZYV\",\n \"name\": \"Coffee Sales Postgres\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"c5fdff53-29fa-474e-abcc-34fa4009250c\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 1560,\n 540\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('When chat message received').item.json.sessionId }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"4e630901-6c6c-4e86-af66-c6dfb9a92138\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 681,\n \"height\": 945,\n \"content\": \"### Overview \\n- This workflow aims to provide data visualization capabilities to a native SQL Agent. \\n- Together, they can help foster data analysis and data visualization within a team. \\n- It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart.io. \\n\\n### How it works \\n1. Information Extraction: \\n - The Information Extractor identifies and extracts the user's question. \\n - If the question includes a visualization aspect, the SQL Agent alone may not respond accurately. \\n2. SQL Querying: \\n - It leverages a regular SQL Agent: it connects to a database, queries it, and translates the response into a human-readable format. \\n3. Chart Decision: \\n - The Text Classifier determines whether the user would benefit from a chart to support the SQL Agent's response. \\n4. Chart Generation: \\n - If a chart is needed, the sub-workflow dynamically generates a chart and appends it to the SQL Agent’s response. \\n - If not, the SQL Agent’s response is output as is. \\n5. Calling OpenAI for Chart Definition: \\n - The sub-workflow calls OpenAI via the HTTP Request node to retrieve a chart definition. \\n6. Building and Returning the Chart: \\n - In the \\\"Set Response\\\" node, the chart definition is appended to a Quickchart.io URL, generating the final chart image. \\n - The AI Agent returns the response along with the chart. \\n\\n### How to use it \\n- Use an existing database or create a new one. \\n- For example, I've used [this Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download) and uploaded it to a Supabase DB. \\n- Add the PostgreSQL or MySQL credentials. \\n- Alternatively, you can use SQLite binary files (check [this template](https://n8n.io/workflows/2292-talk-to-your-sqlite-database-with-a-langchain-ai-agent/)). \\n- Activate the workflow. \\n- Start chatting with the AI SQL Agent. \\n- If the Text Classifier determines a chart would be useful, it will generate one in addition to the SQL Agent's response. \\n\\n### Notes \\n- The full Quickchart.io specifications have not been fully integrated, so there may be some glitches (e.g., radar graphs may not display properly due to size limitations). \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"36d7b17f-c7df-4a0a-8781-626dc1edddee\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1260,\n 800\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 769,\n \"height\": 523,\n \"content\": \"## Generate a Quickchart definition \\n[Original template](https://n8n.io/workflows/2400-ai-agent-with-charts-capabilities-using-openai-structured-output-and-quickchart/)\\n\\n**HTTP Request node**\\n- Send the chart query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\\n- The JSON structure is based on ChartJS and Quickchart.io definitions, that let us create nice looking graphs.\\n- The output is a JSON containing the chart definition that is passed to the next node.\\n\\n**Set Response node**\\n- Adds the chart definition at the end of a Quickchart.io URL ([see documentation](https://quickchart.io/documentation/usage/parameters/))\\n- Note that in the parameters, we specify the width to 250 in order to be properly displayed in the chart interface.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9ccea33b-c5d9-422e-a5b9-11efbc05ab1a\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 888,\n \"height\": 646,\n \"content\": \"### Information Extractor \\n- This Information Extractor is added to extract the user's question\\n- In some cases, if the question contains a visualization aspect, the SQL Agent may not responding accurately.\\n\\n### SQL Agent\\n- This SQL Agent is connected to a Database.\\n- It queries the Database for each user message.\\n- In this example, the prompt has been slightly changed to address an issue with querying a Supabase DB. Feel free to change the `Prefix Prompt` to suit your needs.\\n- This example uses the data from this [Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d8bf0767-faf0-4030-b325-08315188adcb\",\n \"name\": \"OpenAI Chat Model Classifier\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1900,\n 540\n ],\n \"parameters\": {\n \"options\": {\n \"temperature\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4bcd676f-44f3-4242-a5fd-7cf2098a3a64\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1760,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 948,\n \"height\": 646,\n \"content\": \"### Respond with a text only or also include a chart \\n- The text classifier determines if the response from the SQL Agent would benefit from a chart\\n- If it does, then it executes the subworkflow to dynamically generate a chart, and append the chart to the response from the SQL Agent\\n- If it doesn't, then the SQL Agent response is directly outputted. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"256cb28b-0d83-4f6d-bb11-33745c9efa4a\",\n \"name\": \"Text Classifier - Chart required?\",\n \"type\": \"@n8n/n8n-nodes-langchain.textClassifier\",\n \"position\": [\n 1800,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"inputText\": \"=**User Request**: {{ $('When chat message received').item.json.chatInput }}\\n**Data to visualize**: {{ $json.output }}\\n\",\n \"categories\": {\n \"categories\": [\n {\n \"category\": \"chart_required\",\n \"description\": \"If a chart can help the user understand the response (if there are multiple data to show) or if the user specifically request a chart. \"\n },\n {\n \"category\": \"chart_not_required\",\n \"description\": \"if a chart doesn't help the user understand the response (e.g a single data point that doesn't require visualization).\\n\\\"I don't know\\\" does fall into this category\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6df60db5-19c0-4585-a229-b56f4b9a2b29\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n 1020\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 680,\n \"height\": 720,\n \"content\": \"## Demo\\n![Demo SQL Agent](https://media.licdn.com/dms/image/v2/D4E22AQERT4FEXEUncw/feedshare-shrink_800/feedshare-shrink_800/0/1731433289953?e=1741824000&v=beta&t=e6xUqjcsSq5U_NELeD-nn1mFROGYZLazkYC0eELTv5Y)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a843845d-e010-4a09-ab50-e169beb67811\",\n \"name\": \"User question + Agent initial response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2200,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"debab41c-da64-4999-a80f-fae06522d672\",\n \"name\": \"user_question\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.chatInput }}\"\n },\n {\n \"id\": \"2b4bbf7f-9890-4ef3-9d8f-15e3a55fbfda\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $json.output }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"12c9dc38-c0fe-4f4c-a101-ec1ff7ea9048\",\n \"name\": \"Information Extractor - User question\",\n \"type\": \"@n8n/n8n-nodes-langchain.informationExtractor\",\n \"position\": [\n 1060,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"attributes\": {\n \"attributes\": [\n {\n \"name\": \"user_question\",\n \"required\": true,\n \"description\": \"Extract the question from the user, omitting everything related to charts.\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Text Classifier - Chart required?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Set Text + Chart output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n },\n {\n \"node\": \"Information Extractor - User question\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Information Extractor - User question\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model Classifier\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Text Classifier - Chart required?\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute \\\"Generate a chart\\\" tool\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI - Generate Chart definition with Structured Output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Text Classifier - Chart required?\": {\n \"main\": [\n [\n {\n \"node\": \"User question + Agent initial response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Set Text output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Information Extractor - User question\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"User question + Agent initial response\": {\n \"main\": [\n [\n {\n \"node\": \"Execute Workflow\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI - Generate Chart definition with Structured Output\": {\n \"main\": [\n [\n {\n \"node\": \"Set response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
15
1
3
true
combined_workflows.json
{ "input": "The workflow aims to create an AI-powered SQL agent that can generate and display charts based on user queries, enhancing data visualization capabilities.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 20817, "processed_size": 20817, "processed_timestamp": "2025-04-09T03:08:37.399761", "timestamp": "2025-04-09T02:35:29.069622", "token_count": 4097, "tokens": 2132, "workflow_chunk_info": { "is_truncated": false, "original_size": 20817, "processed_size": 20817, "workflow_hash": "5e8de361451a323513fefb94b65da2f3" }, "workflow_hash": "5e8de361451a323513fefb94b65da2f3" }
main": [ [ { "node": "OpenAI - Generate Chart definition with Structured Output", "type": "main", "index": 0 } ] ] }, "Text Classifier - Chart required?": { "main": [ [ { "node": "User question + Agent initial response", "type": "main", "index": 0 } ], [ { "node": "Set Text output", "type": "main", "index": 0 } ] ] }, "Information Extractor - User question": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "User question + Agent initial response": { "main": [ [ { "node": "Execute Workflow", "type": "main", "index": 0 } ] ] }, "OpenAI - Generate Chart definition with Structured Output": { "main": [ [ { "node": "Set response", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"50695e7f-3334-4124-a46e-1b3819412e26\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1260,\n 560\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {\n \"temperature\": 0.1\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2f07481d-3ca4-48ab-a8ff-59e9ab5c6062\",\n \"name\": \"Execute Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 2360,\n 280\n ],\n \"parameters\": {\n \"options\": {\n \"waitForSubWorkflow\": true\n },\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"49120164-4ffc-4fe0-8ee3-4ae13bda6c8d\",\n \"name\": \"Execute \\\"Generate a chart\\\" tool\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 1320,\n 1140\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0fc6eaf9-8521-44ec-987e-73644d0cba79\",\n \"name\": \"OpenAI - Generate Chart definition with Structured Output\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1620,\n 1140\n ],\n \"parameters\": {\n \"url\": \"https://api.openai.com/v1/chat/completions\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"model\\\": \\\"gpt-4o-2024-08-06\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"system\\\",\\n \\\"content\\\": \\\"Based on the user request, generate a valid Chart.js definition. Important: - Be careful with the data scale and beginatzero that all data are visible. Example if ploted data 2 and 3 on a bar chart, the baseline should be 0. - Charts colors should be different only if there are multiple datasets. - Output valid JSON. In scales, min and max are numbers. Example: `{scales:{yAxes:[{ticks:{min:0,max:3}`\\\"\\n },\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"**User Request**: {{ $json.user_question }} \\\\n **Data to visualize**: {{ $json.output.replaceAll('\\\\n', \\\" \\\").replaceAll('\\\"', \\\"\\\") }}\\\"\\n }\\n ],\\n \\\"response_format\\\": {\\n \\\"type\\\": \\\"json_schema\\\",\\n \\\"json_schema\\\": {\\n \\\"name\\\": \\\"chart_configuration\\\",\\n \\\"description\\\": \\\"Configuration schema for Chart.js charts\\\",\\n \\\"strict\\\": true,\\n \\\"schema\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"type\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"enum\\\": [\\\"bar\\\", \\\"line\\\", \\\"radar\\\", \\\"pie\\\", \\\"doughnut\\\", \\\"polarArea\\\", \\\"bubble\\\", \\\"scatter\\\", \\\"area\\\"]\\n },\\n \\\"data\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"labels\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"datasets\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"label\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"]\\n },\\n \\\"data\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n },\\n \\\"backgroundColor\\\": {\\n \\\"type\\\": [\\\"array\\\", \\\"null\\\"],\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"borderColor\\\": {\\n \\\"type\\\": [\\\"array\\\", \\\"null\\\"],\\n \\\"items\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n },\\n \\\"borderWidth\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"data\\\", \\\"label\\\", \\\"backgroundColor\\\", \\\"borderColor\\\", \\\"borderWidth\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n }\\n },\\n \\\"required\\\": [\\\"labels\\\", \\\"datasets\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"options\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"scales\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"yAxes\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"ticks\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"max\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"min\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"stepSize\\\": {\\n \\\"type\\\": [\\\"number\\\", \\\"null\\\"]\\n },\\n \\\"beginAtZero\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"max\\\", \\\"min\\\", \\\"stepSize\\\", \\\"beginAtZero\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"stacked\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"ticks\\\", \\\"stacked\\\"],\\n \\\"additionalProperties\\\": false\\n }},\\n \\\"xAxes\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"stacked\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"stacked\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"yAxes\\\", \\\"xAxes\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"plugins\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"title\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"display\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n },\\n \\\"text\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"]\\n }\\n },\\n \\\"required\\\": [\\\"display\\\", \\\"text\\\"],\\n \\\"additionalProperties\\\": false\\n },\\n \\\"legend\\\": {\\n \\\"type\\\": [\\\"object\\\", \\\"null\\\"],\\n \\\"properties\\\": {\\n \\\"display\\\": {\\n \\\"type\\\": [\\\"boolean\\\", \\\"null\\\"]\\n },\\n \\\"position\\\": {\\n \\\"type\\\": [\\\"string\\\", \\\"null\\\"],\\n \\\"enum\\\": [\\\"top\\\", \\\"left\\\", \\\"bottom\\\", \\\"right\\\", null]\\n }\\n },\\n \\\"required\\\": [\\\"display\\\", \\\"position\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"title\\\", \\\"legend\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"scales\\\", \\\"plugins\\\"],\\n \\\"additionalProperties\\\": false\\n }\\n },\\n \\\"required\\\": [\\\"type\\\", \\\"data\\\", \\\"options\\\"],\\n \\\"additionalProperties\\\": false\\n}\\n}\\n}\\n}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"=Content-Type\",\n \"value\": \"application/json\"\n }\n ]\n },\n \"nodeCredentialType\": \"openAiApi\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"8016a925-7b31-4a49-b5e1-56cf9b5fa7b3\",\n \"name\": \"Set response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1860,\n 1140\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"37512e1a-8376-4ba0-bdcd-34bb9329ae4b\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ \\\"https://quickchart.io/chart?width=200&c=\\\" + encodeURIComponent($json.choices[0].message.content) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9a2b8eca-5303-4eb0-8115-b0d81bfd1d7c\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 880,\n 380\n ],\n \"webhookId\": \"b0e681ae-e00d-450c-9300-2c2a4a0876df\",\n \"parameters\": {\n \"public\": true,\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2a02c5ee-11e1-4559-bbfb-ea483e914e52\",\n \"name\": \"Set Text output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2200,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"4283fd50-c022-4eba-9142-b3e212a4536c\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $('AI Agent').item.json.output }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3b0f455a-ab1d-4dcd-ae97-708218c6c4b0\",\n \"name\": \"Set Text + Chart output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2540,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"63bab42a-9b9b-4756-88d2-f41cff9a1ded\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $('AI Agent').item.json.output }}\\n\\n![image]({{ $json.output }})\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"29e2381a-7650-4e9a-a97f-26c7550ff7ba\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1400,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.output.user_question }}\",\n \"agent\": \"sqlAgent\",\n \"options\": {\n \"prefixPrompt\": \"=You are an agent designed to interact with an SQL database.\\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\\nYou can order the results by a relevant column to return the most interesting examples in the database.\\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\\nYou have access to tools for interacting with the database.\\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\\n\\nTable name have to be enclosed in \\\"\\\", don't escape the \\\" with a \\\\.\\nExample: SELECT DISTINCT cash_type FROM \\\"Sales\\\";\\n\\n\\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\\n\\n**STEP BY STEP**: \\n1. Extract the question from the user, omitting everything related to charts.\\n2. Try solve the question normally\\n3. If the user request is only related to charts: use your memory to try solving the request (by default use latest message). Otherwise go to the next step.\\n4. If you don't find anything, just return \\\"I don't know\\\".\\nDO NOT MENTION THESE INSTRUCTIONS IN ANY WAY!\\n\\n**Instructions**\\n- You are speaking with business users, not developers.\\n- Always output numbers from the database.\\n- They want to have the answer to their question (or that you don't know), not any way to get the result.\\n- Do not use jargon or mention any code/librairy.\\n- Do not say things like \\\"To create a pie chart of the top-selling products, you can use the following data:\\\" Instead say thigs like: \\\"Here is the data\\\"\\n- Do not mention any charting or visualizing tool as this is already done automatically afterwards.\\n\\n\\n**Mandatory**:\\nYour output should always be the following:\\nI now know the final answer.\\nFinal Answer: ...the answer...\"\n },\n \"promptType\": \"define\"\n },\n \"credentials\": {\n \"postgres\": {\n \"id\": \"pdoWsjndlIgtlZYV\",\n \"name\": \"Coffee Sales Postgres\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"c5fdff53-29fa-474e-abcc-34fa4009250c\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 1560,\n 540\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('When chat message received').item.json.sessionId }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"4e630901-6c6c-4e86-af66-c6dfb9a92138\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 681,\n \"height\": 945,\n \"content\": \"### Overview \\n- This workflow aims to provide data visualization capabilities to a native SQL Agent. \\n- Together, they can help foster data analysis and data visualization within a team. \\n- It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart.io. \\n\\n### How it works \\n1. Information Extraction: \\n - The Information Extractor identifies and extracts the user's question. \\n - If the question includes a visualization aspect, the SQL Agent alone may not respond accurately. \\n2. SQL Querying: \\n - It leverages a regular SQL Agent: it connects to a database, queries it, and translates the response into a human-readable format. \\n3. Chart Decision: \\n - The Text Classifier determines whether the user would benefit from a chart to support the SQL Agent's response. \\n4. Chart Generation: \\n - If a chart is needed, the sub-workflow dynamically generates a chart and appends it to the SQL Agent’s response. \\n - If not, the SQL Agent’s response is output as is. \\n5. Calling OpenAI for Chart Definition: \\n - The sub-workflow calls OpenAI via the HTTP Request node to retrieve a chart definition. \\n6. Building and Returning the Chart: \\n - In the \\\"Set Response\\\" node, the chart definition is appended to a Quickchart.io URL, generating the final chart image. \\n - The AI Agent returns the response along with the chart. \\n\\n### How to use it \\n- Use an existing database or create a new one. \\n- For example, I've used [this Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download) and uploaded it to a Supabase DB. \\n- Add the PostgreSQL or MySQL credentials. \\n- Alternatively, you can use SQLite binary files (check [this template](https://n8n.io/workflows/2292-talk-to-your-sqlite-database-with-a-langchain-ai-agent/)). \\n- Activate the workflow. \\n- Start chatting with the AI SQL Agent. \\n- If the Text Classifier determines a chart would be useful, it will generate one in addition to the SQL Agent's response. \\n\\n### Notes \\n- The full Quickchart.io specifications have not been fully integrated, so there may be some glitches (e.g., radar graphs may not display properly due to size limitations). \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"36d7b17f-c7df-4a0a-8781-626dc1edddee\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1260,\n 800\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 769,\n \"height\": 523,\n \"content\": \"## Generate a Quickchart definition \\n[Original template](https://n8n.io/workflows/2400-ai-agent-with-charts-capabilities-using-openai-structured-output-and-quickchart/)\\n\\n**HTTP Request node**\\n- Send the chart query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\\n- The JSON structure is based on ChartJS and Quickchart.io definitions, that let us create nice looking graphs.\\n- The output is a JSON containing the chart definition that is passed to the next node.\\n\\n**Set Response node**\\n- Adds the chart definition at the end of a Quickchart.io URL ([see documentation](https://quickchart.io/documentation/usage/parameters/))\\n- Note that in the parameters, we specify the width to 250 in order to be properly displayed in the chart interface.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9ccea33b-c5d9-422e-a5b9-11efbc05ab1a\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 888,\n \"height\": 646,\n \"content\": \"### Information Extractor \\n- This Information Extractor is added to extract the user's question\\n- In some cases, if the question contains a visualization aspect, the SQL Agent may not responding accurately.\\n\\n### SQL Agent\\n- This SQL Agent is connected to a Database.\\n- It queries the Database for each user message.\\n- In this example, the prompt has been slightly changed to address an issue with querying a Supabase DB. Feel free to change the `Prefix Prompt` to suit your needs.\\n- This example uses the data from this [Kaggle dataset](https://www.kaggle.com/datasets/ihelon/coffee-sales/versions/15?resource=download)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d8bf0767-faf0-4030-b325-08315188adcb\",\n \"name\": \"OpenAI Chat Model Classifier\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1900,\n 540\n ],\n \"parameters\": {\n \"options\": {\n \"temperature\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"WqzqjezKh8VtxdqA\",\n \"name\": \"OpenAi account - Baptiste\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4bcd676f-44f3-4242-a5fd-7cf2098a3a64\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1760,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 948,\n \"height\": 646,\n \"content\": \"### Respond with a text only or also include a chart \\n- The text classifier determines if the response from the SQL Agent would benefit from a chart\\n- If it does, then it executes the subworkflow to dynamically generate a chart, and append the chart to the response from the SQL Agent\\n- If it doesn't, then the SQL Agent response is directly outputted. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"256cb28b-0d83-4f6d-bb11-33745c9efa4a\",\n \"name\": \"Text Classifier - Chart required?\",\n \"type\": \"@n8n/n8n-nodes-langchain.textClassifier\",\n \"position\": [\n 1800,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"inputText\": \"=**User Request**: {{ $('When chat message received').item.json.chatInput }}\\n**Data to visualize**: {{ $json.output }}\\n\",\n \"categories\": {\n \"categories\": [\n {\n \"category\": \"chart_required\",\n \"description\": \"If a chart can help the user understand the response (if there are multiple data to show) or if the user specifically request a chart. \"\n },\n {\n \"category\": \"chart_not_required\",\n \"description\": \"if a chart doesn't help the user understand the response (e.g a single data point that doesn't require visualization).\\n\\\"I don't know\\\" does fall into this category\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6df60db5-19c0-4585-a229-b56f4b9a2b29\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n 1020\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 680,\n \"height\": 720,\n \"content\": \"## Demo\\n![Demo SQL Agent](https://media.licdn.com/dms/image/v2/D4E22AQERT4FEXEUncw/feedshare-shrink_800/feedshare-shrink_800/0/1731433289953?e=1741824000&v=beta&t=e6xUqjcsSq5U_NELeD-nn1mFROGYZLazkYC0eELTv5Y)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a843845d-e010-4a09-ab50-e169beb67811\",\n \"name\": \"User question + Agent initial response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2200,\n 280\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"debab41c-da64-4999-a80f-fae06522d672\",\n \"name\": \"user_question\",\n \"type\": \"string\",\n \"value\": \"={{ $('When chat message received').item.json.chatInput }}\"\n },\n {\n \"id\": \"2b4bbf7f-9890-4ef3-9d8f-15e3a55fbfda\",\n \"name\": \"output\",\n \"type\": \"string\",\n \"value\": \"={{ $json.output }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"12c9dc38-c0fe-4f4c-a101-ec1ff7ea9048\",\n \"name\": \"Information Extractor - User question\",\n \"type\": \"@n8n/n8n-nodes-langchain.informationExtractor\",\n \"position\": [\n 1060,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"attributes\": {\n \"attributes\": [\n {\n \"name\": \"user_question\",\n \"required\": true,\n \"description\": \"Extract the question from the user, omitting everything related to charts.\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Text Classifier - Chart required?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Set Text + Chart output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n },\n {\n \"node\": \"Information Extractor - User question\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Information Extractor - User question\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model Classifier\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Text Classifier - Chart required?\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute \\\"Generate a chart\\\" tool\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI - Generate Chart definition with Structured Output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Text Classifier - Chart required?\": {\n \"main\": [\n [\n {\n \"node\": \"User question + Agent initial response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Set Text output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Information Extractor - User question\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"User question + Agent initial response\": {\n \"main\": [\n [\n {\n \"node\": \"Execute Workflow\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI - Generate Chart definition with Structured Output\": {\n \"main\": [\n [\n {\n \"node\": \"Set response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
15
2
3
true
combined_workflows.json
{ "input": "The workflow aims to create an AI-powered SQL agent that can generate and display charts based on user queries, enhancing data visualization capabilities.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 20817, "processed_size": 20817, "processed_timestamp": "2025-04-09T03:08:37.401761", "timestamp": "2025-04-09T02:35:29.069622", "token_count": 378, "tokens": 2132, "workflow_chunk_info": { "is_truncated": false, "original_size": 20817, "processed_size": 20817, "workflow_hash": "5e8de361451a323513fefb94b65da2f3" }, "workflow_hash": "5e8de361451a323513fefb94b65da2f3" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To notify a Slack channel about new releases from a specific GitHub repository. Analyze this workflow: ```json { "id": "5ec2322573f7590007802e1f", "name": "Extranet Releases", "nodes": [ { "name": "Slack", "type": "n8n-nodes-base.slack", "position": [ 560, 550 ], "parameters": { "text": "=New release is available in {{$node[\"Github Trigger\"].json[\"body\"][\"repository\"][\"full_name\"]}} !\n{{$node[\"Github Trigger\"].json[\"body\"][\"release\"][\"tag_name\"]}} Details:\n{{$node[\"Github Trigger\"].json[\"body\"][\"release\"][\"body\"]}}\n\nLink: {{$node[\"Github Trigger\"].json[\"body\"][\"release\"][\"html_url\"]}}", "as_user": true, "channel": "extranet-md", "attachments": [], "otherOptions": {} }, "credentials": { "slackApi": "Extranet-md" }, "typeVersion": 1 }, { "name": "Github Trigger", "type": "n8n-nodes-base.githubTrigger", "position": [ 350, 550 ], "parameters": { "owner": "Mesdocteurs", "events": [ "release" ], "repository": "mda-admin-partner-api" }, "credentials": { "githubApi": "Github API" }, "typeVersion": 1 } ], "active": true, "settings": {}, "connections": { "Github Trigger": { "main": [ [ { "node": "Slack", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"5ec2322573f7590007802e1f\",\n \"name\": \"Extranet Releases\",\n \"nodes\": [\n {\n \"name\": \"Slack\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n 560,\n 550\n ],\n \"parameters\": {\n \"text\": \"=New release is available in {{$node[\\\"Github Trigger\\\"].json[\\\"body\\\"][\\\"repository\\\"][\\\"full_name\\\"]}} !\\n{{$node[\\\"Github Trigger\\\"].json[\\\"body\\\"][\\\"release\\\"][\\\"tag_name\\\"]}} Details:\\n{{$node[\\\"Github Trigger\\\"].json[\\\"body\\\"][\\\"release\\\"][\\\"body\\\"]}}\\n\\nLink: {{$node[\\\"Github Trigger\\\"].json[\\\"body\\\"][\\\"release\\\"][\\\"html_url\\\"]}}\",\n \"as_user\": true,\n \"channel\": \"extranet-md\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"slackApi\": \"Extranet-md\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Github Trigger\",\n \"type\": \"n8n-nodes-base.githubTrigger\",\n \"position\": [\n 350,\n 550\n ],\n \"parameters\": {\n \"owner\": \"Mesdocteurs\",\n \"events\": [\n \"release\"\n ],\n \"repository\": \"mda-admin-partner-api\"\n },\n \"credentials\": {\n \"githubApi\": \"Github API\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": true,\n \"settings\": {},\n \"connections\": {\n \"Github Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Slack\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
16
0
1
false
combined_workflows.json
{ "input": "To notify a Slack channel about new releases from a specific GitHub repository.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 1043, "processed_size": 1043, "processed_timestamp": "2025-04-09T03:08:37.405762", "timestamp": "2025-04-09T02:35:29.789884", "token_count": 662, "tokens": 76, "workflow_chunk_info": { "is_truncated": false, "original_size": 1043, "processed_size": 1043, "workflow_hash": "06556abf4c35cfd691085d0d909db13c" }, "workflow_hash": "06556abf4c35cfd691085d0d909db13c" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: Monitor Jira for any event. Analyze this workflow: ```json { "nodes": [ { "name": "Jira Trigger", "type": "n8n-nodes-base.jiraTrigger", "position": [ 880, 400 ], "webhookId": "a3ddaf66-7f75-4494-b435-ef88ef1f1917", "parameters": { "events": [ "*" ], "additionalFields": {} }, "credentials": { "jiraSoftwareCloudApi": "n8n" }, "typeVersion": 1 } ], "connections": {} } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"Jira Trigger\",\n \"type\": \"n8n-nodes-base.jiraTrigger\",\n \"position\": [\n 880,\n 400\n ],\n \"webhookId\": \"a3ddaf66-7f75-4494-b435-ef88ef1f1917\",\n \"parameters\": {\n \"events\": [\n \"*\"\n ],\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": \"n8n\"\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {}\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
17
0
1
false
combined_workflows.json
{ "input": "Monitor Jira for any event.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 294, "processed_size": 294, "processed_timestamp": "2025-04-09T03:08:37.406761", "timestamp": "2025-04-09T02:35:29.849889", "token_count": 290, "tokens": 23, "workflow_chunk_info": { "is_truncated": false, "original_size": 294, "processed_size": 294, "workflow_hash": "11602bd1a1a7a82aea9a859cc83a9d19" }, "workflow_hash": "11602bd1a1a7a82aea9a859cc83a9d19" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to retrieve files from a Google Drive folder, generate public download links for them, and then make the files publicly accessible. Analyze this workflow: ```json { "meta": { "instanceId": "c59a6b1daf09a846754bc2cf0a94db3299bd5a69fb14687c3a5e692704c548dd" }, "nodes": [ { "id": "2165cd37-10ff-46bd-88a5-c8377bf4bef7", "name": "Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ 1280, 1100 ], "parameters": { "limit": 100, "options": { "spaces": [ "*" ], "corpora": "allDrives" }, "operation": "list", "queryString": "='{{ $json[\"Folder ID\"] }}' in parents", "authentication": "oAuth2", "useQueryString": true }, "credentials": { "googleDriveOAuth2Api": { "id": "KJE0ZORR1Q1fJCd5", "name": "Google Drive account 2" } }, "typeVersion": 1 }, { "id": "5061db5e-2137-4c50-8902-a24cd53a6bdf", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ 1480, 1160 ], "parameters": { "options": {}, "batchSize": 50 }, "typeVersion": 3 }, { "id": "62a16fb8-9bfc-46db-a556-23fac7f403f5", "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 1720, 1020 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "multiplex" }, "typeVersion": 2.1 }, { "id": "bd410148-e745-43a2-960b-128bbb49828f", "name": "Set Folder ID", "type": "n8n-nodes-base.set", "notes": "Enter desired Folder", "position": [ 1120, 1100 ], "parameters": { "fields": { "values": [ { "name": "Folder ID", "stringValue": "Enter Your Folder ID here" } ] }, "options": {} }, "notesInFlow": true, "typeVersion": 3.2 }, { "id": "16def9df-5c8b-4359-a879-11e66f191f92", "name": "Manual Execute Workflow", "type": "n8n-nodes-base.manualTrigger", "notes": "Optional", "position": [ 940, 1100 ], "parameters": {}, "notesInFlow": true, "typeVersion": 1 }, { "id": "e7d54620-e5e6-470e-add5-ccefdfb2a979", "name": "Generate Download Links", "type": "n8n-nodes-base.code", "position": [ 1480, 980 ], "parameters": { "jsCode": "// This function will create an array of file links from the given Google Drive folder\nreturn items.map(file => {\n return { json: { 'link': `https://drive.google.com/u/3/uc?id=${file.json.id}&export=download&confirm=t&authuser=0`, 'name': file.json.name } };\n});" }, "typeVersion": 2 }, { "id": "04e71edf-c40f-4c80-961c-f511e145232c", "name": "Change Status", "type": "n8n-nodes-base.googleDrive", "notes": "Make Files Public to anyone with a link", "position": [ 1660, 1180 ], "parameters": { "fileId": { "__rl": true, "mode": "id", "value": "={{ $json.id }}" }, "options": { "supportsAllDrives": true }, "operation": "share", "permissionsUi": { "permissionsValues": { "role": "reader", "type": "anyone" } }, "authentication": "oAuth2" }, "credentials": { "googleDriveOAuth2Api": { "id": "KJE0ZORR1Q1fJCd5", "name": "Google Drive account 2" } }, "notesInFlow": true, "typeVersion": 1 }, { "id": "4452cd81-e94a-465e-987b-5acf46e25428", "name": "Replace Me", "type": "n8n-nodes-base.noOp", "position": [ 1880, 1020 ], "parameters": {}, "typeVersion": 1 }, { "id": "dab69e10-d9af-4ece-a6c6-cb35468e3bf0", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 880, 820 ], "parameters": { "width": 1235.0111197082438, "height": 545.6382804772701, "content": "## Example Output:\n```JSON\n{\n\"link\": \"https://drive.google.com/u/3/uc?id=1hojqPfXchNTY8YRTNkxSo-8txK9re-V4&export=download&confirm=t&authuser=0\",\n\"name\": \"firefox_rNjA0ybKu7.png\",\n\"kind\": \"drive#permission\",\n\"id\": \"anyoneWithLink\",\n\"type\": \"anyone\",\n\"role\": \"reader\",\n\"allowFileDiscovery\": false\n}\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### You can store the output data with any data store node you want\n### for example save them into Excel Sheet or Airtable etc..." }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Merge": { "main": [ [ { "node": "Replace Me", "type": "main", "index": 0 } ] ] }, "Google Drive": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 }, { "node": "Generate Download Links", "type": "main", "index": 0 } ] ] }, "Change Status": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Set Folder ID": { "main": [ [ { "node": "Google Drive", "type": "main", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ], [ { "node": "Change Status", "type": "main", "index": 0 } ] ] }, "Generate Download Links": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Manual Execute Workflow": { "main": [ [ { "node": "Set Folder ID", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"c59a6b1daf09a846754bc2cf0a94db3299bd5a69fb14687c3a5e692704c548dd\"\n },\n \"nodes\": [\n {\n \"id\": \"2165cd37-10ff-46bd-88a5-c8377bf4bef7\",\n \"name\": \"Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n 1280,\n 1100\n ],\n \"parameters\": {\n \"limit\": 100,\n \"options\": {\n \"spaces\": [\n \"*\"\n ],\n \"corpora\": \"allDrives\"\n },\n \"operation\": \"list\",\n \"queryString\": \"='{{ $json[\\\"Folder ID\\\"] }}' in parents\",\n \"authentication\": \"oAuth2\",\n \"useQueryString\": true\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"KJE0ZORR1Q1fJCd5\",\n \"name\": \"Google Drive account 2\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5061db5e-2137-4c50-8902-a24cd53a6bdf\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 1480,\n 1160\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": 50\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"62a16fb8-9bfc-46db-a556-23fac7f403f5\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1720,\n 1020\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combinationMode\": \"multiplex\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"bd410148-e745-43a2-960b-128bbb49828f\",\n \"name\": \"Set Folder ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Enter desired Folder\",\n \"position\": [\n 1120,\n 1100\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"Folder ID\",\n \"stringValue\": \"Enter Your Folder ID here\"\n }\n ]\n },\n \"options\": {}\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"16def9df-5c8b-4359-a879-11e66f191f92\",\n \"name\": \"Manual Execute Workflow\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"notes\": \"Optional\",\n \"position\": [\n 940,\n 1100\n ],\n \"parameters\": {},\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"e7d54620-e5e6-470e-add5-ccefdfb2a979\",\n \"name\": \"Generate Download Links\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1480,\n 980\n ],\n \"parameters\": {\n \"jsCode\": \"// This function will create an array of file links from the given Google Drive folder\\nreturn items.map(file => {\\n return { json: { 'link': `https://drive.google.com/u/3/uc?id=${file.json.id}&export=download&confirm=t&authuser=0`, 'name': file.json.name } };\\n});\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"04e71edf-c40f-4c80-961c-f511e145232c\",\n \"name\": \"Change Status\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"notes\": \"Make Files Public to anyone with a link\",\n \"position\": [\n 1660,\n 1180\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {\n \"supportsAllDrives\": true\n },\n \"operation\": \"share\",\n \"permissionsUi\": {\n \"permissionsValues\": {\n \"role\": \"reader\",\n \"type\": \"anyone\"\n }\n },\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"KJE0ZORR1Q1fJCd5\",\n \"name\": \"Google Drive account 2\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"4452cd81-e94a-465e-987b-5acf46e25428\",\n \"name\": \"Replace Me\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1880,\n 1020\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"dab69e10-d9af-4ece-a6c6-cb35468e3bf0\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 820\n ],\n \"parameters\": {\n \"width\": 1235.0111197082438,\n \"height\": 545.6382804772701,\n \"content\": \"## Example Output:\\n```JSON\\n{\\n\\\"link\\\": \\\"https://drive.google.com/u/3/uc?id=1hojqPfXchNTY8YRTNkxSo-8txK9re-V4&export=download&confirm=t&authuser=0\\\",\\n\\\"name\\\": \\\"firefox_rNjA0ybKu7.png\\\",\\n\\\"kind\\\": \\\"drive#permission\\\",\\n\\\"id\\\": \\\"anyoneWithLink\\\",\\n\\\"type\\\": \\\"anyone\\\",\\n\\\"role\\\": \\\"reader\\\",\\n\\\"allowFileDiscovery\\\": false\\n}\\n```\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n### You can store the output data with any data store node you want\\n### for example save them into Excel Sheet or Airtable etc...\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Replace Me\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Generate Download Links\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Change Status\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Folder ID\": {\n \"main\": [\n [\n {\n \"node\": \"Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ],\n [\n {\n \"node\": \"Change Status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Download Links\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Manual Execute Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Set Folder ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
18
0
1
false
combined_workflows.json
{ "input": "The workflow's goal is to retrieve files from a Google Drive folder, generate public download links for them, and then make the files publicly accessible.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 4263, "processed_size": 4263, "processed_timestamp": "2025-04-09T03:08:37.417765", "timestamp": "2025-04-09T02:35:29.904703", "token_count": 2564, "tokens": 390, "workflow_chunk_info": { "is_truncated": false, "original_size": 4263, "processed_size": 4263, "workflow_hash": "6cc9cb4541418804736b421ea7c7ef96" }, "workflow_hash": "6cc9cb4541418804736b421ea7c7ef96" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow monitors network performance (latency and packet loss) in a Meraki environment, identifies problematic sites exceeding thresholds, and alerts relevant teams via Microsoft Teams, while preventing redundant alerts. Analyze this workflow: ```json { "meta": { "instanceId": "257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833", "templateId": "2054" }, "nodes": [ { "id": "3b18d784-eded-4b74-ac44-b25565049e13", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ 380, 400 ], "parameters": {}, "typeVersion": 1 }, { "id": "96eadd32-17c2-44b0-a00b-8e2ddcecaafa", "name": "Get Meraki Organizations", "type": "n8n-nodes-base.httpRequest", "notes": "This node uses an API call to Meraki using the URL https://api.meraki.com/api/v1/organizations\n\nthe Authorization header is what is used to authenticate. You also have to set it to accept json", "position": [ 620, 320 ], "parameters": { "url": "https://api.meraki.com/api/v1/organizations", "options": { "redirect": { "redirect": {} } }, "sendHeaders": true, "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/json" } ] } }, "credentials": { "httpHeaderAuth": { "id": "12", "name": "Header Auth account" } }, "typeVersion": 4.1 }, { "id": "444071ea-a364-45a6-9430-0338d2752b18", "name": "Get Network IDs", "type": "n8n-nodes-base.httpRequest", "notes": "This node uses a URL with an expression in the middle to do an API call for each ORG ID that was pulled to pull all the network's for each org", "position": [ 1020, 240 ], "parameters": { "url": "=https://api.meraki.com/api/v1/organizations/{{ $json.OrgID }}/networks ", "options": { "redirect": { "redirect": {} } }, "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Authorization" }, { "name": "Accept", "value": "application/json" } ] } }, "typeVersion": 4.1 }, { "id": "42deea02-e2d2-4ba6-97f7-698c219715a5", "name": "Get Org Name & ID", "type": "n8n-nodes-base.set", "notes": "This takes the output data from the previous node and changes the variables to better suit what we'll be using. ", "position": [ 840, 240 ], "parameters": { "fields": { "values": [ { "name": "CompanyName", "stringValue": "={{ $json.name }}" }, { "name": "OrgID", "stringValue": "={{ $json.id }}" } ] }, "include": "selected", "options": {} }, "typeVersion": 3.2 }, { "id": "3d5ce6a8-bf05-4457-88e6-c5ad5a995b1d", "name": "Combine latency to its respective Network", "type": "n8n-nodes-base.merge", "notes": "This node matches on the NetworkID field, so that the networks we pulled earlier and the Loss / Latency can be combined into one dataset", "position": [ 1500, 400 ], "parameters": { "mode": "combine", "options": {}, "joinMode": "enrichInput1", "mergeByFields": { "values": [ { "field1": "NetworkID", "field2": "networkId" } ] } }, "notesInFlow": false, "typeVersion": 2.1 }, { "id": "caafd6dd-a2b2-405d-a078-cea3bb615788", "name": "Makes Latency and Loss Filterable", "type": "n8n-nodes-base.set", "notes": "Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. ", "position": [ 1680, 400 ], "parameters": { "fields": { "values": [ { "name": "networkId", "stringValue": "={{ $json.networkId }}" }, { "name": "NetworkName", "stringValue": "={{ $json.NetworkName }}" }, { "name": "networkURL", "stringValue": "={{ $json.networkURL }}" }, { "name": "Serial", "stringValue": "={{ $json.serial }}" }, { "name": "TS0-Loss", "stringValue": "={{ $json.timeSeries[0].lossPercent }}" }, { "name": "TS1-Loss", "stringValue": "={{ $json.timeSeries[1].lossPercent }}" }, { "name": "TS2-Loss", "stringValue": "={{ $json.timeSeries[2].lossPercent }}" }, { "name": "TS3-Loss", "stringValue": "={{ $json.timeSeries[3].lossPercent }}" }, { "name": "TS4-Loss", "stringValue": "={{ $json.timeSeries[4].lossPercent }}" }, { "name": "TS0-Latency", "stringValue": "={{ $json.timeSeries[0].latencyMs }}" }, { "name": "TS1-Latency", "stringValue": "={{ $json.timeSeries[1].latencyMs }}" }, { "name": "TS2-Latency", "stringValue": "={{ $json.timeSeries[2].latencyMs }}" }, { "name": "TS3-Latency", "stringValue": "={{ $json.timeSeries[3].latencyMs }}" }, { "name": "TS4-Latency", "stringValue": "={{ $json.timeSeries[4].latencyMs }}" } ] }, "include": "selected", "options": {} }, "typeVersion": 3.2 }, { "id": "c695fd89-c884-4794-b0e5-51b91a71ac5c", "name": "Filters Problematic sites", "type": "n8n-nodes-base.code", "notes": "This node uses JavaScript to look at the calculated averages and if they pass the threshold for 300ms Latency or 2% Loss it will pass that site info forward", "position": [ 2040, 400 ], "parameters": { "jsCode": "// Function to filter items based on averageLatency and averageLoss\nfunction filterItems(items) {\n return items.filter(item =>\n item.AverageLatency >300 || item.AverageLoss > 2\n );\n}\n\n// Get the input items from the previous node\nconst inputItems = items.map(item => item.json); // Adjust based on your actual data structure\n\n// Filter the items based on the conditions\nconst filteredItems = filterItems(inputItems);\n\n// Return the filtered items to the workflow\nreturn filteredItems.map(item => {\n return { json: item }; // Format each filtered item as JSON\n});\n" }, "typeVersion": 2 }, { "id": "6db219fd-f54d-4bf8-b150-9c4f3069cf92", "name": "Average Latency & Loss over 5m", "type": "n8n-nodes-base.code", "notes": "This node uses JavaScript to calculate the average over the last 5 entries of packet loss and latency", "position": [ 1860, 400 ], "parameters": { "jsCode": "// Assuming $input.all() is an array of items and each item has a json property\nfunction calculateAverages(inputItems) {\n return inputItems.map(item => {\n // Calculate total and average loss\n const totalLoss = \n parseFloat(item.json['TS0-Loss']) +\n parseFloat(item.json['TS1-Loss']) +\n parseFloat(item.json['TS2-Loss']) +\n parseFloat(item.json['TS3-Loss']) +\n parseFloat(item.json['TS4-Loss']);\n const averageLoss = totalLoss / 5;\n item.json['AverageLoss'] = averageLoss;\n\n // Calculate total and average latency\n const totalLatency = \n parseFloat(item.json['TS0-Latency']) +\n parseFloat(item.json['TS1-Latency']) +\n parseFloat(item.json['TS2-Latency']) +\n parseFloat(item.json['TS3-Latency']) +\n parseFloat(item.json['TS4-Latency']);\n const averageLatency = totalLatency / 5;\n item.json['AverageLatency'] = averageLatency;\n\n // Return the modified item\n return item;\n });\n}\n\nreturn calculateAverages($input.all());\n" }, "typeVersion": 2 }, { "id": "f3831843-2596-492d-b800-7d349e443293", "name": "Get Uplink Loss and Latency", "type": "n8n-nodes-base.httpRequest", "notes": "This uses a URL with an expression in the middle so that for each org ID it will pull the Loss and Latency for their uplinks. ", "position": [ 840, 400 ], "parameters": { "url": "=https://api.meraki.com/api/v1/organizations/{{ $json.id }}/devices/uplinksLossAndLatency?timespan=300", "options": { "redirect": { "redirect": {} } }, "sendHeaders": true, "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/json" } ] } }, "credentials": { "httpHeaderAuth": { "id": "12", "name": "Header Auth account" } }, "typeVersion": 4.1 }, { "id": "87c3f32c-de4f-48fd-a711-3521a008c245", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "notes": "schedules the workflow to run every 5 minutes mon-fri 8am-5pm", "position": [ 380, 240 ], "parameters": { "rule": { "interval": [ { "field": "cronExpression", "expression": "*/5 8-16 * * 1-5" } ] } }, "typeVersion": 1.1 }, { "id": "572adb5c-6745-4b4e-89d8-a97835c3d486", "name": "Sets Network Variables", "type": "n8n-nodes-base.set", "notes": "Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. ", "position": [ 1220, 240 ], "parameters": { "fields": { "values": [ { "name": "NetworkID", "stringValue": "={{ $json.id }}" }, { "name": "NetworkName", "stringValue": "={{ $json.name }}" }, { "name": "networkURL", "stringValue": "={{ $json.url }}" } ] }, "include": "selected", "options": {} }, "typeVersion": 3.2 }, { "id": "01717ed3-1012-4eda-9da9-567038132e06", "name": "Merge", "type": "n8n-nodes-base.merge", "notes": "This looks at the problematic sites as well as the info from the database. It will pass on all non-matching as if the site name matches with the database then that means we have an open alert for that site already.", "position": [ 2720, 300 ], "parameters": { "mode": "combine", "options": {}, "joinMode": "keepNonMatches", "mergeByFields": { "values": [ { "field1": "NetworkName", "field2": "NetworkName" } ] }, "outputDataFrom": "input2" }, "typeVersion": 2.1 }, { "id": "a20f6f7c-0c92-4db9-903b-e322d67b536d", "name": "Check if Alert Exists", "type": "n8n-nodes-base.redis", "notes": "This node Looks to see if the alert already exists in the Redis database. If it does exist it won't alert us in Teams", "position": [ 2300, 240
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833\",\n \"templateId\": \"2054\"\n },\n \"nodes\": [\n {\n \"id\": \"3b18d784-eded-4b74-ac44-b25565049e13\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 380,\n 400\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"96eadd32-17c2-44b0-a00b-8e2ddcecaafa\",\n \"name\": \"Get Meraki Organizations\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This node uses an API call to Meraki using the URL https://api.meraki.com/api/v1/organizations\\n\\nthe Authorization header is what is used to authenticate. You also have to set it to accept json\",\n \"position\": [\n 620,\n 320\n ],\n \"parameters\": {\n \"url\": \"https://api.meraki.com/api/v1/organizations\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"12\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"444071ea-a364-45a6-9430-0338d2752b18\",\n \"name\": \"Get Network IDs\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This node uses a URL with an expression in the middle to do an API call for each ORG ID that was pulled to pull all the network's for each org\",\n \"position\": [\n 1020,\n 240\n ],\n \"parameters\": {\n \"url\": \"=https://api.meraki.com/api/v1/organizations/{{ $json.OrgID }}/networks \",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\"\n },\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"42deea02-e2d2-4ba6-97f7-698c219715a5\",\n \"name\": \"Get Org Name & ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 840,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"CompanyName\",\n \"stringValue\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"OrgID\",\n \"stringValue\": \"={{ $json.id }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"3d5ce6a8-bf05-4457-88e6-c5ad5a995b1d\",\n \"name\": \"Combine latency to its respective Network\",\n \"type\": \"n8n-nodes-base.merge\",\n \"notes\": \"This node matches on the NetworkID field, so that the networks we pulled earlier and the Loss / Latency can be combined into one dataset\",\n \"position\": [\n 1500,\n 400\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"joinMode\": \"enrichInput1\",\n \"mergeByFields\": {\n \"values\": [\n {\n \"field1\": \"NetworkID\",\n \"field2\": \"networkId\"\n }\n ]\n }\n },\n \"notesInFlow\": false,\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"caafd6dd-a2b2-405d-a078-cea3bb615788\",\n \"name\": \"Makes Latency and Loss Filterable\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 1680,\n 400\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"networkId\",\n \"stringValue\": \"={{ $json.networkId }}\"\n },\n {\n \"name\": \"NetworkName\",\n \"stringValue\": \"={{ $json.NetworkName }}\"\n },\n {\n \"name\": \"networkURL\",\n \"stringValue\": \"={{ $json.networkURL }}\"\n },\n {\n \"name\": \"Serial\",\n \"stringValue\": \"={{ $json.serial }}\"\n },\n {\n \"name\": \"TS0-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[0].lossPercent }}\"\n },\n {\n \"name\": \"TS1-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[1].lossPercent }}\"\n },\n {\n \"name\": \"TS2-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[2].lossPercent }}\"\n },\n {\n \"name\": \"TS3-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[3].lossPercent }}\"\n },\n {\n \"name\": \"TS4-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[4].lossPercent }}\"\n },\n {\n \"name\": \"TS0-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[0].latencyMs }}\"\n },\n {\n \"name\": \"TS1-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[1].latencyMs }}\"\n },\n {\n \"name\": \"TS2-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[2].latencyMs }}\"\n },\n {\n \"name\": \"TS3-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[3].latencyMs }}\"\n },\n {\n \"name\": \"TS4-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[4].latencyMs }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"c695fd89-c884-4794-b0e5-51b91a71ac5c\",\n \"name\": \"Filters Problematic sites\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"This node uses JavaScript to look at the calculated averages and if they pass the threshold for 300ms Latency or 2% Loss it will pass that site info forward\",\n \"position\": [\n 2040,\n 400\n ],\n \"parameters\": {\n \"jsCode\": \"// Function to filter items based on averageLatency and averageLoss\\nfunction filterItems(items) {\\n return items.filter(item =>\\n item.AverageLatency >300 || item.AverageLoss > 2\\n );\\n}\\n\\n// Get the input items from the previous node\\nconst inputItems = items.map(item => item.json); // Adjust based on your actual data structure\\n\\n// Filter the items based on the conditions\\nconst filteredItems = filterItems(inputItems);\\n\\n// Return the filtered items to the workflow\\nreturn filteredItems.map(item => {\\n return { json: item }; // Format each filtered item as JSON\\n});\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"6db219fd-f54d-4bf8-b150-9c4f3069cf92\",\n \"name\": \"Average Latency & Loss over 5m\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"This node uses JavaScript to calculate the average over the last 5 entries of packet loss and latency\",\n \"position\": [\n 1860,\n 400\n ],\n \"parameters\": {\n \"jsCode\": \"// Assuming $input.all() is an array of items and each item has a json property\\nfunction calculateAverages(inputItems) {\\n return inputItems.map(item => {\\n // Calculate total and average loss\\n const totalLoss = \\n parseFloat(item.json['TS0-Loss']) +\\n parseFloat(item.json['TS1-Loss']) +\\n parseFloat(item.json['TS2-Loss']) +\\n parseFloat(item.json['TS3-Loss']) +\\n parseFloat(item.json['TS4-Loss']);\\n const averageLoss = totalLoss / 5;\\n item.json['AverageLoss'] = averageLoss;\\n\\n // Calculate total and average latency\\n const totalLatency = \\n parseFloat(item.json['TS0-Latency']) +\\n parseFloat(item.json['TS1-Latency']) +\\n parseFloat(item.json['TS2-Latency']) +\\n parseFloat(item.json['TS3-Latency']) +\\n parseFloat(item.json['TS4-Latency']);\\n const averageLatency = totalLatency / 5;\\n item.json['AverageLatency'] = averageLatency;\\n\\n // Return the modified item\\n return item;\\n });\\n}\\n\\nreturn calculateAverages($input.all());\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"f3831843-2596-492d-b800-7d349e443293\",\n \"name\": \"Get Uplink Loss and Latency\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This uses a URL with an expression in the middle so that for each org ID it will pull the Loss and Latency for their uplinks. \",\n \"position\": [\n 840,\n 400\n ],\n \"parameters\": {\n \"url\": \"=https://api.meraki.com/api/v1/organizations/{{ $json.id }}/devices/uplinksLossAndLatency?timespan=300\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"12\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"87c3f32c-de4f-48fd-a711-3521a008c245\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"notes\": \"schedules the workflow to run every 5 minutes mon-fri 8am-5pm\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"cronExpression\",\n \"expression\": \"*/5 8-16 * * 1-5\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"572adb5c-6745-4b4e-89d8-a97835c3d486\",\n \"name\": \"Sets Network Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 1220,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"NetworkID\",\n \"stringValue\": \"={{ $json.id }}\"\n },\n {\n \"name\": \"NetworkName\",\n \"stringValue\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"networkURL\",\n \"stringValue\": \"={{ $json.url }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"01717ed3-1012-4eda-9da9-567038132e06\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"notes\": \"This looks at the problematic sites as well as the info from the database. It will pass on all non-matching as if the site name matches with the database then that means we have an open alert for that site already.\",\n \"position\": [\n 2720,\n 300\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"joinMode\": \"keepNonMatches\",\n \"mergeByFields\": {\n \"values\": [\n {\n \"field1\": \"NetworkName\",\n \"field2\": \"NetworkName\"\n }\n ]\n },\n \"outputDataFrom\": \"input2\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"a20f6f7c-0c92-4db9-903b-e322d67b536d\",\n \"name\": \"Check if Alert Exists\",\n \"type\": \"n8n-nodes-base.redis\",\n \"notes\": \"This node Looks to see if the alert already exists in the Redis database. If it does exist it won't alert us in Teams\",\n \"position\": [\n 2300,\n 240\n ],\n \"parameters\": {\n \"key\": \"={{ $json.NetworkName }}\",\n \"options\": {\n \"dotNotation\": \"={{ true }}\"\n },\n \"operation\": \"get\",\n \"propertyName\": \"NetworkName\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"63590446-2938-443a-adbe-bfc0ba89008c\",\n \"name\": \"Create Response\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"If the alert isn't in the database all the Redis will respond with is \\\"null\\\" \\n\\nother n8n nodes see null as (no data) and show blank which is fair. So I made this node to look at the null responses and make a response of \\\"false\\\" for a \\\"alertExists\\\" variable. that way we have something to filter on\",\n \"position\": [\n 2500,\n 240\n ],\n \"parameters\": {\n \"jsCode\": \"return items.map(item => {\\n // Check if the 'NetworkName' property is not null, indicating an alert exists.\\n // If 'NetworkName' is null, no alert exists for this network.\\n const alertExists = item.json.NetworkName !== null;\\n\\n // Set the alertExists property correctly based on the condition.\\n item.json.alertExists = alertExists;\\n\\n return item;\\n});\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"c63e2a45-bf5e-455f-8012-9868d55aa3e2\",\n \"name\": \"Message Techs\",\n \"type\": \"n8n-nodes-base.microsoftTeams\",\n \"notes\": \"sends an alert to Dispatch with info related to the site.\",\n \"position\": [\n 2920,\n 300\n ],\n \"parameters\": {\n \"chatId\": \"19:bfd41d9621e544c88ae9f2f275e373b5@thread.v2\",\n \"message\": \"=<strong>Loss & Latency Alert</strong> <br><br>\\n<strong>Network Name:</strong> <a href=\\\"{{ $json.networkURL }}\\\">{{ $json.NetworkName }}</a> <br>\\n<strong>Average Loss:</strong> {{ $json.AverageLoss }}% <br>\\n<strong>Average Latency:</strong> {{ $json.AverageLatency }} <br> \",\n \"options\": {},\n \"resource\": \"chatMessage\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"b4ae54cd-8345-4611-9fbe-32e7537855a9\",\n \"name\": \"Log the Alert\",\n \"type\": \"n8n-nodes-base.redis\",\n \"notes\": \"Logs the alert and sets the TTL to 3h, after 3h Redis will delete the entry and if the site is still having issues, the next run of the workflow will notify us again\",\n \"position\": [\n 3120,\n 300\n ],\n \"parameters\": {\n \"key\": \"={{ $('Merge').item.json.NetworkName }}\",\n \"ttl\": 10800,\n \"value\": \"={{ $('Merge').item.json.NetworkName }}\",\n \"expire\": true,\n \"keyType\": \"string\",\n \"operation\": \"set\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"05416de5-a0c0-4ff8-bfc5-3d26f0d88139\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 573.394087003982,\n 143.69977924944794\n ],\n \"parameters\": {\n \"width\": 791.5865288559442,\n \"height\": 462.84878343542437,\n \"content\": \"## Pulling in Info \\nThis section pulls in all the data we will need to see any possible errors and generate our alert\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"aeb1c8a6-3cec-4899-83e2-098d0b1a9703\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1464,\n 211\n ],\n \"parameters\": {\n \"width\": 688.5000872281419,\n \"height\": 411.1258278145692,\n \"content\": \"## Changing data\\nThis section pulls together the data we got from the first section and sets everything up to be notified \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9ca9e89b-61ce-4b3f-af8e-bf03daff6710\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2260,\n 60\n ],\n \"parameters\": {\n \"width\": 1015.6997792494475,\n \"height\": 614.8167770419421,\n \"content\": \"## Notify\\nThis last section is for the push of the alert as well as storing the alert as to not re-notify every time the workflow runs\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"801879be-e83b-4c74-b8ac-b20157ca32d1\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 600,\n 640\n ],\n \"parameters\": {\n \"width\": 673.6064168725538,\n \"height\": 394.26386951839356,\n \"content\": \"## Explanation\\nusing an HTTP request you will can do a get request for all Organizations your Meraki account has access to. \\n\\nYou will have to Generate your own API key inside of the Meraki Dashboard explained here https://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API\\n\\nYou will have to add two headers to your HTTPS node Authorization and Accept. the 1st is how you'll authenticate with Meraki and the second is how it will know how to answer the request. \\n\\nUsing the same methods you'll do a get for Organizations, Network IDs and Uplink stats\\n\\nUsing the Set nodes to organize the data in a \\\"neat\\\" way\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b028326-0776-4b9b-bdf2-d79949809092\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1480,\n 660\n ],\n \"parameters\": {\n \"width\": 645.9603701592033,\n \"height\": 389.89870424786454,\n \"content\": \"## Explanation\\nthe Merge node will combine the Networks with their respective stats by matching on NetworkID and networkid and enriching the input \\n\\nagain we add a set node to better organize the statistics of the uplinks. \\n\\nThe first JS node will average the 5 Time stamps of Latency and Packet loss \\n\\nThe last JS node will send the data forward only for sites that pass the threshold (in this example 300ms latency and 2% packet loss) \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f7c1448d-3a03-4196-bde6-a1aea92f28ad\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2300,\n 700\n ],\n \"parameters\": {\n \"width\": 913.6905067516504,\n \"height\": 523.763772544089,\n \"content\": \"## Explanation \\nwe will send the problematic sites to both the Redis node and the Merge node. \\n\\nThe Redis node does a get request to see if a key exists matching the Network name in Meraki. If so it will respond with the Network name, If not it will respond with \\\"null\\\" \\n\\nthe n8n nodes view \\\"null\\\" as no data (which isn't exactly wrong as it literally is no data) but the next node will just say the input is blank so I've added the JS node to look at the output and respond if an alert does or doesn't exist based on the response of the Redis node. \\n\\nThis time we Merge looking at the NetworkName and keep all non-matching. The reason for this is because if they match, that means the key in the database exists, meaning we've already sent a message that the site is having issues. \\n\\nWe send the tickets forth that don't match and we will send a teams message that will notify of a Network passing the threshold for issues. I've included the Network URL and re-written the message to include a hyperlink that way the alert can be used to take you straight to the problematic site. \\n\\nFinally we log the site in the database with a TTL of 3h, this way if the error has not been fixed in 3h we will get another message. \\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4f4d40ef-8e7d-420a-8273-4cfefd3af6e9\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1460,\n -320\n ],\n \"parameters\": {\n \"width\": 670.6963066922013,\n \"height\": 366.61782280504275,\n \"content\": \"## other usecases \\n If you feel confident enough the Teams nodes can be replaced with a node that can generate a ticket for your PSA such as ConnectWise Mange. That way these are generating tickets rather than just messages. \"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Message Techs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Message Techs\": {\n \"main\": [\n [\n {\n \"node\": \"Log the Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Response\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Network IDs\": {\n \"main\": [\n [\n {\n \"node\": \"Sets Network Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get Meraki Organizations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Org Name & ID\": {\n \"main\": [\n [\n {\n \"node\": \"Get Network IDs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Alert Exists\": {\n \"main\": [\n [\n {\n \"node\": \"Create Response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Sets Network Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Combine latency to its respective Network\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Meraki Organizations\": {\n \"main\": [\n [\n {\n \"node\": \"Get Org Name & ID\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Get Uplink Loss and Latency\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filters Problematic sites\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Alert Exists\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Get Uplink Loss and Latency\": {\n \"main\": [\n [\n {\n \"node\": \"Combine latency to its respective Network\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Average Latency & Loss over 5m\": {\n \"main\": [\n [\n {\n \"node\": \"Filters Problematic sites\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get Meraki Organizations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Makes Latency and Loss Filterable\": {\n \"main\": [\n [\n {\n \"node\": \"Average Latency & Loss over 5m\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Combine latency to its respective Network\": {\n \"main\": [\n [\n {\n \"node\": \"Makes Latency and Loss Filterable\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
19
0
3
true
combined_workflows.json
{ "input": "The workflow monitors network performance (latency and packet loss) in a Meraki environment, identifies problematic sites exceeding thresholds, and alerts relevant teams via Microsoft Teams, while preventing redundant alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17421, "processed_size": 17421, "processed_timestamp": "2025-04-09T03:08:37.526761", "timestamp": "2025-04-09T02:35:30.239708", "token_count": 4095, "tokens": 2044, "workflow_chunk_info": { "is_truncated": false, "original_size": 17421, "processed_size": 17421, "workflow_hash": "8b616775bbc651475e0ef090a5e5e336" }, "workflow_hash": "8b616775bbc651475e0ef090a5e5e336" }
ByFields": { "values": [ { "field1": "NetworkName", "field2": "NetworkName" } ] }, "outputDataFrom": "input2" }, "typeVersion": 2.1 }, { "id": "a20f6f7c-0c92-4db9-903b-e322d67b536d", "name": "Check if Alert Exists", "type": "n8n-nodes-base.redis", "notes": "This node Looks to see if the alert already exists in the Redis database. If it does exist it won't alert us in Teams", "position": [ 2300, 240 ], "parameters": { "key": "={{ $json.NetworkName }}", "options": { "dotNotation": "={{ true }}" }, "operation": "get", "propertyName": "NetworkName" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "63590446-2938-443a-adbe-bfc0ba89008c", "name": "Create Response", "type": "n8n-nodes-base.code", "notes": "If the alert isn't in the database all the Redis will respond with is \"null\" \n\nother n8n nodes see null as (no data) and show blank which is fair. So I made this node to look at the null responses and make a response of \"false\" for a \"alertExists\" variable. that way we have something to filter on", "position": [ 2500, 240 ], "parameters": { "jsCode": "return items.map(item => {\n // Check if the 'NetworkName' property is not null, indicating an alert exists.\n // If 'NetworkName' is null, no alert exists for this network.\n const alertExists = item.json.NetworkName !== null;\n\n // Set the alertExists property correctly based on the condition.\n item.json.alertExists = alertExists;\n\n return item;\n});\n" }, "typeVersion": 2 }, { "id": "c63e2a45-bf5e-455f-8012-9868d55aa3e2", "name": "Message Techs", "type": "n8n-nodes-base.microsoftTeams", "notes": "sends an alert to Dispatch with info related to the site.", "position": [ 2920, 300 ], "parameters": { "chatId": "19:bfd41d9621e544c88ae9f2f275e373b5@thread.v2", "message": "=<strong>Loss & Latency Alert</strong> <br><br>\n<strong>Network Name:</strong> <a href=\"{{ $json.networkURL }}\">{{ $json.NetworkName }}</a> <br>\n<strong>Average Loss:</strong> {{ $json.AverageLoss }}% <br>\n<strong>Average Latency:</strong> {{ $json.AverageLatency }} <br> ", "options": {}, "resource": "chatMessage" }, "typeVersion": 1.1 }, { "id": "b4ae54cd-8345-4611-9fbe-32e7537855a9", "name": "Log the Alert", "type": "n8n-nodes-base.redis", "notes": "Logs the alert and sets the TTL to 3h, after 3h Redis will delete the entry and if the site is still having issues, the next run of the workflow will notify us again", "position": [ 3120, 300 ], "parameters": { "key": "={{ $('Merge').item.json.NetworkName }}", "ttl": 10800, "value": "={{ $('Merge').item.json.NetworkName }}", "expire": true, "keyType": "string", "operation": "set" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "05416de5-a0c0-4ff8-bfc5-3d26f0d88139", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 573.394087003982, 143.69977924944794 ], "parameters": { "width": 791.5865288559442, "height": 462.84878343542437, "content": "## Pulling in Info \nThis section pulls in all the data we will need to see any possible errors and generate our alert\n" }, "typeVersion": 1 }, { "id": "aeb1c8a6-3cec-4899-83e2-098d0b1a9703", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1464, 211 ], "parameters": { "width": 688.5000872281419, "height": 411.1258278145692, "content": "## Changing data\nThis section pulls together the data we got from the first section and sets everything up to be notified " }, "typeVersion": 1 }, { "id": "9ca9e89b-61ce-4b3f-af8e-bf03daff6710", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 2260, 60 ], "parameters": { "width": 1015.6997792494475, "height": 614.8167770419421, "content": "## Notify\nThis last section is for the push of the alert as well as storing the alert as to not re-notify every time the workflow runs" }, "typeVersion": 1 }, { "id": "801879be-e83b-4c74-b8ac-b20157ca32d1", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 600, 640 ], "parameters": { "width": 673.6064168725538, "height": 394.26386951839356, "content": "## Explanation\nusing an HTTP request you will can do a get request for all Organizations your Meraki account has access to. \n\nYou will have to Generate your own API key inside of the Meraki Dashboard explained here https://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API\n\nYou will have to add two headers to your HTTPS node Authorization and Accept. the 1st is how you'll authenticate with Meraki and the second is how it will know how to answer the request. \n\nUsing the same methods you'll do a get for Organizations, Network IDs and Uplink stats\n\nUsing the Set nodes to organize the data in a \"neat\" way" }, "typeVersion": 1 }, { "id": "2b028326-0776-4b9b-bdf2-d79949809092", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1480, 660 ], "parameters": { "width": 645.9603701592033, "height": 389.89870424786454, "content": "## Explanation\nthe Merge node will combine the Networks with their respective stats by matching on NetworkID and networkid and enriching the input \n\nagain we add a set node to better organize the statistics of the uplinks. \n\nThe first JS node will average the 5 Time stamps of Latency and Packet loss \n\nThe last JS node will send the data forward only for sites that pass the threshold (in this example 300ms latency and 2% packet loss) " }, "typeVersion": 1 }, { "id": "f7c1448d-3a03-4196-bde6-a1aea92f28ad", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 2300, 700 ], "parameters": { "width": 913.6905067516504, "height": 523.763772544089, "content": "## Explanation \nwe will send the problematic sites to both the Redis node and the Merge node. \n\nThe Redis node does a get request to see if a key exists matching the Network name in Meraki. If so it will respond with the Network name, If not it will respond with \"null\" \n\nthe n8n nodes view \"null\" as no data (which isn't exactly wrong as it literally is no data) but the next node will just say the input is blank so I've added the JS node to look at the output and respond if an alert does or doesn't exist based on the response of the Redis node. \n\nThis time we Merge looking at the NetworkName and keep all non-matching. The reason for this is because if they match, that means the key in the database exists, meaning we've already sent a message that the site is having issues. \n\nWe send the tickets forth that don't match and we will send a teams message that will notify of a Network passing the threshold for issues. I've included the Network URL and re-written the message to include a hyperlink that way the alert can be used to take you straight to the problematic site. \n\nFinally we log the site in the database with a TTL of 3h, this way if the error has not been fixed in 3h we will get another message. \n" }, "typeVersion": 1 }, { "id": "4f4d40ef-8e7d-420a-8273-4cfefd3af6e9", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 1460, -320 ], "parameters": { "width": 670.6963066922013, "height": 366.61782280504275, "content": "## other usecases \n If you feel confident enough the Teams nodes can be replaced with a node that can generate a ticket for your PSA such as ConnectWise Mange. That way these are generating tickets rather than just messages. " }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Merge": { "main": [ [ { "node": "Message Techs", "type": "main", "index": 0 } ] ] }, "Message Techs": { "main": [ [ { "node": "Log the Alert", "type": "main", "index": 0 } ] ] }, "Create Response": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Get Network IDs": { "main": [ [ { "node": "Sets Network Variables", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Get Meraki Organizations", "type": "main", "index": 0 } ] ] }, "Get Org Name & ID": { "main": [ [ { "node": "Get Network IDs", "type": "main", "index": 0 } ] ] }, "Check if Alert Exists": { "main": [ [ { "node": "Create Response", "type": "main", "index": 0 } ] ] }, "Sets Network Variables": { "main": [ [ { "node": "Combine latency to its respective Network", "type": "main", "index": 0 } ] ] }, "Get Meraki Organizations": { "main": [ [ { "node": "Get Org Name & ID", "type": "main", "index": 0 }, { "node": "Get Uplink Loss and Latency", "type": "main", "index": 0 } ] ] }, "Filters Problematic sites": { "main": [ [ { "node": "Check if Alert Exists", "type": "main", "index": 0 }, { "node": "Merge", "type": "main", "index": 1 } ] ] }, "Get Uplink Loss and Latency": { "main": [ [ { "node": "Combine latency to its respective Network", "type": "main", "index": 1 } ] ] }, "Average Latency & Loss over 5m": { "main": [ [ { "node": "Filters Problematic sites", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Get Meraki Organizations", "type": "main", "index": 0 } ] ] }, "Makes Latency and Loss Filterable": { "main": [ [ { "node": "Average Latency & Loss over 5m", "type": "main", "index": 0 } ] ] }, "Combine latency to its respective Network": { "main": [ [ { "node": "Makes Latency and Loss Filterable", "type": "main", "index": 0 } ] ] } } } ``` [/INST
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833\",\n \"templateId\": \"2054\"\n },\n \"nodes\": [\n {\n \"id\": \"3b18d784-eded-4b74-ac44-b25565049e13\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 380,\n 400\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"96eadd32-17c2-44b0-a00b-8e2ddcecaafa\",\n \"name\": \"Get Meraki Organizations\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This node uses an API call to Meraki using the URL https://api.meraki.com/api/v1/organizations\\n\\nthe Authorization header is what is used to authenticate. You also have to set it to accept json\",\n \"position\": [\n 620,\n 320\n ],\n \"parameters\": {\n \"url\": \"https://api.meraki.com/api/v1/organizations\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"12\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"444071ea-a364-45a6-9430-0338d2752b18\",\n \"name\": \"Get Network IDs\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This node uses a URL with an expression in the middle to do an API call for each ORG ID that was pulled to pull all the network's for each org\",\n \"position\": [\n 1020,\n 240\n ],\n \"parameters\": {\n \"url\": \"=https://api.meraki.com/api/v1/organizations/{{ $json.OrgID }}/networks \",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\"\n },\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"42deea02-e2d2-4ba6-97f7-698c219715a5\",\n \"name\": \"Get Org Name & ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 840,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"CompanyName\",\n \"stringValue\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"OrgID\",\n \"stringValue\": \"={{ $json.id }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"3d5ce6a8-bf05-4457-88e6-c5ad5a995b1d\",\n \"name\": \"Combine latency to its respective Network\",\n \"type\": \"n8n-nodes-base.merge\",\n \"notes\": \"This node matches on the NetworkID field, so that the networks we pulled earlier and the Loss / Latency can be combined into one dataset\",\n \"position\": [\n 1500,\n 400\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"joinMode\": \"enrichInput1\",\n \"mergeByFields\": {\n \"values\": [\n {\n \"field1\": \"NetworkID\",\n \"field2\": \"networkId\"\n }\n ]\n }\n },\n \"notesInFlow\": false,\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"caafd6dd-a2b2-405d-a078-cea3bb615788\",\n \"name\": \"Makes Latency and Loss Filterable\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 1680,\n 400\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"networkId\",\n \"stringValue\": \"={{ $json.networkId }}\"\n },\n {\n \"name\": \"NetworkName\",\n \"stringValue\": \"={{ $json.NetworkName }}\"\n },\n {\n \"name\": \"networkURL\",\n \"stringValue\": \"={{ $json.networkURL }}\"\n },\n {\n \"name\": \"Serial\",\n \"stringValue\": \"={{ $json.serial }}\"\n },\n {\n \"name\": \"TS0-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[0].lossPercent }}\"\n },\n {\n \"name\": \"TS1-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[1].lossPercent }}\"\n },\n {\n \"name\": \"TS2-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[2].lossPercent }}\"\n },\n {\n \"name\": \"TS3-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[3].lossPercent }}\"\n },\n {\n \"name\": \"TS4-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[4].lossPercent }}\"\n },\n {\n \"name\": \"TS0-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[0].latencyMs }}\"\n },\n {\n \"name\": \"TS1-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[1].latencyMs }}\"\n },\n {\n \"name\": \"TS2-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[2].latencyMs }}\"\n },\n {\n \"name\": \"TS3-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[3].latencyMs }}\"\n },\n {\n \"name\": \"TS4-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[4].latencyMs }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"c695fd89-c884-4794-b0e5-51b91a71ac5c\",\n \"name\": \"Filters Problematic sites\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"This node uses JavaScript to look at the calculated averages and if they pass the threshold for 300ms Latency or 2% Loss it will pass that site info forward\",\n \"position\": [\n 2040,\n 400\n ],\n \"parameters\": {\n \"jsCode\": \"// Function to filter items based on averageLatency and averageLoss\\nfunction filterItems(items) {\\n return items.filter(item =>\\n item.AverageLatency >300 || item.AverageLoss > 2\\n );\\n}\\n\\n// Get the input items from the previous node\\nconst inputItems = items.map(item => item.json); // Adjust based on your actual data structure\\n\\n// Filter the items based on the conditions\\nconst filteredItems = filterItems(inputItems);\\n\\n// Return the filtered items to the workflow\\nreturn filteredItems.map(item => {\\n return { json: item }; // Format each filtered item as JSON\\n});\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"6db219fd-f54d-4bf8-b150-9c4f3069cf92\",\n \"name\": \"Average Latency & Loss over 5m\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"This node uses JavaScript to calculate the average over the last 5 entries of packet loss and latency\",\n \"position\": [\n 1860,\n 400\n ],\n \"parameters\": {\n \"jsCode\": \"// Assuming $input.all() is an array of items and each item has a json property\\nfunction calculateAverages(inputItems) {\\n return inputItems.map(item => {\\n // Calculate total and average loss\\n const totalLoss = \\n parseFloat(item.json['TS0-Loss']) +\\n parseFloat(item.json['TS1-Loss']) +\\n parseFloat(item.json['TS2-Loss']) +\\n parseFloat(item.json['TS3-Loss']) +\\n parseFloat(item.json['TS4-Loss']);\\n const averageLoss = totalLoss / 5;\\n item.json['AverageLoss'] = averageLoss;\\n\\n // Calculate total and average latency\\n const totalLatency = \\n parseFloat(item.json['TS0-Latency']) +\\n parseFloat(item.json['TS1-Latency']) +\\n parseFloat(item.json['TS2-Latency']) +\\n parseFloat(item.json['TS3-Latency']) +\\n parseFloat(item.json['TS4-Latency']);\\n const averageLatency = totalLatency / 5;\\n item.json['AverageLatency'] = averageLatency;\\n\\n // Return the modified item\\n return item;\\n });\\n}\\n\\nreturn calculateAverages($input.all());\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"f3831843-2596-492d-b800-7d349e443293\",\n \"name\": \"Get Uplink Loss and Latency\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This uses a URL with an expression in the middle so that for each org ID it will pull the Loss and Latency for their uplinks. \",\n \"position\": [\n 840,\n 400\n ],\n \"parameters\": {\n \"url\": \"=https://api.meraki.com/api/v1/organizations/{{ $json.id }}/devices/uplinksLossAndLatency?timespan=300\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"12\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"87c3f32c-de4f-48fd-a711-3521a008c245\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"notes\": \"schedules the workflow to run every 5 minutes mon-fri 8am-5pm\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"cronExpression\",\n \"expression\": \"*/5 8-16 * * 1-5\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"572adb5c-6745-4b4e-89d8-a97835c3d486\",\n \"name\": \"Sets Network Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 1220,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"NetworkID\",\n \"stringValue\": \"={{ $json.id }}\"\n },\n {\n \"name\": \"NetworkName\",\n \"stringValue\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"networkURL\",\n \"stringValue\": \"={{ $json.url }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"01717ed3-1012-4eda-9da9-567038132e06\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"notes\": \"This looks at the problematic sites as well as the info from the database. It will pass on all non-matching as if the site name matches with the database then that means we have an open alert for that site already.\",\n \"position\": [\n 2720,\n 300\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"joinMode\": \"keepNonMatches\",\n \"mergeByFields\": {\n \"values\": [\n {\n \"field1\": \"NetworkName\",\n \"field2\": \"NetworkName\"\n }\n ]\n },\n \"outputDataFrom\": \"input2\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"a20f6f7c-0c92-4db9-903b-e322d67b536d\",\n \"name\": \"Check if Alert Exists\",\n \"type\": \"n8n-nodes-base.redis\",\n \"notes\": \"This node Looks to see if the alert already exists in the Redis database. If it does exist it won't alert us in Teams\",\n \"position\": [\n 2300,\n 240\n ],\n \"parameters\": {\n \"key\": \"={{ $json.NetworkName }}\",\n \"options\": {\n \"dotNotation\": \"={{ true }}\"\n },\n \"operation\": \"get\",\n \"propertyName\": \"NetworkName\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"63590446-2938-443a-adbe-bfc0ba89008c\",\n \"name\": \"Create Response\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"If the alert isn't in the database all the Redis will respond with is \\\"null\\\" \\n\\nother n8n nodes see null as (no data) and show blank which is fair. So I made this node to look at the null responses and make a response of \\\"false\\\" for a \\\"alertExists\\\" variable. that way we have something to filter on\",\n \"position\": [\n 2500,\n 240\n ],\n \"parameters\": {\n \"jsCode\": \"return items.map(item => {\\n // Check if the 'NetworkName' property is not null, indicating an alert exists.\\n // If 'NetworkName' is null, no alert exists for this network.\\n const alertExists = item.json.NetworkName !== null;\\n\\n // Set the alertExists property correctly based on the condition.\\n item.json.alertExists = alertExists;\\n\\n return item;\\n});\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"c63e2a45-bf5e-455f-8012-9868d55aa3e2\",\n \"name\": \"Message Techs\",\n \"type\": \"n8n-nodes-base.microsoftTeams\",\n \"notes\": \"sends an alert to Dispatch with info related to the site.\",\n \"position\": [\n 2920,\n 300\n ],\n \"parameters\": {\n \"chatId\": \"19:bfd41d9621e544c88ae9f2f275e373b5@thread.v2\",\n \"message\": \"=<strong>Loss & Latency Alert</strong> <br><br>\\n<strong>Network Name:</strong> <a href=\\\"{{ $json.networkURL }}\\\">{{ $json.NetworkName }}</a> <br>\\n<strong>Average Loss:</strong> {{ $json.AverageLoss }}% <br>\\n<strong>Average Latency:</strong> {{ $json.AverageLatency }} <br> \",\n \"options\": {},\n \"resource\": \"chatMessage\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"b4ae54cd-8345-4611-9fbe-32e7537855a9\",\n \"name\": \"Log the Alert\",\n \"type\": \"n8n-nodes-base.redis\",\n \"notes\": \"Logs the alert and sets the TTL to 3h, after 3h Redis will delete the entry and if the site is still having issues, the next run of the workflow will notify us again\",\n \"position\": [\n 3120,\n 300\n ],\n \"parameters\": {\n \"key\": \"={{ $('Merge').item.json.NetworkName }}\",\n \"ttl\": 10800,\n \"value\": \"={{ $('Merge').item.json.NetworkName }}\",\n \"expire\": true,\n \"keyType\": \"string\",\n \"operation\": \"set\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"05416de5-a0c0-4ff8-bfc5-3d26f0d88139\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 573.394087003982,\n 143.69977924944794\n ],\n \"parameters\": {\n \"width\": 791.5865288559442,\n \"height\": 462.84878343542437,\n \"content\": \"## Pulling in Info \\nThis section pulls in all the data we will need to see any possible errors and generate our alert\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"aeb1c8a6-3cec-4899-83e2-098d0b1a9703\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1464,\n 211\n ],\n \"parameters\": {\n \"width\": 688.5000872281419,\n \"height\": 411.1258278145692,\n \"content\": \"## Changing data\\nThis section pulls together the data we got from the first section and sets everything up to be notified \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9ca9e89b-61ce-4b3f-af8e-bf03daff6710\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2260,\n 60\n ],\n \"parameters\": {\n \"width\": 1015.6997792494475,\n \"height\": 614.8167770419421,\n \"content\": \"## Notify\\nThis last section is for the push of the alert as well as storing the alert as to not re-notify every time the workflow runs\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"801879be-e83b-4c74-b8ac-b20157ca32d1\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 600,\n 640\n ],\n \"parameters\": {\n \"width\": 673.6064168725538,\n \"height\": 394.26386951839356,\n \"content\": \"## Explanation\\nusing an HTTP request you will can do a get request for all Organizations your Meraki account has access to. \\n\\nYou will have to Generate your own API key inside of the Meraki Dashboard explained here https://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API\\n\\nYou will have to add two headers to your HTTPS node Authorization and Accept. the 1st is how you'll authenticate with Meraki and the second is how it will know how to answer the request. \\n\\nUsing the same methods you'll do a get for Organizations, Network IDs and Uplink stats\\n\\nUsing the Set nodes to organize the data in a \\\"neat\\\" way\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b028326-0776-4b9b-bdf2-d79949809092\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1480,\n 660\n ],\n \"parameters\": {\n \"width\": 645.9603701592033,\n \"height\": 389.89870424786454,\n \"content\": \"## Explanation\\nthe Merge node will combine the Networks with their respective stats by matching on NetworkID and networkid and enriching the input \\n\\nagain we add a set node to better organize the statistics of the uplinks. \\n\\nThe first JS node will average the 5 Time stamps of Latency and Packet loss \\n\\nThe last JS node will send the data forward only for sites that pass the threshold (in this example 300ms latency and 2% packet loss) \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f7c1448d-3a03-4196-bde6-a1aea92f28ad\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2300,\n 700\n ],\n \"parameters\": {\n \"width\": 913.6905067516504,\n \"height\": 523.763772544089,\n \"content\": \"## Explanation \\nwe will send the problematic sites to both the Redis node and the Merge node. \\n\\nThe Redis node does a get request to see if a key exists matching the Network name in Meraki. If so it will respond with the Network name, If not it will respond with \\\"null\\\" \\n\\nthe n8n nodes view \\\"null\\\" as no data (which isn't exactly wrong as it literally is no data) but the next node will just say the input is blank so I've added the JS node to look at the output and respond if an alert does or doesn't exist based on the response of the Redis node. \\n\\nThis time we Merge looking at the NetworkName and keep all non-matching. The reason for this is because if they match, that means the key in the database exists, meaning we've already sent a message that the site is having issues. \\n\\nWe send the tickets forth that don't match and we will send a teams message that will notify of a Network passing the threshold for issues. I've included the Network URL and re-written the message to include a hyperlink that way the alert can be used to take you straight to the problematic site. \\n\\nFinally we log the site in the database with a TTL of 3h, this way if the error has not been fixed in 3h we will get another message. \\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4f4d40ef-8e7d-420a-8273-4cfefd3af6e9\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1460,\n -320\n ],\n \"parameters\": {\n \"width\": 670.6963066922013,\n \"height\": 366.61782280504275,\n \"content\": \"## other usecases \\n If you feel confident enough the Teams nodes can be replaced with a node that can generate a ticket for your PSA such as ConnectWise Mange. That way these are generating tickets rather than just messages. \"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Message Techs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Message Techs\": {\n \"main\": [\n [\n {\n \"node\": \"Log the Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Response\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Network IDs\": {\n \"main\": [\n [\n {\n \"node\": \"Sets Network Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get Meraki Organizations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Org Name & ID\": {\n \"main\": [\n [\n {\n \"node\": \"Get Network IDs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Alert Exists\": {\n \"main\": [\n [\n {\n \"node\": \"Create Response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Sets Network Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Combine latency to its respective Network\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Meraki Organizations\": {\n \"main\": [\n [\n {\n \"node\": \"Get Org Name & ID\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Get Uplink Loss and Latency\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filters Problematic sites\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Alert Exists\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Get Uplink Loss and Latency\": {\n \"main\": [\n [\n {\n \"node\": \"Combine latency to its respective Network\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Average Latency & Loss over 5m\": {\n \"main\": [\n [\n {\n \"node\": \"Filters Problematic sites\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get Meraki Organizations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Makes Latency and Loss Filterable\": {\n \"main\": [\n [\n {\n \"node\": \"Average Latency & Loss over 5m\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Combine latency to its respective Network\": {\n \"main\": [\n [\n {\n \"node\": \"Makes Latency and Loss Filterable\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
19
1
3
true
combined_workflows.json
{ "input": "The workflow monitors network performance (latency and packet loss) in a Meraki environment, identifies problematic sites exceeding thresholds, and alerts relevant teams via Microsoft Teams, while preventing redundant alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17421, "processed_size": 17421, "processed_timestamp": "2025-04-09T03:08:37.536762", "timestamp": "2025-04-09T02:35:30.239708", "token_count": 4097, "tokens": 2044, "workflow_chunk_info": { "is_truncated": false, "original_size": 17421, "processed_size": 17421, "workflow_hash": "8b616775bbc651475e0ef090a5e5e336" }, "workflow_hash": "8b616775bbc651475e0ef090a5e5e336" }
": { "main": [ [ { "node": "Get Meraki Organizations", "type": "main", "index": 0 } ] ] }, "Makes Latency and Loss Filterable": { "main": [ [ { "node": "Average Latency & Loss over 5m", "type": "main", "index": 0 } ] ] }, "Combine latency to its respective Network": { "main": [ [ { "node": "Makes Latency and Loss Filterable", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833\",\n \"templateId\": \"2054\"\n },\n \"nodes\": [\n {\n \"id\": \"3b18d784-eded-4b74-ac44-b25565049e13\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 380,\n 400\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"96eadd32-17c2-44b0-a00b-8e2ddcecaafa\",\n \"name\": \"Get Meraki Organizations\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This node uses an API call to Meraki using the URL https://api.meraki.com/api/v1/organizations\\n\\nthe Authorization header is what is used to authenticate. You also have to set it to accept json\",\n \"position\": [\n 620,\n 320\n ],\n \"parameters\": {\n \"url\": \"https://api.meraki.com/api/v1/organizations\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"12\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"444071ea-a364-45a6-9430-0338d2752b18\",\n \"name\": \"Get Network IDs\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This node uses a URL with an expression in the middle to do an API call for each ORG ID that was pulled to pull all the network's for each org\",\n \"position\": [\n 1020,\n 240\n ],\n \"parameters\": {\n \"url\": \"=https://api.meraki.com/api/v1/organizations/{{ $json.OrgID }}/networks \",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\"\n },\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"42deea02-e2d2-4ba6-97f7-698c219715a5\",\n \"name\": \"Get Org Name & ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 840,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"CompanyName\",\n \"stringValue\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"OrgID\",\n \"stringValue\": \"={{ $json.id }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"3d5ce6a8-bf05-4457-88e6-c5ad5a995b1d\",\n \"name\": \"Combine latency to its respective Network\",\n \"type\": \"n8n-nodes-base.merge\",\n \"notes\": \"This node matches on the NetworkID field, so that the networks we pulled earlier and the Loss / Latency can be combined into one dataset\",\n \"position\": [\n 1500,\n 400\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"joinMode\": \"enrichInput1\",\n \"mergeByFields\": {\n \"values\": [\n {\n \"field1\": \"NetworkID\",\n \"field2\": \"networkId\"\n }\n ]\n }\n },\n \"notesInFlow\": false,\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"caafd6dd-a2b2-405d-a078-cea3bb615788\",\n \"name\": \"Makes Latency and Loss Filterable\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 1680,\n 400\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"networkId\",\n \"stringValue\": \"={{ $json.networkId }}\"\n },\n {\n \"name\": \"NetworkName\",\n \"stringValue\": \"={{ $json.NetworkName }}\"\n },\n {\n \"name\": \"networkURL\",\n \"stringValue\": \"={{ $json.networkURL }}\"\n },\n {\n \"name\": \"Serial\",\n \"stringValue\": \"={{ $json.serial }}\"\n },\n {\n \"name\": \"TS0-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[0].lossPercent }}\"\n },\n {\n \"name\": \"TS1-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[1].lossPercent }}\"\n },\n {\n \"name\": \"TS2-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[2].lossPercent }}\"\n },\n {\n \"name\": \"TS3-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[3].lossPercent }}\"\n },\n {\n \"name\": \"TS4-Loss\",\n \"stringValue\": \"={{ $json.timeSeries[4].lossPercent }}\"\n },\n {\n \"name\": \"TS0-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[0].latencyMs }}\"\n },\n {\n \"name\": \"TS1-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[1].latencyMs }}\"\n },\n {\n \"name\": \"TS2-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[2].latencyMs }}\"\n },\n {\n \"name\": \"TS3-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[3].latencyMs }}\"\n },\n {\n \"name\": \"TS4-Latency\",\n \"stringValue\": \"={{ $json.timeSeries[4].latencyMs }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"c695fd89-c884-4794-b0e5-51b91a71ac5c\",\n \"name\": \"Filters Problematic sites\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"This node uses JavaScript to look at the calculated averages and if they pass the threshold for 300ms Latency or 2% Loss it will pass that site info forward\",\n \"position\": [\n 2040,\n 400\n ],\n \"parameters\": {\n \"jsCode\": \"// Function to filter items based on averageLatency and averageLoss\\nfunction filterItems(items) {\\n return items.filter(item =>\\n item.AverageLatency >300 || item.AverageLoss > 2\\n );\\n}\\n\\n// Get the input items from the previous node\\nconst inputItems = items.map(item => item.json); // Adjust based on your actual data structure\\n\\n// Filter the items based on the conditions\\nconst filteredItems = filterItems(inputItems);\\n\\n// Return the filtered items to the workflow\\nreturn filteredItems.map(item => {\\n return { json: item }; // Format each filtered item as JSON\\n});\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"6db219fd-f54d-4bf8-b150-9c4f3069cf92\",\n \"name\": \"Average Latency & Loss over 5m\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"This node uses JavaScript to calculate the average over the last 5 entries of packet loss and latency\",\n \"position\": [\n 1860,\n 400\n ],\n \"parameters\": {\n \"jsCode\": \"// Assuming $input.all() is an array of items and each item has a json property\\nfunction calculateAverages(inputItems) {\\n return inputItems.map(item => {\\n // Calculate total and average loss\\n const totalLoss = \\n parseFloat(item.json['TS0-Loss']) +\\n parseFloat(item.json['TS1-Loss']) +\\n parseFloat(item.json['TS2-Loss']) +\\n parseFloat(item.json['TS3-Loss']) +\\n parseFloat(item.json['TS4-Loss']);\\n const averageLoss = totalLoss / 5;\\n item.json['AverageLoss'] = averageLoss;\\n\\n // Calculate total and average latency\\n const totalLatency = \\n parseFloat(item.json['TS0-Latency']) +\\n parseFloat(item.json['TS1-Latency']) +\\n parseFloat(item.json['TS2-Latency']) +\\n parseFloat(item.json['TS3-Latency']) +\\n parseFloat(item.json['TS4-Latency']);\\n const averageLatency = totalLatency / 5;\\n item.json['AverageLatency'] = averageLatency;\\n\\n // Return the modified item\\n return item;\\n });\\n}\\n\\nreturn calculateAverages($input.all());\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"f3831843-2596-492d-b800-7d349e443293\",\n \"name\": \"Get Uplink Loss and Latency\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \"This uses a URL with an expression in the middle so that for each org ID it will pull the Loss and Latency for their uplinks. \",\n \"position\": [\n 840,\n 400\n ],\n \"parameters\": {\n \"url\": \"=https://api.meraki.com/api/v1/organizations/{{ $json.id }}/devices/uplinksLossAndLatency?timespan=300\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {}\n }\n },\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"12\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"87c3f32c-de4f-48fd-a711-3521a008c245\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"notes\": \"schedules the workflow to run every 5 minutes mon-fri 8am-5pm\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"cronExpression\",\n \"expression\": \"*/5 8-16 * * 1-5\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"572adb5c-6745-4b4e-89d8-a97835c3d486\",\n \"name\": \"Sets Network Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"Like before, This takes the output data from the previous node and changes the variables to better suit what we'll be using. \",\n \"position\": [\n 1220,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"NetworkID\",\n \"stringValue\": \"={{ $json.id }}\"\n },\n {\n \"name\": \"NetworkName\",\n \"stringValue\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"networkURL\",\n \"stringValue\": \"={{ $json.url }}\"\n }\n ]\n },\n \"include\": \"selected\",\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"01717ed3-1012-4eda-9da9-567038132e06\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"notes\": \"This looks at the problematic sites as well as the info from the database. It will pass on all non-matching as if the site name matches with the database then that means we have an open alert for that site already.\",\n \"position\": [\n 2720,\n 300\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"joinMode\": \"keepNonMatches\",\n \"mergeByFields\": {\n \"values\": [\n {\n \"field1\": \"NetworkName\",\n \"field2\": \"NetworkName\"\n }\n ]\n },\n \"outputDataFrom\": \"input2\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"a20f6f7c-0c92-4db9-903b-e322d67b536d\",\n \"name\": \"Check if Alert Exists\",\n \"type\": \"n8n-nodes-base.redis\",\n \"notes\": \"This node Looks to see if the alert already exists in the Redis database. If it does exist it won't alert us in Teams\",\n \"position\": [\n 2300,\n 240\n ],\n \"parameters\": {\n \"key\": \"={{ $json.NetworkName }}\",\n \"options\": {\n \"dotNotation\": \"={{ true }}\"\n },\n \"operation\": \"get\",\n \"propertyName\": \"NetworkName\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"63590446-2938-443a-adbe-bfc0ba89008c\",\n \"name\": \"Create Response\",\n \"type\": \"n8n-nodes-base.code\",\n \"notes\": \"If the alert isn't in the database all the Redis will respond with is \\\"null\\\" \\n\\nother n8n nodes see null as (no data) and show blank which is fair. So I made this node to look at the null responses and make a response of \\\"false\\\" for a \\\"alertExists\\\" variable. that way we have something to filter on\",\n \"position\": [\n 2500,\n 240\n ],\n \"parameters\": {\n \"jsCode\": \"return items.map(item => {\\n // Check if the 'NetworkName' property is not null, indicating an alert exists.\\n // If 'NetworkName' is null, no alert exists for this network.\\n const alertExists = item.json.NetworkName !== null;\\n\\n // Set the alertExists property correctly based on the condition.\\n item.json.alertExists = alertExists;\\n\\n return item;\\n});\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"c63e2a45-bf5e-455f-8012-9868d55aa3e2\",\n \"name\": \"Message Techs\",\n \"type\": \"n8n-nodes-base.microsoftTeams\",\n \"notes\": \"sends an alert to Dispatch with info related to the site.\",\n \"position\": [\n 2920,\n 300\n ],\n \"parameters\": {\n \"chatId\": \"19:bfd41d9621e544c88ae9f2f275e373b5@thread.v2\",\n \"message\": \"=<strong>Loss & Latency Alert</strong> <br><br>\\n<strong>Network Name:</strong> <a href=\\\"{{ $json.networkURL }}\\\">{{ $json.NetworkName }}</a> <br>\\n<strong>Average Loss:</strong> {{ $json.AverageLoss }}% <br>\\n<strong>Average Latency:</strong> {{ $json.AverageLatency }} <br> \",\n \"options\": {},\n \"resource\": \"chatMessage\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"b4ae54cd-8345-4611-9fbe-32e7537855a9\",\n \"name\": \"Log the Alert\",\n \"type\": \"n8n-nodes-base.redis\",\n \"notes\": \"Logs the alert and sets the TTL to 3h, after 3h Redis will delete the entry and if the site is still having issues, the next run of the workflow will notify us again\",\n \"position\": [\n 3120,\n 300\n ],\n \"parameters\": {\n \"key\": \"={{ $('Merge').item.json.NetworkName }}\",\n \"ttl\": 10800,\n \"value\": \"={{ $('Merge').item.json.NetworkName }}\",\n \"expire\": true,\n \"keyType\": \"string\",\n \"operation\": \"set\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"05416de5-a0c0-4ff8-bfc5-3d26f0d88139\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 573.394087003982,\n 143.69977924944794\n ],\n \"parameters\": {\n \"width\": 791.5865288559442,\n \"height\": 462.84878343542437,\n \"content\": \"## Pulling in Info \\nThis section pulls in all the data we will need to see any possible errors and generate our alert\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"aeb1c8a6-3cec-4899-83e2-098d0b1a9703\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1464,\n 211\n ],\n \"parameters\": {\n \"width\": 688.5000872281419,\n \"height\": 411.1258278145692,\n \"content\": \"## Changing data\\nThis section pulls together the data we got from the first section and sets everything up to be notified \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9ca9e89b-61ce-4b3f-af8e-bf03daff6710\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2260,\n 60\n ],\n \"parameters\": {\n \"width\": 1015.6997792494475,\n \"height\": 614.8167770419421,\n \"content\": \"## Notify\\nThis last section is for the push of the alert as well as storing the alert as to not re-notify every time the workflow runs\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"801879be-e83b-4c74-b8ac-b20157ca32d1\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 600,\n 640\n ],\n \"parameters\": {\n \"width\": 673.6064168725538,\n \"height\": 394.26386951839356,\n \"content\": \"## Explanation\\nusing an HTTP request you will can do a get request for all Organizations your Meraki account has access to. \\n\\nYou will have to Generate your own API key inside of the Meraki Dashboard explained here https://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API\\n\\nYou will have to add two headers to your HTTPS node Authorization and Accept. the 1st is how you'll authenticate with Meraki and the second is how it will know how to answer the request. \\n\\nUsing the same methods you'll do a get for Organizations, Network IDs and Uplink stats\\n\\nUsing the Set nodes to organize the data in a \\\"neat\\\" way\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b028326-0776-4b9b-bdf2-d79949809092\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1480,\n 660\n ],\n \"parameters\": {\n \"width\": 645.9603701592033,\n \"height\": 389.89870424786454,\n \"content\": \"## Explanation\\nthe Merge node will combine the Networks with their respective stats by matching on NetworkID and networkid and enriching the input \\n\\nagain we add a set node to better organize the statistics of the uplinks. \\n\\nThe first JS node will average the 5 Time stamps of Latency and Packet loss \\n\\nThe last JS node will send the data forward only for sites that pass the threshold (in this example 300ms latency and 2% packet loss) \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f7c1448d-3a03-4196-bde6-a1aea92f28ad\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2300,\n 700\n ],\n \"parameters\": {\n \"width\": 913.6905067516504,\n \"height\": 523.763772544089,\n \"content\": \"## Explanation \\nwe will send the problematic sites to both the Redis node and the Merge node. \\n\\nThe Redis node does a get request to see if a key exists matching the Network name in Meraki. If so it will respond with the Network name, If not it will respond with \\\"null\\\" \\n\\nthe n8n nodes view \\\"null\\\" as no data (which isn't exactly wrong as it literally is no data) but the next node will just say the input is blank so I've added the JS node to look at the output and respond if an alert does or doesn't exist based on the response of the Redis node. \\n\\nThis time we Merge looking at the NetworkName and keep all non-matching. The reason for this is because if they match, that means the key in the database exists, meaning we've already sent a message that the site is having issues. \\n\\nWe send the tickets forth that don't match and we will send a teams message that will notify of a Network passing the threshold for issues. I've included the Network URL and re-written the message to include a hyperlink that way the alert can be used to take you straight to the problematic site. \\n\\nFinally we log the site in the database with a TTL of 3h, this way if the error has not been fixed in 3h we will get another message. \\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4f4d40ef-8e7d-420a-8273-4cfefd3af6e9\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1460,\n -320\n ],\n \"parameters\": {\n \"width\": 670.6963066922013,\n \"height\": 366.61782280504275,\n \"content\": \"## other usecases \\n If you feel confident enough the Teams nodes can be replaced with a node that can generate a ticket for your PSA such as ConnectWise Mange. That way these are generating tickets rather than just messages. \"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Message Techs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Message Techs\": {\n \"main\": [\n [\n {\n \"node\": \"Log the Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Response\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Network IDs\": {\n \"main\": [\n [\n {\n \"node\": \"Sets Network Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get Meraki Organizations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Org Name & ID\": {\n \"main\": [\n [\n {\n \"node\": \"Get Network IDs\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Alert Exists\": {\n \"main\": [\n [\n {\n \"node\": \"Create Response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Sets Network Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Combine latency to its respective Network\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Meraki Organizations\": {\n \"main\": [\n [\n {\n \"node\": \"Get Org Name & ID\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Get Uplink Loss and Latency\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filters Problematic sites\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Alert Exists\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Get Uplink Loss and Latency\": {\n \"main\": [\n [\n {\n \"node\": \"Combine latency to its respective Network\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Average Latency & Loss over 5m\": {\n \"main\": [\n [\n {\n \"node\": \"Filters Problematic sites\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get Meraki Organizations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Makes Latency and Loss Filterable\": {\n \"main\": [\n [\n {\n \"node\": \"Average Latency & Loss over 5m\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Combine latency to its respective Network\": {\n \"main\": [\n [\n {\n \"node\": \"Makes Latency and Loss Filterable\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
19
2
3
true
combined_workflows.json
{ "input": "The workflow monitors network performance (latency and packet loss) in a Meraki environment, identifies problematic sites exceeding thresholds, and alerts relevant teams via Microsoft Teams, while preventing redundant alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17421, "processed_size": 17421, "processed_timestamp": "2025-04-09T03:08:37.538762", "timestamp": "2025-04-09T02:35:30.239708", "token_count": 230, "tokens": 2044, "workflow_chunk_info": { "is_truncated": false, "original_size": 17421, "processed_size": 17421, "workflow_hash": "8b616775bbc651475e0ef090a5e5e336" }, "workflow_hash": "8b616775bbc651475e0ef090a5e5e336" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow automates the processing of PDF files uploaded to Google Drive, extracting their content, storing it in a vector database (Pinecone), and enabling a chatbot to answer questions based on the content of those documents. Analyze this workflow: ```json { "id": "lC8xkfCSTjIiUhpk", "meta": { "instanceId": "a1f3364de0f3da48758a2641efb07c3b0d216a3a7cc93596fbed2316d6dea4ad", "templateCredsSetupCompleted": true }, "name": "Google Drive Automation", "tags": [], "nodes": [ { "id": "e7769ee7-a247-426e-b792-c095597ada54", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 320, 700 ], "parameters": { "text": "={{ $json.prompt }}", "options": { "systemMessage": "You are a knowledgeable and helpful assistant. Respond with clear, concise, and detailed answers formatted in markdown. Use proper markdown formatting including headings, bullet points, numbered lists, code blocks, and other structures as needed to improve readability and clarity." }, "promptType": "define" }, "typeVersion": 1.7 }, { "id": "72ca46ad-891f-42f2-81d7-00e04e1c6f5f", "name": "Monitor Google Drive for New Files", "type": "n8n-nodes-base.googleDriveTrigger", "position": [ -520, -240 ], "parameters": { "event": "fileCreated", "options": {}, "pollTimes": { "item": [ {} ] }, "triggerOn": "specificFolder", "folderToWatch": { "__rl": true, "mode": "list", "value": "1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP", "cachedResultUrl": "https://drive.google.com/drive/folders/1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP", "cachedResultName": "RAG_Files" } }, "credentials": { "googleDriveOAuth2Api": { "id": "zj3v6gsTRb9CreKV", "name": "Google Drive account" } }, "typeVersion": 1 }, { "id": "03e9dc61-bdba-49d7-859e-73b8adebae41", "name": "Download File from Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ -300, -240 ], "parameters": { "fileId": { "__rl": true, "mode": "id", "value": "={{ $json.id }}" }, "options": {}, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "zj3v6gsTRb9CreKV", "name": "Google Drive account" } }, "typeVersion": 3 }, { "id": "782fc162-0c3f-40fc-af92-455c1250ede0", "name": "Extract PDF Content", "type": "n8n-nodes-base.extractFromFile", "position": [ -80, -240 ], "parameters": { "options": {}, "operation": "pdf" }, "typeVersion": 1 }, { "id": "b8da9cff-756b-419e-b39a-4ad1020092d0", "name": "Insert Document into Pinecone Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 360, -240 ], "parameters": { "mode": "insert", "options": {}, "pineconeIndex": { "__rl": true, "mode": "list", "value": "n8n-rag-demo", "cachedResultName": "n8n-rag-demo" } }, "credentials": { "pineconeApi": { "id": "ldIxYWz8E9e0N4yV", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "f5b93646-b466-4cd7-aec9-6fae62023fa3", "name": "Generate Document Embeddings (Google Gemini)", "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", "position": [ 260, 20 ], "parameters": { "modelName": "models/text-embedding-004" }, "credentials": { "googlePalmApi": { "id": "prd6Qnbbj4UbNH75", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "b5277663-3120-4614-85e3-f7dc05c4e1c2", "name": "Clean and Normalize PDF Text", "type": "n8n-nodes-base.code", "position": [ 140, -240 ], "parameters": { "jsCode": "const rawData = $json[\"text\"];\nconst cleanedData = rawData\n .replace(/(\\r\\n|\\n|\\r)/gm, \" \") // remove line breaks\n .trim() // remove extra spaces\n .replace(/[^\\w\\s]/gi, \"\"); // remove special characters\nreturn { cleanedData };\n" }, "typeVersion": 2 }, { "id": "68aa5515-6b58-4e98-ab08-4d9516e1f2a3", "name": "Load Document Data for Processing", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 480, 20 ], "parameters": { "options": {} }, "typeVersion": 1 }, { "id": "3f463338-c692-4b7b-a888-8c00d190c441", "name": "Split Document Text into Chunks", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 380, 240 ], "parameters": { "options": {}, "chunkSize": 3000, "chunkOverlap": 300 }, "typeVersion": 1 }, { "id": "9c4a7ec9-0808-443f-9e12-9ec12c7288b9", "name": "Chat Message Trigger", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -520, 700 ], "webhookId": "d36e67b9-a789-4801-b624-64bf8b88d702", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "ee62efc9-60b2-40ec-a10c-8897d24b1429", "name": "Retrieve Relevant Documents from Pinecone", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ -260, 700 ], "parameters": { "mode": "load", "prompt": "={{ $json.chatInput }}", "options": {}, "pineconeIndex": { "__rl": true, "mode": "list", "value": "n8n-rag-demo", "cachedResultName": "n8n-rag-demo" } }, "credentials": { "pineconeApi": { "id": "ldIxYWz8E9e0N4yV", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "8d479b6b-3c87-40c6-8a68-4390e6bafac8", "name": "Generate Query Embeddings (Google Gemini)", "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", "position": [ -280, 940 ], "parameters": { "modelName": "models/text-embedding-004" }, "credentials": { "googlePalmApi": { "id": "prd6Qnbbj4UbNH75", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "f521d243-1b62-4bc5-972d-736c65c48818", "name": "Generate Chat Prompt with Context", "type": "n8n-nodes-base.code", "position": [ 100, 700 ], "parameters": { "jsCode": "const userQuery = $('Chat Message Trigger').first().json.chatInput\n// Retrieve the user query from the previous node output.\n// Assuming the Pinecone node has passed an array of items where each item has a document and score:\nlet documents = items.map(item => {\n return {\n pageContent: item.json.document.pageContent,\n score: item.json.score\n };\n});\n\n// Sort the documents by their score in descending order.\ndocuments.sort((a, b) => b.score - a.score);\n\n// Pick the top 3 documents to use as context.\nconst topDocuments = documents.slice(0, 3);\n\n// Combine the top documents into one context string.\nconst contextContent = topDocuments\n .map((doc, index) => `Document ${index + 1}:\\n${doc.pageContent}`)\n .join(\"\\n\\n\");\n\n// Build the final prompt that combines the context with the user query.\nconst prompt = `Using the following context from documents:\\n\\n${contextContent}\\n\\nAnswer the following question:\\n${userQuery}\\n\\nAnswer:`;\n\n// Return the prompt so it can be passed to a Chat/AI node for further processing.\nreturn [{ json: { prompt } }];\n" }, "typeVersion": 2 }, { "id": "208057c8-8672-41d2-9c99-89e52856a742", "name": "OpenRouter Chat Model Interface", "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter", "position": [ 280, 940 ], "parameters": { "model": "google/gemini-2.0-flash-exp:free", "options": {} }, "credentials": { "openRouterApi": { "id": "iTDRPtvPicVqeXaT", "name": "OpenRouter account" } }, "typeVersion": 1 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "43fd0dd9-5ec1-401a-b1c2-368b15c9f0db", "connections": { "Extract PDF Content": { "main": [ [ { "node": "Clean and Normalize PDF Text", "type": "main", "index": 0 } ] ] }, "Chat Message Trigger": { "main": [ [ { "node": "Retrieve Relevant Documents from Pinecone", "type": "main", "index": 0 } ] ] }, "Clean and Normalize PDF Text": { "main": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "main", "index": 0 } ] ] }, "Download File from Google Drive": { "main": [ [ { "node": "Extract PDF Content", "type": "main", "index": 0 } ] ] }, "OpenRouter Chat Model Interface": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Split Document Text into Chunks": { "ai_textSplitter": [ [ { "node": "Load Document Data for Processing", "type": "ai_textSplitter", "index": 0 } ] ] }, "Generate Chat Prompt with Context": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Load Document Data for Processing": { "ai_document": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "Monitor Google Drive for New Files": { "main": [ [ { "node": "Download File from Google Drive", "type": "main", "index": 0 } ] ] }, "Generate Query Embeddings (Google Gemini)": { "ai_embedding": [ [
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"lC8xkfCSTjIiUhpk\",\n \"meta\": {\n \"instanceId\": \"a1f3364de0f3da48758a2641efb07c3b0d216a3a7cc93596fbed2316d6dea4ad\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Google Drive Automation\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"e7769ee7-a247-426e-b792-c095597ada54\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 320,\n 700\n ],\n \"parameters\": {\n \"text\": \"={{ $json.prompt }}\",\n \"options\": {\n \"systemMessage\": \"You are a knowledgeable and helpful assistant. Respond with clear, concise, and detailed answers formatted in markdown. Use proper markdown formatting including headings, bullet points, numbered lists, code blocks, and other structures as needed to improve readability and clarity.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"72ca46ad-891f-42f2-81d7-00e04e1c6f5f\",\n \"name\": \"Monitor Google Drive for New Files\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n -520,\n -240\n ],\n \"parameters\": {\n \"event\": \"fileCreated\",\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {}\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultName\": \"RAG_Files\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"03e9dc61-bdba-49d7-859e-73b8adebae41\",\n \"name\": \"Download File from Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -300,\n -240\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"782fc162-0c3f-40fc-af92-455c1250ede0\",\n \"name\": \"Extract PDF Content\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -80,\n -240\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8da9cff-756b-419e-b39a-4ad1020092d0\",\n \"name\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 360,\n -240\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f5b93646-b466-4cd7-aec9-6fae62023fa3\",\n \"name\": \"Generate Document Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 260,\n 20\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b5277663-3120-4614-85e3-f7dc05c4e1c2\",\n \"name\": \"Clean and Normalize PDF Text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 140,\n -240\n ],\n \"parameters\": {\n \"jsCode\": \"const rawData = $json[\\\"text\\\"];\\nconst cleanedData = rawData\\n .replace(/(\\\\r\\\\n|\\\\n|\\\\r)/gm, \\\" \\\") // remove line breaks\\n .trim() // remove extra spaces\\n .replace(/[^\\\\w\\\\s]/gi, \\\"\\\"); // remove special characters\\nreturn { cleanedData };\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"68aa5515-6b58-4e98-ab08-4d9516e1f2a3\",\n \"name\": \"Load Document Data for Processing\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 480,\n 20\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3f463338-c692-4b7b-a888-8c00d190c441\",\n \"name\": \"Split Document Text into Chunks\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 300\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9c4a7ec9-0808-443f-9e12-9ec12c7288b9\",\n \"name\": \"Chat Message Trigger\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -520,\n 700\n ],\n \"webhookId\": \"d36e67b9-a789-4801-b624-64bf8b88d702\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"ee62efc9-60b2-40ec-a10c-8897d24b1429\",\n \"name\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n -260,\n 700\n ],\n \"parameters\": {\n \"mode\": \"load\",\n \"prompt\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d479b6b-3c87-40c6-8a68-4390e6bafac8\",\n \"name\": \"Generate Query Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n -280,\n 940\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f521d243-1b62-4bc5-972d-736c65c48818\",\n \"name\": \"Generate Chat Prompt with Context\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 100,\n 700\n ],\n \"parameters\": {\n \"jsCode\": \"const userQuery = $('Chat Message Trigger').first().json.chatInput\\n// Retrieve the user query from the previous node output.\\n// Assuming the Pinecone node has passed an array of items where each item has a document and score:\\nlet documents = items.map(item => {\\n return {\\n pageContent: item.json.document.pageContent,\\n score: item.json.score\\n };\\n});\\n\\n// Sort the documents by their score in descending order.\\ndocuments.sort((a, b) => b.score - a.score);\\n\\n// Pick the top 3 documents to use as context.\\nconst topDocuments = documents.slice(0, 3);\\n\\n// Combine the top documents into one context string.\\nconst contextContent = topDocuments\\n .map((doc, index) => `Document ${index + 1}:\\\\n${doc.pageContent}`)\\n .join(\\\"\\\\n\\\\n\\\");\\n\\n// Build the final prompt that combines the context with the user query.\\nconst prompt = `Using the following context from documents:\\\\n\\\\n${contextContent}\\\\n\\\\nAnswer the following question:\\\\n${userQuery}\\\\n\\\\nAnswer:`;\\n\\n// Return the prompt so it can be passed to a Chat/AI node for further processing.\\nreturn [{ json: { prompt } }];\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"208057c8-8672-41d2-9c99-89e52856a742\",\n \"name\": \"OpenRouter Chat Model Interface\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenRouter\",\n \"position\": [\n 280,\n 940\n ],\n \"parameters\": {\n \"model\": \"google/gemini-2.0-flash-exp:free\",\n \"options\": {}\n },\n \"credentials\": {\n \"openRouterApi\": {\n \"id\": \"iTDRPtvPicVqeXaT\",\n \"name\": \"OpenRouter account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"43fd0dd9-5ec1-401a-b1c2-368b15c9f0db\",\n \"connections\": {\n \"Extract PDF Content\": {\n \"main\": [\n [\n {\n \"node\": \"Clean and Normalize PDF Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Chat Message Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Clean and Normalize PDF Text\": {\n \"main\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download File from Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract PDF Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenRouter Chat Model Interface\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Document Text into Chunks\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Load Document Data for Processing\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Chat Prompt with Context\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Load Document Data for Processing\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Monitor Google Drive for New Files\": {\n \"main\": [\n [\n {\n \"node\": \"Download File from Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Query Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Relevant Documents from Pinecone\": {\n \"main\": [\n [\n {\n \"node\": \"Generate Chat Prompt with Context\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Document Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
20
0
2
true
combined_workflows.json
{ "input": "This workflow automates the processing of PDF files uploaded to Google Drive, extracting their content, storing it in a vector database (Pinecone), and enabling a chatbot to answer questions based on the content of those documents.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8256, "processed_size": 8256, "processed_timestamp": "2025-04-09T03:08:37.603801", "timestamp": "2025-04-09T02:35:30.586302", "token_count": 4095, "tokens": 779, "workflow_chunk_info": { "is_truncated": false, "original_size": 8256, "processed_size": 8256, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }
{ "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Load Document Data for Processing": { "ai_document": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "Monitor Google Drive for New Files": { "main": [ [ { "node": "Download File from Google Drive", "type": "main", "index": 0 } ] ] }, "Generate Query Embeddings (Google Gemini)": { "ai_embedding": [ [ { "node": "Retrieve Relevant Documents from Pinecone", "type": "ai_embedding", "index": 0 } ] ] }, "Retrieve Relevant Documents from Pinecone": { "main": [ [ { "node": "Generate Chat Prompt with Context", "type": "main", "index": 0 } ] ] }, "Generate Document Embeddings (Google Gemini)": { "ai_embedding": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "ai_embedding", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"lC8xkfCSTjIiUhpk\",\n \"meta\": {\n \"instanceId\": \"a1f3364de0f3da48758a2641efb07c3b0d216a3a7cc93596fbed2316d6dea4ad\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Google Drive Automation\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"e7769ee7-a247-426e-b792-c095597ada54\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 320,\n 700\n ],\n \"parameters\": {\n \"text\": \"={{ $json.prompt }}\",\n \"options\": {\n \"systemMessage\": \"You are a knowledgeable and helpful assistant. Respond with clear, concise, and detailed answers formatted in markdown. Use proper markdown formatting including headings, bullet points, numbered lists, code blocks, and other structures as needed to improve readability and clarity.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"72ca46ad-891f-42f2-81d7-00e04e1c6f5f\",\n \"name\": \"Monitor Google Drive for New Files\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n -520,\n -240\n ],\n \"parameters\": {\n \"event\": \"fileCreated\",\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {}\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultName\": \"RAG_Files\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"03e9dc61-bdba-49d7-859e-73b8adebae41\",\n \"name\": \"Download File from Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -300,\n -240\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"782fc162-0c3f-40fc-af92-455c1250ede0\",\n \"name\": \"Extract PDF Content\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -80,\n -240\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8da9cff-756b-419e-b39a-4ad1020092d0\",\n \"name\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 360,\n -240\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f5b93646-b466-4cd7-aec9-6fae62023fa3\",\n \"name\": \"Generate Document Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 260,\n 20\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b5277663-3120-4614-85e3-f7dc05c4e1c2\",\n \"name\": \"Clean and Normalize PDF Text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 140,\n -240\n ],\n \"parameters\": {\n \"jsCode\": \"const rawData = $json[\\\"text\\\"];\\nconst cleanedData = rawData\\n .replace(/(\\\\r\\\\n|\\\\n|\\\\r)/gm, \\\" \\\") // remove line breaks\\n .trim() // remove extra spaces\\n .replace(/[^\\\\w\\\\s]/gi, \\\"\\\"); // remove special characters\\nreturn { cleanedData };\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"68aa5515-6b58-4e98-ab08-4d9516e1f2a3\",\n \"name\": \"Load Document Data for Processing\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 480,\n 20\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3f463338-c692-4b7b-a888-8c00d190c441\",\n \"name\": \"Split Document Text into Chunks\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 300\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9c4a7ec9-0808-443f-9e12-9ec12c7288b9\",\n \"name\": \"Chat Message Trigger\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -520,\n 700\n ],\n \"webhookId\": \"d36e67b9-a789-4801-b624-64bf8b88d702\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"ee62efc9-60b2-40ec-a10c-8897d24b1429\",\n \"name\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n -260,\n 700\n ],\n \"parameters\": {\n \"mode\": \"load\",\n \"prompt\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d479b6b-3c87-40c6-8a68-4390e6bafac8\",\n \"name\": \"Generate Query Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n -280,\n 940\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f521d243-1b62-4bc5-972d-736c65c48818\",\n \"name\": \"Generate Chat Prompt with Context\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 100,\n 700\n ],\n \"parameters\": {\n \"jsCode\": \"const userQuery = $('Chat Message Trigger').first().json.chatInput\\n// Retrieve the user query from the previous node output.\\n// Assuming the Pinecone node has passed an array of items where each item has a document and score:\\nlet documents = items.map(item => {\\n return {\\n pageContent: item.json.document.pageContent,\\n score: item.json.score\\n };\\n});\\n\\n// Sort the documents by their score in descending order.\\ndocuments.sort((a, b) => b.score - a.score);\\n\\n// Pick the top 3 documents to use as context.\\nconst topDocuments = documents.slice(0, 3);\\n\\n// Combine the top documents into one context string.\\nconst contextContent = topDocuments\\n .map((doc, index) => `Document ${index + 1}:\\\\n${doc.pageContent}`)\\n .join(\\\"\\\\n\\\\n\\\");\\n\\n// Build the final prompt that combines the context with the user query.\\nconst prompt = `Using the following context from documents:\\\\n\\\\n${contextContent}\\\\n\\\\nAnswer the following question:\\\\n${userQuery}\\\\n\\\\nAnswer:`;\\n\\n// Return the prompt so it can be passed to a Chat/AI node for further processing.\\nreturn [{ json: { prompt } }];\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"208057c8-8672-41d2-9c99-89e52856a742\",\n \"name\": \"OpenRouter Chat Model Interface\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenRouter\",\n \"position\": [\n 280,\n 940\n ],\n \"parameters\": {\n \"model\": \"google/gemini-2.0-flash-exp:free\",\n \"options\": {}\n },\n \"credentials\": {\n \"openRouterApi\": {\n \"id\": \"iTDRPtvPicVqeXaT\",\n \"name\": \"OpenRouter account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"43fd0dd9-5ec1-401a-b1c2-368b15c9f0db\",\n \"connections\": {\n \"Extract PDF Content\": {\n \"main\": [\n [\n {\n \"node\": \"Clean and Normalize PDF Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Chat Message Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Clean and Normalize PDF Text\": {\n \"main\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download File from Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract PDF Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenRouter Chat Model Interface\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Document Text into Chunks\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Load Document Data for Processing\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Chat Prompt with Context\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Load Document Data for Processing\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Monitor Google Drive for New Files\": {\n \"main\": [\n [\n {\n \"node\": \"Download File from Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Query Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Relevant Documents from Pinecone\": {\n \"main\": [\n [\n {\n \"node\": \"Generate Chat Prompt with Context\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Document Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
20
1
2
true
combined_workflows.json
{ "input": "This workflow automates the processing of PDF files uploaded to Google Drive, extracting their content, storing it in a vector database (Pinecone), and enabling a chatbot to answer questions based on the content of those documents.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8256, "processed_size": 8256, "processed_timestamp": "2025-04-09T03:08:37.605763", "timestamp": "2025-04-09T02:35:30.586302", "token_count": 435, "tokens": 779, "workflow_chunk_info": { "is_truncated": false, "original_size": 8256, "processed_size": 8256, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: Turn a light red when a GitHub repository is updated. Analyze this workflow: ```json { "meta": { "instanceId": "a2434c94d549548a685cca39cc4614698e94f527bcea84eefa363f1037ae14cd" }, "nodes": [ { "id": "161c2837-6a3c-4492-93d0-c094b8788362", "name": "On any update in repository", "type": "n8n-nodes-base.githubTrigger", "position": [ 620, 520 ], "webhookId": "9f16fefe-dacf-48b8-a576-48ed0599e911", "parameters": { "owner": "dummydavid", "events": [ "*" ], "repository": "DemoRepo" }, "credentials": { "githubApi": { "id": "20", "name": "[UPDATE ME]" } }, "typeVersion": 1 }, { "id": "2703e869-60e0-4906-9fd2-35a5e54aae1f", "name": "Turn a light red", "type": "n8n-nodes-base.homeAssistant", "position": [ 840, 520 ], "parameters": { "domain": "light", "service": "turn_on", "resource": "service", "operation": "call", "serviceAttributes": { "attributes": [ { "name": "entity_id", "value": "light.lamp" }, { "name": "rgb_color", "value": "={{[255,0,0]}}" } ] } }, "credentials": { "homeAssistantApi": { "id": "21", "name": "home.davidsha.me" } }, "typeVersion": 1 }, { "id": "bbbd01eb-9409-414e-bc85-c615add05580", "name": "Note", "type": "n8n-nodes-base.stickyNote", "position": [ 160, 420 ], "parameters": { "width": 378, "height": 351, "content": "## Turn on a light to a specific color on any update in GitHub repository\nThis workflow turns a light red when an update is made to a GitHub repository. By default, updates include pull requests, issues, pushes just to name a few.\n\n### How it works\n1. Triggers off on the `On any update in repository` node.\n2. Uses Home Assistant to turn on a light and then configure the light to turn red." }, "typeVersion": 1 }, { "id": "33dfde3b-a4b5-468d-8d13-9d3577563f9b", "name": "Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 840, 700 ], "parameters": { "width": 315, "height": 248, "content": "### Configure light here\nIt is likely the name of the light that you want to turn a specific colour is not called `light.lamp`. In which case, please head to your Home Assistant instance and find the light taking note of it's `entity_id`. See discussion [here](https://community.home-assistant.io/t/find-the-entity-id-of-a-yeelight-light-in-manual-mode-or-automatic-mode-doesnt-work/165557) for help.\n\nIf you would also like to change the colour the light turns to, do so with an [RGB color picker](https://www.google.com/search?q=rgb+color+picker&oq=rgb+colo&aqs=chrome.0.0i67i433j69i57j0i67l4j0i512l4.6248j0j7&sourceid=chrome&ie=UTF-8). Default colour is red (255,0,0)." }, "typeVersion": 1 } ], "connections": { "On any update in repository": { "main": [ [ { "node": "Turn a light red", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"a2434c94d549548a685cca39cc4614698e94f527bcea84eefa363f1037ae14cd\"\n },\n \"nodes\": [\n {\n \"id\": \"161c2837-6a3c-4492-93d0-c094b8788362\",\n \"name\": \"On any update in repository\",\n \"type\": \"n8n-nodes-base.githubTrigger\",\n \"position\": [\n 620,\n 520\n ],\n \"webhookId\": \"9f16fefe-dacf-48b8-a576-48ed0599e911\",\n \"parameters\": {\n \"owner\": \"dummydavid\",\n \"events\": [\n \"*\"\n ],\n \"repository\": \"DemoRepo\"\n },\n \"credentials\": {\n \"githubApi\": {\n \"id\": \"20\",\n \"name\": \"[UPDATE ME]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2703e869-60e0-4906-9fd2-35a5e54aae1f\",\n \"name\": \"Turn a light red\",\n \"type\": \"n8n-nodes-base.homeAssistant\",\n \"position\": [\n 840,\n 520\n ],\n \"parameters\": {\n \"domain\": \"light\",\n \"service\": \"turn_on\",\n \"resource\": \"service\",\n \"operation\": \"call\",\n \"serviceAttributes\": {\n \"attributes\": [\n {\n \"name\": \"entity_id\",\n \"value\": \"light.lamp\"\n },\n {\n \"name\": \"rgb_color\",\n \"value\": \"={{[255,0,0]}}\"\n }\n ]\n }\n },\n \"credentials\": {\n \"homeAssistantApi\": {\n \"id\": \"21\",\n \"name\": \"home.davidsha.me\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"bbbd01eb-9409-414e-bc85-c615add05580\",\n \"name\": \"Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 420\n ],\n \"parameters\": {\n \"width\": 378,\n \"height\": 351,\n \"content\": \"## Turn on a light to a specific color on any update in GitHub repository\\nThis workflow turns a light red when an update is made to a GitHub repository. By default, updates include pull requests, issues, pushes just to name a few.\\n\\n### How it works\\n1. Triggers off on the `On any update in repository` node.\\n2. Uses Home Assistant to turn on a light and then configure the light to turn red.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"33dfde3b-a4b5-468d-8d13-9d3577563f9b\",\n \"name\": \"Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 840,\n 700\n ],\n \"parameters\": {\n \"width\": 315,\n \"height\": 248,\n \"content\": \"### Configure light here\\nIt is likely the name of the light that you want to turn a specific colour is not called `light.lamp`. In which case, please head to your Home Assistant instance and find the light taking note of it's `entity_id`. See discussion [here](https://community.home-assistant.io/t/find-the-entity-id-of-a-yeelight-light-in-manual-mode-or-automatic-mode-doesnt-work/165557) for help.\\n\\nIf you would also like to change the colour the light turns to, do so with an [RGB color picker](https://www.google.com/search?q=rgb+color+picker&oq=rgb+colo&aqs=chrome.0.0i67i433j69i57j0i67l4j0i512l4.6248j0j7&sourceid=chrome&ie=UTF-8). Default colour is red (255,0,0).\"\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"On any update in repository\": {\n \"main\": [\n [\n {\n \"node\": \"Turn a light red\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
21
0
1
false
combined_workflows.json
{ "input": "Turn a light red when a GitHub repository is updated.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 2544, "processed_size": 2544, "processed_timestamp": "2025-04-09T03:08:37.610800", "timestamp": "2025-04-09T02:35:30.723933", "token_count": 1389, "tokens": 266, "workflow_chunk_info": { "is_truncated": false, "original_size": 2544, "processed_size": 2544, "workflow_hash": "737e8eb88c4afc53302b69c32bebfc93" }, "workflow_hash": "737e8eb88c4afc53302b69c32bebfc93" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow automates daily standup meetings in Mattermost. It allows users to configure standup settings, reminds users to submit their updates, and publishes the collected reports. Analyze this workflow: ```json { "id": 114, "name": "Standup Bot - Worker", "nodes": [ { "name": "publish report", "type": "n8n-nodes-base.mattermost", "position": [ 1840, 1040 ], "parameters": { "message": "={{$node[\"Prep Report\"].json[\"post\"]}}", "channelId": "={{$node[\"Prep Report\"].json[\"channel\"]}}", "attachments": [], "otherOptions": {} }, "credentials": { "mattermostApi": { "id": "2", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "get user data", "type": "n8n-nodes-base.httpRequest", "position": [ 1400, 1040 ], "parameters": { "url": "={{$node[\"Read Config 2\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/users/{{$node[\"Action from MM\"].json[\"body\"][\"user_id\"]}}", "options": {}, "jsonParameters": true, "headerParametersJson": "={\n\"Authorization\": \"Bearer {{$item(0).$node[\"Read Config 2\"].json[\"config\"][\"botUserToken\"]}}\"\n}" }, "typeVersion": 1 }, { "name": "open-standup-dialog?", "type": "n8n-nodes-base.if", "position": [ 1180, 1260 ], "parameters": { "conditions": { "string": [ { "value1": "={{$node[\"Action from MM\"].json[\"body\"][\"context\"][\"action\"]}}", "value2": "open-standup-dialog" } ] } }, "typeVersion": 1 }, { "name": "Action from MM", "type": "n8n-nodes-base.webhook", "position": [ 520, 820 ], "webhookId": "6a28d86b-9f74-4825-9785-57e0d43b198f", "parameters": { "path": "standup-bot/action/f6f9b174745fa4651f750c36957d674c", "options": {}, "httpMethod": "POST" }, "typeVersion": 1 }, { "name": "Slash Cmd from MM", "type": "n8n-nodes-base.webhook", "position": [ 520, 600 ], "webhookId": "72732516-1143-430f-8465-d193fe657311", "parameters": { "path": "standup-bot/slashCmd", "options": {}, "httpMethod": "POST" }, "typeVersion": 1 }, { "name": "config?", "type": "n8n-nodes-base.if", "position": [ 740, 600 ], "parameters": { "conditions": { "string": [ { "value1": "={{$node[\"Slash Cmd from MM\"].json[\"body\"][\"text\"]}}", "value2": "config" } ] } }, "typeVersion": 1 }, { "name": "open config dialog", "type": "n8n-nodes-base.httpRequest", "position": [ 1360, 580 ], "parameters": { "url": "={{$node[\"Read Config 1\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/actions/dialogs/open", "options": { "bodyContentType": "json" }, "requestMethod": "POST", "jsonParameters": true, "bodyParametersJson": "={{$json}}" }, "typeVersion": 1 }, { "name": "Prep Config Dialog", "type": "n8n-nodes-base.function", "position": [ 1160, 580 ], "parameters": { "functionCode": "const channelId =\n $item(0).$node['Slash Cmd from MM'].json['body']['channel_id'];\n\nconst configuredStandups =\n $item(0).$node['Read Config 1'].json['standups'] ?? [];\n\nlet standup = configuredStandups.find(\n (standup) => standup.channelId == channelId\n);\n\n// define default values:\nif (!standup) {\n standup = {\n title: 'Team Standup',\n time: '09:00',\n days: [1, 2, 3, 4, 5],\n questions: [\n 'What have you accomplished since your last report?',\n 'What do you want to accomplish until your next report?',\n 'Is anything blocking your progress?',\n ],\n users: [],\n };\n}\n\nconst payload = {\n trigger_id: $item(0).$node['Slash Cmd from MM'].json['body']['trigger_id'],\n url: $item(0).$node['Read Config 1'].json['config']['n8nWebhookUrl'],\n dialog: {\n callback_id: 'standup-config',\n title: 'Standup Configuration',\n submit_label: 'Save',\n notify_on_cancel: false,\n state: JSON.stringify({ standupId: channelId }),\n elements: [\n {\n display_name: 'Standup title',\n name: 'title',\n type: 'text',\n placeholder: 'Team Standup',\n default: standup.title,\n optional: true,\n help_text:\n 'πŸ’‘ The standup can be deleted by setting its title to an empty string!',\n },\n {\n display_name: 'Time',\n name: 'time',\n type: 'select',\n default: standup.time,\n options: [\n {\n text: '06:00',\n value: '06:00',\n },\n {\n text: '07:00',\n value: '07:00',\n },\n {\n text: '08:00',\n value: '08:00',\n },\n {\n text: '09:00',\n value: '09:00',\n },\n {\n text: '10:00',\n value: '10:00',\n },\n {\n text: '11:00',\n value: '11:00',\n },\n {\n text: '12:00',\n value: '12:00',\n },\n {\n text: '13:00',\n value: '13:00',\n },\n {\n text: '14:00',\n value: '14:00',\n },\n {\n text: '15:00',\n value: '15:00',\n },\n {\n text: '16:00',\n value: '16:00',\n },\n {\n text: '17:00',\n value: '17:00',\n },\n ],\n },\n {\n display_name: 'Days',\n name: 'days',\n type: 'text',\n placeholder: '1,2,3,4,5',\n help_text:\n 'comma-separated; 0=Sun | 1=Mon | 2=Tue | 3=Wed | 4=Thu | 5=Fri | 6=Sat',\n default: standup.days.join(','),\n },\n {\n display_name: 'Questions',\n name: 'questions',\n type: 'textarea',\n help_text: 'Max 5 questions, one question per line;',\n default: standup.questions.join('\\n'),\n },\n {\n display_name: 'Users',\n name: 'users',\n type: 'textarea',\n help_text: 'One user per line',\n default: standup.users.join('\\n'),\n },\n ],\n },\n};\n\nreturn [{ json: payload }];\n\n" }, "typeVersion": 1 }, { "name": "callback ID?", "type": "n8n-nodes-base.switch", "position": [ 960, 820 ], "parameters": { "rules": { "rules": [ { "value2": "standup-config" }, { "output": 1, "value2": "standup-answers" } ] }, "value1": "={{$node[\"Action from MM\"].json[\"body\"][\"callback_id\"]}}", "dataType": "string", "fallbackOutput": 3 }, "typeVersion": 1 }, { "name": "standup-config", "type": "n8n-nodes-base.noOp", "position": [ 1180, 820 ], "parameters": {}, "typeVersion": 1 }, { "name": "standup-answers", "type": "n8n-nodes-base.noOp", "position": [ 1180, 1040 ], "parameters": {}, "typeVersion": 1 }, { "name": "Prep Config Override", "type": "n8n-nodes-base.function", "position": [ 1400, 820 ], "parameters": { "functionCode": "const mattermostInput = $item(0).$node['Action from MM'].json['body'];\nconst config = $item(0).$node['Read Config 2'].json;\n\n// ensure there is a \"standups\" array:\nconfig['standups'] = config['standups'] ?? [];\n\n// remove the standup from the list:\nconfig['standups'] = config['standups'].filter(\n (standup) => standup.channelId != mattermostInput.channel_id\n);\n\nconst textToArray = (text, separator) => {\n return text\n .split(separator)\n .map((e) => e.trim())\n .filter((e) => e.length > 0);\n};\n\n// a standup can be deleted by updating its title to \"\"\nif (mattermostInput.submission.title.length > 0) {\n const newStandup = {\n channelId: mattermostInput.channel_id,\n title: mattermostInput.submission.title,\n time: mattermostInput.submission.time,\n days: textToArray(mattermostInput.submission.days, ',').map((e) =>\n parseInt(e)\n ),\n users: textToArray(mattermostInput.submission.users, '\\n'),\n questions: textToArray(mattermostInput.submission.questions, '\\n'),\n };\n\n config['standups'].push(newStandup);\n}\n\nreturn [{ json: config }];\n\n" }, "typeVersion": 1 }, { "name": "Override Config", "type": "n8n-nodes-base.executeWorkflow", "position": [ 1620, 820 ], "parameters": { "workflowId": "1005" }, "typeVersion": 1 }, { "name": "Read Config 1", "type": "n8n-nodes-base.executeWorkflow", "position": [ 960, 580 ], "parameters": { "workflowId": "1004" }, "typeVersion": 1 }, { "name": "Read Config 2", "type": "n8n-nodes-base.executeWorkflow", "position": [ 740, 820 ], "parameters": { "workflowId": "1004" }, "typeVersion": 1 }, { "name": "confirm success", "type": "n8n-nodes-base.mattermost", "position": [ 1840, 820 ], "parameters": { "userId": "={{$node[\"Action from MM\"].json[\"body\"][\"user_id\"]}}", "message": "new standup config was saved successfully", "channelId": "={{$node[\"Action from MM\"].json[\"body\"][\"channel_id\"]}}", "operation": "postEphemeral" }, "credentials": { "mattermostApi": { "id": "2", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Read Config 3", "type": "n8n-nodes-base.executeWorkflow", "position": [ 740, 380 ], "parameters": { "workflowId": "1004" }, "typeVersion": 1 }, { "name": "Filter Due Standups", "type": "n8n-nodes-base.function", "position": [ 960, 380 ], "parameters": { "functionCode": "const config = $item(0).$node['Read Config 3'].json;\n\n// ensure there is a \"standups\" array:\nconfig['standups'] = config['standups'] ?? [];\n\nconst now = new Date();\nconst duePattern = `${now.getDay()}_${now\n .getHours()\n .toString()\n .padStart(2, '0')}:00`; // e.g. 1_13:00 => Monday 1 p.m.\n \nconsole.log(duePattern);\n\n// filter standups that are due now:\nconst dueStandups = config.standups.filter((standup) =>\n //true\n standup.days.map((day) => `${
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": 114,\n \"name\": \"Standup Bot - Worker\",\n \"nodes\": [\n {\n \"name\": \"publish report\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 1840,\n 1040\n ],\n \"parameters\": {\n \"message\": \"={{$node[\\\"Prep Report\\\"].json[\\\"post\\\"]}}\",\n \"channelId\": \"={{$node[\\\"Prep Report\\\"].json[\\\"channel\\\"]}}\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"get user data\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1400,\n 1040\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/users/{{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"user_id\\\"]}}\",\n \"options\": {},\n \"jsonParameters\": true,\n \"headerParametersJson\": \"={\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open-standup-dialog?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1180,\n 1260\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"context\\\"][\\\"action\\\"]}}\",\n \"value2\": \"open-standup-dialog\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Action from MM\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 520,\n 820\n ],\n \"webhookId\": \"6a28d86b-9f74-4825-9785-57e0d43b198f\",\n \"parameters\": {\n \"path\": \"standup-bot/action/f6f9b174745fa4651f750c36957d674c\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Slash Cmd from MM\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 520,\n 600\n ],\n \"webhookId\": \"72732516-1143-430f-8465-d193fe657311\",\n \"parameters\": {\n \"path\": \"standup-bot/slashCmd\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"config?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 740,\n 600\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$node[\\\"Slash Cmd from MM\\\"].json[\\\"body\\\"][\\\"text\\\"]}}\",\n \"value2\": \"config\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open config dialog\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1360,\n 580\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 1\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/actions/dialogs/open\",\n \"options\": {\n \"bodyContentType\": \"json\"\n },\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Config Dialog\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1160,\n 580\n ],\n \"parameters\": {\n \"functionCode\": \"const channelId =\\n $item(0).$node['Slash Cmd from MM'].json['body']['channel_id'];\\n\\nconst configuredStandups =\\n $item(0).$node['Read Config 1'].json['standups'] ?? [];\\n\\nlet standup = configuredStandups.find(\\n (standup) => standup.channelId == channelId\\n);\\n\\n// define default values:\\nif (!standup) {\\n standup = {\\n title: 'Team Standup',\\n time: '09:00',\\n days: [1, 2, 3, 4, 5],\\n questions: [\\n 'What have you accomplished since your last report?',\\n 'What do you want to accomplish until your next report?',\\n 'Is anything blocking your progress?',\\n ],\\n users: [],\\n };\\n}\\n\\nconst payload = {\\n trigger_id: $item(0).$node['Slash Cmd from MM'].json['body']['trigger_id'],\\n url: $item(0).$node['Read Config 1'].json['config']['n8nWebhookUrl'],\\n dialog: {\\n callback_id: 'standup-config',\\n title: 'Standup Configuration',\\n submit_label: 'Save',\\n notify_on_cancel: false,\\n state: JSON.stringify({ standupId: channelId }),\\n elements: [\\n {\\n display_name: 'Standup title',\\n name: 'title',\\n type: 'text',\\n placeholder: 'Team Standup',\\n default: standup.title,\\n optional: true,\\n help_text:\\n 'πŸ’‘ The standup can be deleted by setting its title to an empty string!',\\n },\\n {\\n display_name: 'Time',\\n name: 'time',\\n type: 'select',\\n default: standup.time,\\n options: [\\n {\\n text: '06:00',\\n value: '06:00',\\n },\\n {\\n text: '07:00',\\n value: '07:00',\\n },\\n {\\n text: '08:00',\\n value: '08:00',\\n },\\n {\\n text: '09:00',\\n value: '09:00',\\n },\\n {\\n text: '10:00',\\n value: '10:00',\\n },\\n {\\n text: '11:00',\\n value: '11:00',\\n },\\n {\\n text: '12:00',\\n value: '12:00',\\n },\\n {\\n text: '13:00',\\n value: '13:00',\\n },\\n {\\n text: '14:00',\\n value: '14:00',\\n },\\n {\\n text: '15:00',\\n value: '15:00',\\n },\\n {\\n text: '16:00',\\n value: '16:00',\\n },\\n {\\n text: '17:00',\\n value: '17:00',\\n },\\n ],\\n },\\n {\\n display_name: 'Days',\\n name: 'days',\\n type: 'text',\\n placeholder: '1,2,3,4,5',\\n help_text:\\n 'comma-separated; 0=Sun | 1=Mon | 2=Tue | 3=Wed | 4=Thu | 5=Fri | 6=Sat',\\n default: standup.days.join(','),\\n },\\n {\\n display_name: 'Questions',\\n name: 'questions',\\n type: 'textarea',\\n help_text: 'Max 5 questions, one question per line;',\\n default: standup.questions.join('\\\\n'),\\n },\\n {\\n display_name: 'Users',\\n name: 'users',\\n type: 'textarea',\\n help_text: 'One user per line',\\n default: standup.users.join('\\\\n'),\\n },\\n ],\\n },\\n};\\n\\nreturn [{ json: payload }];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"callback ID?\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 960,\n 820\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"standup-config\"\n },\n {\n \"output\": 1,\n \"value2\": \"standup-answers\"\n }\n ]\n },\n \"value1\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"callback_id\\\"]}}\",\n \"dataType\": \"string\",\n \"fallbackOutput\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"standup-config\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1180,\n 820\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"standup-answers\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1180,\n 1040\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Config Override\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1400,\n 820\n ],\n \"parameters\": {\n \"functionCode\": \"const mattermostInput = $item(0).$node['Action from MM'].json['body'];\\nconst config = $item(0).$node['Read Config 2'].json;\\n\\n// ensure there is a \\\"standups\\\" array:\\nconfig['standups'] = config['standups'] ?? [];\\n\\n// remove the standup from the list:\\nconfig['standups'] = config['standups'].filter(\\n (standup) => standup.channelId != mattermostInput.channel_id\\n);\\n\\nconst textToArray = (text, separator) => {\\n return text\\n .split(separator)\\n .map((e) => e.trim())\\n .filter((e) => e.length > 0);\\n};\\n\\n// a standup can be deleted by updating its title to \\\"\\\"\\nif (mattermostInput.submission.title.length > 0) {\\n const newStandup = {\\n channelId: mattermostInput.channel_id,\\n title: mattermostInput.submission.title,\\n time: mattermostInput.submission.time,\\n days: textToArray(mattermostInput.submission.days, ',').map((e) =>\\n parseInt(e)\\n ),\\n users: textToArray(mattermostInput.submission.users, '\\\\n'),\\n questions: textToArray(mattermostInput.submission.questions, '\\\\n'),\\n };\\n\\n config['standups'].push(newStandup);\\n}\\n\\nreturn [{ json: config }];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Override Config\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 1620,\n 820\n ],\n \"parameters\": {\n \"workflowId\": \"1005\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 1\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 960,\n 580\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 2\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 740,\n 820\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"confirm success\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 1840,\n 820\n ],\n \"parameters\": {\n \"userId\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"user_id\\\"]}}\",\n \"message\": \"new standup config was saved successfully\",\n \"channelId\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"channel_id\\\"]}}\",\n \"operation\": \"postEphemeral\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 3\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 740,\n 380\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Filter Due Standups\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 960,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const config = $item(0).$node['Read Config 3'].json;\\n\\n// ensure there is a \\\"standups\\\" array:\\nconfig['standups'] = config['standups'] ?? [];\\n\\nconst now = new Date();\\nconst duePattern = `${now.getDay()}_${now\\n .getHours()\\n .toString()\\n .padStart(2, '0')}:00`; // e.g. 1_13:00 => Monday 1 p.m.\\n \\nconsole.log(duePattern);\\n\\n// filter standups that are due now:\\nconst dueStandups = config.standups.filter((standup) =>\\n //true\\n standup.days.map((day) => `${day}_${standup.time}`).includes(duePattern)\\n);\\n\\nreturn dueStandups.map((standup) => ({\\n json: standup,\\n}));\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Request Standup\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1180,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const reminders = items.reduce((prev, curr) => {\\n return prev.concat(\\n curr.json.users.map((user) => ({\\n channelId: curr.json.channelId,\\n title: curr.json.title,\\n user: user,\\n }))\\n );\\n}, []);\\n\\nreturn reminders.map((reminder) => ({\\n json: reminder,\\n}));\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Create Channel\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1620,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/channels/direct\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"=[\\\"{{$node[\\\"Get User\\\"].json[\\\"id\\\"]}}\\\", \\\"{{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserId\\\"]}}\\\"]\",\n \"headerParametersJson\": \"={\\n \\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Remind Users\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2060,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/posts\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\",\n \"headerParametersJson\": \"={\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get User\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1400,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/users/username/{{$node[\\\"Prep Request Standup\\\"].json[\\\"user\\\"]}}\",\n \"options\": {},\n \"jsonParameters\": true,\n \"headerParametersJson\": \"={\\n \\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"name\": \"Prep Reminder\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1840,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const webhookUrl =\\n $item(0).$node['Read Config 3'].json['config']['n8nWebhookUrl']; // e.g. https://xyz.app.n8n.cloud/webhook-test/standup-bot/action/top-secret-api-key\\n\\nconst botUserToken =\\n $item(0).$node['Read Config 3'].json['config']['botUserToken'];\\n\\nlet itemIndex = 0;\\n\\nfor (item of items) {\\n const directChannelId = item.json.id;\\n\\n const payload = {\\n channel_id: directChannelId,\\n props: {\\n attachments: [\\n {\\n pretext: \\\"Hi there! It's time for standup!\\\",\\n text: `Please provide your input for: **${\\n $item(itemIndex).$node['Prep Request Standup'].json['title']\\n }**`,\\n actions: [\\n {\\n id: webhookUrl.includes('test') ? 'webhook-test' : 'webhook',\\n name: 'Provide Update',\\n integration: {\\n url: webhookUrl,\\n context: {\\n action: 'open-standup-dialog',\\n secret: botUserToken, // not ideal but good enough for now...\\n standupId:\\n $item(itemIndex).$node['Prep Request Standup'].json[\\n 'channelId'\\n ],\\n },\\n },\\n },\\n ],\\n },\\n ],\\n },\\n };\\n\\n item.json = payload;\\n\\n itemIndex++;\\n}\\n\\nreturn items;\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Standup Dialog\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1400,\n 1240\n ],\n \"parameters\": {\n \"functionCode\": \"const standupId =\\n $item(0).$node['Action from MM'].json['body']['context']['standupId'];\\n\\nconst postId = $item(0).$node['Action from MM'].json['body']['post_id'];\\n\\nconst configuredStandups =\\n $item(0).$node['Read Config 2'].json['standups'] ?? [];\\n\\nlet standup = configuredStandups.find(\\n (standup) => (standup.channelId == standupId)\\n);\\n\\nconst renderQuestions = (questions) => {\\n let questionId = 1;\\n\\n return questions.map((question) => ({\\n display_name: question,\\n name: `q${questionId++}`,\\n type: 'textarea',\\n }));\\n};\\n\\nconst payload = {\\n trigger_id: $item(0).$node['Action from MM'].json['body']['trigger_id'],\\n url: $item(0).$node['Read Config 2'].json['config']['n8nWebhookUrl'],\\n dialog: {\\n callback_id: 'standup-answers',\\n title: `Report for: ${standup.title}`,\\n submit_label: 'Submit',\\n notify_on_cancel: false,\\n state: JSON.stringify({ standupId, reminderPostId: postId }),\\n elements: renderQuestions(standup.questions),\\n },\\n};\\n\\nreturn [{ json: payload }];\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open standup dialog\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1600,\n 1240\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/actions/dialogs/open\",\n \"options\": {\n \"bodyContentType\": \"json\"\n },\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Report\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1620,\n 1040\n ],\n \"parameters\": {\n \"functionCode\": \"const { standupId, reminderPostId } = JSON.parse(\\n $item(0).$node['Action from MM'].json['body']['state']\\n);\\nconst submission = $item(0).$node['Action from MM'].json['body']['submission'];\\n\\nconst configuredStandups = $item(0).$node['Read Config 2'].json['standups'];\\n\\nconst standup = configuredStandups.find(\\n (standup) => standup.channelId == standupId\\n);\\n\\nconst emptyAnswers = [\\n '-',\\n '/',\\n ' ',\\n 'x',\\n 'n/a',\\n 'nope',\\n 'nopes',\\n 'no',\\n 'none',\\n 'no.',\\n 'nothing',\\n];\\n\\nfunction capitalize(text) {\\n return text.charAt(0).toUpperCase() + text.slice(1);\\n}\\n\\nconst renderPost = (submission, standup) => {\\n let postText = `### ${capitalize(\\n $item(0).$node['get user data'].json['username']\\n )}\\\\n`;\\n\\n let questionIndex = 0;\\n\\n postText += standup.questions\\n .map((question) => {\\n questionIndex++;\\n\\n if (\\n !submission[`q${questionIndex}`] ||\\n emptyAnswers.includes(submission[`q${questionIndex}`].toLowerCase())\\n ) {\\n return '';\\n }\\n\\n return `#### ${question}\\\\n${submission[`q${questionIndex}`]}`;\\n })\\n .join('\\\\n');\\n\\n return postText;\\n};\\n\\nreturn [\\n {\\n json: {\\n post: renderPost(submission, standup),\\n channel: standupId,\\n reminderPostId,\\n standupTitle: standup.title,\\n },\\n },\\n];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Delete ReminderPost\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 2280,\n 1040\n ],\n \"parameters\": {\n \"postId\": \"={{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\",\n \"operation\": \"delete\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Update Post\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2060,\n 1040\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/posts/{{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\",\n \"options\": {},\n \"requestMethod\": \"PUT\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={\\n\\\"id\\\":\\\"{{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\\\",\\n\\\"message\\\": \\\"Thank you for providing your report for {{$node[\\\"Prep Report\\\"].json[\\\"standupTitle\\\"]}}\\\"\\n}\",\n \"headerParametersJson\": \"={\\n\\\"Content-Type\\\":\\\"application/json\\\",\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Every hour\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n 520,\n 380\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"mode\": \"custom\",\n \"cronExpression\": \"0 0 6-12 * * 1-5\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"settings\": {},\n \"connections\": {\n \"config?\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get User\": {\n \"main\": [\n [\n {\n \"node\": \"Create Channel\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Every hour\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Report\": {\n \"main\": [\n [\n {\n \"node\": \"publish report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"callback ID?\": {\n \"main\": [\n [\n {\n \"node\": \"standup-config\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"standup-answers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [],\n [\n {\n \"node\": \"open-standup-dialog?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Reminder\": {\n \"main\": [\n [\n {\n \"node\": \"Remind Users\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 1\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Config Dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 2\": {\n \"main\": [\n [\n {\n \"node\": \"callback ID?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 3\": {\n \"main\": [\n [\n {\n \"node\": \"Filter Due Standups\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get user data\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Action from MM\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Channel\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Reminder\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"publish report\": {\n \"main\": [\n [\n {\n \"node\": \"Update Post\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"standup-config\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Config Override\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Override Config\": {\n \"main\": [\n [\n {\n \"node\": \"confirm success\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"standup-answers\": {\n \"main\": [\n [\n {\n \"node\": \"get user data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Slash Cmd from MM\": {\n \"main\": [\n [\n {\n \"node\": \"config?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Config Dialog\": {\n \"main\": [\n [\n {\n \"node\": \"open config dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter Due Standups\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Request Standup\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Standup Dialog\": {\n \"main\": [\n [\n {\n \"node\": \"open standup dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Config Override\": {\n \"main\": [\n [\n {\n \"node\": \"Override Config\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Request Standup\": {\n \"main\": [\n [\n {\n \"node\": \"Get User\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"open-standup-dialog?\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Standup Dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
22
0
3
true
combined_workflows.json
{ "input": "This workflow automates daily standup meetings in Mattermost. It allows users to configure standup settings, reminds users to submit their updates, and publishes the collected reports.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 19189, "processed_size": 19189, "processed_timestamp": "2025-04-09T03:08:37.715117", "timestamp": "2025-04-09T02:35:30.801166", "token_count": 4095, "tokens": 1610, "workflow_chunk_info": { "is_truncated": false, "original_size": 19189, "processed_size": 19189, "workflow_hash": "010ddae84094c900120409190f98da01" }, "workflow_hash": "010ddae84094c900120409190f98da01" }
0 ], "parameters": { "functionCode": "const config = $item(0).$node['Read Config 3'].json;\n\n// ensure there is a \"standups\" array:\nconfig['standups'] = config['standups'] ?? [];\n\nconst now = new Date();\nconst duePattern = `${now.getDay()}_${now\n .getHours()\n .toString()\n .padStart(2, '0')}:00`; // e.g. 1_13:00 => Monday 1 p.m.\n \nconsole.log(duePattern);\n\n// filter standups that are due now:\nconst dueStandups = config.standups.filter((standup) =>\n //true\n standup.days.map((day) => `${day}_${standup.time}`).includes(duePattern)\n);\n\nreturn dueStandups.map((standup) => ({\n json: standup,\n}));\n\n" }, "typeVersion": 1 }, { "name": "Prep Request Standup", "type": "n8n-nodes-base.function", "position": [ 1180, 380 ], "parameters": { "functionCode": "const reminders = items.reduce((prev, curr) => {\n return prev.concat(\n curr.json.users.map((user) => ({\n channelId: curr.json.channelId,\n title: curr.json.title,\n user: user,\n }))\n );\n}, []);\n\nreturn reminders.map((reminder) => ({\n json: reminder,\n}));\n" }, "typeVersion": 1 }, { "name": "Create Channel", "type": "n8n-nodes-base.httpRequest", "position": [ 1620, 380 ], "parameters": { "url": "={{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/channels/direct", "options": {}, "requestMethod": "POST", "jsonParameters": true, "bodyParametersJson": "=[\"{{$node[\"Get User\"].json[\"id\"]}}\", \"{{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"botUserId\"]}}\"]", "headerParametersJson": "={\n \"Authorization\": \"Bearer {{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"botUserToken\"]}}\"\n}" }, "typeVersion": 1 }, { "name": "Remind Users", "type": "n8n-nodes-base.httpRequest", "position": [ 2060, 380 ], "parameters": { "url": "={{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/posts", "options": {}, "requestMethod": "POST", "jsonParameters": true, "bodyParametersJson": "={{$json}}", "headerParametersJson": "={\n\"Authorization\": \"Bearer {{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"botUserToken\"]}}\"\n}" }, "typeVersion": 1 }, { "name": "Get User", "type": "n8n-nodes-base.httpRequest", "position": [ 1400, 380 ], "parameters": { "url": "={{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/users/username/{{$node[\"Prep Request Standup\"].json[\"user\"]}}", "options": {}, "jsonParameters": true, "headerParametersJson": "={\n \"Authorization\": \"Bearer {{$item(0).$node[\"Read Config 3\"].json[\"config\"][\"botUserToken\"]}}\"\n}" }, "typeVersion": 1, "continueOnFail": true }, { "name": "Prep Reminder", "type": "n8n-nodes-base.function", "position": [ 1840, 380 ], "parameters": { "functionCode": "const webhookUrl =\n $item(0).$node['Read Config 3'].json['config']['n8nWebhookUrl']; // e.g. https://xyz.app.n8n.cloud/webhook-test/standup-bot/action/top-secret-api-key\n\nconst botUserToken =\n $item(0).$node['Read Config 3'].json['config']['botUserToken'];\n\nlet itemIndex = 0;\n\nfor (item of items) {\n const directChannelId = item.json.id;\n\n const payload = {\n channel_id: directChannelId,\n props: {\n attachments: [\n {\n pretext: \"Hi there! It's time for standup!\",\n text: `Please provide your input for: **${\n $item(itemIndex).$node['Prep Request Standup'].json['title']\n }**`,\n actions: [\n {\n id: webhookUrl.includes('test') ? 'webhook-test' : 'webhook',\n name: 'Provide Update',\n integration: {\n url: webhookUrl,\n context: {\n action: 'open-standup-dialog',\n secret: botUserToken, // not ideal but good enough for now...\n standupId:\n $item(itemIndex).$node['Prep Request Standup'].json[\n 'channelId'\n ],\n },\n },\n },\n ],\n },\n ],\n },\n };\n\n item.json = payload;\n\n itemIndex++;\n}\n\nreturn items;\n\n" }, "typeVersion": 1 }, { "name": "Prep Standup Dialog", "type": "n8n-nodes-base.function", "position": [ 1400, 1240 ], "parameters": { "functionCode": "const standupId =\n $item(0).$node['Action from MM'].json['body']['context']['standupId'];\n\nconst postId = $item(0).$node['Action from MM'].json['body']['post_id'];\n\nconst configuredStandups =\n $item(0).$node['Read Config 2'].json['standups'] ?? [];\n\nlet standup = configuredStandups.find(\n (standup) => (standup.channelId == standupId)\n);\n\nconst renderQuestions = (questions) => {\n let questionId = 1;\n\n return questions.map((question) => ({\n display_name: question,\n name: `q${questionId++}`,\n type: 'textarea',\n }));\n};\n\nconst payload = {\n trigger_id: $item(0).$node['Action from MM'].json['body']['trigger_id'],\n url: $item(0).$node['Read Config 2'].json['config']['n8nWebhookUrl'],\n dialog: {\n callback_id: 'standup-answers',\n title: `Report for: ${standup.title}`,\n submit_label: 'Submit',\n notify_on_cancel: false,\n state: JSON.stringify({ standupId, reminderPostId: postId }),\n elements: renderQuestions(standup.questions),\n },\n};\n\nreturn [{ json: payload }];\n" }, "typeVersion": 1 }, { "name": "open standup dialog", "type": "n8n-nodes-base.httpRequest", "position": [ 1600, 1240 ], "parameters": { "url": "={{$node[\"Read Config 2\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/actions/dialogs/open", "options": { "bodyContentType": "json" }, "requestMethod": "POST", "jsonParameters": true, "bodyParametersJson": "={{$json}}" }, "typeVersion": 1 }, { "name": "Prep Report", "type": "n8n-nodes-base.function", "position": [ 1620, 1040 ], "parameters": { "functionCode": "const { standupId, reminderPostId } = JSON.parse(\n $item(0).$node['Action from MM'].json['body']['state']\n);\nconst submission = $item(0).$node['Action from MM'].json['body']['submission'];\n\nconst configuredStandups = $item(0).$node['Read Config 2'].json['standups'];\n\nconst standup = configuredStandups.find(\n (standup) => standup.channelId == standupId\n);\n\nconst emptyAnswers = [\n '-',\n '/',\n ' ',\n 'x',\n 'n/a',\n 'nope',\n 'nopes',\n 'no',\n 'none',\n 'no.',\n 'nothing',\n];\n\nfunction capitalize(text) {\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\nconst renderPost = (submission, standup) => {\n let postText = `### ${capitalize(\n $item(0).$node['get user data'].json['username']\n )}\\n`;\n\n let questionIndex = 0;\n\n postText += standup.questions\n .map((question) => {\n questionIndex++;\n\n if (\n !submission[`q${questionIndex}`] ||\n emptyAnswers.includes(submission[`q${questionIndex}`].toLowerCase())\n ) {\n return '';\n }\n\n return `#### ${question}\\n${submission[`q${questionIndex}`]}`;\n })\n .join('\\n');\n\n return postText;\n};\n\nreturn [\n {\n json: {\n post: renderPost(submission, standup),\n channel: standupId,\n reminderPostId,\n standupTitle: standup.title,\n },\n },\n];\n\n" }, "typeVersion": 1 }, { "name": "Delete ReminderPost", "type": "n8n-nodes-base.mattermost", "position": [ 2280, 1040 ], "parameters": { "postId": "={{$node[\"Prep Report\"].json[\"reminderPostId\"]}}", "operation": "delete" }, "credentials": { "mattermostApi": { "id": "2", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Update Post", "type": "n8n-nodes-base.httpRequest", "position": [ 2060, 1040 ], "parameters": { "url": "={{$node[\"Read Config 2\"].json[\"config\"][\"mattermostBaseUrl\"]}}/api/v4/posts/{{$node[\"Prep Report\"].json[\"reminderPostId\"]}}", "options": {}, "requestMethod": "PUT", "jsonParameters": true, "bodyParametersJson": "={\n\"id\":\"{{$node[\"Prep Report\"].json[\"reminderPostId\"]}}\",\n\"message\": \"Thank you for providing your report for {{$node[\"Prep Report\"].json[\"standupTitle\"]}}\"\n}", "headerParametersJson": "={\n\"Content-Type\":\"application/json\",\n\"Authorization\": \"Bearer {{$item(0).$node[\"Read Config 2\"].json[\"config\"][\"botUserToken\"]}}\"\n}" }, "typeVersion": 1 }, { "name": "Every hour", "type": "n8n-nodes-base.cron", "position": [ 520, 380 ], "parameters": { "triggerTimes": { "item": [ { "mode": "custom", "cronExpression": "0 0 6-12 * * 1-5" } ] } }, "typeVersion": 1 } ], "active": false, "settings": {}, "connections": { "config?": { "main": [ [ { "node": "Read Config 1", "type": "main", "index": 0 } ] ] }, "Get User": { "main": [ [ { "node": "Create Channel", "type": "main", "index": 0 } ] ] }, "Every hour": { "main": [ [ { "node": "Read Config 3", "type": "main", "index": 0 } ] ] }, "Prep Report": { "main": [ [ { "node": "publish report", "type": "main", "index": 0 } ] ] }, "callback ID?": { "main": [ [ { "node": "standup-config", "type": "main", "index": 0 } ], [ { "node": "standup-answers", "type": "main", "index": 0 } ], [], [ { "node": "open-standup-dialog?", "type": "main", "index": 0 } ] ] }, "Prep Reminder": { "main": [ [ { "node": "Remind Users", "type": "main", "index": 0 } ] ] }, "Read Config 1": { "main": [ [ { "node": "Prep Config Dialog", "type": "main", "index": 0 } ] ] }, "Read Config 2": { "main": [ [ { "node": "callback ID?", "type": "main", "index": 0 } ] ] }, "Read Config 3": { "main": [ [ { "node": "Filter Due Standups", "type": "main", "index": 0 } ] ] }, "get user data": { "main": [ [ { "node": "Prep Report", "type": "main", "index": 0 } ] ] }, "Action from MM": { "main": [ [ { "node": "Read Config
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": 114,\n \"name\": \"Standup Bot - Worker\",\n \"nodes\": [\n {\n \"name\": \"publish report\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 1840,\n 1040\n ],\n \"parameters\": {\n \"message\": \"={{$node[\\\"Prep Report\\\"].json[\\\"post\\\"]}}\",\n \"channelId\": \"={{$node[\\\"Prep Report\\\"].json[\\\"channel\\\"]}}\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"get user data\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1400,\n 1040\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/users/{{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"user_id\\\"]}}\",\n \"options\": {},\n \"jsonParameters\": true,\n \"headerParametersJson\": \"={\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open-standup-dialog?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1180,\n 1260\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"context\\\"][\\\"action\\\"]}}\",\n \"value2\": \"open-standup-dialog\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Action from MM\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 520,\n 820\n ],\n \"webhookId\": \"6a28d86b-9f74-4825-9785-57e0d43b198f\",\n \"parameters\": {\n \"path\": \"standup-bot/action/f6f9b174745fa4651f750c36957d674c\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Slash Cmd from MM\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 520,\n 600\n ],\n \"webhookId\": \"72732516-1143-430f-8465-d193fe657311\",\n \"parameters\": {\n \"path\": \"standup-bot/slashCmd\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"config?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 740,\n 600\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$node[\\\"Slash Cmd from MM\\\"].json[\\\"body\\\"][\\\"text\\\"]}}\",\n \"value2\": \"config\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open config dialog\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1360,\n 580\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 1\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/actions/dialogs/open\",\n \"options\": {\n \"bodyContentType\": \"json\"\n },\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Config Dialog\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1160,\n 580\n ],\n \"parameters\": {\n \"functionCode\": \"const channelId =\\n $item(0).$node['Slash Cmd from MM'].json['body']['channel_id'];\\n\\nconst configuredStandups =\\n $item(0).$node['Read Config 1'].json['standups'] ?? [];\\n\\nlet standup = configuredStandups.find(\\n (standup) => standup.channelId == channelId\\n);\\n\\n// define default values:\\nif (!standup) {\\n standup = {\\n title: 'Team Standup',\\n time: '09:00',\\n days: [1, 2, 3, 4, 5],\\n questions: [\\n 'What have you accomplished since your last report?',\\n 'What do you want to accomplish until your next report?',\\n 'Is anything blocking your progress?',\\n ],\\n users: [],\\n };\\n}\\n\\nconst payload = {\\n trigger_id: $item(0).$node['Slash Cmd from MM'].json['body']['trigger_id'],\\n url: $item(0).$node['Read Config 1'].json['config']['n8nWebhookUrl'],\\n dialog: {\\n callback_id: 'standup-config',\\n title: 'Standup Configuration',\\n submit_label: 'Save',\\n notify_on_cancel: false,\\n state: JSON.stringify({ standupId: channelId }),\\n elements: [\\n {\\n display_name: 'Standup title',\\n name: 'title',\\n type: 'text',\\n placeholder: 'Team Standup',\\n default: standup.title,\\n optional: true,\\n help_text:\\n 'πŸ’‘ The standup can be deleted by setting its title to an empty string!',\\n },\\n {\\n display_name: 'Time',\\n name: 'time',\\n type: 'select',\\n default: standup.time,\\n options: [\\n {\\n text: '06:00',\\n value: '06:00',\\n },\\n {\\n text: '07:00',\\n value: '07:00',\\n },\\n {\\n text: '08:00',\\n value: '08:00',\\n },\\n {\\n text: '09:00',\\n value: '09:00',\\n },\\n {\\n text: '10:00',\\n value: '10:00',\\n },\\n {\\n text: '11:00',\\n value: '11:00',\\n },\\n {\\n text: '12:00',\\n value: '12:00',\\n },\\n {\\n text: '13:00',\\n value: '13:00',\\n },\\n {\\n text: '14:00',\\n value: '14:00',\\n },\\n {\\n text: '15:00',\\n value: '15:00',\\n },\\n {\\n text: '16:00',\\n value: '16:00',\\n },\\n {\\n text: '17:00',\\n value: '17:00',\\n },\\n ],\\n },\\n {\\n display_name: 'Days',\\n name: 'days',\\n type: 'text',\\n placeholder: '1,2,3,4,5',\\n help_text:\\n 'comma-separated; 0=Sun | 1=Mon | 2=Tue | 3=Wed | 4=Thu | 5=Fri | 6=Sat',\\n default: standup.days.join(','),\\n },\\n {\\n display_name: 'Questions',\\n name: 'questions',\\n type: 'textarea',\\n help_text: 'Max 5 questions, one question per line;',\\n default: standup.questions.join('\\\\n'),\\n },\\n {\\n display_name: 'Users',\\n name: 'users',\\n type: 'textarea',\\n help_text: 'One user per line',\\n default: standup.users.join('\\\\n'),\\n },\\n ],\\n },\\n};\\n\\nreturn [{ json: payload }];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"callback ID?\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 960,\n 820\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"standup-config\"\n },\n {\n \"output\": 1,\n \"value2\": \"standup-answers\"\n }\n ]\n },\n \"value1\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"callback_id\\\"]}}\",\n \"dataType\": \"string\",\n \"fallbackOutput\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"standup-config\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1180,\n 820\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"standup-answers\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1180,\n 1040\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Config Override\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1400,\n 820\n ],\n \"parameters\": {\n \"functionCode\": \"const mattermostInput = $item(0).$node['Action from MM'].json['body'];\\nconst config = $item(0).$node['Read Config 2'].json;\\n\\n// ensure there is a \\\"standups\\\" array:\\nconfig['standups'] = config['standups'] ?? [];\\n\\n// remove the standup from the list:\\nconfig['standups'] = config['standups'].filter(\\n (standup) => standup.channelId != mattermostInput.channel_id\\n);\\n\\nconst textToArray = (text, separator) => {\\n return text\\n .split(separator)\\n .map((e) => e.trim())\\n .filter((e) => e.length > 0);\\n};\\n\\n// a standup can be deleted by updating its title to \\\"\\\"\\nif (mattermostInput.submission.title.length > 0) {\\n const newStandup = {\\n channelId: mattermostInput.channel_id,\\n title: mattermostInput.submission.title,\\n time: mattermostInput.submission.time,\\n days: textToArray(mattermostInput.submission.days, ',').map((e) =>\\n parseInt(e)\\n ),\\n users: textToArray(mattermostInput.submission.users, '\\\\n'),\\n questions: textToArray(mattermostInput.submission.questions, '\\\\n'),\\n };\\n\\n config['standups'].push(newStandup);\\n}\\n\\nreturn [{ json: config }];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Override Config\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 1620,\n 820\n ],\n \"parameters\": {\n \"workflowId\": \"1005\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 1\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 960,\n 580\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 2\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 740,\n 820\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"confirm success\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 1840,\n 820\n ],\n \"parameters\": {\n \"userId\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"user_id\\\"]}}\",\n \"message\": \"new standup config was saved successfully\",\n \"channelId\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"channel_id\\\"]}}\",\n \"operation\": \"postEphemeral\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 3\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 740,\n 380\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Filter Due Standups\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 960,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const config = $item(0).$node['Read Config 3'].json;\\n\\n// ensure there is a \\\"standups\\\" array:\\nconfig['standups'] = config['standups'] ?? [];\\n\\nconst now = new Date();\\nconst duePattern = `${now.getDay()}_${now\\n .getHours()\\n .toString()\\n .padStart(2, '0')}:00`; // e.g. 1_13:00 => Monday 1 p.m.\\n \\nconsole.log(duePattern);\\n\\n// filter standups that are due now:\\nconst dueStandups = config.standups.filter((standup) =>\\n //true\\n standup.days.map((day) => `${day}_${standup.time}`).includes(duePattern)\\n);\\n\\nreturn dueStandups.map((standup) => ({\\n json: standup,\\n}));\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Request Standup\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1180,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const reminders = items.reduce((prev, curr) => {\\n return prev.concat(\\n curr.json.users.map((user) => ({\\n channelId: curr.json.channelId,\\n title: curr.json.title,\\n user: user,\\n }))\\n );\\n}, []);\\n\\nreturn reminders.map((reminder) => ({\\n json: reminder,\\n}));\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Create Channel\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1620,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/channels/direct\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"=[\\\"{{$node[\\\"Get User\\\"].json[\\\"id\\\"]}}\\\", \\\"{{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserId\\\"]}}\\\"]\",\n \"headerParametersJson\": \"={\\n \\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Remind Users\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2060,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/posts\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\",\n \"headerParametersJson\": \"={\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get User\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1400,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/users/username/{{$node[\\\"Prep Request Standup\\\"].json[\\\"user\\\"]}}\",\n \"options\": {},\n \"jsonParameters\": true,\n \"headerParametersJson\": \"={\\n \\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"name\": \"Prep Reminder\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1840,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const webhookUrl =\\n $item(0).$node['Read Config 3'].json['config']['n8nWebhookUrl']; // e.g. https://xyz.app.n8n.cloud/webhook-test/standup-bot/action/top-secret-api-key\\n\\nconst botUserToken =\\n $item(0).$node['Read Config 3'].json['config']['botUserToken'];\\n\\nlet itemIndex = 0;\\n\\nfor (item of items) {\\n const directChannelId = item.json.id;\\n\\n const payload = {\\n channel_id: directChannelId,\\n props: {\\n attachments: [\\n {\\n pretext: \\\"Hi there! It's time for standup!\\\",\\n text: `Please provide your input for: **${\\n $item(itemIndex).$node['Prep Request Standup'].json['title']\\n }**`,\\n actions: [\\n {\\n id: webhookUrl.includes('test') ? 'webhook-test' : 'webhook',\\n name: 'Provide Update',\\n integration: {\\n url: webhookUrl,\\n context: {\\n action: 'open-standup-dialog',\\n secret: botUserToken, // not ideal but good enough for now...\\n standupId:\\n $item(itemIndex).$node['Prep Request Standup'].json[\\n 'channelId'\\n ],\\n },\\n },\\n },\\n ],\\n },\\n ],\\n },\\n };\\n\\n item.json = payload;\\n\\n itemIndex++;\\n}\\n\\nreturn items;\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Standup Dialog\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1400,\n 1240\n ],\n \"parameters\": {\n \"functionCode\": \"const standupId =\\n $item(0).$node['Action from MM'].json['body']['context']['standupId'];\\n\\nconst postId = $item(0).$node['Action from MM'].json['body']['post_id'];\\n\\nconst configuredStandups =\\n $item(0).$node['Read Config 2'].json['standups'] ?? [];\\n\\nlet standup = configuredStandups.find(\\n (standup) => (standup.channelId == standupId)\\n);\\n\\nconst renderQuestions = (questions) => {\\n let questionId = 1;\\n\\n return questions.map((question) => ({\\n display_name: question,\\n name: `q${questionId++}`,\\n type: 'textarea',\\n }));\\n};\\n\\nconst payload = {\\n trigger_id: $item(0).$node['Action from MM'].json['body']['trigger_id'],\\n url: $item(0).$node['Read Config 2'].json['config']['n8nWebhookUrl'],\\n dialog: {\\n callback_id: 'standup-answers',\\n title: `Report for: ${standup.title}`,\\n submit_label: 'Submit',\\n notify_on_cancel: false,\\n state: JSON.stringify({ standupId, reminderPostId: postId }),\\n elements: renderQuestions(standup.questions),\\n },\\n};\\n\\nreturn [{ json: payload }];\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open standup dialog\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1600,\n 1240\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/actions/dialogs/open\",\n \"options\": {\n \"bodyContentType\": \"json\"\n },\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Report\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1620,\n 1040\n ],\n \"parameters\": {\n \"functionCode\": \"const { standupId, reminderPostId } = JSON.parse(\\n $item(0).$node['Action from MM'].json['body']['state']\\n);\\nconst submission = $item(0).$node['Action from MM'].json['body']['submission'];\\n\\nconst configuredStandups = $item(0).$node['Read Config 2'].json['standups'];\\n\\nconst standup = configuredStandups.find(\\n (standup) => standup.channelId == standupId\\n);\\n\\nconst emptyAnswers = [\\n '-',\\n '/',\\n ' ',\\n 'x',\\n 'n/a',\\n 'nope',\\n 'nopes',\\n 'no',\\n 'none',\\n 'no.',\\n 'nothing',\\n];\\n\\nfunction capitalize(text) {\\n return text.charAt(0).toUpperCase() + text.slice(1);\\n}\\n\\nconst renderPost = (submission, standup) => {\\n let postText = `### ${capitalize(\\n $item(0).$node['get user data'].json['username']\\n )}\\\\n`;\\n\\n let questionIndex = 0;\\n\\n postText += standup.questions\\n .map((question) => {\\n questionIndex++;\\n\\n if (\\n !submission[`q${questionIndex}`] ||\\n emptyAnswers.includes(submission[`q${questionIndex}`].toLowerCase())\\n ) {\\n return '';\\n }\\n\\n return `#### ${question}\\\\n${submission[`q${questionIndex}`]}`;\\n })\\n .join('\\\\n');\\n\\n return postText;\\n};\\n\\nreturn [\\n {\\n json: {\\n post: renderPost(submission, standup),\\n channel: standupId,\\n reminderPostId,\\n standupTitle: standup.title,\\n },\\n },\\n];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Delete ReminderPost\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 2280,\n 1040\n ],\n \"parameters\": {\n \"postId\": \"={{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\",\n \"operation\": \"delete\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Update Post\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2060,\n 1040\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/posts/{{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\",\n \"options\": {},\n \"requestMethod\": \"PUT\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={\\n\\\"id\\\":\\\"{{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\\\",\\n\\\"message\\\": \\\"Thank you for providing your report for {{$node[\\\"Prep Report\\\"].json[\\\"standupTitle\\\"]}}\\\"\\n}\",\n \"headerParametersJson\": \"={\\n\\\"Content-Type\\\":\\\"application/json\\\",\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Every hour\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n 520,\n 380\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"mode\": \"custom\",\n \"cronExpression\": \"0 0 6-12 * * 1-5\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"settings\": {},\n \"connections\": {\n \"config?\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get User\": {\n \"main\": [\n [\n {\n \"node\": \"Create Channel\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Every hour\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Report\": {\n \"main\": [\n [\n {\n \"node\": \"publish report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"callback ID?\": {\n \"main\": [\n [\n {\n \"node\": \"standup-config\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"standup-answers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [],\n [\n {\n \"node\": \"open-standup-dialog?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Reminder\": {\n \"main\": [\n [\n {\n \"node\": \"Remind Users\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 1\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Config Dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 2\": {\n \"main\": [\n [\n {\n \"node\": \"callback ID?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 3\": {\n \"main\": [\n [\n {\n \"node\": \"Filter Due Standups\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get user data\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Action from MM\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Channel\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Reminder\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"publish report\": {\n \"main\": [\n [\n {\n \"node\": \"Update Post\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"standup-config\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Config Override\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Override Config\": {\n \"main\": [\n [\n {\n \"node\": \"confirm success\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"standup-answers\": {\n \"main\": [\n [\n {\n \"node\": \"get user data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Slash Cmd from MM\": {\n \"main\": [\n [\n {\n \"node\": \"config?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Config Dialog\": {\n \"main\": [\n [\n {\n \"node\": \"open config dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter Due Standups\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Request Standup\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Standup Dialog\": {\n \"main\": [\n [\n {\n \"node\": \"open standup dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Config Override\": {\n \"main\": [\n [\n {\n \"node\": \"Override Config\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Request Standup\": {\n \"main\": [\n [\n {\n \"node\": \"Get User\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"open-standup-dialog?\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Standup Dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
22
1
3
true
combined_workflows.json
{ "input": "This workflow automates daily standup meetings in Mattermost. It allows users to configure standup settings, reminds users to submit their updates, and publishes the collected reports.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 19189, "processed_size": 19189, "processed_timestamp": "2025-04-09T03:08:37.725118", "timestamp": "2025-04-09T02:35:30.801166", "token_count": 4098, "tokens": 1610, "workflow_chunk_info": { "is_truncated": false, "original_size": 19189, "processed_size": 19189, "workflow_hash": "010ddae84094c900120409190f98da01" }, "workflow_hash": "010ddae84094c900120409190f98da01" }
Config 2": { "main": [ [ { "node": "callback ID?", "type": "main", "index": 0 } ] ] }, "Read Config 3": { "main": [ [ { "node": "Filter Due Standups", "type": "main", "index": 0 } ] ] }, "get user data": { "main": [ [ { "node": "Prep Report", "type": "main", "index": 0 } ] ] }, "Action from MM": { "main": [ [ { "node": "Read Config 2", "type": "main", "index": 0 } ] ] }, "Create Channel": { "main": [ [ { "node": "Prep Reminder", "type": "main", "index": 0 } ] ] }, "publish report": { "main": [ [ { "node": "Update Post", "type": "main", "index": 0 } ] ] }, "standup-config": { "main": [ [ { "node": "Prep Config Override", "type": "main", "index": 0 } ] ] }, "Override Config": { "main": [ [ { "node": "confirm success", "type": "main", "index": 0 } ] ] }, "standup-answers": { "main": [ [ { "node": "get user data", "type": "main", "index": 0 } ] ] }, "Slash Cmd from MM": { "main": [ [ { "node": "config?", "type": "main", "index": 0 } ] ] }, "Prep Config Dialog": { "main": [ [ { "node": "open config dialog", "type": "main", "index": 0 } ] ] }, "Filter Due Standups": { "main": [ [ { "node": "Prep Request Standup", "type": "main", "index": 0 } ] ] }, "Prep Standup Dialog": { "main": [ [ { "node": "open standup dialog", "type": "main", "index": 0 } ] ] }, "Prep Config Override": { "main": [ [ { "node": "Override Config", "type": "main", "index": 0 } ] ] }, "Prep Request Standup": { "main": [ [ { "node": "Get User", "type": "main", "index": 0 } ] ] }, "open-standup-dialog?": { "main": [ [ { "node": "Prep Standup Dialog", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": 114,\n \"name\": \"Standup Bot - Worker\",\n \"nodes\": [\n {\n \"name\": \"publish report\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 1840,\n 1040\n ],\n \"parameters\": {\n \"message\": \"={{$node[\\\"Prep Report\\\"].json[\\\"post\\\"]}}\",\n \"channelId\": \"={{$node[\\\"Prep Report\\\"].json[\\\"channel\\\"]}}\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"get user data\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1400,\n 1040\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/users/{{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"user_id\\\"]}}\",\n \"options\": {},\n \"jsonParameters\": true,\n \"headerParametersJson\": \"={\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open-standup-dialog?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1180,\n 1260\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"context\\\"][\\\"action\\\"]}}\",\n \"value2\": \"open-standup-dialog\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Action from MM\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 520,\n 820\n ],\n \"webhookId\": \"6a28d86b-9f74-4825-9785-57e0d43b198f\",\n \"parameters\": {\n \"path\": \"standup-bot/action/f6f9b174745fa4651f750c36957d674c\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Slash Cmd from MM\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 520,\n 600\n ],\n \"webhookId\": \"72732516-1143-430f-8465-d193fe657311\",\n \"parameters\": {\n \"path\": \"standup-bot/slashCmd\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"config?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 740,\n 600\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$node[\\\"Slash Cmd from MM\\\"].json[\\\"body\\\"][\\\"text\\\"]}}\",\n \"value2\": \"config\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open config dialog\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1360,\n 580\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 1\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/actions/dialogs/open\",\n \"options\": {\n \"bodyContentType\": \"json\"\n },\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Config Dialog\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1160,\n 580\n ],\n \"parameters\": {\n \"functionCode\": \"const channelId =\\n $item(0).$node['Slash Cmd from MM'].json['body']['channel_id'];\\n\\nconst configuredStandups =\\n $item(0).$node['Read Config 1'].json['standups'] ?? [];\\n\\nlet standup = configuredStandups.find(\\n (standup) => standup.channelId == channelId\\n);\\n\\n// define default values:\\nif (!standup) {\\n standup = {\\n title: 'Team Standup',\\n time: '09:00',\\n days: [1, 2, 3, 4, 5],\\n questions: [\\n 'What have you accomplished since your last report?',\\n 'What do you want to accomplish until your next report?',\\n 'Is anything blocking your progress?',\\n ],\\n users: [],\\n };\\n}\\n\\nconst payload = {\\n trigger_id: $item(0).$node['Slash Cmd from MM'].json['body']['trigger_id'],\\n url: $item(0).$node['Read Config 1'].json['config']['n8nWebhookUrl'],\\n dialog: {\\n callback_id: 'standup-config',\\n title: 'Standup Configuration',\\n submit_label: 'Save',\\n notify_on_cancel: false,\\n state: JSON.stringify({ standupId: channelId }),\\n elements: [\\n {\\n display_name: 'Standup title',\\n name: 'title',\\n type: 'text',\\n placeholder: 'Team Standup',\\n default: standup.title,\\n optional: true,\\n help_text:\\n 'πŸ’‘ The standup can be deleted by setting its title to an empty string!',\\n },\\n {\\n display_name: 'Time',\\n name: 'time',\\n type: 'select',\\n default: standup.time,\\n options: [\\n {\\n text: '06:00',\\n value: '06:00',\\n },\\n {\\n text: '07:00',\\n value: '07:00',\\n },\\n {\\n text: '08:00',\\n value: '08:00',\\n },\\n {\\n text: '09:00',\\n value: '09:00',\\n },\\n {\\n text: '10:00',\\n value: '10:00',\\n },\\n {\\n text: '11:00',\\n value: '11:00',\\n },\\n {\\n text: '12:00',\\n value: '12:00',\\n },\\n {\\n text: '13:00',\\n value: '13:00',\\n },\\n {\\n text: '14:00',\\n value: '14:00',\\n },\\n {\\n text: '15:00',\\n value: '15:00',\\n },\\n {\\n text: '16:00',\\n value: '16:00',\\n },\\n {\\n text: '17:00',\\n value: '17:00',\\n },\\n ],\\n },\\n {\\n display_name: 'Days',\\n name: 'days',\\n type: 'text',\\n placeholder: '1,2,3,4,5',\\n help_text:\\n 'comma-separated; 0=Sun | 1=Mon | 2=Tue | 3=Wed | 4=Thu | 5=Fri | 6=Sat',\\n default: standup.days.join(','),\\n },\\n {\\n display_name: 'Questions',\\n name: 'questions',\\n type: 'textarea',\\n help_text: 'Max 5 questions, one question per line;',\\n default: standup.questions.join('\\\\n'),\\n },\\n {\\n display_name: 'Users',\\n name: 'users',\\n type: 'textarea',\\n help_text: 'One user per line',\\n default: standup.users.join('\\\\n'),\\n },\\n ],\\n },\\n};\\n\\nreturn [{ json: payload }];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"callback ID?\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 960,\n 820\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"standup-config\"\n },\n {\n \"output\": 1,\n \"value2\": \"standup-answers\"\n }\n ]\n },\n \"value1\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"callback_id\\\"]}}\",\n \"dataType\": \"string\",\n \"fallbackOutput\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"standup-config\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1180,\n 820\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"standup-answers\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1180,\n 1040\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Config Override\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1400,\n 820\n ],\n \"parameters\": {\n \"functionCode\": \"const mattermostInput = $item(0).$node['Action from MM'].json['body'];\\nconst config = $item(0).$node['Read Config 2'].json;\\n\\n// ensure there is a \\\"standups\\\" array:\\nconfig['standups'] = config['standups'] ?? [];\\n\\n// remove the standup from the list:\\nconfig['standups'] = config['standups'].filter(\\n (standup) => standup.channelId != mattermostInput.channel_id\\n);\\n\\nconst textToArray = (text, separator) => {\\n return text\\n .split(separator)\\n .map((e) => e.trim())\\n .filter((e) => e.length > 0);\\n};\\n\\n// a standup can be deleted by updating its title to \\\"\\\"\\nif (mattermostInput.submission.title.length > 0) {\\n const newStandup = {\\n channelId: mattermostInput.channel_id,\\n title: mattermostInput.submission.title,\\n time: mattermostInput.submission.time,\\n days: textToArray(mattermostInput.submission.days, ',').map((e) =>\\n parseInt(e)\\n ),\\n users: textToArray(mattermostInput.submission.users, '\\\\n'),\\n questions: textToArray(mattermostInput.submission.questions, '\\\\n'),\\n };\\n\\n config['standups'].push(newStandup);\\n}\\n\\nreturn [{ json: config }];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Override Config\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 1620,\n 820\n ],\n \"parameters\": {\n \"workflowId\": \"1005\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 1\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 960,\n 580\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 2\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 740,\n 820\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"confirm success\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 1840,\n 820\n ],\n \"parameters\": {\n \"userId\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"user_id\\\"]}}\",\n \"message\": \"new standup config was saved successfully\",\n \"channelId\": \"={{$node[\\\"Action from MM\\\"].json[\\\"body\\\"][\\\"channel_id\\\"]}}\",\n \"operation\": \"postEphemeral\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Config 3\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 740,\n 380\n ],\n \"parameters\": {\n \"workflowId\": \"1004\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Filter Due Standups\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 960,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const config = $item(0).$node['Read Config 3'].json;\\n\\n// ensure there is a \\\"standups\\\" array:\\nconfig['standups'] = config['standups'] ?? [];\\n\\nconst now = new Date();\\nconst duePattern = `${now.getDay()}_${now\\n .getHours()\\n .toString()\\n .padStart(2, '0')}:00`; // e.g. 1_13:00 => Monday 1 p.m.\\n \\nconsole.log(duePattern);\\n\\n// filter standups that are due now:\\nconst dueStandups = config.standups.filter((standup) =>\\n //true\\n standup.days.map((day) => `${day}_${standup.time}`).includes(duePattern)\\n);\\n\\nreturn dueStandups.map((standup) => ({\\n json: standup,\\n}));\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Request Standup\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1180,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const reminders = items.reduce((prev, curr) => {\\n return prev.concat(\\n curr.json.users.map((user) => ({\\n channelId: curr.json.channelId,\\n title: curr.json.title,\\n user: user,\\n }))\\n );\\n}, []);\\n\\nreturn reminders.map((reminder) => ({\\n json: reminder,\\n}));\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Create Channel\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1620,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/channels/direct\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"=[\\\"{{$node[\\\"Get User\\\"].json[\\\"id\\\"]}}\\\", \\\"{{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserId\\\"]}}\\\"]\",\n \"headerParametersJson\": \"={\\n \\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Remind Users\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2060,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/posts\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\",\n \"headerParametersJson\": \"={\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Get User\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1400,\n 380\n ],\n \"parameters\": {\n \"url\": \"={{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/users/username/{{$node[\\\"Prep Request Standup\\\"].json[\\\"user\\\"]}}\",\n \"options\": {},\n \"jsonParameters\": true,\n \"headerParametersJson\": \"={\\n \\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 3\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"name\": \"Prep Reminder\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1840,\n 380\n ],\n \"parameters\": {\n \"functionCode\": \"const webhookUrl =\\n $item(0).$node['Read Config 3'].json['config']['n8nWebhookUrl']; // e.g. https://xyz.app.n8n.cloud/webhook-test/standup-bot/action/top-secret-api-key\\n\\nconst botUserToken =\\n $item(0).$node['Read Config 3'].json['config']['botUserToken'];\\n\\nlet itemIndex = 0;\\n\\nfor (item of items) {\\n const directChannelId = item.json.id;\\n\\n const payload = {\\n channel_id: directChannelId,\\n props: {\\n attachments: [\\n {\\n pretext: \\\"Hi there! It's time for standup!\\\",\\n text: `Please provide your input for: **${\\n $item(itemIndex).$node['Prep Request Standup'].json['title']\\n }**`,\\n actions: [\\n {\\n id: webhookUrl.includes('test') ? 'webhook-test' : 'webhook',\\n name: 'Provide Update',\\n integration: {\\n url: webhookUrl,\\n context: {\\n action: 'open-standup-dialog',\\n secret: botUserToken, // not ideal but good enough for now...\\n standupId:\\n $item(itemIndex).$node['Prep Request Standup'].json[\\n 'channelId'\\n ],\\n },\\n },\\n },\\n ],\\n },\\n ],\\n },\\n };\\n\\n item.json = payload;\\n\\n itemIndex++;\\n}\\n\\nreturn items;\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Standup Dialog\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1400,\n 1240\n ],\n \"parameters\": {\n \"functionCode\": \"const standupId =\\n $item(0).$node['Action from MM'].json['body']['context']['standupId'];\\n\\nconst postId = $item(0).$node['Action from MM'].json['body']['post_id'];\\n\\nconst configuredStandups =\\n $item(0).$node['Read Config 2'].json['standups'] ?? [];\\n\\nlet standup = configuredStandups.find(\\n (standup) => (standup.channelId == standupId)\\n);\\n\\nconst renderQuestions = (questions) => {\\n let questionId = 1;\\n\\n return questions.map((question) => ({\\n display_name: question,\\n name: `q${questionId++}`,\\n type: 'textarea',\\n }));\\n};\\n\\nconst payload = {\\n trigger_id: $item(0).$node['Action from MM'].json['body']['trigger_id'],\\n url: $item(0).$node['Read Config 2'].json['config']['n8nWebhookUrl'],\\n dialog: {\\n callback_id: 'standup-answers',\\n title: `Report for: ${standup.title}`,\\n submit_label: 'Submit',\\n notify_on_cancel: false,\\n state: JSON.stringify({ standupId, reminderPostId: postId }),\\n elements: renderQuestions(standup.questions),\\n },\\n};\\n\\nreturn [{ json: payload }];\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"open standup dialog\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1600,\n 1240\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/actions/dialogs/open\",\n \"options\": {\n \"bodyContentType\": \"json\"\n },\n \"requestMethod\": \"POST\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={{$json}}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prep Report\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1620,\n 1040\n ],\n \"parameters\": {\n \"functionCode\": \"const { standupId, reminderPostId } = JSON.parse(\\n $item(0).$node['Action from MM'].json['body']['state']\\n);\\nconst submission = $item(0).$node['Action from MM'].json['body']['submission'];\\n\\nconst configuredStandups = $item(0).$node['Read Config 2'].json['standups'];\\n\\nconst standup = configuredStandups.find(\\n (standup) => standup.channelId == standupId\\n);\\n\\nconst emptyAnswers = [\\n '-',\\n '/',\\n ' ',\\n 'x',\\n 'n/a',\\n 'nope',\\n 'nopes',\\n 'no',\\n 'none',\\n 'no.',\\n 'nothing',\\n];\\n\\nfunction capitalize(text) {\\n return text.charAt(0).toUpperCase() + text.slice(1);\\n}\\n\\nconst renderPost = (submission, standup) => {\\n let postText = `### ${capitalize(\\n $item(0).$node['get user data'].json['username']\\n )}\\\\n`;\\n\\n let questionIndex = 0;\\n\\n postText += standup.questions\\n .map((question) => {\\n questionIndex++;\\n\\n if (\\n !submission[`q${questionIndex}`] ||\\n emptyAnswers.includes(submission[`q${questionIndex}`].toLowerCase())\\n ) {\\n return '';\\n }\\n\\n return `#### ${question}\\\\n${submission[`q${questionIndex}`]}`;\\n })\\n .join('\\\\n');\\n\\n return postText;\\n};\\n\\nreturn [\\n {\\n json: {\\n post: renderPost(submission, standup),\\n channel: standupId,\\n reminderPostId,\\n standupTitle: standup.title,\\n },\\n },\\n];\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Delete ReminderPost\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 2280,\n 1040\n ],\n \"parameters\": {\n \"postId\": \"={{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\",\n \"operation\": \"delete\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"2\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Update Post\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2060,\n 1040\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"mattermostBaseUrl\\\"]}}/api/v4/posts/{{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\",\n \"options\": {},\n \"requestMethod\": \"PUT\",\n \"jsonParameters\": true,\n \"bodyParametersJson\": \"={\\n\\\"id\\\":\\\"{{$node[\\\"Prep Report\\\"].json[\\\"reminderPostId\\\"]}}\\\",\\n\\\"message\\\": \\\"Thank you for providing your report for {{$node[\\\"Prep Report\\\"].json[\\\"standupTitle\\\"]}}\\\"\\n}\",\n \"headerParametersJson\": \"={\\n\\\"Content-Type\\\":\\\"application/json\\\",\\n\\\"Authorization\\\": \\\"Bearer {{$item(0).$node[\\\"Read Config 2\\\"].json[\\\"config\\\"][\\\"botUserToken\\\"]}}\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Every hour\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n 520,\n 380\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"mode\": \"custom\",\n \"cronExpression\": \"0 0 6-12 * * 1-5\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"settings\": {},\n \"connections\": {\n \"config?\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get User\": {\n \"main\": [\n [\n {\n \"node\": \"Create Channel\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Every hour\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Report\": {\n \"main\": [\n [\n {\n \"node\": \"publish report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"callback ID?\": {\n \"main\": [\n [\n {\n \"node\": \"standup-config\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"standup-answers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [],\n [\n {\n \"node\": \"open-standup-dialog?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Reminder\": {\n \"main\": [\n [\n {\n \"node\": \"Remind Users\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 1\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Config Dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 2\": {\n \"main\": [\n [\n {\n \"node\": \"callback ID?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Config 3\": {\n \"main\": [\n [\n {\n \"node\": \"Filter Due Standups\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get user data\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Action from MM\": {\n \"main\": [\n [\n {\n \"node\": \"Read Config 2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Channel\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Reminder\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"publish report\": {\n \"main\": [\n [\n {\n \"node\": \"Update Post\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"standup-config\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Config Override\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Override Config\": {\n \"main\": [\n [\n {\n \"node\": \"confirm success\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"standup-answers\": {\n \"main\": [\n [\n {\n \"node\": \"get user data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Slash Cmd from MM\": {\n \"main\": [\n [\n {\n \"node\": \"config?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Config Dialog\": {\n \"main\": [\n [\n {\n \"node\": \"open config dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter Due Standups\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Request Standup\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Standup Dialog\": {\n \"main\": [\n [\n {\n \"node\": \"open standup dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Config Override\": {\n \"main\": [\n [\n {\n \"node\": \"Override Config\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prep Request Standup\": {\n \"main\": [\n [\n {\n \"node\": \"Get User\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"open-standup-dialog?\": {\n \"main\": [\n [\n {\n \"node\": \"Prep Standup Dialog\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
22
2
3
true
combined_workflows.json
{ "input": "This workflow automates daily standup meetings in Mattermost. It allows users to configure standup settings, reminds users to submit their updates, and publishes the collected reports.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 19189, "processed_size": 19189, "processed_timestamp": "2025-04-09T03:08:37.729154", "timestamp": "2025-04-09T02:35:30.801166", "token_count": 974, "tokens": 1610, "workflow_chunk_info": { "is_truncated": false, "original_size": 19189, "processed_size": 19189, "workflow_hash": "010ddae84094c900120409190f98da01" }, "workflow_hash": "010ddae84094c900120409190f98da01" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow automates the process of extracting information from PDF files uploaded to Google Drive and making it available for conversational AI. It monitors Google Drive for new PDF uploads, extracts the text, cleans it, embeds it, and stores it in a vector database (Pinecone). It then uses a chat interface to allow users to ask questions about the documents, retrieving relevant information from the vector database to generate answers using an AI model. Analyze this workflow: ```json { "id": "lC8xkfCSTjIiUhpk", "meta": { "instanceId": "a1f3364de0f3da48758a2641efb07c3b0d216a3a7cc93596fbed2316d6dea4ad", "templateCredsSetupCompleted": true }, "name": "Google Drive Automation", "tags": [], "nodes": [ { "id": "e7769ee7-a247-426e-b792-c095597ada54", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 320, 700 ], "parameters": { "text": "={{ $json.prompt }}", "options": { "systemMessage": "You are a knowledgeable and helpful assistant. Respond with clear, concise, and detailed answers formatted in markdown. Use proper markdown formatting including headings, bullet points, numbered lists, code blocks, and other structures as needed to improve readability and clarity." }, "promptType": "define" }, "typeVersion": 1.7 }, { "id": "72ca46ad-891f-42f2-81d7-00e04e1c6f5f", "name": "Monitor Google Drive for New Files", "type": "n8n-nodes-base.googleDriveTrigger", "position": [ -520, -240 ], "parameters": { "event": "fileCreated", "options": {}, "pollTimes": { "item": [ {} ] }, "triggerOn": "specificFolder", "folderToWatch": { "__rl": true, "mode": "list", "value": "1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP", "cachedResultUrl": "https://drive.google.com/drive/folders/1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP", "cachedResultName": "RAG_Files" } }, "credentials": { "googleDriveOAuth2Api": { "id": "zj3v6gsTRb9CreKV", "name": "Google Drive account" } }, "typeVersion": 1 }, { "id": "03e9dc61-bdba-49d7-859e-73b8adebae41", "name": "Download File from Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ -300, -240 ], "parameters": { "fileId": { "__rl": true, "mode": "id", "value": "={{ $json.id }}" }, "options": {}, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "zj3v6gsTRb9CreKV", "name": "Google Drive account" } }, "typeVersion": 3 }, { "id": "782fc162-0c3f-40fc-af92-455c1250ede0", "name": "Extract PDF Content", "type": "n8n-nodes-base.extractFromFile", "position": [ -80, -240 ], "parameters": { "options": {}, "operation": "pdf" }, "typeVersion": 1 }, { "id": "b8da9cff-756b-419e-b39a-4ad1020092d0", "name": "Insert Document into Pinecone Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 360, -240 ], "parameters": { "mode": "insert", "options": {}, "pineconeIndex": { "__rl": true, "mode": "list", "value": "n8n-rag-demo", "cachedResultName": "n8n-rag-demo" } }, "credentials": { "pineconeApi": { "id": "ldIxYWz8E9e0N4yV", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "f5b93646-b466-4cd7-aec9-6fae62023fa3", "name": "Generate Document Embeddings (Google Gemini)", "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", "position": [ 260, 20 ], "parameters": { "modelName": "models/text-embedding-004" }, "credentials": { "googlePalmApi": { "id": "prd6Qnbbj4UbNH75", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "b5277663-3120-4614-85e3-f7dc05c4e1c2", "name": "Clean and Normalize PDF Text", "type": "n8n-nodes-base.code", "position": [ 140, -240 ], "parameters": { "jsCode": "const rawData = $json[\"text\"];\nconst cleanedData = rawData\n .replace(/(\\r\\n|\\n|\\r)/gm, \" \") // remove line breaks\n .trim() // remove extra spaces\n .replace(/[^\\w\\s]/gi, \"\"); // remove special characters\nreturn { cleanedData };\n" }, "typeVersion": 2 }, { "id": "68aa5515-6b58-4e98-ab08-4d9516e1f2a3", "name": "Load Document Data for Processing", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 480, 20 ], "parameters": { "options": {} }, "typeVersion": 1 }, { "id": "3f463338-c692-4b7b-a888-8c00d190c441", "name": "Split Document Text into Chunks", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 380, 240 ], "parameters": { "options": {}, "chunkSize": 3000, "chunkOverlap": 300 }, "typeVersion": 1 }, { "id": "9c4a7ec9-0808-443f-9e12-9ec12c7288b9", "name": "Chat Message Trigger", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -520, 700 ], "webhookId": "d36e67b9-a789-4801-b624-64bf8b88d702", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "ee62efc9-60b2-40ec-a10c-8897d24b1429", "name": "Retrieve Relevant Documents from Pinecone", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ -260, 700 ], "parameters": { "mode": "load", "prompt": "={{ $json.chatInput }}", "options": {}, "pineconeIndex": { "__rl": true, "mode": "list", "value": "n8n-rag-demo", "cachedResultName": "n8n-rag-demo" } }, "credentials": { "pineconeApi": { "id": "ldIxYWz8E9e0N4yV", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "8d479b6b-3c87-40c6-8a68-4390e6bafac8", "name": "Generate Query Embeddings (Google Gemini)", "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", "position": [ -280, 940 ], "parameters": { "modelName": "models/text-embedding-004" }, "credentials": { "googlePalmApi": { "id": "prd6Qnbbj4UbNH75", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "f521d243-1b62-4bc5-972d-736c65c48818", "name": "Generate Chat Prompt with Context", "type": "n8n-nodes-base.code", "position": [ 100, 700 ], "parameters": { "jsCode": "const userQuery = $('Chat Message Trigger').first().json.chatInput\n// Retrieve the user query from the previous node output.\n// Assuming the Pinecone node has passed an array of items where each item has a document and score:\nlet documents = items.map(item => {\n return {\n pageContent: item.json.document.pageContent,\n score: item.json.score\n };\n});\n\n// Sort the documents by their score in descending order.\ndocuments.sort((a, b) => b.score - a.score);\n\n// Pick the top 3 documents to use as context.\nconst topDocuments = documents.slice(0, 3);\n\n// Combine the top documents into one context string.\nconst contextContent = topDocuments\n .map((doc, index) => `Document ${index + 1}:\\n${doc.pageContent}`)\n .join(\"\\n\\n\");\n\n// Build the final prompt that combines the context with the user query.\nconst prompt = `Using the following context from documents:\\n\\n${contextContent}\\n\\nAnswer the following question:\\n${userQuery}\\n\\nAnswer:`;\n\n// Return the prompt so it can be passed to a Chat/AI node for further processing.\nreturn [{ json: { prompt } }];\n" }, "typeVersion": 2 }, { "id": "208057c8-8672-41d2-9c99-89e52856a742", "name": "OpenRouter Chat Model Interface", "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter", "position": [ 280, 940 ], "parameters": { "model": "google/gemini-2.0-flash-exp:free", "options": {} }, "credentials": { "openRouterApi": { "id": "iTDRPtvPicVqeXaT", "name": "OpenRouter account" } }, "typeVersion": 1 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "43fd0dd9-5ec1-401a-b1c2-368b15c9f0db", "connections": { "Extract PDF Content": { "main": [ [ { "node": "Clean and Normalize PDF Text", "type": "main", "index": 0 } ] ] }, "Chat Message Trigger": { "main": [ [ { "node": "Retrieve Relevant Documents from Pinecone", "type": "main", "index": 0 } ] ] }, "Clean and Normalize PDF Text": { "main": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "main", "index": 0 } ] ] }, "Download File from Google Drive": { "main": [ [ { "node": "Extract PDF Content", "type": "main", "index": 0 } ] ] }, "OpenRouter Chat Model Interface": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Split Document Text into Chunks": { "ai_textSplitter": [ [ { "node": "Load Document Data for Processing", "type": "ai_textSplitter", "index": 0 } ] ] }, "Generate Chat Prompt with Context": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Load Document Data for Processing": { "ai_document": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "Monitor Google Drive for New Files": { "main": [ [ { "node": "Download File from Google Drive", "type": "main",
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"lC8xkfCSTjIiUhpk\",\n \"meta\": {\n \"instanceId\": \"a1f3364de0f3da48758a2641efb07c3b0d216a3a7cc93596fbed2316d6dea4ad\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Google Drive Automation\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"e7769ee7-a247-426e-b792-c095597ada54\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 320,\n 700\n ],\n \"parameters\": {\n \"text\": \"={{ $json.prompt }}\",\n \"options\": {\n \"systemMessage\": \"You are a knowledgeable and helpful assistant. Respond with clear, concise, and detailed answers formatted in markdown. Use proper markdown formatting including headings, bullet points, numbered lists, code blocks, and other structures as needed to improve readability and clarity.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"72ca46ad-891f-42f2-81d7-00e04e1c6f5f\",\n \"name\": \"Monitor Google Drive for New Files\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n -520,\n -240\n ],\n \"parameters\": {\n \"event\": \"fileCreated\",\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {}\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultName\": \"RAG_Files\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"03e9dc61-bdba-49d7-859e-73b8adebae41\",\n \"name\": \"Download File from Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -300,\n -240\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"782fc162-0c3f-40fc-af92-455c1250ede0\",\n \"name\": \"Extract PDF Content\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -80,\n -240\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8da9cff-756b-419e-b39a-4ad1020092d0\",\n \"name\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 360,\n -240\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f5b93646-b466-4cd7-aec9-6fae62023fa3\",\n \"name\": \"Generate Document Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 260,\n 20\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b5277663-3120-4614-85e3-f7dc05c4e1c2\",\n \"name\": \"Clean and Normalize PDF Text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 140,\n -240\n ],\n \"parameters\": {\n \"jsCode\": \"const rawData = $json[\\\"text\\\"];\\nconst cleanedData = rawData\\n .replace(/(\\\\r\\\\n|\\\\n|\\\\r)/gm, \\\" \\\") // remove line breaks\\n .trim() // remove extra spaces\\n .replace(/[^\\\\w\\\\s]/gi, \\\"\\\"); // remove special characters\\nreturn { cleanedData };\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"68aa5515-6b58-4e98-ab08-4d9516e1f2a3\",\n \"name\": \"Load Document Data for Processing\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 480,\n 20\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3f463338-c692-4b7b-a888-8c00d190c441\",\n \"name\": \"Split Document Text into Chunks\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 300\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9c4a7ec9-0808-443f-9e12-9ec12c7288b9\",\n \"name\": \"Chat Message Trigger\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -520,\n 700\n ],\n \"webhookId\": \"d36e67b9-a789-4801-b624-64bf8b88d702\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"ee62efc9-60b2-40ec-a10c-8897d24b1429\",\n \"name\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n -260,\n 700\n ],\n \"parameters\": {\n \"mode\": \"load\",\n \"prompt\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d479b6b-3c87-40c6-8a68-4390e6bafac8\",\n \"name\": \"Generate Query Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n -280,\n 940\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f521d243-1b62-4bc5-972d-736c65c48818\",\n \"name\": \"Generate Chat Prompt with Context\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 100,\n 700\n ],\n \"parameters\": {\n \"jsCode\": \"const userQuery = $('Chat Message Trigger').first().json.chatInput\\n// Retrieve the user query from the previous node output.\\n// Assuming the Pinecone node has passed an array of items where each item has a document and score:\\nlet documents = items.map(item => {\\n return {\\n pageContent: item.json.document.pageContent,\\n score: item.json.score\\n };\\n});\\n\\n// Sort the documents by their score in descending order.\\ndocuments.sort((a, b) => b.score - a.score);\\n\\n// Pick the top 3 documents to use as context.\\nconst topDocuments = documents.slice(0, 3);\\n\\n// Combine the top documents into one context string.\\nconst contextContent = topDocuments\\n .map((doc, index) => `Document ${index + 1}:\\\\n${doc.pageContent}`)\\n .join(\\\"\\\\n\\\\n\\\");\\n\\n// Build the final prompt that combines the context with the user query.\\nconst prompt = `Using the following context from documents:\\\\n\\\\n${contextContent}\\\\n\\\\nAnswer the following question:\\\\n${userQuery}\\\\n\\\\nAnswer:`;\\n\\n// Return the prompt so it can be passed to a Chat/AI node for further processing.\\nreturn [{ json: { prompt } }];\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"208057c8-8672-41d2-9c99-89e52856a742\",\n \"name\": \"OpenRouter Chat Model Interface\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenRouter\",\n \"position\": [\n 280,\n 940\n ],\n \"parameters\": {\n \"model\": \"google/gemini-2.0-flash-exp:free\",\n \"options\": {}\n },\n \"credentials\": {\n \"openRouterApi\": {\n \"id\": \"iTDRPtvPicVqeXaT\",\n \"name\": \"OpenRouter account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"43fd0dd9-5ec1-401a-b1c2-368b15c9f0db\",\n \"connections\": {\n \"Extract PDF Content\": {\n \"main\": [\n [\n {\n \"node\": \"Clean and Normalize PDF Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Chat Message Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Clean and Normalize PDF Text\": {\n \"main\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download File from Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract PDF Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenRouter Chat Model Interface\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Document Text into Chunks\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Load Document Data for Processing\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Chat Prompt with Context\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Load Document Data for Processing\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Monitor Google Drive for New Files\": {\n \"main\": [\n [\n {\n \"node\": \"Download File from Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Query Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Relevant Documents from Pinecone\": {\n \"main\": [\n [\n {\n \"node\": \"Generate Chat Prompt with Context\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Document Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
23
0
2
true
combined_workflows.json
{ "input": "This workflow automates the process of extracting information from PDF files uploaded to Google Drive and making it available for conversational AI. It monitors Google Drive for new PDF uploads, extracts the text, cleans it, embeds it, and stores it in a vector database (Pinecone). It then uses a chat interface to allow users to ask questions about the documents, retrieving relevant information from the vector database to generate answers using an AI model.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8256, "processed_size": 8256, "processed_timestamp": "2025-04-09T03:08:37.792157", "timestamp": "2025-04-09T02:35:30.885660", "token_count": 4095, "tokens": 779, "workflow_chunk_info": { "is_truncated": false, "original_size": 8256, "processed_size": 8256, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }
": "ai_textSplitter", "index": 0 } ] ] }, "Generate Chat Prompt with Context": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Load Document Data for Processing": { "ai_document": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "Monitor Google Drive for New Files": { "main": [ [ { "node": "Download File from Google Drive", "type": "main", "index": 0 } ] ] }, "Generate Query Embeddings (Google Gemini)": { "ai_embedding": [ [ { "node": "Retrieve Relevant Documents from Pinecone", "type": "ai_embedding", "index": 0 } ] ] }, "Retrieve Relevant Documents from Pinecone": { "main": [ [ { "node": "Generate Chat Prompt with Context", "type": "main", "index": 0 } ] ] }, "Generate Document Embeddings (Google Gemini)": { "ai_embedding": [ [ { "node": "Insert Document into Pinecone Vector Store", "type": "ai_embedding", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"lC8xkfCSTjIiUhpk\",\n \"meta\": {\n \"instanceId\": \"a1f3364de0f3da48758a2641efb07c3b0d216a3a7cc93596fbed2316d6dea4ad\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Google Drive Automation\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"e7769ee7-a247-426e-b792-c095597ada54\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 320,\n 700\n ],\n \"parameters\": {\n \"text\": \"={{ $json.prompt }}\",\n \"options\": {\n \"systemMessage\": \"You are a knowledgeable and helpful assistant. Respond with clear, concise, and detailed answers formatted in markdown. Use proper markdown formatting including headings, bullet points, numbered lists, code blocks, and other structures as needed to improve readability and clarity.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"72ca46ad-891f-42f2-81d7-00e04e1c6f5f\",\n \"name\": \"Monitor Google Drive for New Files\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n -520,\n -240\n ],\n \"parameters\": {\n \"event\": \"fileCreated\",\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {}\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1RQvAHIw8cQbtwI9ZvdVV0k0x6TM6HZwP\",\n \"cachedResultName\": \"RAG_Files\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"03e9dc61-bdba-49d7-859e-73b8adebae41\",\n \"name\": \"Download File from Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -300,\n -240\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"zj3v6gsTRb9CreKV\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"782fc162-0c3f-40fc-af92-455c1250ede0\",\n \"name\": \"Extract PDF Content\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -80,\n -240\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8da9cff-756b-419e-b39a-4ad1020092d0\",\n \"name\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 360,\n -240\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f5b93646-b466-4cd7-aec9-6fae62023fa3\",\n \"name\": \"Generate Document Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 260,\n 20\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b5277663-3120-4614-85e3-f7dc05c4e1c2\",\n \"name\": \"Clean and Normalize PDF Text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 140,\n -240\n ],\n \"parameters\": {\n \"jsCode\": \"const rawData = $json[\\\"text\\\"];\\nconst cleanedData = rawData\\n .replace(/(\\\\r\\\\n|\\\\n|\\\\r)/gm, \\\" \\\") // remove line breaks\\n .trim() // remove extra spaces\\n .replace(/[^\\\\w\\\\s]/gi, \\\"\\\"); // remove special characters\\nreturn { cleanedData };\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"68aa5515-6b58-4e98-ab08-4d9516e1f2a3\",\n \"name\": \"Load Document Data for Processing\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 480,\n 20\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3f463338-c692-4b7b-a888-8c00d190c441\",\n \"name\": \"Split Document Text into Chunks\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 300\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9c4a7ec9-0808-443f-9e12-9ec12c7288b9\",\n \"name\": \"Chat Message Trigger\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -520,\n 700\n ],\n \"webhookId\": \"d36e67b9-a789-4801-b624-64bf8b88d702\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"ee62efc9-60b2-40ec-a10c-8897d24b1429\",\n \"name\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n -260,\n 700\n ],\n \"parameters\": {\n \"mode\": \"load\",\n \"prompt\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"n8n-rag-demo\",\n \"cachedResultName\": \"n8n-rag-demo\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"ldIxYWz8E9e0N4yV\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8d479b6b-3c87-40c6-8a68-4390e6bafac8\",\n \"name\": \"Generate Query Embeddings (Google Gemini)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n -280,\n 940\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"prd6Qnbbj4UbNH75\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f521d243-1b62-4bc5-972d-736c65c48818\",\n \"name\": \"Generate Chat Prompt with Context\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 100,\n 700\n ],\n \"parameters\": {\n \"jsCode\": \"const userQuery = $('Chat Message Trigger').first().json.chatInput\\n// Retrieve the user query from the previous node output.\\n// Assuming the Pinecone node has passed an array of items where each item has a document and score:\\nlet documents = items.map(item => {\\n return {\\n pageContent: item.json.document.pageContent,\\n score: item.json.score\\n };\\n});\\n\\n// Sort the documents by their score in descending order.\\ndocuments.sort((a, b) => b.score - a.score);\\n\\n// Pick the top 3 documents to use as context.\\nconst topDocuments = documents.slice(0, 3);\\n\\n// Combine the top documents into one context string.\\nconst contextContent = topDocuments\\n .map((doc, index) => `Document ${index + 1}:\\\\n${doc.pageContent}`)\\n .join(\\\"\\\\n\\\\n\\\");\\n\\n// Build the final prompt that combines the context with the user query.\\nconst prompt = `Using the following context from documents:\\\\n\\\\n${contextContent}\\\\n\\\\nAnswer the following question:\\\\n${userQuery}\\\\n\\\\nAnswer:`;\\n\\n// Return the prompt so it can be passed to a Chat/AI node for further processing.\\nreturn [{ json: { prompt } }];\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"208057c8-8672-41d2-9c99-89e52856a742\",\n \"name\": \"OpenRouter Chat Model Interface\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenRouter\",\n \"position\": [\n 280,\n 940\n ],\n \"parameters\": {\n \"model\": \"google/gemini-2.0-flash-exp:free\",\n \"options\": {}\n },\n \"credentials\": {\n \"openRouterApi\": {\n \"id\": \"iTDRPtvPicVqeXaT\",\n \"name\": \"OpenRouter account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"43fd0dd9-5ec1-401a-b1c2-368b15c9f0db\",\n \"connections\": {\n \"Extract PDF Content\": {\n \"main\": [\n [\n {\n \"node\": \"Clean and Normalize PDF Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Chat Message Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Clean and Normalize PDF Text\": {\n \"main\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download File from Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract PDF Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenRouter Chat Model Interface\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Document Text into Chunks\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Load Document Data for Processing\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Chat Prompt with Context\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Load Document Data for Processing\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Monitor Google Drive for New Files\": {\n \"main\": [\n [\n {\n \"node\": \"Download File from Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Query Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Retrieve Relevant Documents from Pinecone\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Relevant Documents from Pinecone\": {\n \"main\": [\n [\n {\n \"node\": \"Generate Chat Prompt with Context\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate Document Embeddings (Google Gemini)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Insert Document into Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
23
1
2
true
combined_workflows.json
{ "input": "This workflow automates the process of extracting information from PDF files uploaded to Google Drive and making it available for conversational AI. It monitors Google Drive for new PDF uploads, extracts the text, cleans it, embeds it, and stores it in a vector database (Pinecone). It then uses a chat interface to allow users to ask questions about the documents, retrieving relevant information from the vector database to generate answers using an AI model.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8256, "processed_size": 8256, "processed_timestamp": "2025-04-09T03:08:37.795120", "timestamp": "2025-04-09T02:35:30.885660", "token_count": 481, "tokens": 779, "workflow_chunk_info": { "is_truncated": false, "original_size": 8256, "processed_size": 8256, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }, "workflow_hash": "5ad24227b6ea9864e44d744978c55754" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow monitors multiple GitHub repositories for changes and sends notifications via Slack and Telegram. It registers and deletes webhooks for the repositories. Analyze this workflow: ```json { "meta": { "instanceId": "bb6a1286a4ce98dce786d6c2748b867c1252d53458c87d87fbf6824b862d4c9c" }, "nodes": [ { "id": "95252956-51fb-49ee-924e-df01ea27b98d", "name": "When clicking β€˜Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ 60, 340 ], "parameters": {}, "typeVersion": 1 }, { "id": "bfaaee00-7545-404b-9526-fb77726e833e", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -940, 120 ], "parameters": { "color": 5, "width": 819.6790739248162, "height": 212.7465225154412, "content": "# Monitor Multiple Github Repos\nThis workflow allows you to monitor multiple Github repos simultaneously without polling due to use of Webhooks. It programmatically allows for adding and deleting of repos to your watchlist to make management convenient.\n\n" }, "typeVersion": 1 }, { "id": "d1075f59-356e-47c4-9f85-c9067127d70f", "name": "Split Out", "type": "n8n-nodes-base.splitOut", "position": [ 380, 340 ], "parameters": { "options": {}, "fieldToSplitOut": "repos" }, "typeVersion": 1 }, { "id": "7d2a3226-e3b1-4cab-91e2-01f60c1184cb", "name": "Register Github Webhook", "type": "n8n-nodes-base.httpRequest", "position": [ 540, 340 ], "parameters": { "url": "={{$json.repos.replace('https://github.com','https://api.github.com/repos')}}/hooks", "method": "POST", "options": {}, "jsonBody": "{\"name\":\"web\",\"active\":true,\"events\":[\"push\",\"pull_request\"],\"config\":{\"url\":\"https://webhook.site/d53d7bb9-72f5-4743-af4d-15c86f811492\",\"content_type\":\"json\",\"insecure_ssl\":\"0\"}}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/vnd.github+json" }, { "name": "X-GitHub-Api-Version", "value": "2022-11-28" } ] } }, "credentials": { "httpHeaderAuth": { "id": "A8NIXOiG7JTWqrUI", "name": "Header Auth account" } }, "typeVersion": 4.2 }, { "id": "c1b8a02b-38fd-43d1-b14b-18de6d84b729", "name": "Split Out1", "type": "n8n-nodes-base.splitOut", "position": [ 400, 760 ], "parameters": { "options": {}, "fieldToSplitOut": "repos" }, "typeVersion": 1 }, { "id": "35c3e7e0-50c8-4660-8e89-46849da751a9", "name": "Delete Github Webhook", "type": "n8n-nodes-base.httpRequest", "position": [ 900, 760 ], "parameters": { "url": "={{ $json.url }}", "method": "DELETE", "options": {}, "sendHeaders": true, "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/vnd.github+json" }, { "name": "X-GitHub-Api-Version", "value": "2022-11-28" } ] } }, "credentials": { "httpHeaderAuth": { "id": "A8NIXOiG7JTWqrUI", "name": "Header Auth account" } }, "typeVersion": 4.2 }, { "id": "8eeb818d-9ac3-48bb-9a85-7099216bb243", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 160, 680 ], "parameters": { "width": 858.0344141951173, "height": 279.85434264975174, "content": "## Delete All Webhooks" }, "typeVersion": 1 }, { "id": "eb1a649a-8408-4e2f-a0a4-b9761ba8565b", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 167.0254479998971, 260 ], "parameters": { "width": 848.6550531504272, "height": 283.2561904154995, "content": "## Register Webhooks" }, "typeVersion": 1 }, { "id": "3053ad9f-2756-4518-b17e-56a4ba8a287f", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 160, 1060 ], "parameters": { "width": 858.0344141951173, "height": 279.85434264975174, "content": "## Handle Github Event" }, "typeVersion": 1 }, { "id": "6aca0ef9-a8d7-4e8a-a875-a0f46c624cc7", "name": "Fields", "type": "n8n-nodes-base.set", "position": [ 280, 1180 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "8dc55086-d1f5-4074-ba38-3ae6b477773c", "name": "repo", "type": "string", "value": "={{ $json.body.repository.full_name}}" }, { "id": "384fc78d-0125-4cbc-83f0-a4d67194beee", "name": "repo_avatar", "type": "string", "value": "={{ $json.body.repository.owner.avatar_url }}" }, { "id": "537313d4-074c-454e-b57f-0f952b1a590c", "name": "date", "type": "string", "value": "={{ $json.body.commits[0].timestamp }}" }, { "id": "34bcccc2-cad4-4306-ad54-b3685d7bc896", "name": "author", "type": "string", "value": "={{ $json.body.commits[0].author.name }} ({{ $json.body.commits[0].author.username }})" }, { "id": "c22e9ca3-9dbc-4f01-96e2-f914bd4230a1", "name": "modified_files", "type": "string", "value": "={{ $json.body.commits[0].modified.join(', ') }}" }, { "id": "c17f33cf-0d27-4813-8f35-7cd276245a8b", "name": "url", "type": "string", "value": "={{ $json.body.commits[0].url }}" }, { "id": "4b23a64e-2acc-476c-a36b-936c32360e67", "name": "description", "type": "string", "value": "={{ $json.body.commits[0].message }}" } ] } }, "typeVersion": 3.4 }, { "id": "72f1ac3f-4277-481d-bbc7-c5137e7ef431", "name": "Notify Slack", "type": "n8n-nodes-base.slack", "disabled": true, "position": [ 640, 1060 ], "parameters": { "text": "=[Github Event] {{ $json.date }}: {{ $json.author }} committed to {{ $json.repo }}!\n\nDescription:\n```{{ $json.description }}```\n\nModified Files:\n```{{ $json.modified_files }}```\n{{ $json.url }}", "select": "channel", "channelId": { "__rl": true, "mode": "id", "value": "=" }, "otherOptions": { "mrkdwn": true, "sendAsUser": "Github Bot", "includeLinkToWorkflow": false } }, "typeVersion": 2.1 }, { "id": "85ec09d2-fccb-4669-80d1-ba3bb7ce3544", "name": "Telegram", "type": "n8n-nodes-base.telegram", "position": [ 640, 1260 ], "parameters": { "text": "=*[Github Event] @* `{{ $json.date }}`: \n`{{ $json.author }}` committed to `{{ $json.repo }}`!\n\nDescription:\n```{{ $json.description }}```\n\nModified Files:\n```{{ $json.modified_files }}```\n{{ $json.url }}", "replyMarkup": "inlineKeyboard", "additionalFields": {} }, "credentials": { "telegramApi": { "id": "lulhyqZvExuxci8F", "name": "Telegram account" } }, "typeVersion": 1.2 }, { "id": "1f57a9cb-7061-4679-97ce-081746acfd55", "name": "Repos to Monitor", "type": "n8n-nodes-base.set", "position": [ 220, 340 ], "parameters": { "mode": "raw", "options": {}, "jsonOutput": "{\n \"repos\":[\n \"https://github.com/arose26/testrepo2\",\n \"https://github.com/arose26/testrepo3\"\n \n ]\n}\n" }, "typeVersion": 3.4 }, { "id": "6a83a757-673b-4ffc-9f91-54e5a24b8437", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ -640, 1180 ], "parameters": { "color": 4, "width": 520.7636244130189, "height": 381.80326328628485, "content": "## Test\n## 1. Register Webhooks\n- In `Repos to Monitor`, add any repo you want to monitor changes for. \n- Disable `Webhook Trigger`, Click `Test Workflow` and if your Github credentials were set correctly, it will automatically register the webhooks. - You can test this by running the single node `Get Existing Webhook` and confirming it outputs the repo addresses.\n## 2. Handle Github Events\n- Now that you have registered the webhooks, reenable `Webhook Trigger` and activate the workflow.\n- Make a commit to any of the registered repos.\n- Confirm that the notification went through.\n*That's it!*\n" }, "typeVersion": 1 }, { "id": "cb204806-1f7d-494a-9e0f-340b56d2dcd5", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ -940, 440 ], "parameters": { "color": 4, "width": 821.1807025349485, "height": 693.4508863847356, "content": "## Setup\n## 1. Creating Credentials on Github\n#### Generate a personal access token on github
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"bb6a1286a4ce98dce786d6c2748b867c1252d53458c87d87fbf6824b862d4c9c\"\n },\n \"nodes\": [\n {\n \"id\": \"95252956-51fb-49ee-924e-df01ea27b98d\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 60,\n 340\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"bfaaee00-7545-404b-9526-fb77726e833e\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -940,\n 120\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 819.6790739248162,\n \"height\": 212.7465225154412,\n \"content\": \"# Monitor Multiple Github Repos\\nThis workflow allows you to monitor multiple Github repos simultaneously without polling due to use of Webhooks. It programmatically allows for adding and deleting of repos to your watchlist to make management convenient.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d1075f59-356e-47c4-9f85-c9067127d70f\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 380,\n 340\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"repos\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d2a3226-e3b1-4cab-91e2-01f60c1184cb\",\n \"name\": \"Register Github Webhook\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 540,\n 340\n ],\n \"parameters\": {\n \"url\": \"={{$json.repos.replace('https://github.com','https://api.github.com/repos')}}/hooks\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"{\\\"name\\\":\\\"web\\\",\\\"active\\\":true,\\\"events\\\":[\\\"push\\\",\\\"pull_request\\\"],\\\"config\\\":{\\\"url\\\":\\\"https://webhook.site/d53d7bb9-72f5-4743-af4d-15c86f811492\\\",\\\"content_type\\\":\\\"json\\\",\\\"insecure_ssl\\\":\\\"0\\\"}}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/vnd.github+json\"\n },\n {\n \"name\": \"X-GitHub-Api-Version\",\n \"value\": \"2022-11-28\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"A8NIXOiG7JTWqrUI\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"c1b8a02b-38fd-43d1-b14b-18de6d84b729\",\n \"name\": \"Split Out1\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 400,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"repos\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"35c3e7e0-50c8-4660-8e89-46849da751a9\",\n \"name\": \"Delete Github Webhook\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 900,\n 760\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"method\": \"DELETE\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/vnd.github+json\"\n },\n {\n \"name\": \"X-GitHub-Api-Version\",\n \"value\": \"2022-11-28\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"A8NIXOiG7JTWqrUI\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"8eeb818d-9ac3-48bb-9a85-7099216bb243\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 680\n ],\n \"parameters\": {\n \"width\": 858.0344141951173,\n \"height\": 279.85434264975174,\n \"content\": \"## Delete All Webhooks\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eb1a649a-8408-4e2f-a0a4-b9761ba8565b\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 167.0254479998971,\n 260\n ],\n \"parameters\": {\n \"width\": 848.6550531504272,\n \"height\": 283.2561904154995,\n \"content\": \"## Register Webhooks\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3053ad9f-2756-4518-b17e-56a4ba8a287f\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 1060\n ],\n \"parameters\": {\n \"width\": 858.0344141951173,\n \"height\": 279.85434264975174,\n \"content\": \"## Handle Github Event\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6aca0ef9-a8d7-4e8a-a875-a0f46c624cc7\",\n \"name\": \"Fields\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 280,\n 1180\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"8dc55086-d1f5-4074-ba38-3ae6b477773c\",\n \"name\": \"repo\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.repository.full_name}}\"\n },\n {\n \"id\": \"384fc78d-0125-4cbc-83f0-a4d67194beee\",\n \"name\": \"repo_avatar\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.repository.owner.avatar_url }}\"\n },\n {\n \"id\": \"537313d4-074c-454e-b57f-0f952b1a590c\",\n \"name\": \"date\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].timestamp }}\"\n },\n {\n \"id\": \"34bcccc2-cad4-4306-ad54-b3685d7bc896\",\n \"name\": \"author\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].author.name }} ({{ $json.body.commits[0].author.username }})\"\n },\n {\n \"id\": \"c22e9ca3-9dbc-4f01-96e2-f914bd4230a1\",\n \"name\": \"modified_files\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].modified.join(', ') }}\"\n },\n {\n \"id\": \"c17f33cf-0d27-4813-8f35-7cd276245a8b\",\n \"name\": \"url\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].url }}\"\n },\n {\n \"id\": \"4b23a64e-2acc-476c-a36b-936c32360e67\",\n \"name\": \"description\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].message }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"72f1ac3f-4277-481d-bbc7-c5137e7ef431\",\n \"name\": \"Notify Slack\",\n \"type\": \"n8n-nodes-base.slack\",\n \"disabled\": true,\n \"position\": [\n 640,\n 1060\n ],\n \"parameters\": {\n \"text\": \"=[Github Event] {{ $json.date }}: {{ $json.author }} committed to {{ $json.repo }}!\\n\\nDescription:\\n```{{ $json.description }}```\\n\\nModified Files:\\n```{{ $json.modified_files }}```\\n{{ $json.url }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"=\"\n },\n \"otherOptions\": {\n \"mrkdwn\": true,\n \"sendAsUser\": \"Github Bot\",\n \"includeLinkToWorkflow\": false\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"85ec09d2-fccb-4669-80d1-ba3bb7ce3544\",\n \"name\": \"Telegram\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 640,\n 1260\n ],\n \"parameters\": {\n \"text\": \"=*[Github Event] @* `{{ $json.date }}`: \\n`{{ $json.author }}` committed to `{{ $json.repo }}`!\\n\\nDescription:\\n```{{ $json.description }}```\\n\\nModified Files:\\n```{{ $json.modified_files }}```\\n{{ $json.url }}\",\n \"replyMarkup\": \"inlineKeyboard\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"lulhyqZvExuxci8F\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"1f57a9cb-7061-4679-97ce-081746acfd55\",\n \"name\": \"Repos to Monitor\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 220,\n 340\n ],\n \"parameters\": {\n \"mode\": \"raw\",\n \"options\": {},\n \"jsonOutput\": \"{\\n \\\"repos\\\":[\\n \\\"https://github.com/arose26/testrepo2\\\",\\n \\\"https://github.com/arose26/testrepo3\\\"\\n \\n ]\\n}\\n\"\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"6a83a757-673b-4ffc-9f91-54e5a24b8437\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -640,\n 1180\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 520.7636244130189,\n \"height\": 381.80326328628485,\n \"content\": \"## Test\\n## 1. Register Webhooks\\n- In `Repos to Monitor`, add any repo you want to monitor changes for. \\n- Disable `Webhook Trigger`, Click `Test Workflow` and if your Github credentials were set correctly, it will automatically register the webhooks. - You can test this by running the single node `Get Existing Webhook` and confirming it outputs the repo addresses.\\n## 2. Handle Github Events\\n- Now that you have registered the webhooks, reenable `Webhook Trigger` and activate the workflow.\\n- Make a commit to any of the registered repos.\\n- Confirm that the notification went through.\\n*That's it!*\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cb204806-1f7d-494a-9e0f-340b56d2dcd5\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -940,\n 440\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 821.1807025349485,\n \"height\": 693.4508863847356,\n \"content\": \"## Setup\\n## 1. Creating Credentials on Github\\n#### Generate a personal access token on github by following these esteps;\\n- Right hand side of page -> Settings -> scroll to bottom -> Developer Settings > Personal Access Token > Tokens (classic) > Generate New Token\\n- Give scopes:\\n *admin:repo_hook*\\n *repo* (if you want to use it for your own private repo)\\n\\nif you need more help, see here:\\nhttps://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens\\n\\n## 2. Setting Credentials in n8n\\nIn `Register Github Webhook`\\n*Authenticaion > Generic Credential Type*\\n*Generic Auth Type > Header Auth*\\n*Header Auth > Create New Credential* with Name set to *'Authorization'* and Value set to *'Bearer <YOUR GITHUB TOKEN HERE>'*.\\n(You can reuse this for `Delete Github Webhook` and `Get Existing Webhooks`).\\nNow in `Register Github Webhook`, scroll down to Send Body > JSON and inside the JSON, change the value of *\\\"url\\\"* to the webhook address given as Production URL in the node `Webhook Trigger`.\\n\\n\\n## 3. Notification settings\\nIn the third row, link up the Webhook Trigger to any API of your choice. Slack and Telegram are given as examples.\\nYou can also format the notification message as you wish.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"28bd218b-7dfb-460e-a2a8-012af08835cd\",\n \"name\": \"Webhook Trigger\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 40,\n 1180\n ],\n \"webhookId\": \"e90c3560-2c95-4e7e-9df3-2d084d7e8fde\",\n \"parameters\": {\n \"path\": \"e90c3560-2c95-4e7e-9df3-2d084d7e8fde\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"b68dff7d-f7ee-47dc-b360-08d9ea2d7f42\",\n \"name\": \"Repos to Monitor1\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 240,\n 760\n ],\n \"parameters\": {\n \"mode\": \"raw\",\n \"options\": {},\n \"jsonOutput\": \"{\\n \\\"repos\\\":[\\n \\\"https://github.com/arose26/testrepo\\\",\\n \\\"https://github.com/arose26/testrepo2\\\",\\n \\\"https://github.com/arose26/testrepo3\\\"\\n \\n ]\\n}\\n\"\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"39dd7062-bb85-4f95-90f7-47fe27a257c8\",\n \"name\": \"Get Existing Hook\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 740,\n 760\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/vnd.github+json\"\n },\n {\n \"name\": \"X-GitHub-Api-Version\",\n \"value\": \"2022-11-28\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"A8NIXOiG7JTWqrUI\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.2,\n \"alwaysOutputData\": false\n },\n {\n \"id\": \"6d092a2f-ba48-4b0f-a772-4f55ba761d64\",\n \"name\": \"Hook URL\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 560,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"b90c27f3-b81a-4098-9cd8-7934880d78a7\",\n \"name\": \"url\",\n \"type\": \"string\",\n \"value\": \"=https://api.github.com/repos/{{ $json.repos.replace('https://github.com/','')}}/hooks\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Fields\": {\n \"main\": [\n [\n {\n \"node\": \"Telegram\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Hook URL\": {\n \"main\": [\n [\n {\n \"node\": \"Get Existing Hook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Register Github Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out1\": {\n \"main\": [\n [\n {\n \"node\": \"Hook URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Webhook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Fields\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Repos to Monitor\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Existing Hook\": {\n \"main\": [\n [\n {\n \"node\": \"Delete Github Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Repos to Monitor1\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Repos to Monitor\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
24
0
2
true
combined_workflows.json
{ "input": "This workflow monitors multiple GitHub repositories for changes and sends notifications via Slack and Telegram. It registers and deletes webhooks for the repositories.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11080, "processed_size": 11080, "processed_timestamp": "2025-04-09T03:08:37.866107", "timestamp": "2025-04-09T02:35:31.295856", "token_count": 4095, "tokens": 1012, "workflow_chunk_info": { "is_truncated": false, "original_size": 11080, "processed_size": 11080, "workflow_hash": "59f684befa6f5867ec4210643071e2d7" }, "workflow_hash": "59f684befa6f5867ec4210643071e2d7" }
"typeVersion": 1 }, { "id": "cb204806-1f7d-494a-9e0f-340b56d2dcd5", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ -940, 440 ], "parameters": { "color": 4, "width": 821.1807025349485, "height": 693.4508863847356, "content": "## Setup\n## 1. Creating Credentials on Github\n#### Generate a personal access token on github by following these esteps;\n- Right hand side of page -> Settings -> scroll to bottom -> Developer Settings > Personal Access Token > Tokens (classic) > Generate New Token\n- Give scopes:\n *admin:repo_hook*\n *repo* (if you want to use it for your own private repo)\n\nif you need more help, see here:\nhttps://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens\n\n## 2. Setting Credentials in n8n\nIn `Register Github Webhook`\n*Authenticaion > Generic Credential Type*\n*Generic Auth Type > Header Auth*\n*Header Auth > Create New Credential* with Name set to *'Authorization'* and Value set to *'Bearer <YOUR GITHUB TOKEN HERE>'*.\n(You can reuse this for `Delete Github Webhook` and `Get Existing Webhooks`).\nNow in `Register Github Webhook`, scroll down to Send Body > JSON and inside the JSON, change the value of *\"url\"* to the webhook address given as Production URL in the node `Webhook Trigger`.\n\n\n## 3. Notification settings\nIn the third row, link up the Webhook Trigger to any API of your choice. Slack and Telegram are given as examples.\nYou can also format the notification message as you wish.\n\n" }, "typeVersion": 1 }, { "id": "28bd218b-7dfb-460e-a2a8-012af08835cd", "name": "Webhook Trigger", "type": "n8n-nodes-base.webhook", "position": [ 40, 1180 ], "webhookId": "e90c3560-2c95-4e7e-9df3-2d084d7e8fde", "parameters": { "path": "e90c3560-2c95-4e7e-9df3-2d084d7e8fde", "options": {}, "httpMethod": "POST" }, "typeVersion": 2 }, { "id": "b68dff7d-f7ee-47dc-b360-08d9ea2d7f42", "name": "Repos to Monitor1", "type": "n8n-nodes-base.set", "position": [ 240, 760 ], "parameters": { "mode": "raw", "options": {}, "jsonOutput": "{\n \"repos\":[\n \"https://github.com/arose26/testrepo\",\n \"https://github.com/arose26/testrepo2\",\n \"https://github.com/arose26/testrepo3\"\n \n ]\n}\n" }, "typeVersion": 3.4 }, { "id": "39dd7062-bb85-4f95-90f7-47fe27a257c8", "name": "Get Existing Hook", "type": "n8n-nodes-base.httpRequest", "position": [ 740, 760 ], "parameters": { "url": "={{ $json.url }}", "options": {}, "sendHeaders": true, "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/vnd.github+json" }, { "name": "X-GitHub-Api-Version", "value": "2022-11-28" } ] } }, "credentials": { "httpHeaderAuth": { "id": "A8NIXOiG7JTWqrUI", "name": "Header Auth account" } }, "typeVersion": 4.2, "alwaysOutputData": false }, { "id": "6d092a2f-ba48-4b0f-a772-4f55ba761d64", "name": "Hook URL", "type": "n8n-nodes-base.set", "position": [ 560, 760 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "b90c27f3-b81a-4098-9cd8-7934880d78a7", "name": "url", "type": "string", "value": "=https://api.github.com/repos/{{ $json.repos.replace('https://github.com/','')}}/hooks" } ] } }, "typeVersion": 3.4 } ], "pinData": {}, "connections": { "Fields": { "main": [ [ { "node": "Telegram", "type": "main", "index": 0 } ] ] }, "Hook URL": { "main": [ [ { "node": "Get Existing Hook", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "Register Github Webhook", "type": "main", "index": 0 } ] ] }, "Split Out1": { "main": [ [ { "node": "Hook URL", "type": "main", "index": 0 } ] ] }, "Webhook Trigger": { "main": [ [ { "node": "Fields", "type": "main", "index": 0 } ] ] }, "Repos to Monitor": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "Get Existing Hook": { "main": [ [ { "node": "Delete Github Webhook", "type": "main", "index": 0 } ] ] }, "Repos to Monitor1": { "main": [ [ { "node": "Split Out1", "type": "main", "index": 0 } ] ] }, "When clicking β€˜Test workflow’": { "main": [ [ { "node": "Repos to Monitor", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"bb6a1286a4ce98dce786d6c2748b867c1252d53458c87d87fbf6824b862d4c9c\"\n },\n \"nodes\": [\n {\n \"id\": \"95252956-51fb-49ee-924e-df01ea27b98d\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 60,\n 340\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"bfaaee00-7545-404b-9526-fb77726e833e\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -940,\n 120\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 819.6790739248162,\n \"height\": 212.7465225154412,\n \"content\": \"# Monitor Multiple Github Repos\\nThis workflow allows you to monitor multiple Github repos simultaneously without polling due to use of Webhooks. It programmatically allows for adding and deleting of repos to your watchlist to make management convenient.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d1075f59-356e-47c4-9f85-c9067127d70f\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 380,\n 340\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"repos\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d2a3226-e3b1-4cab-91e2-01f60c1184cb\",\n \"name\": \"Register Github Webhook\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 540,\n 340\n ],\n \"parameters\": {\n \"url\": \"={{$json.repos.replace('https://github.com','https://api.github.com/repos')}}/hooks\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"{\\\"name\\\":\\\"web\\\",\\\"active\\\":true,\\\"events\\\":[\\\"push\\\",\\\"pull_request\\\"],\\\"config\\\":{\\\"url\\\":\\\"https://webhook.site/d53d7bb9-72f5-4743-af4d-15c86f811492\\\",\\\"content_type\\\":\\\"json\\\",\\\"insecure_ssl\\\":\\\"0\\\"}}\",\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/vnd.github+json\"\n },\n {\n \"name\": \"X-GitHub-Api-Version\",\n \"value\": \"2022-11-28\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"A8NIXOiG7JTWqrUI\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"c1b8a02b-38fd-43d1-b14b-18de6d84b729\",\n \"name\": \"Split Out1\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 400,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"repos\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"35c3e7e0-50c8-4660-8e89-46849da751a9\",\n \"name\": \"Delete Github Webhook\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 900,\n 760\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"method\": \"DELETE\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/vnd.github+json\"\n },\n {\n \"name\": \"X-GitHub-Api-Version\",\n \"value\": \"2022-11-28\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"A8NIXOiG7JTWqrUI\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"8eeb818d-9ac3-48bb-9a85-7099216bb243\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 680\n ],\n \"parameters\": {\n \"width\": 858.0344141951173,\n \"height\": 279.85434264975174,\n \"content\": \"## Delete All Webhooks\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eb1a649a-8408-4e2f-a0a4-b9761ba8565b\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 167.0254479998971,\n 260\n ],\n \"parameters\": {\n \"width\": 848.6550531504272,\n \"height\": 283.2561904154995,\n \"content\": \"## Register Webhooks\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3053ad9f-2756-4518-b17e-56a4ba8a287f\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 1060\n ],\n \"parameters\": {\n \"width\": 858.0344141951173,\n \"height\": 279.85434264975174,\n \"content\": \"## Handle Github Event\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6aca0ef9-a8d7-4e8a-a875-a0f46c624cc7\",\n \"name\": \"Fields\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 280,\n 1180\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"8dc55086-d1f5-4074-ba38-3ae6b477773c\",\n \"name\": \"repo\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.repository.full_name}}\"\n },\n {\n \"id\": \"384fc78d-0125-4cbc-83f0-a4d67194beee\",\n \"name\": \"repo_avatar\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.repository.owner.avatar_url }}\"\n },\n {\n \"id\": \"537313d4-074c-454e-b57f-0f952b1a590c\",\n \"name\": \"date\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].timestamp }}\"\n },\n {\n \"id\": \"34bcccc2-cad4-4306-ad54-b3685d7bc896\",\n \"name\": \"author\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].author.name }} ({{ $json.body.commits[0].author.username }})\"\n },\n {\n \"id\": \"c22e9ca3-9dbc-4f01-96e2-f914bd4230a1\",\n \"name\": \"modified_files\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].modified.join(', ') }}\"\n },\n {\n \"id\": \"c17f33cf-0d27-4813-8f35-7cd276245a8b\",\n \"name\": \"url\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].url }}\"\n },\n {\n \"id\": \"4b23a64e-2acc-476c-a36b-936c32360e67\",\n \"name\": \"description\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.commits[0].message }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"72f1ac3f-4277-481d-bbc7-c5137e7ef431\",\n \"name\": \"Notify Slack\",\n \"type\": \"n8n-nodes-base.slack\",\n \"disabled\": true,\n \"position\": [\n 640,\n 1060\n ],\n \"parameters\": {\n \"text\": \"=[Github Event] {{ $json.date }}: {{ $json.author }} committed to {{ $json.repo }}!\\n\\nDescription:\\n```{{ $json.description }}```\\n\\nModified Files:\\n```{{ $json.modified_files }}```\\n{{ $json.url }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"=\"\n },\n \"otherOptions\": {\n \"mrkdwn\": true,\n \"sendAsUser\": \"Github Bot\",\n \"includeLinkToWorkflow\": false\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"85ec09d2-fccb-4669-80d1-ba3bb7ce3544\",\n \"name\": \"Telegram\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 640,\n 1260\n ],\n \"parameters\": {\n \"text\": \"=*[Github Event] @* `{{ $json.date }}`: \\n`{{ $json.author }}` committed to `{{ $json.repo }}`!\\n\\nDescription:\\n```{{ $json.description }}```\\n\\nModified Files:\\n```{{ $json.modified_files }}```\\n{{ $json.url }}\",\n \"replyMarkup\": \"inlineKeyboard\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"lulhyqZvExuxci8F\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"1f57a9cb-7061-4679-97ce-081746acfd55\",\n \"name\": \"Repos to Monitor\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 220,\n 340\n ],\n \"parameters\": {\n \"mode\": \"raw\",\n \"options\": {},\n \"jsonOutput\": \"{\\n \\\"repos\\\":[\\n \\\"https://github.com/arose26/testrepo2\\\",\\n \\\"https://github.com/arose26/testrepo3\\\"\\n \\n ]\\n}\\n\"\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"6a83a757-673b-4ffc-9f91-54e5a24b8437\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -640,\n 1180\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 520.7636244130189,\n \"height\": 381.80326328628485,\n \"content\": \"## Test\\n## 1. Register Webhooks\\n- In `Repos to Monitor`, add any repo you want to monitor changes for. \\n- Disable `Webhook Trigger`, Click `Test Workflow` and if your Github credentials were set correctly, it will automatically register the webhooks. - You can test this by running the single node `Get Existing Webhook` and confirming it outputs the repo addresses.\\n## 2. Handle Github Events\\n- Now that you have registered the webhooks, reenable `Webhook Trigger` and activate the workflow.\\n- Make a commit to any of the registered repos.\\n- Confirm that the notification went through.\\n*That's it!*\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cb204806-1f7d-494a-9e0f-340b56d2dcd5\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -940,\n 440\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 821.1807025349485,\n \"height\": 693.4508863847356,\n \"content\": \"## Setup\\n## 1. Creating Credentials on Github\\n#### Generate a personal access token on github by following these esteps;\\n- Right hand side of page -> Settings -> scroll to bottom -> Developer Settings > Personal Access Token > Tokens (classic) > Generate New Token\\n- Give scopes:\\n *admin:repo_hook*\\n *repo* (if you want to use it for your own private repo)\\n\\nif you need more help, see here:\\nhttps://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens\\n\\n## 2. Setting Credentials in n8n\\nIn `Register Github Webhook`\\n*Authenticaion > Generic Credential Type*\\n*Generic Auth Type > Header Auth*\\n*Header Auth > Create New Credential* with Name set to *'Authorization'* and Value set to *'Bearer <YOUR GITHUB TOKEN HERE>'*.\\n(You can reuse this for `Delete Github Webhook` and `Get Existing Webhooks`).\\nNow in `Register Github Webhook`, scroll down to Send Body > JSON and inside the JSON, change the value of *\\\"url\\\"* to the webhook address given as Production URL in the node `Webhook Trigger`.\\n\\n\\n## 3. Notification settings\\nIn the third row, link up the Webhook Trigger to any API of your choice. Slack and Telegram are given as examples.\\nYou can also format the notification message as you wish.\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"28bd218b-7dfb-460e-a2a8-012af08835cd\",\n \"name\": \"Webhook Trigger\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 40,\n 1180\n ],\n \"webhookId\": \"e90c3560-2c95-4e7e-9df3-2d084d7e8fde\",\n \"parameters\": {\n \"path\": \"e90c3560-2c95-4e7e-9df3-2d084d7e8fde\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"b68dff7d-f7ee-47dc-b360-08d9ea2d7f42\",\n \"name\": \"Repos to Monitor1\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 240,\n 760\n ],\n \"parameters\": {\n \"mode\": \"raw\",\n \"options\": {},\n \"jsonOutput\": \"{\\n \\\"repos\\\":[\\n \\\"https://github.com/arose26/testrepo\\\",\\n \\\"https://github.com/arose26/testrepo2\\\",\\n \\\"https://github.com/arose26/testrepo3\\\"\\n \\n ]\\n}\\n\"\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"39dd7062-bb85-4f95-90f7-47fe27a257c8\",\n \"name\": \"Get Existing Hook\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 740,\n 760\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/vnd.github+json\"\n },\n {\n \"name\": \"X-GitHub-Api-Version\",\n \"value\": \"2022-11-28\"\n }\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"A8NIXOiG7JTWqrUI\",\n \"name\": \"Header Auth account\"\n }\n },\n \"typeVersion\": 4.2,\n \"alwaysOutputData\": false\n },\n {\n \"id\": \"6d092a2f-ba48-4b0f-a772-4f55ba761d64\",\n \"name\": \"Hook URL\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 560,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"b90c27f3-b81a-4098-9cd8-7934880d78a7\",\n \"name\": \"url\",\n \"type\": \"string\",\n \"value\": \"=https://api.github.com/repos/{{ $json.repos.replace('https://github.com/','')}}/hooks\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Fields\": {\n \"main\": [\n [\n {\n \"node\": \"Telegram\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Hook URL\": {\n \"main\": [\n [\n {\n \"node\": \"Get Existing Hook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Register Github Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out1\": {\n \"main\": [\n [\n {\n \"node\": \"Hook URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Webhook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Fields\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Repos to Monitor\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Existing Hook\": {\n \"main\": [\n [\n {\n \"node\": \"Delete Github Webhook\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Repos to Monitor1\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Repos to Monitor\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
24
1
2
true
combined_workflows.json
{ "input": "This workflow monitors multiple GitHub repositories for changes and sends notifications via Slack and Telegram. It registers and deletes webhooks for the repositories.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11080, "processed_size": 11080, "processed_timestamp": "2025-04-09T03:08:37.871106", "timestamp": "2025-04-09T02:35:31.295856", "token_count": 2107, "tokens": 1012, "workflow_chunk_info": { "is_truncated": false, "original_size": 11080, "processed_size": 11080, "workflow_hash": "59f684befa6f5867ec4210643071e2d7" }, "workflow_hash": "59f684befa6f5867ec4210643071e2d7" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to regularly back up n8n workflows to Dropbox, move older backups to an "old" folder, and delete backups older than 30 days. Analyze this workflow: ```json { "meta": { "instanceId": "257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833", "templateId": "2075" }, "nodes": [ { "id": "e3df7c90-fd1e-4e56-b4b8-ee2095720077", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 380, 240 ], "parameters": { "rule": { "interval": [ {} ] } }, "typeVersion": 1.1 }, { "id": "fd37f3cc-b42c-43db-ba4c-8f760d620050", "name": "PURGE DAYS", "type": "n8n-nodes-base.dateTime", "position": [ 920, 460 ], "parameters": { "options": {}, "duration": 30, "magnitude": "={{ $now }}", "operation": "subtractFromDate" }, "typeVersion": 2 }, { "id": "88d38a16-3dad-466f-adab-5c5ac846a65e", "name": "DELETE OLD BACKUPS", "type": "n8n-nodes-base.dropbox", "position": [ 1520, 460 ], "parameters": { "path": "={{ $json.pathDisplay }}", "operation": "delete", "authentication": "oAuth2" }, "credentials": { "dropboxOAuth2Api": { "id": "28", "name": "Dropbox account" } }, "typeVersion": 1 }, { "id": "ff2b37de-8bc8-446a-8369-9bc52a54addd", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 820, -20 ], "parameters": { "width": 932.4394074276975, "height": 223.80675203725258, "content": "MOVE CURRENT BACKUPS TO OLD FOLDER" }, "typeVersion": 1 }, { "id": "732eeb83-f552-4c4a-b0dc-e7e25e7a74cb", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 820, 220 ], "parameters": { "width": 931.4765002625034, "height": 185.32013969732247, "content": "BACKUP ALL CURRENT WORKFLOWS" }, "typeVersion": 1 }, { "id": "fb8e941b-343a-47c0-9806-10f13a0e1c2d", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 817.111278504417, 420 ], "parameters": { "width": 932.4394074276973, "height": 203.55064027939466, "content": "PURGE BACKUPS OLDER THEN 30 DAYS\n" }, "typeVersion": 1 }, { "id": "cbf0c9a8-f188-499f-ba9b-68ea6bfdb38b", "name": "GET WORKFLOWS", "type": "n8n-nodes-base.n8n", "position": [ 1100, 260 ], "parameters": { "filters": {} }, "credentials": { "n8nApi": { "id": "9zn8iY4B9oVtPrcc", "name": "n8n account" } }, "typeVersion": 1 }, { "id": "43436e4f-83e8-422c-8726-6257976dd9ab", "name": "MAKE JSON FILES", "type": "n8n-nodes-base.moveBinaryData", "position": [ 1300, 260 ], "parameters": { "mode": "jsonToBinary", "options": { "fileName": "={{ $json.name }}" } }, "notesInFlow": true, "typeVersion": 1 }, { "id": "4a3df15e-3679-415a-bcfc-51b19961b08b", "name": "UPLOAD WORKFLOWS", "type": "n8n-nodes-base.dropbox", "position": [ 1520, 260 ], "parameters": { "path": "={{ $('DESTINATION FOLDER').last().json.folder }}{{ $('GET WORKFLOWS').item.json.name }}.json", "binaryData": true, "authentication": "oAuth2" }, "credentials": { "dropboxOAuth2Api": { "id": "28", "name": "Dropbox account" } }, "notesInFlow": true, "typeVersion": 1 }, { "id": "1350580e-a6b8-4d18-b2f3-322f3dbefd0b", "name": "DESTINATION FOLDER", "type": "n8n-nodes-base.set", "position": [ 580, 240 ], "parameters": { "fields": { "values": [ { "name": "folder", "stringValue": "/n8n_backups/" } ] }, "include": "none", "options": {} }, "notesInFlow": true, "typeVersion": 3.2 }, { "id": "920c837e-f328-47bc-ac01-da4584640e01", "name": "WAIT FOR MOVE TO FINISH", "type": "n8n-nodes-base.merge", "position": [ 900, 260 ], "parameters": { "mode": "chooseBranch", "output": "input2" }, "typeVersion": 2.1 }, { "id": "8798f472-5a7f-442b-880e-3bffe3597d0b", "name": "GET CURRENT BACKUPS", "type": "n8n-nodes-base.dropbox", "onError": "continueRegularOutput", "position": [ 1100, 40 ], "parameters": { "path": "={{ $('DESTINATION FOLDER').last().json.folder }}", "limit": 250, "filters": {}, "resource": "folder", "operation": "list", "authentication": "oAuth2" }, "credentials": { "dropboxOAuth2Api": { "id": "28", "name": "Dropbox account" } }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "b524ac5f-08bf-4c87-9c53-8e9150068690", "name": "IGNORE FOLDERS", "type": "n8n-nodes-base.filter", "position": [ 1300, 40 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "a13e9fd6-ef31-4e23-bde6-955ffab5849b", "operator": { "type": "string", "operation": "notEquals" }, "leftValue": "={{ $json.type }}", "rightValue": "folder" } ] } }, "typeVersion": 2, "alwaysOutputData": true }, { "id": "7ca4c3d3-93dc-4da0-a4d0-c9282d0e7689", "name": "MOVE INTO OLD FOLDER", "type": "n8n-nodes-base.dropbox", "onError": "continueRegularOutput", "position": [ 1520, 40 ], "parameters": { "path": "={{ $json.pathDisplay }}", "toPath": "={{ $('DESTINATION FOLDER').last().json.folder }}old/{{ $json.name }}_{{ $('GET CURRENT DATE').last().json.formattedDate }}.json", "operation": "move", "authentication": "oAuth2" }, "credentials": { "dropboxOAuth2Api": { "id": "28", "name": "Dropbox account" } }, "executeOnce": false, "notesInFlow": true, "retryOnFail": false, "typeVersion": 1, "alwaysOutputData": true }, { "id": "60505840-821b-43e1-8aa0-6478955c5f3a", "name": "LIST OLD BACKUPS", "type": "n8n-nodes-base.dropbox", "onError": "continueRegularOutput", "position": [ 1100, 460 ], "parameters": { "path": "={{ $('DESTINATION FOLDER').last().json.folder }}old", "limit": 500, "filters": {}, "resource": "folder", "operation": "list", "authentication": "oAuth2" }, "credentials": { "dropboxOAuth2Api": { "id": "28", "name": "Dropbox account" } }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "ffab6a02-a9f9-4a91-b4f1-dbc157d079e7", "name": "CHECK DATES", "type": "n8n-nodes-base.if", "position": [ 1300, 460 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "e0aa83a7-a65b-4008-9010-bf4f14c0c398", "operator": { "type": "dateTime", "operation": "before" }, "leftValue": "={{ $json.lastModifiedServer }}", "rightValue": "={{ $('PURGE DAYS').item.json.newDate }}" } ] } }, "typeVersion": 2 }, { "id": "6bb40592-b599-4511-9e29-fdb1d374053f", "name": "GET CURRENT DATE", "type": "n8n-nodes-base.dateTime", "position": [ 900, 40 ], "parameters": { "date": "={{ $now }}", "format": "=yyyy-MM-dd_HHmm", "options": {}, "operation": "formatDate" }, "typeVersion": 2 } ], "pinData": {}, "connections": { "PURGE DAYS": { "main": [ [ { "node": "LIST OLD BACKUPS", "type": "main", "index": 0 } ] ] }, "CHECK DATES": { "main": [ [ { "node": "DELETE OLD BACKUPS", "type": "main", "index": 0 } ] ] }, "GET WORKFLOWS": { "main": [ [ { "node": "MAKE JSON FILES", "type": "main", "index": 0 } ] ] }, "IGNORE FOLDERS": { "main": [ [ { "node": "MOVE INTO OLD FOLDER", "type": "main", "index": 0 } ] ] }, "MAKE JSON FILES": { "main": [ [ { "node": "UPLOAD WORKFLOWS", "type": "main", "index": 0 } ] ] }, "GET CURRENT DATE": { "main": [ [ { "node": "GET CURRENT BACKUPS", "type": "main", "index": 0 } ] ] }, "LIST OLD BACKUPS": { "main": [ [ { "node": "CHECK DATES", "type": "main", "index": 0 } ] ] },
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833\",\n \"templateId\": \"2075\"\n },\n \"nodes\": [\n {\n \"id\": \"e3df7c90-fd1e-4e56-b4b8-ee2095720077\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {}\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"fd37f3cc-b42c-43db-ba4c-8f760d620050\",\n \"name\": \"PURGE DAYS\",\n \"type\": \"n8n-nodes-base.dateTime\",\n \"position\": [\n 920,\n 460\n ],\n \"parameters\": {\n \"options\": {},\n \"duration\": 30,\n \"magnitude\": \"={{ $now }}\",\n \"operation\": \"subtractFromDate\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"88d38a16-3dad-466f-adab-5c5ac846a65e\",\n \"name\": \"DELETE OLD BACKUPS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"position\": [\n 1520,\n 460\n ],\n \"parameters\": {\n \"path\": \"={{ $json.pathDisplay }}\",\n \"operation\": \"delete\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ff2b37de-8bc8-446a-8369-9bc52a54addd\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n -20\n ],\n \"parameters\": {\n \"width\": 932.4394074276975,\n \"height\": 223.80675203725258,\n \"content\": \"MOVE CURRENT BACKUPS TO OLD FOLDER\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"732eeb83-f552-4c4a-b0dc-e7e25e7a74cb\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n 220\n ],\n \"parameters\": {\n \"width\": 931.4765002625034,\n \"height\": 185.32013969732247,\n \"content\": \"BACKUP ALL CURRENT WORKFLOWS\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fb8e941b-343a-47c0-9806-10f13a0e1c2d\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 817.111278504417,\n 420\n ],\n \"parameters\": {\n \"width\": 932.4394074276973,\n \"height\": 203.55064027939466,\n \"content\": \"PURGE BACKUPS OLDER THEN 30 DAYS\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cbf0c9a8-f188-499f-ba9b-68ea6bfdb38b\",\n \"name\": \"GET WORKFLOWS\",\n \"type\": \"n8n-nodes-base.n8n\",\n \"position\": [\n 1100,\n 260\n ],\n \"parameters\": {\n \"filters\": {}\n },\n \"credentials\": {\n \"n8nApi\": {\n \"id\": \"9zn8iY4B9oVtPrcc\",\n \"name\": \"n8n account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"43436e4f-83e8-422c-8726-6257976dd9ab\",\n \"name\": \"MAKE JSON FILES\",\n \"type\": \"n8n-nodes-base.moveBinaryData\",\n \"position\": [\n 1300,\n 260\n ],\n \"parameters\": {\n \"mode\": \"jsonToBinary\",\n \"options\": {\n \"fileName\": \"={{ $json.name }}\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"4a3df15e-3679-415a-bcfc-51b19961b08b\",\n \"name\": \"UPLOAD WORKFLOWS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"position\": [\n 1520,\n 260\n ],\n \"parameters\": {\n \"path\": \"={{ $('DESTINATION FOLDER').last().json.folder }}{{ $('GET WORKFLOWS').item.json.name }}.json\",\n \"binaryData\": true,\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"1350580e-a6b8-4d18-b2f3-322f3dbefd0b\",\n \"name\": \"DESTINATION FOLDER\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 580,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"folder\",\n \"stringValue\": \"/n8n_backups/\"\n }\n ]\n },\n \"include\": \"none\",\n \"options\": {}\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"920c837e-f328-47bc-ac01-da4584640e01\",\n \"name\": \"WAIT FOR MOVE TO FINISH\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 900,\n 260\n ],\n \"parameters\": {\n \"mode\": \"chooseBranch\",\n \"output\": \"input2\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"8798f472-5a7f-442b-880e-3bffe3597d0b\",\n \"name\": \"GET CURRENT BACKUPS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"onError\": \"continueRegularOutput\",\n \"position\": [\n 1100,\n 40\n ],\n \"parameters\": {\n \"path\": \"={{ $('DESTINATION FOLDER').last().json.folder }}\",\n \"limit\": 250,\n \"filters\": {},\n \"resource\": \"folder\",\n \"operation\": \"list\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"b524ac5f-08bf-4c87-9c53-8e9150068690\",\n \"name\": \"IGNORE FOLDERS\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1300,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a13e9fd6-ef31-4e23-bde6-955ffab5849b\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.type }}\",\n \"rightValue\": \"folder\"\n }\n ]\n }\n },\n \"typeVersion\": 2,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"7ca4c3d3-93dc-4da0-a4d0-c9282d0e7689\",\n \"name\": \"MOVE INTO OLD FOLDER\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"onError\": \"continueRegularOutput\",\n \"position\": [\n 1520,\n 40\n ],\n \"parameters\": {\n \"path\": \"={{ $json.pathDisplay }}\",\n \"toPath\": \"={{ $('DESTINATION FOLDER').last().json.folder }}old/{{ $json.name }}_{{ $('GET CURRENT DATE').last().json.formattedDate }}.json\",\n \"operation\": \"move\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"executeOnce\": false,\n \"notesInFlow\": true,\n \"retryOnFail\": false,\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"60505840-821b-43e1-8aa0-6478955c5f3a\",\n \"name\": \"LIST OLD BACKUPS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"onError\": \"continueRegularOutput\",\n \"position\": [\n 1100,\n 460\n ],\n \"parameters\": {\n \"path\": \"={{ $('DESTINATION FOLDER').last().json.folder }}old\",\n \"limit\": 500,\n \"filters\": {},\n \"resource\": \"folder\",\n \"operation\": \"list\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"ffab6a02-a9f9-4a91-b4f1-dbc157d079e7\",\n \"name\": \"CHECK DATES\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1300,\n 460\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"e0aa83a7-a65b-4008-9010-bf4f14c0c398\",\n \"operator\": {\n \"type\": \"dateTime\",\n \"operation\": \"before\"\n },\n \"leftValue\": \"={{ $json.lastModifiedServer }}\",\n \"rightValue\": \"={{ $('PURGE DAYS').item.json.newDate }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"6bb40592-b599-4511-9e29-fdb1d374053f\",\n \"name\": \"GET CURRENT DATE\",\n \"type\": \"n8n-nodes-base.dateTime\",\n \"position\": [\n 900,\n 40\n ],\n \"parameters\": {\n \"date\": \"={{ $now }}\",\n \"format\": \"=yyyy-MM-dd_HHmm\",\n \"options\": {},\n \"operation\": \"formatDate\"\n },\n \"typeVersion\": 2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"PURGE DAYS\": {\n \"main\": [\n [\n {\n \"node\": \"LIST OLD BACKUPS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"CHECK DATES\": {\n \"main\": [\n [\n {\n \"node\": \"DELETE OLD BACKUPS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GET WORKFLOWS\": {\n \"main\": [\n [\n {\n \"node\": \"MAKE JSON FILES\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IGNORE FOLDERS\": {\n \"main\": [\n [\n {\n \"node\": \"MOVE INTO OLD FOLDER\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"MAKE JSON FILES\": {\n \"main\": [\n [\n {\n \"node\": \"UPLOAD WORKFLOWS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GET CURRENT DATE\": {\n \"main\": [\n [\n {\n \"node\": \"GET CURRENT BACKUPS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"LIST OLD BACKUPS\": {\n \"main\": [\n [\n {\n \"node\": \"CHECK DATES\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"DESTINATION FOLDER\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"DESTINATION FOLDER\": {\n \"main\": [\n [\n {\n \"node\": \"GET CURRENT DATE\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"WAIT FOR MOVE TO FINISH\",\n \"type\": \"main\",\n \"index\": 1\n },\n {\n \"node\": \"PURGE DAYS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GET CURRENT BACKUPS\": {\n \"main\": [\n [\n {\n \"node\": \"IGNORE FOLDERS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"MOVE INTO OLD FOLDER\": {\n \"main\": [\n [\n {\n \"node\": \"WAIT FOR MOVE TO FINISH\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"WAIT FOR MOVE TO FINISH\": {\n \"main\": [\n [\n {\n \"node\": \"GET WORKFLOWS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
25
0
2
true
combined_workflows.json
{ "input": "The workflow's goal is to regularly back up n8n workflows to Dropbox, move older backups to an \"old\" folder, and delete backups older than 30 days.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7304, "processed_size": 7304, "processed_timestamp": "2025-04-09T03:08:37.937069", "timestamp": "2025-04-09T02:35:31.486447", "token_count": 4095, "tokens": 665, "workflow_chunk_info": { "is_truncated": false, "original_size": 7304, "processed_size": 7304, "workflow_hash": "cc5564b71424748a3d8d89970dc8a03c" }, "workflow_hash": "cc5564b71424748a3d8d89970dc8a03c" }
] ] }, "MAKE JSON FILES": { "main": [ [ { "node": "UPLOAD WORKFLOWS", "type": "main", "index": 0 } ] ] }, "GET CURRENT DATE": { "main": [ [ { "node": "GET CURRENT BACKUPS", "type": "main", "index": 0 } ] ] }, "LIST OLD BACKUPS": { "main": [ [ { "node": "CHECK DATES", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "DESTINATION FOLDER", "type": "main", "index": 0 } ] ] }, "DESTINATION FOLDER": { "main": [ [ { "node": "GET CURRENT DATE", "type": "main", "index": 0 }, { "node": "WAIT FOR MOVE TO FINISH", "type": "main", "index": 1 }, { "node": "PURGE DAYS", "type": "main", "index": 0 } ] ] }, "GET CURRENT BACKUPS": { "main": [ [ { "node": "IGNORE FOLDERS", "type": "main", "index": 0 } ] ] }, "MOVE INTO OLD FOLDER": { "main": [ [ { "node": "WAIT FOR MOVE TO FINISH", "type": "main", "index": 0 } ] ] }, "WAIT FOR MOVE TO FINISH": { "main": [ [ { "node": "GET WORKFLOWS", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"257476b1ef58bf3cb6a46e65fac7ee34a53a5e1a8492d5c6e4da5f87c9b82833\",\n \"templateId\": \"2075\"\n },\n \"nodes\": [\n {\n \"id\": \"e3df7c90-fd1e-4e56-b4b8-ee2095720077\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {}\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"fd37f3cc-b42c-43db-ba4c-8f760d620050\",\n \"name\": \"PURGE DAYS\",\n \"type\": \"n8n-nodes-base.dateTime\",\n \"position\": [\n 920,\n 460\n ],\n \"parameters\": {\n \"options\": {},\n \"duration\": 30,\n \"magnitude\": \"={{ $now }}\",\n \"operation\": \"subtractFromDate\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"88d38a16-3dad-466f-adab-5c5ac846a65e\",\n \"name\": \"DELETE OLD BACKUPS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"position\": [\n 1520,\n 460\n ],\n \"parameters\": {\n \"path\": \"={{ $json.pathDisplay }}\",\n \"operation\": \"delete\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ff2b37de-8bc8-446a-8369-9bc52a54addd\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n -20\n ],\n \"parameters\": {\n \"width\": 932.4394074276975,\n \"height\": 223.80675203725258,\n \"content\": \"MOVE CURRENT BACKUPS TO OLD FOLDER\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"732eeb83-f552-4c4a-b0dc-e7e25e7a74cb\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n 220\n ],\n \"parameters\": {\n \"width\": 931.4765002625034,\n \"height\": 185.32013969732247,\n \"content\": \"BACKUP ALL CURRENT WORKFLOWS\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fb8e941b-343a-47c0-9806-10f13a0e1c2d\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 817.111278504417,\n 420\n ],\n \"parameters\": {\n \"width\": 932.4394074276973,\n \"height\": 203.55064027939466,\n \"content\": \"PURGE BACKUPS OLDER THEN 30 DAYS\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cbf0c9a8-f188-499f-ba9b-68ea6bfdb38b\",\n \"name\": \"GET WORKFLOWS\",\n \"type\": \"n8n-nodes-base.n8n\",\n \"position\": [\n 1100,\n 260\n ],\n \"parameters\": {\n \"filters\": {}\n },\n \"credentials\": {\n \"n8nApi\": {\n \"id\": \"9zn8iY4B9oVtPrcc\",\n \"name\": \"n8n account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"43436e4f-83e8-422c-8726-6257976dd9ab\",\n \"name\": \"MAKE JSON FILES\",\n \"type\": \"n8n-nodes-base.moveBinaryData\",\n \"position\": [\n 1300,\n 260\n ],\n \"parameters\": {\n \"mode\": \"jsonToBinary\",\n \"options\": {\n \"fileName\": \"={{ $json.name }}\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"4a3df15e-3679-415a-bcfc-51b19961b08b\",\n \"name\": \"UPLOAD WORKFLOWS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"position\": [\n 1520,\n 260\n ],\n \"parameters\": {\n \"path\": \"={{ $('DESTINATION FOLDER').last().json.folder }}{{ $('GET WORKFLOWS').item.json.name }}.json\",\n \"binaryData\": true,\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"1350580e-a6b8-4d18-b2f3-322f3dbefd0b\",\n \"name\": \"DESTINATION FOLDER\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 580,\n 240\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"folder\",\n \"stringValue\": \"/n8n_backups/\"\n }\n ]\n },\n \"include\": \"none\",\n \"options\": {}\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"920c837e-f328-47bc-ac01-da4584640e01\",\n \"name\": \"WAIT FOR MOVE TO FINISH\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 900,\n 260\n ],\n \"parameters\": {\n \"mode\": \"chooseBranch\",\n \"output\": \"input2\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"8798f472-5a7f-442b-880e-3bffe3597d0b\",\n \"name\": \"GET CURRENT BACKUPS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"onError\": \"continueRegularOutput\",\n \"position\": [\n 1100,\n 40\n ],\n \"parameters\": {\n \"path\": \"={{ $('DESTINATION FOLDER').last().json.folder }}\",\n \"limit\": 250,\n \"filters\": {},\n \"resource\": \"folder\",\n \"operation\": \"list\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"b524ac5f-08bf-4c87-9c53-8e9150068690\",\n \"name\": \"IGNORE FOLDERS\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1300,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a13e9fd6-ef31-4e23-bde6-955ffab5849b\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.type }}\",\n \"rightValue\": \"folder\"\n }\n ]\n }\n },\n \"typeVersion\": 2,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"7ca4c3d3-93dc-4da0-a4d0-c9282d0e7689\",\n \"name\": \"MOVE INTO OLD FOLDER\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"onError\": \"continueRegularOutput\",\n \"position\": [\n 1520,\n 40\n ],\n \"parameters\": {\n \"path\": \"={{ $json.pathDisplay }}\",\n \"toPath\": \"={{ $('DESTINATION FOLDER').last().json.folder }}old/{{ $json.name }}_{{ $('GET CURRENT DATE').last().json.formattedDate }}.json\",\n \"operation\": \"move\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"executeOnce\": false,\n \"notesInFlow\": true,\n \"retryOnFail\": false,\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"60505840-821b-43e1-8aa0-6478955c5f3a\",\n \"name\": \"LIST OLD BACKUPS\",\n \"type\": \"n8n-nodes-base.dropbox\",\n \"onError\": \"continueRegularOutput\",\n \"position\": [\n 1100,\n 460\n ],\n \"parameters\": {\n \"path\": \"={{ $('DESTINATION FOLDER').last().json.folder }}old\",\n \"limit\": 500,\n \"filters\": {},\n \"resource\": \"folder\",\n \"operation\": \"list\",\n \"authentication\": \"oAuth2\"\n },\n \"credentials\": {\n \"dropboxOAuth2Api\": {\n \"id\": \"28\",\n \"name\": \"Dropbox account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"ffab6a02-a9f9-4a91-b4f1-dbc157d079e7\",\n \"name\": \"CHECK DATES\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1300,\n 460\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"e0aa83a7-a65b-4008-9010-bf4f14c0c398\",\n \"operator\": {\n \"type\": \"dateTime\",\n \"operation\": \"before\"\n },\n \"leftValue\": \"={{ $json.lastModifiedServer }}\",\n \"rightValue\": \"={{ $('PURGE DAYS').item.json.newDate }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"6bb40592-b599-4511-9e29-fdb1d374053f\",\n \"name\": \"GET CURRENT DATE\",\n \"type\": \"n8n-nodes-base.dateTime\",\n \"position\": [\n 900,\n 40\n ],\n \"parameters\": {\n \"date\": \"={{ $now }}\",\n \"format\": \"=yyyy-MM-dd_HHmm\",\n \"options\": {},\n \"operation\": \"formatDate\"\n },\n \"typeVersion\": 2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"PURGE DAYS\": {\n \"main\": [\n [\n {\n \"node\": \"LIST OLD BACKUPS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"CHECK DATES\": {\n \"main\": [\n [\n {\n \"node\": \"DELETE OLD BACKUPS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GET WORKFLOWS\": {\n \"main\": [\n [\n {\n \"node\": \"MAKE JSON FILES\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IGNORE FOLDERS\": {\n \"main\": [\n [\n {\n \"node\": \"MOVE INTO OLD FOLDER\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"MAKE JSON FILES\": {\n \"main\": [\n [\n {\n \"node\": \"UPLOAD WORKFLOWS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GET CURRENT DATE\": {\n \"main\": [\n [\n {\n \"node\": \"GET CURRENT BACKUPS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"LIST OLD BACKUPS\": {\n \"main\": [\n [\n {\n \"node\": \"CHECK DATES\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"DESTINATION FOLDER\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"DESTINATION FOLDER\": {\n \"main\": [\n [\n {\n \"node\": \"GET CURRENT DATE\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"WAIT FOR MOVE TO FINISH\",\n \"type\": \"main\",\n \"index\": 1\n },\n {\n \"node\": \"PURGE DAYS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GET CURRENT BACKUPS\": {\n \"main\": [\n [\n {\n \"node\": \"IGNORE FOLDERS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"MOVE INTO OLD FOLDER\": {\n \"main\": [\n [\n {\n \"node\": \"WAIT FOR MOVE TO FINISH\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"WAIT FOR MOVE TO FINISH\": {\n \"main\": [\n [\n {\n \"node\": \"GET WORKFLOWS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
25
1
2
true
combined_workflows.json
{ "input": "The workflow's goal is to regularly back up n8n workflows to Dropbox, move older backups to an \"old\" folder, and delete backups older than 30 days.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7304, "processed_size": 7304, "processed_timestamp": "2025-04-09T03:08:37.940068", "timestamp": "2025-04-09T02:35:31.486447", "token_count": 631, "tokens": 665, "workflow_chunk_info": { "is_truncated": false, "original_size": 7304, "processed_size": 7304, "workflow_hash": "cc5564b71424748a3d8d89970dc8a03c" }, "workflow_hash": "cc5564b71424748a3d8d89970dc8a03c" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow automatically processes incoming emails, identifies appointment requests, and drafts a reply suggesting available meeting times. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "eaa31cde-3017-400d-aac8-999def8cc227", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -340, -780 ], "parameters": { "width": 617, "height": 490, "content": "## Check if incoming email is about appointment\nWe use LLM to check subject and body of the email and determine if it's an appointment request. " }, "typeVersion": 1 }, { "id": "b03d3f72-d1d8-49a7-bcc1-a476fd5c4ad7", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 400, -780 ], "parameters": { "width": 796, "height": 482, "content": "## Get calendar availability and compose a response\nMake sure to update the Workflow ID if you are running this as 2 workflows" }, "typeVersion": 1 }, { "id": "29ce0093-c4c8-41cc-be69-334de3a1d1a2", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ -60, -460 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "5176f475-704b-446e-b368-ffa395bb089e", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 480, -460 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "0e8a75dd-ce68-46c3-972c-32b15e04b254", "name": "Send reply", "type": "n8n-nodes-base.gmail", "position": [ 940, -660 ], "webhookId": "0f18d414-1b14-4d2e-9fc2-d2d302372dc6", "parameters": { "message": "={{ $json.output }}", "options": {}, "messageId": "={{ $('Gmail Trigger').first().json.id }}", "operation": "reply" }, "credentials": { "gmailOAuth2": { "id": "Sf5Gfl9NiFTNXFWb", "name": "Gmail account" } }, "typeVersion": 2.1 }, { "id": "bf154384-274a-4cdd-977d-890220948a9d", "name": "Gmail Trigger", "type": "n8n-nodes-base.gmailTrigger", "position": [ -280, -640 ], "parameters": { "filters": { "readStatus": "unread", "includeSpamTrash": false }, "pollTimes": { "item": [ { "mode": "everyMinute" } ] } }, "credentials": { "gmailOAuth2": { "id": "Sf5Gfl9NiFTNXFWb", "name": "Gmail account" } }, "typeVersion": 1.2 }, { "id": "5a268b34-38ea-4e55-87ab-8a616e2aa1fa", "name": "Classify appointment", "type": "@n8n/n8n-nodes-langchain.textClassifier", "position": [ -60, -640 ], "parameters": { "options": { "fallback": "discard" }, "inputText": "=Please evaluate the following email to determine if it suggests scheduling a meeting or a call:\nSubject: {{ $json.Subject }}\nSnippet: {{ $json.snippet }}", "categories": { "categories": [ { "category": "is_appointment", "description": "email Is requesting an appointment" } ] } }, "typeVersion": 1 }, { "id": "7b5a8468-09e5-4575-97cb-9175ee02b19d", "name": "Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 500, -660 ], "parameters": { "text": "=Sender: {{ $('Gmail Trigger').first().json.From }}\nSubject: {{ $('Gmail Trigger').first().json.Subject }}\nEmail Text: {{ $('Gmail Trigger').first().json.snippet }}", "options": { "systemMessage": "=You are an email scheduling assistant. Based on the received email, check my availability and propose an appropriate response. \nAim to get a specific time, rather than just a day. When checking my availability, make sure that there's enough time in between meetings.\nIf I'm not available, ALWAYS propose a new time based on my availability. When proposing a new time, always leave 15 minutes buffer from previous meeting.\nToday date and time is: {{ $now.toISO() }}." }, "promptType": "define" }, "typeVersion": 1.8 }, { "id": "b61e8061-5719-4c30-97da-e306e7b79b76", "name": "Google Calendar", "type": "n8n-nodes-base.googleCalendarTool", "position": [ 680, -460 ], "parameters": { "options": {}, "timeMax": "={{ $now.plus(1, 'month').toISO() }}", "timeMin": "={{ $now.minus(1, 'day').toISO() }}", "calendar": { "__rl": true, "mode": "id", "value": "your_email@gmail.com" }, "operation": "getAll", "returnAll": true }, "credentials": { "googleCalendarOAuth2Api": { "id": "kWMxmDbMDDJoYFVK", "name": "Google Calendar account" } }, "typeVersion": 1.3 }, { "id": "47e07b6c-d432-4111-b33e-56d6c305c40c", "name": "Mark as read", "type": "n8n-nodes-base.gmail", "position": [ 940, -480 ], "webhookId": "7e2d851b-c9f3-471c-875d-0da7c2c3b561", "parameters": { "messageId": "={{ $('Gmail Trigger').first().json.id }}", "operation": "markAsRead" }, "credentials": { "gmailOAuth2": { "id": "Sf5Gfl9NiFTNXFWb", "name": "Gmail account" } }, "typeVersion": 2.1 } ], "pinData": {}, "connections": { "Agent": { "main": [ [ { "node": "Send reply", "type": "main", "index": 0 }, { "node": "Mark as read", "type": "main", "index": 0 } ] ] }, "Gmail Trigger": { "main": [ [ { "node": "Classify appointment", "type": "main", "index": 0 } ] ] }, "Google Calendar": { "ai_tool": [ [ { "node": "Agent", "type": "ai_tool", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "Classify appointment", "type": "ai_languageModel", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Classify appointment": { "main": [ [ { "node": "Agent", "type": "main", "index": 0 } ], [] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"eaa31cde-3017-400d-aac8-999def8cc227\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n -780\n ],\n \"parameters\": {\n \"width\": 617,\n \"height\": 490,\n \"content\": \"## Check if incoming email is about appointment\\nWe use LLM to check subject and body of the email and determine if it's an appointment request. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b03d3f72-d1d8-49a7-bcc1-a476fd5c4ad7\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 400,\n -780\n ],\n \"parameters\": {\n \"width\": 796,\n \"height\": 482,\n \"content\": \"## Get calendar availability and compose a response\\nMake sure to update the Workflow ID if you are running this as 2 workflows\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"29ce0093-c4c8-41cc-be69-334de3a1d1a2\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -60,\n -460\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"5176f475-704b-446e-b368-ffa395bb089e\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 480,\n -460\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"0e8a75dd-ce68-46c3-972c-32b15e04b254\",\n \"name\": \"Send reply\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 940,\n -660\n ],\n \"webhookId\": \"0f18d414-1b14-4d2e-9fc2-d2d302372dc6\",\n \"parameters\": {\n \"message\": \"={{ $json.output }}\",\n \"options\": {},\n \"messageId\": \"={{ $('Gmail Trigger').first().json.id }}\",\n \"operation\": \"reply\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"Sf5Gfl9NiFTNXFWb\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"bf154384-274a-4cdd-977d-890220948a9d\",\n \"name\": \"Gmail Trigger\",\n \"type\": \"n8n-nodes-base.gmailTrigger\",\n \"position\": [\n -280,\n -640\n ],\n \"parameters\": {\n \"filters\": {\n \"readStatus\": \"unread\",\n \"includeSpamTrash\": false\n },\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"Sf5Gfl9NiFTNXFWb\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"5a268b34-38ea-4e55-87ab-8a616e2aa1fa\",\n \"name\": \"Classify appointment\",\n \"type\": \"@n8n/n8n-nodes-langchain.textClassifier\",\n \"position\": [\n -60,\n -640\n ],\n \"parameters\": {\n \"options\": {\n \"fallback\": \"discard\"\n },\n \"inputText\": \"=Please evaluate the following email to determine if it suggests scheduling a meeting or a call:\\nSubject: {{ $json.Subject }}\\nSnippet: {{ $json.snippet }}\",\n \"categories\": {\n \"categories\": [\n {\n \"category\": \"is_appointment\",\n \"description\": \"email Is requesting an appointment\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7b5a8468-09e5-4575-97cb-9175ee02b19d\",\n \"name\": \"Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 500,\n -660\n ],\n \"parameters\": {\n \"text\": \"=Sender: {{ $('Gmail Trigger').first().json.From }}\\nSubject: {{ $('Gmail Trigger').first().json.Subject }}\\nEmail Text: {{ $('Gmail Trigger').first().json.snippet }}\",\n \"options\": {\n \"systemMessage\": \"=You are an email scheduling assistant. Based on the received email, check my availability and propose an appropriate response. \\nAim to get a specific time, rather than just a day. When checking my availability, make sure that there's enough time in between meetings.\\nIf I'm not available, ALWAYS propose a new time based on my availability. When proposing a new time, always leave 15 minutes buffer from previous meeting.\\nToday date and time is: {{ $now.toISO() }}.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"b61e8061-5719-4c30-97da-e306e7b79b76\",\n \"name\": \"Google Calendar\",\n \"type\": \"n8n-nodes-base.googleCalendarTool\",\n \"position\": [\n 680,\n -460\n ],\n \"parameters\": {\n \"options\": {},\n \"timeMax\": \"={{ $now.plus(1, 'month').toISO() }}\",\n \"timeMin\": \"={{ $now.minus(1, 'day').toISO() }}\",\n \"calendar\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"your_email@gmail.com\"\n },\n \"operation\": \"getAll\",\n \"returnAll\": true\n },\n \"credentials\": {\n \"googleCalendarOAuth2Api\": {\n \"id\": \"kWMxmDbMDDJoYFVK\",\n \"name\": \"Google Calendar account\"\n }\n },\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"47e07b6c-d432-4111-b33e-56d6c305c40c\",\n \"name\": \"Mark as read\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 940,\n -480\n ],\n \"webhookId\": \"7e2d851b-c9f3-471c-875d-0da7c2c3b561\",\n \"parameters\": {\n \"messageId\": \"={{ $('Gmail Trigger').first().json.id }}\",\n \"operation\": \"markAsRead\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"Sf5Gfl9NiFTNXFWb\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 2.1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Send reply\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Mark as read\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Gmail Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Classify appointment\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Calendar\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Classify appointment\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Classify appointment\": {\n \"main\": [\n [\n {\n \"node\": \"Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n []\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
26
0
1
false
combined_workflows.json
{ "input": "The workflow automatically processes incoming emails, identifies appointment requests, and drafts a reply suggesting available meeting times.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 5297, "processed_size": 5297, "processed_timestamp": "2025-04-09T03:08:37.953106", "timestamp": "2025-04-09T02:36:32.533411", "token_count": 2955, "tokens": 513, "workflow_chunk_info": { "is_truncated": false, "original_size": 5297, "processed_size": 5297, "workflow_hash": "0d41617877fca5bdaebecd37a1668ffb" }, "workflow_hash": "0d41617877fca5bdaebecd37a1668ffb" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow extracts a YouTube video's transcript, summarizes it using an AI, and sends the summary and video information to Telegram. Analyze this workflow: ```json { "nodes": [ { "id": "9320d08a-4868-4103-abdf-3f8f54a7a0a0", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 0, 0 ], "webhookId": "9024e29e-9080-4cf5-9a6b-0d918468f195", "parameters": { "path": "ytube", "options": {}, "httpMethod": "POST", "responseMode": "responseNode" }, "typeVersion": 2 }, { "id": "a5cc8922-8124-4269-9cfd-e891b29cc2b7", "name": "YouTube Transcript", "type": "n8n-nodes-youtube-transcription.youtubeTranscripter", "position": [ 800, 0 ], "parameters": {}, "typeVersion": 1 }, { "id": "ff3c0fd1-36d8-4d64-b405-0600efd4d93b", "name": "Split Out", "type": "n8n-nodes-base.splitOut", "position": [ 200, 260 ], "parameters": { "options": {}, "fieldToSplitOut": "transcript" }, "typeVersion": 1 }, { "id": "423276e0-81bf-487a-bbdd-26e9b84fa755", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1200, 140 ], "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "27344649-8029-48ae-867b-7363d904fc59", "name": "Telegram", "type": "n8n-nodes-base.telegram", "position": [ 1200, 380 ], "parameters": { "text": "={{ $json.title }}\n{{ $json.youtubeUrl }}", "additionalFields": { "parse_mode": "HTML", "appendAttribution": false } }, "typeVersion": 1.2 }, { "id": "230c0325-d22a-4070-9460-748a6fef48d5", "name": "Get YouTube URL", "type": "n8n-nodes-base.set", "position": [ 200, 0 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "3ee42e4c-3cee-4934-97e7-64c96b5691ed", "name": "youtubeUrl", "type": "string", "value": "={{ $json.body.youtubeUrl }}" } ] } }, "typeVersion": 3.4 }, { "id": "420e90c3-9dfa-4f41-825a-9874b5ebe43a", "name": "YouTube Video ID", "type": "n8n-nodes-base.code", "position": [ 400, 0 ], "parameters": { "jsCode": "const extractYoutubeId = (url) => {\n // Regex pattern that matches both youtu.be and youtube.com URLs\n const pattern = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/\\s]{11})/;\n const match = url.match(pattern);\n return match ? match[1] : null;\n};\n\n// Input URL from previous node\nconst youtubeUrl = items[0].json.youtubeUrl; // Adjust this based on your workflow\n\n// Process the URL and return the video ID\nreturn [{\n json: {\n videoId: extractYoutubeId(youtubeUrl)\n }\n}];\n" }, "typeVersion": 2 }, { "id": "a4171c3e-1ff2-40de-af7f-b3971a1ebe79", "name": "Get YouTube Video", "type": "n8n-nodes-base.youTube", "position": [ 600, 0 ], "parameters": { "options": {}, "videoId": "={{ $json.videoId }}", "resource": "video", "operation": "get" }, "typeVersion": 1 }, { "id": "73e6bfc5-8b62-4880-acd4-292f2f692540", "name": "gpt-4o-mini", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 620, 440 ], "parameters": { "options": {} }, "typeVersion": 1 }, { "id": "ea14e296-b30c-46f7-b283-746822ae1af4", "name": "Summarize & Analyze Transcript", "type": "@n8n/n8n-nodes-langchain.chainLlm", "position": [ 600, 260 ], "parameters": { "text": "=Please analyze the given text and create a structured summary following these guidelines:\n\n1. Break down the content into main topics using Level 2 headers (##)\n2. Under each header:\n - List only the most essential concepts and key points\n - Use bullet points for clarity\n - Keep explanations concise\n - Preserve technical accuracy\n - Highlight key terms in bold\n3. Organize the information in this sequence:\n - Definition/Background\n - Main characteristics\n - Implementation details\n - Advantages/Disadvantages\n4. Format requirements:\n - Use markdown formatting\n - Keep bullet points simple (no nesting)\n - Bold important terms using **term**\n - Use tables for comparisons\n - Include relevant technical details\n\nPlease provide a clear, structured summary that captures the core concepts while maintaining technical accuracy.\n\nHere is the text: {{ $json.concatenated_text\n }}", "promptType": "define" }, "typeVersion": 1.4 }, { "id": "90e3488f-f854-483e-9106-a5760d0c0457", "name": "Concatenate", "type": "n8n-nodes-base.summarize", "position": [ 400, 260 ], "parameters": { "options": {}, "fieldsToSummarize": { "values": [ { "field": "text", "separateBy": " ", "aggregation": "concatenate" } ] } }, "typeVersion": 1 }, { "id": "9c5c249c-5eeb-4433-ba93-ace4611f4858", "name": "Response Object", "type": "n8n-nodes-base.set", "position": [ 960, 260 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "bf132004-6636-411f-9d85-0c696fda84c4", "name": "summary", "type": "string", "value": "={{ $json.text }}" }, { "id": "63c8d0e3-685c-488a-9b45-363cf52479ea", "name": "topics", "type": "array", "value": "=[]" }, { "id": "171f30cf-34e9-42f3-8735-814024bfde0b", "name": "title", "type": "string", "value": "={{ $('Get YouTube Video').item.json.snippet.title }}" }, { "id": "7f26f5a3-e695-49d1-b1e8-9260c31f1b3d", "name": "description", "type": "string", "value": "={{ $('Get YouTube Video').item.json.snippet.description }}" }, { "id": "d0594232-cb39-453c-b015-3b039c098e1f", "name": "id", "type": "string", "value": "={{ $('Get YouTube Video').item.json.id }}" }, { "id": "17b6ca08-ce89-4467-bd25-0d2d182f7a8b", "name": "youtubeUrl", "type": "string", "value": "={{ $('Webhook').item.json.body.youtubeUrl }}" } ] } }, "typeVersion": 3.4 } ], "pinData": {}, "connections": { "Webhook": { "main": [ [ { "node": "Get YouTube URL", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "Concatenate", "type": "main", "index": 0 } ] ] }, "Concatenate": { "main": [ [ { "node": "Summarize & Analyze Transcript", "type": "main", "index": 0 } ] ] }, "gpt-4o-mini": { "ai_languageModel": [ [ { "node": "Summarize & Analyze Transcript", "type": "ai_languageModel", "index": 0 } ] ] }, "Get YouTube URL": { "main": [ [ { "node": "YouTube Video ID", "type": "main", "index": 0 } ] ] }, "Response Object": { "main": [ [ { "node": "Respond to Webhook", "type": "main", "index": 0 }, { "node": "Telegram", "type": "main", "index": 0 } ] ] }, "YouTube Video ID": { "main": [ [ { "node": "Get YouTube Video", "type": "main", "index": 0 } ] ] }, "Summarize & Analyze Transcript": { "main": [ [ { "node": "Response Object", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"id\": \"9320d08a-4868-4103-abdf-3f8f54a7a0a0\",\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 0,\n 0\n ],\n \"webhookId\": \"9024e29e-9080-4cf5-9a6b-0d918468f195\",\n \"parameters\": {\n \"path\": \"ytube\",\n \"options\": {},\n \"httpMethod\": \"POST\",\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"a5cc8922-8124-4269-9cfd-e891b29cc2b7\",\n \"name\": \"YouTube Transcript\",\n \"type\": \"n8n-nodes-youtube-transcription.youtubeTranscripter\",\n \"position\": [\n 800,\n 0\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"ff3c0fd1-36d8-4d64-b405-0600efd4d93b\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 200,\n 260\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"transcript\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"423276e0-81bf-487a-bbdd-26e9b84fa755\",\n \"name\": \"Respond to Webhook\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1200,\n 140\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"27344649-8029-48ae-867b-7363d904fc59\",\n \"name\": \"Telegram\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1200,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.title }}\\n{{ $json.youtubeUrl }}\",\n \"additionalFields\": {\n \"parse_mode\": \"HTML\",\n \"appendAttribution\": false\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"230c0325-d22a-4070-9460-748a6fef48d5\",\n \"name\": \"Get YouTube URL\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 200,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"3ee42e4c-3cee-4934-97e7-64c96b5691ed\",\n \"name\": \"youtubeUrl\",\n \"type\": \"string\",\n \"value\": \"={{ $json.body.youtubeUrl }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"420e90c3-9dfa-4f41-825a-9874b5ebe43a\",\n \"name\": \"YouTube Video ID\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 400,\n 0\n ],\n \"parameters\": {\n \"jsCode\": \"const extractYoutubeId = (url) => {\\n // Regex pattern that matches both youtu.be and youtube.com URLs\\n const pattern = /(?:youtube\\\\.com\\\\/(?:[^\\\\/]+\\\\/.+\\\\/|(?:v|e(?:mbed)?)\\\\/|.*[?&]v=)|youtu\\\\.be\\\\/)([^\\\"&?\\\\/\\\\s]{11})/;\\n const match = url.match(pattern);\\n return match ? match[1] : null;\\n};\\n\\n// Input URL from previous node\\nconst youtubeUrl = items[0].json.youtubeUrl; // Adjust this based on your workflow\\n\\n// Process the URL and return the video ID\\nreturn [{\\n json: {\\n videoId: extractYoutubeId(youtubeUrl)\\n }\\n}];\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"a4171c3e-1ff2-40de-af7f-b3971a1ebe79\",\n \"name\": \"Get YouTube Video\",\n \"type\": \"n8n-nodes-base.youTube\",\n \"position\": [\n 600,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"videoId\": \"={{ $json.videoId }}\",\n \"resource\": \"video\",\n \"operation\": \"get\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"73e6bfc5-8b62-4880-acd4-292f2f692540\",\n \"name\": \"gpt-4o-mini\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 620,\n 440\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ea14e296-b30c-46f7-b283-746822ae1af4\",\n \"name\": \"Summarize & Analyze Transcript\",\n \"type\": \"@n8n/n8n-nodes-langchain.chainLlm\",\n \"position\": [\n 600,\n 260\n ],\n \"parameters\": {\n \"text\": \"=Please analyze the given text and create a structured summary following these guidelines:\\n\\n1. Break down the content into main topics using Level 2 headers (##)\\n2. Under each header:\\n - List only the most essential concepts and key points\\n - Use bullet points for clarity\\n - Keep explanations concise\\n - Preserve technical accuracy\\n - Highlight key terms in bold\\n3. Organize the information in this sequence:\\n - Definition/Background\\n - Main characteristics\\n - Implementation details\\n - Advantages/Disadvantages\\n4. Format requirements:\\n - Use markdown formatting\\n - Keep bullet points simple (no nesting)\\n - Bold important terms using **term**\\n - Use tables for comparisons\\n - Include relevant technical details\\n\\nPlease provide a clear, structured summary that captures the core concepts while maintaining technical accuracy.\\n\\nHere is the text: {{ $json.concatenated_text\\n }}\",\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.4\n },\n {\n \"id\": \"90e3488f-f854-483e-9106-a5760d0c0457\",\n \"name\": \"Concatenate\",\n \"type\": \"n8n-nodes-base.summarize\",\n \"position\": [\n 400,\n 260\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldsToSummarize\": {\n \"values\": [\n {\n \"field\": \"text\",\n \"separateBy\": \" \",\n \"aggregation\": \"concatenate\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9c5c249c-5eeb-4433-ba93-ace4611f4858\",\n \"name\": \"Response Object\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 960,\n 260\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"bf132004-6636-411f-9d85-0c696fda84c4\",\n \"name\": \"summary\",\n \"type\": \"string\",\n \"value\": \"={{ $json.text }}\"\n },\n {\n \"id\": \"63c8d0e3-685c-488a-9b45-363cf52479ea\",\n \"name\": \"topics\",\n \"type\": \"array\",\n \"value\": \"=[]\"\n },\n {\n \"id\": \"171f30cf-34e9-42f3-8735-814024bfde0b\",\n \"name\": \"title\",\n \"type\": \"string\",\n \"value\": \"={{ $('Get YouTube Video').item.json.snippet.title }}\"\n },\n {\n \"id\": \"7f26f5a3-e695-49d1-b1e8-9260c31f1b3d\",\n \"name\": \"description\",\n \"type\": \"string\",\n \"value\": \"={{ $('Get YouTube Video').item.json.snippet.description }}\"\n },\n {\n \"id\": \"d0594232-cb39-453c-b015-3b039c098e1f\",\n \"name\": \"id\",\n \"type\": \"string\",\n \"value\": \"={{ $('Get YouTube Video').item.json.id }}\"\n },\n {\n \"id\": \"17b6ca08-ce89-4467-bd25-0d2d182f7a8b\",\n \"name\": \"youtubeUrl\",\n \"type\": \"string\",\n \"value\": \"={{ $('Webhook').item.json.body.youtubeUrl }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Get YouTube URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Concatenate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Concatenate\": {\n \"main\": [\n [\n {\n \"node\": \"Summarize & Analyze Transcript\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"gpt-4o-mini\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Summarize & Analyze Transcript\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get YouTube URL\": {\n \"main\": [\n [\n {\n \"node\": \"YouTube Video ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Response Object\": {\n \"main\": [\n [\n {\n \"node\": \"Respond to Webhook\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Telegram\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"YouTube Video ID\": {\n \"main\": [\n [\n {\n \"node\": \"Get YouTube Video\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Summarize & Analyze Transcript\": {\n \"main\": [\n [\n {\n \"node\": \"Response Object\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
27
0
1
false
combined_workflows.json
{ "input": "This workflow extracts a YouTube video's transcript, summarizes it using an AI, and sends the summary and video information to Telegram.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6028, "processed_size": 6028, "processed_timestamp": "2025-04-09T03:08:37.967105", "timestamp": "2025-04-09T02:36:32.603491", "token_count": 3383, "tokens": 575, "workflow_chunk_info": { "is_truncated": false, "original_size": 6028, "processed_size": 6028, "workflow_hash": "a0acdc92bd033eda2855bc56475a7d3f" }, "workflow_hash": "a0acdc92bd033eda2855bc56475a7d3f" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To create a chat interface that allows users to interact with a local language model (Ollama) within the n8n platform. Analyze this workflow: ```json { "id": "af8RV5b2TWB2LclA", "meta": { "instanceId": "95f2ab28b3dabb8da5d47aa5145b95fe3845f47b20d6343dd5256b6a28ba8fab", "templateCredsSetupCompleted": true }, "name": "Chat with local LLMs using n8n and Ollama", "tags": [], "nodes": [ { "id": "475385fa-28f3-45c4-bd1a-10dde79f74f2", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 700, 460 ], "webhookId": "ebdeba3f-6b4f-49f3-ba0a-8253dd226161", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "61133dc6-dcd9-44ff-85f2-5d8cc2ce813e", "name": "Ollama Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOllama", "position": [ 900, 680 ], "parameters": { "options": {} }, "credentials": { "ollamaApi": { "id": "MyYvr1tcNQ4e7M6l", "name": "Local Ollama" } }, "typeVersion": 1 }, { "id": "3e89571f-7c87-44c6-8cfd-4903d5e1cdc5", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 160, 80 ], "parameters": { "width": 485, "height": 473, "content": "## Chat with local LLMs using n8n and Ollama\nThis n8n workflow allows you to seamlessly interact with your self-hosted Large Language Models (LLMs) through a user-friendly chat interface. By connecting to Ollama, a powerful tool for managing local LLMs, you can send prompts and receive AI-generated responses directly within n8n.\n\n### How it works\n1. When chat message received: Captures the user's input from the chat interface.\n2. Chat LLM Chain: Sends the input to the Ollama server and receives the AI-generated response.\n3. Delivers the LLM's response back to the chat interface.\n\n### Set up steps\n* Make sure Ollama is installed and running on your machine before executing this workflow.\n* Edit the Ollama address if different from the default.\n" }, "typeVersion": 1 }, { "id": "9345cadf-a72e-4d3d-b9f0-d670744065fe", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1040, 660 ], "parameters": { "color": 6, "width": 368, "height": 258, "content": "## Ollama setup\n* Connect to your local Ollama, usually on http://localhost:11434\n* If running in Docker, make sure that the n8n container has access to the host's network in order to connect to Ollama. You can do this by passing `--net=host` option when starting the n8n Docker container" }, "typeVersion": 1 }, { "id": "eeffdd4e-6795-4ebc-84f7-87b5ac4167d9", "name": "Chat LLM Chain", "type": "@n8n/n8n-nodes-langchain.chainLlm", "position": [ 920, 460 ], "parameters": {}, "typeVersion": 1.4 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "3af03daa-e085-4774-8676-41578a4cba2d", "connections": { "Ollama Chat Model": { "ai_languageModel": [ [ { "node": "Chat LLM Chain", "type": "ai_languageModel", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "Chat LLM Chain", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"af8RV5b2TWB2LclA\",\n \"meta\": {\n \"instanceId\": \"95f2ab28b3dabb8da5d47aa5145b95fe3845f47b20d6343dd5256b6a28ba8fab\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"Chat with local LLMs using n8n and Ollama\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"475385fa-28f3-45c4-bd1a-10dde79f74f2\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 700,\n 460\n ],\n \"webhookId\": \"ebdeba3f-6b4f-49f3-ba0a-8253dd226161\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"61133dc6-dcd9-44ff-85f2-5d8cc2ce813e\",\n \"name\": \"Ollama Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOllama\",\n \"position\": [\n 900,\n 680\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"ollamaApi\": {\n \"id\": \"MyYvr1tcNQ4e7M6l\",\n \"name\": \"Local Ollama\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3e89571f-7c87-44c6-8cfd-4903d5e1cdc5\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 80\n ],\n \"parameters\": {\n \"width\": 485,\n \"height\": 473,\n \"content\": \"## Chat with local LLMs using n8n and Ollama\\nThis n8n workflow allows you to seamlessly interact with your self-hosted Large Language Models (LLMs) through a user-friendly chat interface. By connecting to Ollama, a powerful tool for managing local LLMs, you can send prompts and receive AI-generated responses directly within n8n.\\n\\n### How it works\\n1. When chat message received: Captures the user's input from the chat interface.\\n2. Chat LLM Chain: Sends the input to the Ollama server and receives the AI-generated response.\\n3. Delivers the LLM's response back to the chat interface.\\n\\n### Set up steps\\n* Make sure Ollama is installed and running on your machine before executing this workflow.\\n* Edit the Ollama address if different from the default.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9345cadf-a72e-4d3d-b9f0-d670744065fe\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1040,\n 660\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 368,\n \"height\": 258,\n \"content\": \"## Ollama setup\\n* Connect to your local Ollama, usually on http://localhost:11434\\n* If running in Docker, make sure that the n8n container has access to the host's network in order to connect to Ollama. You can do this by passing `--net=host` option when starting the n8n Docker container\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eeffdd4e-6795-4ebc-84f7-87b5ac4167d9\",\n \"name\": \"Chat LLM Chain\",\n \"type\": \"@n8n/n8n-nodes-langchain.chainLlm\",\n \"position\": [\n 920,\n 460\n ],\n \"parameters\": {},\n \"typeVersion\": 1.4\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"3af03daa-e085-4774-8676-41578a4cba2d\",\n \"connections\": {\n \"Ollama Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Chat LLM Chain\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Chat LLM Chain\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
28
0
1
false
combined_workflows.json
{ "input": "To create a chat interface that allows users to interact with a local language model (Ollama) within the n8n platform.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 2797, "processed_size": 2797, "processed_timestamp": "2025-04-09T03:08:37.973107", "timestamp": "2025-04-09T02:36:32.671808", "token_count": 1503, "tokens": 311, "workflow_chunk_info": { "is_truncated": false, "original_size": 2797, "processed_size": 2797, "workflow_hash": "c491040022bbc09929b02786014f8c8d" }, "workflow_hash": "c491040022bbc09929b02786014f8c8d" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow extracts website content, uses OpenAI to analyze it and generate company insights (value proposition, industry, target audience, and market), and then updates a Google Sheet with the results. Analyze this workflow: ```json { "meta": { "instanceId": "f0a68da631efd4ed052a324b63ff90f7a844426af0398a68338f44245d1dd9e5" }, "nodes": [ { "id": "04750e9b-6ce3-401b-89e7-f1f17f3a4a28", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ -180, 300 ], "parameters": {}, "typeVersion": 1 }, { "id": "7a8bb997-5a2d-4ee0-a1ca-bebe9fe32bc2", "name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "position": [ 640, 460 ], "parameters": { "url": "=https://www.{{ $node[\"Split In Batches\"].json[\"Domain\"] }}", "options": { "redirect": { "redirect": { "followRedirects": true } } } }, "typeVersion": 3, "continueOnFail": true }, { "id": "6409f0c4-bf93-4a1d-a74c-e294fb39895f", "name": "HTML Extract", "type": "n8n-nodes-base.htmlExtract", "position": [ 820, 460 ], "parameters": { "options": { "trimValues": false }, "extractionValues": { "values": [ { "key": "body", "cssSelector": "html" } ] } }, "typeVersion": 1, "continueOnFail": true }, { "id": "f45fcc6a-9ccd-43c9-9eaf-1797768e1e62", "name": "OpenAI", "type": "n8n-nodes-base.openAi", "position": [ 1140, 460 ], "parameters": { "prompt": "=This is the content of the website {{ $node[\"Split In Batches\"].json[\"Domain\"] }}:\"{{ $json[\"contentShort\"] }}\"\n\nIn a JSON format:\n\n- Give me the value proposition of the company. In less than 25 words. In English. Casual Tone. Format is: \"[Company Name] helps [target audience] [achieve desired outcome] and [additional benefit]\"\n\n- Give me the industry of the company. (Classify using this industry list: [Agriculture, Arts, Construction, Consumer Goods, Education, Entertainment, Finance, Other, Health Care, Legal, Manufacturing, Media & Communications, Public Administration, Advertisements, Real Estate, Recreation & Travel, Retail, Software, Transportation & Logistics, Wellness & Fitness] if it's ambiguous between Sofware and Consumer Goods, prefer Consumer Goods)\n\n- Guess the target audience of each company.(Classify and choose 1 from this list: [sales teams, marketing teams, HR teams, customer Service teams, consumers, C-levels] Write it in lowercase)\n\n- Tell me if they are B2B or B2C\n\nformat should be:\n{\"value_proposition\": value_proposition,\n\"industry\": industry,\n\"target_audience\": target_audience, \n\"market\": market }\n\nJSON:", "options": { "topP": 1, "maxTokens": 120, "temperature": 0 } }, "credentials": { "openAiApi": { "id": "67", "name": "Lucas Open AI" } }, "typeVersion": 1, "continueOnFail": true }, { "id": "8de6c3d4-316f-4e00-a9f5-a4deefce90b3", "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 1600, 320 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "mergeByPosition" }, "typeVersion": 2 }, { "id": "669f888e-1416-4291-a854-07ffbbbfcab1", "name": "Clean Content", "type": "n8n-nodes-base.code", "position": [ 980, 460 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "if ($input.item.json.body){\n\n\n\n$input.item.json.content = $input.item.json.body.replaceAll('/^\\s+|\\s+$/g', '').replace('/(\\r\\n|\\n|\\r)/gm', \"\").replace(/\\s+/g, ' ')\n\n\n $input.item.json.contentShort = $input.item.json.content.slice(0, 10000)\n}\n\n\n\n\nreturn $input.item" }, "executeOnce": false, "typeVersion": 1, "continueOnFail": true, "alwaysOutputData": true }, { "id": "dbd5f866-2f5e-4adf-b1b5-a27b08c0425a", "name": "Update Google Sheets", "type": "n8n-nodes-base.googleSheets", "position": [ 1840, 320 ], "parameters": { "options": {}, "fieldsUi": { "values": [ { "column": "Market", "fieldValue": "={{ $json[\"market\"] }}" }, { "column": "Industry", "fieldValue": "={{ $json[\"industry\"] }}" }, { "column": "Value Proposition", "fieldValue": "={{ $json[\"value_proposition\"] }}" }, { "column": "Target Audience", "fieldValue": "={{ $json[\"target_audience\"] }}" } ] }, "operation": "update", "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/13h8HPWKha5kZHDeKxAPQvQqAOonof5cgpxzh79tIQfY/edit#gid=0", "cachedResultName": "Sheet1" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/18iZ59I0q2AeElqcEpyJECNlSv4M6iJll9PQzXQkqEUk/edit#gid=0", "__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)" }, "valueToMatchOn": "={{ $json[\"Domain\"] }}", "columnToMatchOn": "Domain" }, "credentials": { "googleSheetsOAuth2Api": { "id": "2", "name": "Google Sheets account lucas" } }, "typeVersion": 3 }, { "id": "f8bf8b70-6070-447b-af22-4d4e1ffe3539", "name": "Parse JSON", "type": "n8n-nodes-base.code", "position": [ 1300, 460 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "// Add a new field called 'myNewField' to the\n// JSON of the item\n$input.item.json.value_proposition=JSON.parse($input.item.json.text).value_proposition\n\n$input.item.json.industry=JSON.parse($input.item.json.text).industry\n\n$input.item.json.market=JSON.parse($input.item.json.text).market\n\n$input.item.json.target_audience=JSON.parse($input.item.json.text).target_audience\n\nreturn $input.item;" }, "typeVersion": 1 }, { "id": "2754c6e1-9cf6-47d4-ad97-0797ec9155df", "name": "Read Google Sheets", "type": "n8n-nodes-base.googleSheets", "position": [ 40, 300 ], "parameters": { "options": {}, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/13h8HPWKha5kZHDeKxAPQvQqAOonof5cgpxzh79tIQfY/edit#gid=0", "cachedResultName": "Sheet1" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/18iZ59I0q2AeElqcEpyJECNlSv4M6iJll9PQzXQkqEUk/edit#gid=0", "__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "2", "name": "Google Sheets account lucas" } }, "typeVersion": 3 }, { "id": "c2b93428-0dcc-4c02-bb81-496c12442284", "name": "Split In Batches", "type": "n8n-nodes-base.splitInBatches", "position": [ 260, 300 ], "parameters": { "options": {} }, "typeVersion": 1 }, { "id": "eccf1dc8-a0bb-40f6-9471-95eac8020b02", "name": "Wait", "type": "n8n-nodes-base.wait", "position": [ 2060, 560 ], "webhookId": "d44bc024-1c21-44e0-b2b4-5cff6fb9f402", "parameters": { "unit": "seconds" }, "typeVersion": 1 } ], "connections": { "Wait": { "main": [ [ { "node": "Split In Batches", "type": "main", "index": 0 } ] ] }, "Merge": { "main": [ [ { "node": "Update Google Sheets", "type": "main", "index": 0 } ] ] }, "OpenAI": { "main": [ [ { "node": "Parse JSON", "type": "main", "index": 0 } ] ] }, "Parse JSON": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "HTML Extract": { "main": [ [ { "node": "Clean Content", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "HTML Extract", "type": "main", "index": 0 } ] ] }, "Clean Content": { "main": [ [ { "node": "OpenAI", "type": "main", "index": 0 } ] ] }, "Split In Batches": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 }, { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Read Google Sheets": { "main": [ [ { "node": "Split In Batches", "type": "main", "index": 0 } ] ] }, "Update Google Sheets": { "main": [ [ { "node": "Wait", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Read Google Sheets", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"f0a68da631efd4ed052a324b63ff90f7a844426af0398a68338f44245d1dd9e5\"\n },\n \"nodes\": [\n {\n \"id\": \"04750e9b-6ce3-401b-89e7-f1f17f3a4a28\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -180,\n 300\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"7a8bb997-5a2d-4ee0-a1ca-bebe9fe32bc2\",\n \"name\": \"HTTP Request\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 640,\n 460\n ],\n \"parameters\": {\n \"url\": \"=https://www.{{ $node[\\\"Split In Batches\\\"].json[\\\"Domain\\\"] }}\",\n \"options\": {\n \"redirect\": {\n \"redirect\": {\n \"followRedirects\": true\n }\n }\n }\n },\n \"typeVersion\": 3,\n \"continueOnFail\": true\n },\n {\n \"id\": \"6409f0c4-bf93-4a1d-a74c-e294fb39895f\",\n \"name\": \"HTML Extract\",\n \"type\": \"n8n-nodes-base.htmlExtract\",\n \"position\": [\n 820,\n 460\n ],\n \"parameters\": {\n \"options\": {\n \"trimValues\": false\n },\n \"extractionValues\": {\n \"values\": [\n {\n \"key\": \"body\",\n \"cssSelector\": \"html\"\n }\n ]\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"f45fcc6a-9ccd-43c9-9eaf-1797768e1e62\",\n \"name\": \"OpenAI\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1140,\n 460\n ],\n \"parameters\": {\n \"prompt\": \"=This is the content of the website {{ $node[\\\"Split In Batches\\\"].json[\\\"Domain\\\"] }}:\\\"{{ $json[\\\"contentShort\\\"] }}\\\"\\n\\nIn a JSON format:\\n\\n- Give me the value proposition of the company. In less than 25 words. In English. Casual Tone. Format is: \\\"[Company Name] helps [target audience] [achieve desired outcome] and [additional benefit]\\\"\\n\\n- Give me the industry of the company. (Classify using this industry list: [Agriculture, Arts, Construction, Consumer Goods, Education, Entertainment, Finance, Other, Health Care, Legal, Manufacturing, Media & Communications, Public Administration, Advertisements, Real Estate, Recreation & Travel, Retail, Software, Transportation & Logistics, Wellness & Fitness] if it's ambiguous between Sofware and Consumer Goods, prefer Consumer Goods)\\n\\n- Guess the target audience of each company.(Classify and choose 1 from this list: [sales teams, marketing teams, HR teams, customer Service teams, consumers, C-levels] Write it in lowercase)\\n\\n- Tell me if they are B2B or B2C\\n\\nformat should be:\\n{\\\"value_proposition\\\": value_proposition,\\n\\\"industry\\\": industry,\\n\\\"target_audience\\\": target_audience, \\n\\\"market\\\": market }\\n\\nJSON:\",\n \"options\": {\n \"topP\": 1,\n \"maxTokens\": 120,\n \"temperature\": 0\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"67\",\n \"name\": \"Lucas Open AI\"\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"8de6c3d4-316f-4e00-a9f5-a4deefce90b3\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1600,\n 320\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combinationMode\": \"mergeByPosition\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"669f888e-1416-4291-a854-07ffbbbfcab1\",\n \"name\": \"Clean Content\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 980,\n 460\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"if ($input.item.json.body){\\n\\n\\n\\n$input.item.json.content = $input.item.json.body.replaceAll('/^\\\\s+|\\\\s+$/g', '').replace('/(\\\\r\\\\n|\\\\n|\\\\r)/gm', \\\"\\\").replace(/\\\\s+/g, ' ')\\n\\n\\n $input.item.json.contentShort = $input.item.json.content.slice(0, 10000)\\n}\\n\\n\\n\\n\\nreturn $input.item\"\n },\n \"executeOnce\": false,\n \"typeVersion\": 1,\n \"continueOnFail\": true,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"dbd5f866-2f5e-4adf-b1b5-a27b08c0425a\",\n \"name\": \"Update Google Sheets\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 1840,\n 320\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldsUi\": {\n \"values\": [\n {\n \"column\": \"Market\",\n \"fieldValue\": \"={{ $json[\\\"market\\\"] }}\"\n },\n {\n \"column\": \"Industry\",\n \"fieldValue\": \"={{ $json[\\\"industry\\\"] }}\"\n },\n {\n \"column\": \"Value Proposition\",\n \"fieldValue\": \"={{ $json[\\\"value_proposition\\\"] }}\"\n },\n {\n \"column\": \"Target Audience\",\n \"fieldValue\": \"={{ $json[\\\"target_audience\\\"] }}\"\n }\n ]\n },\n \"operation\": \"update\",\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/13h8HPWKha5kZHDeKxAPQvQqAOonof5cgpxzh79tIQfY/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18iZ59I0q2AeElqcEpyJECNlSv4M6iJll9PQzXQkqEUk/edit#gid=0\",\n \"__regex\": \"https:\\\\/\\\\/(?:drive|docs)\\\\.google\\\\.com\\\\/\\\\w+\\\\/d\\\\/([0-9a-zA-Z\\\\-_]+)(?:\\\\/.*|)\"\n },\n \"valueToMatchOn\": \"={{ $json[\\\"Domain\\\"] }}\",\n \"columnToMatchOn\": \"Domain\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"2\",\n \"name\": \"Google Sheets account lucas\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f8bf8b70-6070-447b-af22-4d4e1ffe3539\",\n \"name\": \"Parse JSON\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1300,\n 460\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"// Add a new field called 'myNewField' to the\\n// JSON of the item\\n$input.item.json.value_proposition=JSON.parse($input.item.json.text).value_proposition\\n\\n$input.item.json.industry=JSON.parse($input.item.json.text).industry\\n\\n$input.item.json.market=JSON.parse($input.item.json.text).market\\n\\n$input.item.json.target_audience=JSON.parse($input.item.json.text).target_audience\\n\\nreturn $input.item;\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2754c6e1-9cf6-47d4-ad97-0797ec9155df\",\n \"name\": \"Read Google Sheets\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 40,\n 300\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/13h8HPWKha5kZHDeKxAPQvQqAOonof5cgpxzh79tIQfY/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18iZ59I0q2AeElqcEpyJECNlSv4M6iJll9PQzXQkqEUk/edit#gid=0\",\n \"__regex\": \"https:\\\\/\\\\/(?:drive|docs)\\\\.google\\\\.com\\\\/\\\\w+\\\\/d\\\\/([0-9a-zA-Z\\\\-_]+)(?:\\\\/.*|)\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"2\",\n \"name\": \"Google Sheets account lucas\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"c2b93428-0dcc-4c02-bb81-496c12442284\",\n \"name\": \"Split In Batches\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n 260,\n 300\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eccf1dc8-a0bb-40f6-9471-95eac8020b02\",\n \"name\": \"Wait\",\n \"type\": \"n8n-nodes-base.wait\",\n \"position\": [\n 2060,\n 560\n ],\n \"webhookId\": \"d44bc024-1c21-44e0-b2b4-5cff6fb9f402\",\n \"parameters\": {\n \"unit\": \"seconds\"\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Wait\": {\n \"main\": [\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Update Google Sheets\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI\": {\n \"main\": [\n [\n {\n \"node\": \"Parse JSON\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Parse JSON\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"HTML Extract\": {\n \"main\": [\n [\n {\n \"node\": \"Clean Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"HTTP Request\": {\n \"main\": [\n [\n {\n \"node\": \"HTML Extract\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Clean Content\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split In Batches\": {\n \"main\": [\n [\n {\n \"node\": \"HTTP Request\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Google Sheets\": {\n \"main\": [\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Google Sheets\": {\n \"main\": [\n [\n {\n \"node\": \"Wait\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Read Google Sheets\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
29
0
1
false
combined_workflows.json
{ "input": "The workflow extracts website content, uses OpenAI to analyze it and generate company insights (value proposition, industry, target audience, and market), and then updates a Google Sheet with the results.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7173, "processed_size": 7173, "processed_timestamp": "2025-04-09T03:08:37.994071", "timestamp": "2025-04-09T02:36:32.733709", "token_count": 3914, "tokens": 607, "workflow_chunk_info": { "is_truncated": false, "original_size": 7173, "processed_size": 7173, "workflow_hash": "350b18163bf4b4529c1eb94dd88484de" }, "workflow_hash": "350b18163bf4b4529c1eb94dd88484de" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow creates a Telegram bot that interacts with users using AI, responding to text messages and generating images based on user input. Analyze this workflow: ```json { "id": "177", "meta": { "instanceId": "dfdeafd1c3ed2ee08eeab8c2fa0c3f522066931ed8138ccd35dc20a1e69decd3" }, "name": "Telegram AI-bot", "tags": [ { "id": "15", "name": "tutorial", "createdAt": "2022-10-04T20:07:25.607Z", "updatedAt": "2022-10-04T20:07:25.607Z" } ], "nodes": [ { "id": "ea71a467-a646-4aca-b72e-cef1249c74e2", "name": "Telegram Trigger", "type": "n8n-nodes-base.telegramTrigger", "position": [ 20, 340 ], "webhookId": "51942fbb-ca0e-4ec4-9423-5fcc7d3c4281", "parameters": { "updates": [ "*" ], "additionalFields": {} }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram bot" } }, "typeVersion": 1 }, { "id": "1cbe43d4-ea8b-4178-bc10-4bfad7abe143", "name": "CheckCommand", "type": "n8n-nodes-base.switch", "position": [ 980, 360 ], "parameters": { "rules": { "rules": [ { "value2": "/", "operation": "notStartsWith" }, { "output": 1, "value2": "/start", "operation": "startsWith" }, { "output": 2, "value2": "=/image ", "operation": "startsWith" } ] }, "value1": "={{ $json.message?.text }}", "dataType": "string", "fallbackOutput": 3 }, "typeVersion": 1 }, { "id": "074e907f-634b-4242-b669-33fa064f8472", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1600, 581.661764705882 ], "parameters": { "width": 316.1071428571428, "height": 231.22373949579838, "content": "## Error fallback for unsupported commands" }, "typeVersion": 1 }, { "id": "2aa961b8-f0af-4d5c-a6af-1be56ea4b2e6", "name": "Settings", "type": "n8n-nodes-base.set", "position": [ 380, 340 ], "parameters": { "values": { "number": [ { "name": "model_temperature", "value": 0.8 }, { "name": "token_length", "value": 500 } ], "string": [ { "name": "system_command", "value": "=You are a friendly chatbot. User name is {{ $json?.message?.from?.first_name }}. User system language is {{ $json?.message?.from?.language_code }}. First, detect user text language. Next, provide your reply in the same language. Include several suitable emojis in your answer." }, { "name": "bot_typing", "value": "={{ $json?.message?.text.startsWith('/image') ? \"upload_photo\" : \"typing\" }}" } ] }, "options": {} }, "typeVersion": 2 }, { "id": "2d2fe268-1e3e-483b-847c-4412e586c1ca", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1240, -240 ], "parameters": { "width": 330.5019024637719, "height": 233, "content": "## Chatbot mode by default\n### (when no command is provided)" }, "typeVersion": 1 }, { "id": "09a9c0b4-ac6e-46eb-b2e0-ef2b55e94ada", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1240, 20 ], "parameters": { "width": 330.7863484403046, "height": 219.892857142857, "content": "## Welcome message\n### /start" }, "typeVersion": 1 }, { "id": "088cffee-5720-488b-a4ec-cfdccbf77e75", "name": "Chat_mode", "type": "n8n-nodes-base.openAi", "position": [ 1340, -160 ], "parameters": { "model": "gpt-4", "prompt": { "messages": [ { "role": "system", "content": "={{ $json.system_command }}" }, { "content": "={{ $json.message.text }}" } ] }, "options": { "maxTokens": "={{ $json.token_length }}", "temperature": "={{ $json.model_temperature }}" }, "resource": "chat" }, "credentials": { "openAiApi": { "id": "63", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "41248697-6474-4a8f-a8b8-038c96465948", "name": "Greeting", "type": "n8n-nodes-base.openAi", "position": [ 1340, 80 ], "parameters": { "prompt": { "messages": [ { "role": "system", "content": "={{ $json.system_command }}" }, { "content": "=This is the first message from a user. Please welcome a new user in `{{ $json.message.from.language_code }}` language" } ] }, "options": { "maxTokens": "={{ $json.token_length }}", "temperature": "={{ $json.model_temperature }}" }, "resource": "chat" }, "credentials": { "openAiApi": { "id": "63", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "20c2e7fa-5d65-441b-8d1d-a8d46c624964", "name": "Text reply", "type": "n8n-nodes-base.telegram", "position": [ 1700, -40 ], "parameters": { "text": "={{ $json.message.content }}", "chatId": "={{ $('Settings').first().json.message.from.id }}", "additionalFields": { "parse_mode": "Markdown" } }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram bot" } }, "typeVersion": 1 }, { "id": "30321276-ebe1-41ac-b420-9dab8daa405b", "name": "Send Typing action", "type": "n8n-nodes-base.telegram", "position": [ 580, 480 ], "parameters": { "action": "={{ $json.bot_typing }}", "chatId": "={{ $json.message.from.id }}", "operation": "sendChatAction" }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram bot" } }, "typeVersion": 1 }, { "id": "7d7ff2e8-b0ca-4638-a056-f7b4e2e6273d", "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 800, 360 ], "parameters": { "mode": "chooseBranch" }, "typeVersion": 2.1 }, { "id": "656bab5e-b7f7-47a1-8e75-4a17d2070290", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1240, 280 ], "parameters": { "width": 329.7428571428562, "height": 233.8785714285713, "content": "## Create an image\n### /image + request" }, "typeVersion": 1 }, { "id": "ca2111d2-463a-4ef0-9436-ee09598dbf07", "name": "Create an image", "type": "n8n-nodes-base.openAi", "position": [ 1340, 360 ], "parameters": { "prompt": "={{ $json.message.text.split(' ').slice(1).join(' ') }}", "options": { "n": 1, "size": "512x512" }, "resource": "image", "responseFormat": "imageUrl" }, "credentials": { "openAiApi": { "id": "63", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "e91d616b-1d5e-40e8-8468-2d0b2dda4cf7", "name": "Send error message", "type": "n8n-nodes-base.telegram", "position": [ 1700, 660 ], "parameters": { "text": "=Sorry, {{ $json.message.from.first_name }}! This command is not supported yet. Please type some text to a chat bot or try this command:\n/image \\[your prompt]\n\nEnter the command, then space and provide your request. Example:\n\n`/image a picture or a cute little kitten with big eyes. Miyazaki studio ghibli style`", "chatId": "={{ $json.message.from.id }}", "additionalFields": { "parse_mode": "Markdown" } }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram bot" } }, "typeVersion": 1 }, { "id": "125e27d2-b03b-4f02-9dd1-8fc81ecf0b6b", "name": "Send image", "type": "n8n-nodes-base.telegram", "position": [ 1700, 360 ], "parameters": { "file": "={{ $json.url }}", "chatId": "={{ $('Settings').first().json.message.from.id }}", "operation": "sendPhoto", "additionalFields": {} }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram bot" } }, "typeVersion": 1 }, { "id": "730a51ac-223e-4956-be7f-166eadb6ed81", "name": "PreProcessing", "type": "n8n-nodes-base.set", "position": [ 200, 340 ], "parameters": { "values": { "string": [ { "name": "message.text", "value": "={{ $json?.message?.text || \"\" }}" } ] }, "options": { "dotNotation": true } }, "typeVersion": 2 } ], "active": true, "pinData": {}, "settings": { "callerPolicy": "workflowsFromSameOwner", "saveManualExecutions": true, "saveDataSuccessExecution": "all" }, "versionId": "6ab99e3f-845d-42cc-847b-37cf19a72e93", "connections": { "Merge": { "main": [ [ { "node": "CheckCommand", "type": "main", "index": 0 } ] ] }, "Greeting": { "main": [ [ { "node": "Text reply", "type": "main", "index": 0 } ] ] }, "Settings": { "main": [ [ { "node": "Send Typing action", "type": "main", "index": 0 }, { "node": "Merge", "type": "main", "index": 0 } ]
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"177\",\n \"meta\": {\n \"instanceId\": \"dfdeafd1c3ed2ee08eeab8c2fa0c3f522066931ed8138ccd35dc20a1e69decd3\"\n },\n \"name\": \"Telegram AI-bot\",\n \"tags\": [\n {\n \"id\": \"15\",\n \"name\": \"tutorial\",\n \"createdAt\": \"2022-10-04T20:07:25.607Z\",\n \"updatedAt\": \"2022-10-04T20:07:25.607Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"ea71a467-a646-4aca-b72e-cef1249c74e2\",\n \"name\": \"Telegram Trigger\",\n \"type\": \"n8n-nodes-base.telegramTrigger\",\n \"position\": [\n 20,\n 340\n ],\n \"webhookId\": \"51942fbb-ca0e-4ec4-9423-5fcc7d3c4281\",\n \"parameters\": {\n \"updates\": [\n \"*\"\n ],\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1cbe43d4-ea8b-4178-bc10-4bfad7abe143\",\n \"name\": \"CheckCommand\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 980,\n 360\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"/\",\n \"operation\": \"notStartsWith\"\n },\n {\n \"output\": 1,\n \"value2\": \"/start\",\n \"operation\": \"startsWith\"\n },\n {\n \"output\": 2,\n \"value2\": \"=/image \",\n \"operation\": \"startsWith\"\n }\n ]\n },\n \"value1\": \"={{ $json.message?.text }}\",\n \"dataType\": \"string\",\n \"fallbackOutput\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"074e907f-634b-4242-b669-33fa064f8472\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1600,\n 581.661764705882\n ],\n \"parameters\": {\n \"width\": 316.1071428571428,\n \"height\": 231.22373949579838,\n \"content\": \"## Error fallback for unsupported commands\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2aa961b8-f0af-4d5c-a6af-1be56ea4b2e6\",\n \"name\": \"Settings\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 380,\n 340\n ],\n \"parameters\": {\n \"values\": {\n \"number\": [\n {\n \"name\": \"model_temperature\",\n \"value\": 0.8\n },\n {\n \"name\": \"token_length\",\n \"value\": 500\n }\n ],\n \"string\": [\n {\n \"name\": \"system_command\",\n \"value\": \"=You are a friendly chatbot. User name is {{ $json?.message?.from?.first_name }}. User system language is {{ $json?.message?.from?.language_code }}. First, detect user text language. Next, provide your reply in the same language. Include several suitable emojis in your answer.\"\n },\n {\n \"name\": \"bot_typing\",\n \"value\": \"={{ $json?.message?.text.startsWith('/image') ? \\\"upload_photo\\\" : \\\"typing\\\" }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"2d2fe268-1e3e-483b-847c-4412e586c1ca\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1240,\n -240\n ],\n \"parameters\": {\n \"width\": 330.5019024637719,\n \"height\": 233,\n \"content\": \"## Chatbot mode by default\\n### (when no command is provided)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"09a9c0b4-ac6e-46eb-b2e0-ef2b55e94ada\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1240,\n 20\n ],\n \"parameters\": {\n \"width\": 330.7863484403046,\n \"height\": 219.892857142857,\n \"content\": \"## Welcome message\\n### /start\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"088cffee-5720-488b-a4ec-cfdccbf77e75\",\n \"name\": \"Chat_mode\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1340,\n -160\n ],\n \"parameters\": {\n \"model\": \"gpt-4\",\n \"prompt\": {\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"={{ $json.system_command }}\"\n },\n {\n \"content\": \"={{ $json.message.text }}\"\n }\n ]\n },\n \"options\": {\n \"maxTokens\": \"={{ $json.token_length }}\",\n \"temperature\": \"={{ $json.model_temperature }}\"\n },\n \"resource\": \"chat\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"41248697-6474-4a8f-a8b8-038c96465948\",\n \"name\": \"Greeting\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1340,\n 80\n ],\n \"parameters\": {\n \"prompt\": {\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"={{ $json.system_command }}\"\n },\n {\n \"content\": \"=This is the first message from a user. Please welcome a new user in `{{ $json.message.from.language_code }}` language\"\n }\n ]\n },\n \"options\": {\n \"maxTokens\": \"={{ $json.token_length }}\",\n \"temperature\": \"={{ $json.model_temperature }}\"\n },\n \"resource\": \"chat\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"20c2e7fa-5d65-441b-8d1d-a8d46c624964\",\n \"name\": \"Text reply\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n -40\n ],\n \"parameters\": {\n \"text\": \"={{ $json.message.content }}\",\n \"chatId\": \"={{ $('Settings').first().json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"Markdown\"\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"30321276-ebe1-41ac-b420-9dab8daa405b\",\n \"name\": \"Send Typing action\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 580,\n 480\n ],\n \"parameters\": {\n \"action\": \"={{ $json.bot_typing }}\",\n \"chatId\": \"={{ $json.message.from.id }}\",\n \"operation\": \"sendChatAction\"\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d7ff2e8-b0ca-4638-a056-f7b4e2e6273d\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 800,\n 360\n ],\n \"parameters\": {\n \"mode\": \"chooseBranch\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"656bab5e-b7f7-47a1-8e75-4a17d2070290\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1240,\n 280\n ],\n \"parameters\": {\n \"width\": 329.7428571428562,\n \"height\": 233.8785714285713,\n \"content\": \"## Create an image\\n### /image + request\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ca2111d2-463a-4ef0-9436-ee09598dbf07\",\n \"name\": \"Create an image\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1340,\n 360\n ],\n \"parameters\": {\n \"prompt\": \"={{ $json.message.text.split(' ').slice(1).join(' ') }}\",\n \"options\": {\n \"n\": 1,\n \"size\": \"512x512\"\n },\n \"resource\": \"image\",\n \"responseFormat\": \"imageUrl\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e91d616b-1d5e-40e8-8468-2d0b2dda4cf7\",\n \"name\": \"Send error message\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n 660\n ],\n \"parameters\": {\n \"text\": \"=Sorry, {{ $json.message.from.first_name }}! This command is not supported yet. Please type some text to a chat bot or try this command:\\n/image \\\\[your prompt]\\n\\nEnter the command, then space and provide your request. Example:\\n\\n`/image a picture or a cute little kitten with big eyes. Miyazaki studio ghibli style`\",\n \"chatId\": \"={{ $json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"Markdown\"\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"125e27d2-b03b-4f02-9dd1-8fc81ecf0b6b\",\n \"name\": \"Send image\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n 360\n ],\n \"parameters\": {\n \"file\": \"={{ $json.url }}\",\n \"chatId\": \"={{ $('Settings').first().json.message.from.id }}\",\n \"operation\": \"sendPhoto\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"730a51ac-223e-4956-be7f-166eadb6ed81\",\n \"name\": \"PreProcessing\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 200,\n 340\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"message.text\",\n \"value\": \"={{ $json?.message?.text || \\\"\\\" }}\"\n }\n ]\n },\n \"options\": {\n \"dotNotation\": true\n }\n },\n \"typeVersion\": 2\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"callerPolicy\": \"workflowsFromSameOwner\",\n \"saveManualExecutions\": true,\n \"saveDataSuccessExecution\": \"all\"\n },\n \"versionId\": \"6ab99e3f-845d-42cc-847b-37cf19a72e93\",\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"CheckCommand\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Greeting\": {\n \"main\": [\n [\n {\n \"node\": \"Text reply\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Settings\": {\n \"main\": [\n [\n {\n \"node\": \"Send Typing action\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Chat_mode\": {\n \"main\": [\n [\n {\n \"node\": \"Text reply\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"CheckCommand\": {\n \"main\": [\n [\n {\n \"node\": \"Chat_mode\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Greeting\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Create an image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send error message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"PreProcessing\": {\n \"main\": [\n [\n {\n \"node\": \"Settings\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create an image\": {\n \"main\": [\n [\n {\n \"node\": \"Send image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Telegram Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"PreProcessing\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Typing action\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
30
0
2
true
combined_workflows.json
{ "input": "The workflow creates a Telegram bot that interacts with users using AI, responding to text messages and generating images based on user input.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7813, "processed_size": 7813, "processed_timestamp": "2025-04-09T03:08:38.060106", "timestamp": "2025-04-09T02:36:33.447612", "token_count": 4095, "tokens": 728, "workflow_chunk_info": { "is_truncated": false, "original_size": 7813, "processed_size": 7813, "workflow_hash": "96c91268f942e4ed18ef41a0de8c557c" }, "workflow_hash": "96c91268f942e4ed18ef41a0de8c557c" }
93", "connections": { "Merge": { "main": [ [ { "node": "CheckCommand", "type": "main", "index": 0 } ] ] }, "Greeting": { "main": [ [ { "node": "Text reply", "type": "main", "index": 0 } ] ] }, "Settings": { "main": [ [ { "node": "Send Typing action", "type": "main", "index": 0 }, { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Chat_mode": { "main": [ [ { "node": "Text reply", "type": "main", "index": 0 } ] ] }, "CheckCommand": { "main": [ [ { "node": "Chat_mode", "type": "main", "index": 0 } ], [ { "node": "Greeting", "type": "main", "index": 0 } ], [ { "node": "Create an image", "type": "main", "index": 0 } ], [ { "node": "Send error message", "type": "main", "index": 0 } ] ] }, "PreProcessing": { "main": [ [ { "node": "Settings", "type": "main", "index": 0 } ] ] }, "Create an image": { "main": [ [ { "node": "Send image", "type": "main", "index": 0 } ] ] }, "Telegram Trigger": { "main": [ [ { "node": "PreProcessing", "type": "main", "index": 0 } ] ] }, "Send Typing action": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"177\",\n \"meta\": {\n \"instanceId\": \"dfdeafd1c3ed2ee08eeab8c2fa0c3f522066931ed8138ccd35dc20a1e69decd3\"\n },\n \"name\": \"Telegram AI-bot\",\n \"tags\": [\n {\n \"id\": \"15\",\n \"name\": \"tutorial\",\n \"createdAt\": \"2022-10-04T20:07:25.607Z\",\n \"updatedAt\": \"2022-10-04T20:07:25.607Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"ea71a467-a646-4aca-b72e-cef1249c74e2\",\n \"name\": \"Telegram Trigger\",\n \"type\": \"n8n-nodes-base.telegramTrigger\",\n \"position\": [\n 20,\n 340\n ],\n \"webhookId\": \"51942fbb-ca0e-4ec4-9423-5fcc7d3c4281\",\n \"parameters\": {\n \"updates\": [\n \"*\"\n ],\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1cbe43d4-ea8b-4178-bc10-4bfad7abe143\",\n \"name\": \"CheckCommand\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 980,\n 360\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"/\",\n \"operation\": \"notStartsWith\"\n },\n {\n \"output\": 1,\n \"value2\": \"/start\",\n \"operation\": \"startsWith\"\n },\n {\n \"output\": 2,\n \"value2\": \"=/image \",\n \"operation\": \"startsWith\"\n }\n ]\n },\n \"value1\": \"={{ $json.message?.text }}\",\n \"dataType\": \"string\",\n \"fallbackOutput\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"074e907f-634b-4242-b669-33fa064f8472\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1600,\n 581.661764705882\n ],\n \"parameters\": {\n \"width\": 316.1071428571428,\n \"height\": 231.22373949579838,\n \"content\": \"## Error fallback for unsupported commands\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2aa961b8-f0af-4d5c-a6af-1be56ea4b2e6\",\n \"name\": \"Settings\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 380,\n 340\n ],\n \"parameters\": {\n \"values\": {\n \"number\": [\n {\n \"name\": \"model_temperature\",\n \"value\": 0.8\n },\n {\n \"name\": \"token_length\",\n \"value\": 500\n }\n ],\n \"string\": [\n {\n \"name\": \"system_command\",\n \"value\": \"=You are a friendly chatbot. User name is {{ $json?.message?.from?.first_name }}. User system language is {{ $json?.message?.from?.language_code }}. First, detect user text language. Next, provide your reply in the same language. Include several suitable emojis in your answer.\"\n },\n {\n \"name\": \"bot_typing\",\n \"value\": \"={{ $json?.message?.text.startsWith('/image') ? \\\"upload_photo\\\" : \\\"typing\\\" }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"2d2fe268-1e3e-483b-847c-4412e586c1ca\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1240,\n -240\n ],\n \"parameters\": {\n \"width\": 330.5019024637719,\n \"height\": 233,\n \"content\": \"## Chatbot mode by default\\n### (when no command is provided)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"09a9c0b4-ac6e-46eb-b2e0-ef2b55e94ada\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1240,\n 20\n ],\n \"parameters\": {\n \"width\": 330.7863484403046,\n \"height\": 219.892857142857,\n \"content\": \"## Welcome message\\n### /start\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"088cffee-5720-488b-a4ec-cfdccbf77e75\",\n \"name\": \"Chat_mode\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1340,\n -160\n ],\n \"parameters\": {\n \"model\": \"gpt-4\",\n \"prompt\": {\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"={{ $json.system_command }}\"\n },\n {\n \"content\": \"={{ $json.message.text }}\"\n }\n ]\n },\n \"options\": {\n \"maxTokens\": \"={{ $json.token_length }}\",\n \"temperature\": \"={{ $json.model_temperature }}\"\n },\n \"resource\": \"chat\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"41248697-6474-4a8f-a8b8-038c96465948\",\n \"name\": \"Greeting\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1340,\n 80\n ],\n \"parameters\": {\n \"prompt\": {\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"={{ $json.system_command }}\"\n },\n {\n \"content\": \"=This is the first message from a user. Please welcome a new user in `{{ $json.message.from.language_code }}` language\"\n }\n ]\n },\n \"options\": {\n \"maxTokens\": \"={{ $json.token_length }}\",\n \"temperature\": \"={{ $json.model_temperature }}\"\n },\n \"resource\": \"chat\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"20c2e7fa-5d65-441b-8d1d-a8d46c624964\",\n \"name\": \"Text reply\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n -40\n ],\n \"parameters\": {\n \"text\": \"={{ $json.message.content }}\",\n \"chatId\": \"={{ $('Settings').first().json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"Markdown\"\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"30321276-ebe1-41ac-b420-9dab8daa405b\",\n \"name\": \"Send Typing action\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 580,\n 480\n ],\n \"parameters\": {\n \"action\": \"={{ $json.bot_typing }}\",\n \"chatId\": \"={{ $json.message.from.id }}\",\n \"operation\": \"sendChatAction\"\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d7ff2e8-b0ca-4638-a056-f7b4e2e6273d\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 800,\n 360\n ],\n \"parameters\": {\n \"mode\": \"chooseBranch\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"656bab5e-b7f7-47a1-8e75-4a17d2070290\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1240,\n 280\n ],\n \"parameters\": {\n \"width\": 329.7428571428562,\n \"height\": 233.8785714285713,\n \"content\": \"## Create an image\\n### /image + request\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ca2111d2-463a-4ef0-9436-ee09598dbf07\",\n \"name\": \"Create an image\",\n \"type\": \"n8n-nodes-base.openAi\",\n \"position\": [\n 1340,\n 360\n ],\n \"parameters\": {\n \"prompt\": \"={{ $json.message.text.split(' ').slice(1).join(' ') }}\",\n \"options\": {\n \"n\": 1,\n \"size\": \"512x512\"\n },\n \"resource\": \"image\",\n \"responseFormat\": \"imageUrl\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e91d616b-1d5e-40e8-8468-2d0b2dda4cf7\",\n \"name\": \"Send error message\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n 660\n ],\n \"parameters\": {\n \"text\": \"=Sorry, {{ $json.message.from.first_name }}! This command is not supported yet. Please type some text to a chat bot or try this command:\\n/image \\\\[your prompt]\\n\\nEnter the command, then space and provide your request. Example:\\n\\n`/image a picture or a cute little kitten with big eyes. Miyazaki studio ghibli style`\",\n \"chatId\": \"={{ $json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"Markdown\"\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"125e27d2-b03b-4f02-9dd1-8fc81ecf0b6b\",\n \"name\": \"Send image\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n 360\n ],\n \"parameters\": {\n \"file\": \"={{ $json.url }}\",\n \"chatId\": \"={{ $('Settings').first().json.message.from.id }}\",\n \"operation\": \"sendPhoto\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"730a51ac-223e-4956-be7f-166eadb6ed81\",\n \"name\": \"PreProcessing\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 200,\n 340\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"message.text\",\n \"value\": \"={{ $json?.message?.text || \\\"\\\" }}\"\n }\n ]\n },\n \"options\": {\n \"dotNotation\": true\n }\n },\n \"typeVersion\": 2\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"callerPolicy\": \"workflowsFromSameOwner\",\n \"saveManualExecutions\": true,\n \"saveDataSuccessExecution\": \"all\"\n },\n \"versionId\": \"6ab99e3f-845d-42cc-847b-37cf19a72e93\",\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"CheckCommand\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Greeting\": {\n \"main\": [\n [\n {\n \"node\": \"Text reply\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Settings\": {\n \"main\": [\n [\n {\n \"node\": \"Send Typing action\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Chat_mode\": {\n \"main\": [\n [\n {\n \"node\": \"Text reply\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"CheckCommand\": {\n \"main\": [\n [\n {\n \"node\": \"Chat_mode\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Greeting\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Create an image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Send error message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"PreProcessing\": {\n \"main\": [\n [\n {\n \"node\": \"Settings\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create an image\": {\n \"main\": [\n [\n {\n \"node\": \"Send image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Telegram Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"PreProcessing\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send Typing action\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
30
1
2
true
combined_workflows.json
{ "input": "The workflow creates a Telegram bot that interacts with users using AI, responding to text messages and generating images based on user input.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7813, "processed_size": 7813, "processed_timestamp": "2025-04-09T03:08:38.063106", "timestamp": "2025-04-09T02:36:33.447612", "token_count": 691, "tokens": 728, "workflow_chunk_info": { "is_truncated": false, "original_size": 7813, "processed_size": 7813, "workflow_hash": "96c91268f942e4ed18ef41a0de8c557c" }, "workflow_hash": "96c91268f942e4ed18ef41a0de8c557c" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow loads data from a Google Drive file into a Pinecone vector store and then enables a chatbot to answer questions about the data. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "1f2bb917-6d65-4cfa-9474-fc3b19a8c3bd", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -440, -120 ], "parameters": { "color": 7, "width": 918, "height": 627, "content": "### Load data into database\nFetch file from Google Drive, split it into chunks and insert into Pinecone index" }, "typeVersion": 1 }, { "id": "eabbc944-5b62-4959-8ea4-879f28e19ab8", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 740, -120 ], "parameters": { "color": 7, "width": 534, "height": 627, "content": "### Chat with database\nEmbed the incoming chat message and use it retrieve relevant chunks from the vector store. These are passed to the model to formulate an answer " }, "typeVersion": 1 }, { "id": "ab577f4d-8906-4e0c-bc62-e8a4b2610551", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -720, 240 ], "parameters": { "height": 264.61498034081166, "content": "## Try me out\n1. In Pinecone, create an index with 1536 dimensions and select it in *both* Pinecone nodes\n2. Click 'test workflow' at the bottom of the canvas to load data into the vector store\n3. Click 'chat' at the bottom of the canvas to ask questions about the data" }, "typeVersion": 1 }, { "id": "6f074b77-3441-4026-a13a-ed891a1c959b", "name": "When clicking 'Test Workflow' button", "type": "n8n-nodes-base.manualTrigger", "position": [ -700, -20 ], "parameters": {}, "typeVersion": 1 }, { "id": "0a6f8b88-9c62-4e3e-82cb-a7028bdcac45", "name": "Pinecone Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 80, -20 ], "parameters": { "mode": "insert", "options": { "clearNamespace": true }, "pineconeIndex": { "__rl": true, "mode": "id", "value": "test-index" } }, "credentials": { "pineconeApi": { "id": "OHDlDbBkaPDgpnOY", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "ae426fdc-0d58-46a6-bfe6-0f25c0e70cf1", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 560, -20 ], "webhookId": "dec328cc-f47e-4727-b1c5-7370be86a958", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "9388b413-f133-45a6-8066-cf71c0fb826c", "name": "Question & Answer", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 800, -20 ], "parameters": { "options": {} }, "typeVersion": 1.8 }, { "id": "c50e8f9b-8254-495e-9e13-62f42d22c9b0", "name": "Set Google Drive file URL", "type": "n8n-nodes-base.set", "position": [ -380, -20 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "d08ef1f5-932b-4bbb-bb02-0cbdff26a636", "name": "file_url", "type": "string", "value": "https://drive.google.com/file/d/11Koq9q53nkk0F5Y8eZgaWJUVR03I4-MM/view" } ] } }, "typeVersion": 3.4 }, { "id": "d97920ad-6b36-4981-8b9d-9d470b5c769a", "name": "Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ -180, -20 ], "parameters": { "fileId": { "__rl": true, "mode": "url", "value": "={{ $json.file_url }}" }, "options": {}, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "yOwz41gMQclOadgu", "name": "Google Drive account" } }, "typeVersion": 3 }, { "id": "742beb54-8b89-49a3-afe5-fd7e73b37044", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 180, 200 ], "parameters": { "options": {}, "dataType": "binary" }, "typeVersion": 1 }, { "id": "f75e31e9-f752-45d1-bc44-75097ec85ce6", "name": "Recursive Character Text Splitter", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 260, 320 ], "parameters": { "options": {}, "chunkSize": 3000, "chunkOverlap": 200 }, "typeVersion": 1 }, { "id": "034a2b72-f728-4978-bc18-c950f0f2c24c", "name": "Embeddings OpenAI1", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 1000, 320 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "bac883c8-4c1f-466b-b20f-d0fdf6acfc42", "name": "Embeddings OpenAI", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 60, 200 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "7b6cdba3-906b-44dd-85be-1d515337972b", "name": "Pinecone Vector Store1", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 920, 200 ], "parameters": { "mode": "retrieve-as-tool", "options": {}, "toolName": "bitcoin_paper", "pineconeIndex": { "__rl": true, "mode": "id", "value": "test-index" }, "toolDescription": "Call this tool to retrieve facts from the bitcoin whitepaper", "includeDocumentMetadata": false }, "credentials": { "pineconeApi": { "id": "OHDlDbBkaPDgpnOY", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "cf9d18a9-4c1e-4a67-8149-961b3eee374d", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 800, 200 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 } ], "pinData": {}, "connections": { "Google Drive": { "main": [ [ { "node": "Pinecone Vector Store", "type": "main", "index": 0 } ] ] }, "Embeddings OpenAI": { "ai_embedding": [ [ { "node": "Pinecone Vector Store", "type": "ai_embedding", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "Question & Answer", "type": "ai_languageModel", "index": 0 } ] ] }, "Embeddings OpenAI1": { "ai_embedding": [ [ { "node": "Pinecone Vector Store1", "type": "ai_embedding", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "Pinecone Vector Store1": { "ai_tool": [ [ { "node": "Question & Answer", "type": "ai_tool", "index": 0 } ] ] }, "Set Google Drive file URL": { "main": [ [ { "node": "Google Drive", "type": "main", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "Question & Answer", "type": "main", "index": 0 } ] ] }, "Recursive Character Text Splitter": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] }, "When clicking 'Test Workflow' button": { "main": [ [ { "node": "Set Google Drive file URL", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"1f2bb917-6d65-4cfa-9474-fc3b19a8c3bd\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -440,\n -120\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 918,\n \"height\": 627,\n \"content\": \"### Load data into database\\nFetch file from Google Drive, split it into chunks and insert into Pinecone index\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eabbc944-5b62-4959-8ea4-879f28e19ab8\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 740,\n -120\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 534,\n \"height\": 627,\n \"content\": \"### Chat with database\\nEmbed the incoming chat message and use it retrieve relevant chunks from the vector store. These are passed to the model to formulate an answer \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ab577f4d-8906-4e0c-bc62-e8a4b2610551\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -720,\n 240\n ],\n \"parameters\": {\n \"height\": 264.61498034081166,\n \"content\": \"## Try me out\\n1. In Pinecone, create an index with 1536 dimensions and select it in *both* Pinecone nodes\\n2. Click 'test workflow' at the bottom of the canvas to load data into the vector store\\n3. Click 'chat' at the bottom of the canvas to ask questions about the data\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6f074b77-3441-4026-a13a-ed891a1c959b\",\n \"name\": \"When clicking 'Test Workflow' button\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -700,\n -20\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a6f8b88-9c62-4e3e-82cb-a7028bdcac45\",\n \"name\": \"Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 80,\n -20\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {\n \"clearNamespace\": true\n },\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"test-index\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"OHDlDbBkaPDgpnOY\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ae426fdc-0d58-46a6-bfe6-0f25c0e70cf1\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 560,\n -20\n ],\n \"webhookId\": \"dec328cc-f47e-4727-b1c5-7370be86a958\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"9388b413-f133-45a6-8066-cf71c0fb826c\",\n \"name\": \"Question & Answer\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 800,\n -20\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"c50e8f9b-8254-495e-9e13-62f42d22c9b0\",\n \"name\": \"Set Google Drive file URL\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -380,\n -20\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"d08ef1f5-932b-4bbb-bb02-0cbdff26a636\",\n \"name\": \"file_url\",\n \"type\": \"string\",\n \"value\": \"https://drive.google.com/file/d/11Koq9q53nkk0F5Y8eZgaWJUVR03I4-MM/view\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"d97920ad-6b36-4981-8b9d-9d470b5c769a\",\n \"name\": \"Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -180,\n -20\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"={{ $json.file_url }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"yOwz41gMQclOadgu\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"742beb54-8b89-49a3-afe5-fd7e73b37044\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 180,\n 200\n ],\n \"parameters\": {\n \"options\": {},\n \"dataType\": \"binary\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f75e31e9-f752-45d1-bc44-75097ec85ce6\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 260,\n 320\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 200\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"034a2b72-f728-4978-bc18-c950f0f2c24c\",\n \"name\": \"Embeddings OpenAI1\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 1000,\n 320\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"bac883c8-4c1f-466b-b20f-d0fdf6acfc42\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 60,\n 200\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"7b6cdba3-906b-44dd-85be-1d515337972b\",\n \"name\": \"Pinecone Vector Store1\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 920,\n 200\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"bitcoin_paper\",\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"test-index\"\n },\n \"toolDescription\": \"Call this tool to retrieve facts from the bitcoin whitepaper\",\n \"includeDocumentMetadata\": false\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"OHDlDbBkaPDgpnOY\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cf9d18a9-4c1e-4a67-8149-961b3eee374d\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 800,\n 200\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Question & Answer\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI1\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store1\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pinecone Vector Store1\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Question & Answer\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Google Drive file URL\": {\n \"main\": [\n [\n {\n \"node\": \"Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Question & Answer\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking 'Test Workflow' button\": {\n \"main\": [\n [\n {\n \"node\": \"Set Google Drive file URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
31
0
1
false
combined_workflows.json
{ "input": "This workflow loads data from a Google Drive file into a Pinecone vector store and then enables a chatbot to answer questions about the data.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6336, "processed_size": 6336, "processed_timestamp": "2025-04-09T03:08:38.079105", "timestamp": "2025-04-09T02:36:33.534008", "token_count": 3726, "tokens": 592, "workflow_chunk_info": { "is_truncated": false, "original_size": 6336, "processed_size": 6336, "workflow_hash": "8005225fe2c73af11c06ae7741d70585" }, "workflow_hash": "8005225fe2c73af11c06ae7741d70585" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow aims to create a chatbot that answers questions based on the content of a file, providing citations for its answers. It first loads and processes the file, stores it in a vector database, and then uses OpenAI to answer user queries, referencing specific parts of the file. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "e2e61eae-6306-47db-908c-9d82758f6516", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ -660, 40 ], "parameters": {}, "typeVersion": 1 }, { "id": "a45afcc0-d780-462a-9ed7-27daf01363a7", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -500, -140 ], "parameters": { "color": 7, "width": 1086.039382705461, "height": 728.4168721167887, "content": "## 1. Setup: Fetch file from Google Drive, split it into chunks and insert into a vector database\nNote that running this part multiple times will insert multiple copies into your DB" }, "typeVersion": 1 }, { "id": "a3c56569-0728-4246-8d87-fa106d373566", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -960, -60 ], "parameters": { "height": 350.7942096493649, "content": "# Try me out\n1. In Pinecone, create an index with 1536 dimensions and select it in the two vector store nodes\n2. Populate Pinecone by clicking the 'test workflow' button below\n3. Click the 'chat' button below and enter the following:\n\n_Which email provider does the creator of Bitcoin use?_" }, "typeVersion": 1 }, { "id": "c1543b8a-dbea-42a9-a35e-e22ed86f565b", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -500, 640 ], "parameters": { "color": 7, "width": 1594, "height": 529, "content": "## 2. Chat with file, getting citations in reponse" }, "typeVersion": 1 }, { "id": "5300d5dd-4186-4402-9442-88adab4e9a89", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -480, -40 ], "parameters": { "color": 7, "width": 179.58883583572606, "height": 257.75985739596473, "content": "Will fetch the Bitcoin whitepaper, but you can change this" }, "typeVersion": 1 }, { "id": "9f707f2b-6cb2-47b8-88fc-65cfd09b6cae", "name": "Pinecone Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 80, 40 ], "parameters": { "mode": "insert", "options": {}, "pineconeIndex": { "__rl": true, "mode": "id", "value": "test-index" } }, "credentials": { "pineconeApi": { "id": "OHDlDbBkaPDgpnOY", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "a32ac59e-efdc-4ff3-92dd-be794c2be7f7", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -660, 760 ], "webhookId": "cd2703a7-f912-46fe-8787-3fb83ea116ab", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "e14145d2-0c18-4813-9555-263314cb0376", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 340, 980 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "e6863abd-d3df-4b45-9083-96b82cd46773", "name": "Set file URL in Google Drive", "type": "n8n-nodes-base.set", "position": [ -440, 40 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "dc7a70e3-9b04-404b-8892-ba0fcc4274c2", "name": "file_url", "type": "string", "value": " https://drive.google.com/file/d/11Koq9q53nkk0F5Y8eZgaWJUVR03I4-MM/view" } ] } }, "typeVersion": 3.4 }, { "id": "80d241f1-7c8a-489e-9255-84bc79ec11c7", "name": "Download file", "type": "n8n-nodes-base.googleDrive", "position": [ -220, 40 ], "parameters": { "fileId": { "__rl": true, "mode": "url", "value": "={{ $json.file_url }}" }, "options": {}, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "yOwz41gMQclOadgu", "name": "Google Drive account" } }, "typeVersion": 3 }, { "id": "8483b283-1ff4-4540-891a-09886c146e16", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 180, 240 ], "parameters": { "options": { "metadata": { "metadataValues": [ { "name": "file_url", "value": "={{ $('Set file URL in Google Drive').first().json.file_url }}" }, { "name": "file_name", "value": "={{ $('Download file').first().binary.data.fileName }}" } ] } }, "dataType": "binary" }, "typeVersion": 1 }, { "id": "c262df34-b2d9-4f48-b975-d694469e6e5a", "name": "Embeddings OpenAI2", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ -220, 980 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "45c8e8cb-a29e-48ad-985f-e0136065840f", "name": "Embeddings OpenAI", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 40, 240 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "8c852568-f100-4849-a06f-86e71733512a", "name": "Recursive Character Text Splitter", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 260, 400 ], "parameters": { "options": {}, "chunkSize": 3000, "chunkOverlap": 200 }, "typeVersion": 1 }, { "id": "319e5b2d-c648-4ef5-8238-7732c62d34f5", "name": "Set max chunks to send to model", "type": "n8n-nodes-base.set", "position": [ -420, 760 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "33f4addf-72f3-4618-a6ba-5b762257d723", "name": "chunks", "type": "number", "value": 4 } ] }, "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "91b9132e-ef51-4044-be1b-f391aeeb467c", "name": "Get top chunks matching query", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ -220, 760 ], "parameters": { "mode": "load", "topK": "={{ $json.chunks }}", "prompt": "={{ $json.chatInput }}", "options": {}, "pineconeIndex": { "__rl": true, "mode": "id", "value": "test-index" } }, "credentials": { "pineconeApi": { "id": "OHDlDbBkaPDgpnOY", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "5ad6e0fd-c296-4507-8232-164b5be57f4a", "name": "Prepare chunks", "type": "n8n-nodes-base.code", "position": [ 140, 760 ], "parameters": { "jsCode": "let out = \"\"\nfor (const i in $input.all()) {\n let itemText = \"--- CHUNK \" + i + \" ---\\n\"\n itemText += $input.all()[i].json.document.pageContent + \"\\n\"\n itemText += \"\\n\"\n out += itemText\n}\n\nreturn {\n 'context': out\n};" }, "typeVersion": 2 }, { "id": "770b066a-abb2-443e-bcaa-14632c6696f4", "name": "Answer the query based on chunks", "type": "@n8n/n8n-nodes-langchain.informationExtractor", "position": [ 340, 760 ], "parameters": { "text": "={{ $json.context }}\n\nQuestion: {{ $('When chat message received').first().json.chatInput }}\nHelpful Answer:", "options": { "systemPromptTemplate": "=Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Important: In your response, also include the the indexes of the chunks you used to generate the answer." }, "schemaType": "manual", "inputSchema": "{\n \"type\": \"object\",\n \"required\": [\"answer\", \"citations\"],\n \"properties\": {\n \"answer\": {\n \"type\": \"string\"\n },\n \"citations\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n }\n }\n}" }, "typeVersion": 1 }, { "id": "e43abc0c-cedf-4e73-a766-7fad57601cfe", "name": "Compose citations", "type": "n8n-nodes-base.set", "position": [ 700, 760
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"e2e61eae-6306-47db-908c-9d82758f6516\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -660,\n 40\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"a45afcc0-d780-462a-9ed7-27daf01363a7\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -500,\n -140\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1086.039382705461,\n \"height\": 728.4168721167887,\n \"content\": \"## 1. Setup: Fetch file from Google Drive, split it into chunks and insert into a vector database\\nNote that running this part multiple times will insert multiple copies into your DB\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a3c56569-0728-4246-8d87-fa106d373566\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -960,\n -60\n ],\n \"parameters\": {\n \"height\": 350.7942096493649,\n \"content\": \"# Try me out\\n1. In Pinecone, create an index with 1536 dimensions and select it in the two vector store nodes\\n2. Populate Pinecone by clicking the 'test workflow' button below\\n3. Click the 'chat' button below and enter the following:\\n\\n_Which email provider does the creator of Bitcoin use?_\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1543b8a-dbea-42a9-a35e-e22ed86f565b\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -500,\n 640\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1594,\n \"height\": 529,\n \"content\": \"## 2. Chat with file, getting citations in reponse\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5300d5dd-4186-4402-9442-88adab4e9a89\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -480,\n -40\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 179.58883583572606,\n \"height\": 257.75985739596473,\n \"content\": \"Will fetch the Bitcoin whitepaper, but you can change this\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9f707f2b-6cb2-47b8-88fc-65cfd09b6cae\",\n \"name\": \"Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 80,\n 40\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"test-index\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"OHDlDbBkaPDgpnOY\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a32ac59e-efdc-4ff3-92dd-be794c2be7f7\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -660,\n 760\n ],\n \"webhookId\": \"cd2703a7-f912-46fe-8787-3fb83ea116ab\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"e14145d2-0c18-4813-9555-263314cb0376\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 340,\n 980\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"e6863abd-d3df-4b45-9083-96b82cd46773\",\n \"name\": \"Set file URL in Google Drive\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -440,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"dc7a70e3-9b04-404b-8892-ba0fcc4274c2\",\n \"name\": \"file_url\",\n \"type\": \"string\",\n \"value\": \" https://drive.google.com/file/d/11Koq9q53nkk0F5Y8eZgaWJUVR03I4-MM/view\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"80d241f1-7c8a-489e-9255-84bc79ec11c7\",\n \"name\": \"Download file\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -220,\n 40\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"={{ $json.file_url }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"yOwz41gMQclOadgu\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"8483b283-1ff4-4540-891a-09886c146e16\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 180,\n 240\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"file_url\",\n \"value\": \"={{ $('Set file URL in Google Drive').first().json.file_url }}\"\n },\n {\n \"name\": \"file_name\",\n \"value\": \"={{ $('Download file').first().binary.data.fileName }}\"\n }\n ]\n }\n },\n \"dataType\": \"binary\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c262df34-b2d9-4f48-b975-d694469e6e5a\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -220,\n 980\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"45c8e8cb-a29e-48ad-985f-e0136065840f\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 40,\n 240\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"8c852568-f100-4849-a06f-86e71733512a\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 260,\n 400\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 200\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"319e5b2d-c648-4ef5-8238-7732c62d34f5\",\n \"name\": \"Set max chunks to send to model\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -420,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"33f4addf-72f3-4618-a6ba-5b762257d723\",\n \"name\": \"chunks\",\n \"type\": \"number\",\n \"value\": 4\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"91b9132e-ef51-4044-be1b-f391aeeb467c\",\n \"name\": \"Get top chunks matching query\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n -220,\n 760\n ],\n \"parameters\": {\n \"mode\": \"load\",\n \"topK\": \"={{ $json.chunks }}\",\n \"prompt\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"test-index\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"OHDlDbBkaPDgpnOY\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5ad6e0fd-c296-4507-8232-164b5be57f4a\",\n \"name\": \"Prepare chunks\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 140,\n 760\n ],\n \"parameters\": {\n \"jsCode\": \"let out = \\\"\\\"\\nfor (const i in $input.all()) {\\n let itemText = \\\"--- CHUNK \\\" + i + \\\" ---\\\\n\\\"\\n itemText += $input.all()[i].json.document.pageContent + \\\"\\\\n\\\"\\n itemText += \\\"\\\\n\\\"\\n out += itemText\\n}\\n\\nreturn {\\n 'context': out\\n};\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"770b066a-abb2-443e-bcaa-14632c6696f4\",\n \"name\": \"Answer the query based on chunks\",\n \"type\": \"@n8n/n8n-nodes-langchain.informationExtractor\",\n \"position\": [\n 340,\n 760\n ],\n \"parameters\": {\n \"text\": \"={{ $json.context }}\\n\\nQuestion: {{ $('When chat message received').first().json.chatInput }}\\nHelpful Answer:\",\n \"options\": {\n \"systemPromptTemplate\": \"=Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Important: In your response, also include the the indexes of the chunks you used to generate the answer.\"\n },\n \"schemaType\": \"manual\",\n \"inputSchema\": \"{\\n \\\"type\\\": \\\"object\\\",\\n \\\"required\\\": [\\\"answer\\\", \\\"citations\\\"],\\n \\\"properties\\\": {\\n \\\"answer\\\": {\\n \\\"type\\\": \\\"string\\\"\\n },\\n \\\"citations\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n }\\n }\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e43abc0c-cedf-4e73-a766-7fad57601cfe\",\n \"name\": \"Compose citations\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 700,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"ace6185e-8b3d-4f89-ae36-dfe0c391a0a9\",\n \"name\": \"citations\",\n \"type\": \"array\",\n \"value\": \"={{ $json.citations.map(i => '[' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata.file_name + ', lines ' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata['loc.lines.from'] + '-' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata['loc.lines.to'] + ']') }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"f82df340-42fc-4e92-9e9d-d808f19e0407\",\n \"name\": \"Generate response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 900,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"11396286-0378-4c3a-86e1-c9ef51afbfc7\",\n \"name\": \"text\",\n \"type\": \"string\",\n \"value\": \"={{ $json.answer }} {{ $if(!$json.citations.isEmpty(), \\\"\\\\n\\\" + $json.citations.join(\\\"\\\"), '') }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Download file\": {\n \"main\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prepare chunks\": {\n \"main\": [\n [\n {\n \"node\": \"Answer the query based on chunks\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Compose citations\": {\n \"main\": [\n [\n {\n \"node\": \"Generate response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Get top chunks matching query\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Answer the query based on chunks\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Set max chunks to send to model\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set file URL in Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Download file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get top chunks matching query\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare chunks\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set max chunks to send to model\": {\n \"main\": [\n [\n {\n \"node\": \"Get top chunks matching query\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Answer the query based on chunks\": {\n \"main\": [\n [\n {\n \"node\": \"Compose citations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Set file URL in Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
32
0
2
true
combined_workflows.json
{ "input": "This workflow aims to create a chatbot that answers questions based on the content of a file, providing citations for its answers. It first loads and processes the file, stores it in a vector database, and then uses OpenAI to answer user queries, referencing specific parts of the file.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9853, "processed_size": 9853, "processed_timestamp": "2025-04-09T03:08:38.153332", "timestamp": "2025-04-09T02:36:33.737822", "token_count": 4095, "tokens": 954, "workflow_chunk_info": { "is_truncated": false, "original_size": 9853, "processed_size": 9853, "workflow_hash": "a4b0ff4810b9ea13cb6e201eb561adf7" }, "workflow_hash": "a4b0ff4810b9ea13cb6e201eb561adf7" }
ual", "inputSchema": "{\n \"type\": \"object\",\n \"required\": [\"answer\", \"citations\"],\n \"properties\": {\n \"answer\": {\n \"type\": \"string\"\n },\n \"citations\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n }\n }\n}" }, "typeVersion": 1 }, { "id": "e43abc0c-cedf-4e73-a766-7fad57601cfe", "name": "Compose citations", "type": "n8n-nodes-base.set", "position": [ 700, 760 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "ace6185e-8b3d-4f89-ae36-dfe0c391a0a9", "name": "citations", "type": "array", "value": "={{ $json.citations.map(i => '[' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata.file_name + ', lines ' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata['loc.lines.from'] + '-' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata['loc.lines.to'] + ']') }}" } ] } }, "typeVersion": 3.4 }, { "id": "f82df340-42fc-4e92-9e9d-d808f19e0407", "name": "Generate response", "type": "n8n-nodes-base.set", "position": [ 900, 760 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "11396286-0378-4c3a-86e1-c9ef51afbfc7", "name": "text", "type": "string", "value": "={{ $json.answer }} {{ $if(!$json.citations.isEmpty(), \"\\n\" + $json.citations.join(\"\"), '') }}" } ] } }, "typeVersion": 3.4 } ], "pinData": {}, "connections": { "Download file": { "main": [ [ { "node": "Pinecone Vector Store", "type": "main", "index": 0 } ] ] }, "Prepare chunks": { "main": [ [ { "node": "Answer the query based on chunks", "type": "main", "index": 0 } ] ] }, "Compose citations": { "main": [ [ { "node": "Generate response", "type": "main", "index": 0 } ] ] }, "Embeddings OpenAI": { "ai_embedding": [ [ { "node": "Pinecone Vector Store", "type": "ai_embedding", "index": 0 } ] ] }, "Embeddings OpenAI2": { "ai_embedding": [ [ { "node": "Get top chunks matching query", "type": "ai_embedding", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "Answer the query based on chunks", "type": "ai_languageModel", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "Set max chunks to send to model", "type": "main", "index": 0 } ] ] }, "Set file URL in Google Drive": { "main": [ [ { "node": "Download file", "type": "main", "index": 0 } ] ] }, "Get top chunks matching query": { "main": [ [ { "node": "Prepare chunks", "type": "main", "index": 0 } ] ] }, "Set max chunks to send to model": { "main": [ [ { "node": "Get top chunks matching query", "type": "main", "index": 0 } ] ] }, "Answer the query based on chunks": { "main": [ [ { "node": "Compose citations", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Set file URL in Google Drive", "type": "main", "index": 0 } ] ] }, "Recursive Character Text Splitter": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"e2e61eae-6306-47db-908c-9d82758f6516\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -660,\n 40\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"a45afcc0-d780-462a-9ed7-27daf01363a7\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -500,\n -140\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1086.039382705461,\n \"height\": 728.4168721167887,\n \"content\": \"## 1. Setup: Fetch file from Google Drive, split it into chunks and insert into a vector database\\nNote that running this part multiple times will insert multiple copies into your DB\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a3c56569-0728-4246-8d87-fa106d373566\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -960,\n -60\n ],\n \"parameters\": {\n \"height\": 350.7942096493649,\n \"content\": \"# Try me out\\n1. In Pinecone, create an index with 1536 dimensions and select it in the two vector store nodes\\n2. Populate Pinecone by clicking the 'test workflow' button below\\n3. Click the 'chat' button below and enter the following:\\n\\n_Which email provider does the creator of Bitcoin use?_\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1543b8a-dbea-42a9-a35e-e22ed86f565b\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -500,\n 640\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1594,\n \"height\": 529,\n \"content\": \"## 2. Chat with file, getting citations in reponse\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5300d5dd-4186-4402-9442-88adab4e9a89\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -480,\n -40\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 179.58883583572606,\n \"height\": 257.75985739596473,\n \"content\": \"Will fetch the Bitcoin whitepaper, but you can change this\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9f707f2b-6cb2-47b8-88fc-65cfd09b6cae\",\n \"name\": \"Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 80,\n 40\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"test-index\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"OHDlDbBkaPDgpnOY\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a32ac59e-efdc-4ff3-92dd-be794c2be7f7\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -660,\n 760\n ],\n \"webhookId\": \"cd2703a7-f912-46fe-8787-3fb83ea116ab\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"e14145d2-0c18-4813-9555-263314cb0376\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 340,\n 980\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"e6863abd-d3df-4b45-9083-96b82cd46773\",\n \"name\": \"Set file URL in Google Drive\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -440,\n 40\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"dc7a70e3-9b04-404b-8892-ba0fcc4274c2\",\n \"name\": \"file_url\",\n \"type\": \"string\",\n \"value\": \" https://drive.google.com/file/d/11Koq9q53nkk0F5Y8eZgaWJUVR03I4-MM/view\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"80d241f1-7c8a-489e-9255-84bc79ec11c7\",\n \"name\": \"Download file\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -220,\n 40\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"={{ $json.file_url }}\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"yOwz41gMQclOadgu\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"8483b283-1ff4-4540-891a-09886c146e16\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 180,\n 240\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"file_url\",\n \"value\": \"={{ $('Set file URL in Google Drive').first().json.file_url }}\"\n },\n {\n \"name\": \"file_name\",\n \"value\": \"={{ $('Download file').first().binary.data.fileName }}\"\n }\n ]\n }\n },\n \"dataType\": \"binary\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c262df34-b2d9-4f48-b975-d694469e6e5a\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -220,\n 980\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"45c8e8cb-a29e-48ad-985f-e0136065840f\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 40,\n 240\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"8c852568-f100-4849-a06f-86e71733512a\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 260,\n 400\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 3000,\n \"chunkOverlap\": 200\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"319e5b2d-c648-4ef5-8238-7732c62d34f5\",\n \"name\": \"Set max chunks to send to model\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -420,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"33f4addf-72f3-4618-a6ba-5b762257d723\",\n \"name\": \"chunks\",\n \"type\": \"number\",\n \"value\": 4\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"91b9132e-ef51-4044-be1b-f391aeeb467c\",\n \"name\": \"Get top chunks matching query\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n -220,\n 760\n ],\n \"parameters\": {\n \"mode\": \"load\",\n \"topK\": \"={{ $json.chunks }}\",\n \"prompt\": \"={{ $json.chatInput }}\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"test-index\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"OHDlDbBkaPDgpnOY\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5ad6e0fd-c296-4507-8232-164b5be57f4a\",\n \"name\": \"Prepare chunks\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 140,\n 760\n ],\n \"parameters\": {\n \"jsCode\": \"let out = \\\"\\\"\\nfor (const i in $input.all()) {\\n let itemText = \\\"--- CHUNK \\\" + i + \\\" ---\\\\n\\\"\\n itemText += $input.all()[i].json.document.pageContent + \\\"\\\\n\\\"\\n itemText += \\\"\\\\n\\\"\\n out += itemText\\n}\\n\\nreturn {\\n 'context': out\\n};\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"770b066a-abb2-443e-bcaa-14632c6696f4\",\n \"name\": \"Answer the query based on chunks\",\n \"type\": \"@n8n/n8n-nodes-langchain.informationExtractor\",\n \"position\": [\n 340,\n 760\n ],\n \"parameters\": {\n \"text\": \"={{ $json.context }}\\n\\nQuestion: {{ $('When chat message received').first().json.chatInput }}\\nHelpful Answer:\",\n \"options\": {\n \"systemPromptTemplate\": \"=Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Important: In your response, also include the the indexes of the chunks you used to generate the answer.\"\n },\n \"schemaType\": \"manual\",\n \"inputSchema\": \"{\\n \\\"type\\\": \\\"object\\\",\\n \\\"required\\\": [\\\"answer\\\", \\\"citations\\\"],\\n \\\"properties\\\": {\\n \\\"answer\\\": {\\n \\\"type\\\": \\\"string\\\"\\n },\\n \\\"citations\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n }\\n }\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e43abc0c-cedf-4e73-a766-7fad57601cfe\",\n \"name\": \"Compose citations\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 700,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"ace6185e-8b3d-4f89-ae36-dfe0c391a0a9\",\n \"name\": \"citations\",\n \"type\": \"array\",\n \"value\": \"={{ $json.citations.map(i => '[' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata.file_name + ', lines ' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata['loc.lines.from'] + '-' + $('Get top chunks matching query').all()[$json.citations].json.document.metadata['loc.lines.to'] + ']') }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"f82df340-42fc-4e92-9e9d-d808f19e0407\",\n \"name\": \"Generate response\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 900,\n 760\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"11396286-0378-4c3a-86e1-c9ef51afbfc7\",\n \"name\": \"text\",\n \"type\": \"string\",\n \"value\": \"={{ $json.answer }} {{ $if(!$json.citations.isEmpty(), \\\"\\\\n\\\" + $json.citations.join(\\\"\\\"), '') }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Download file\": {\n \"main\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prepare chunks\": {\n \"main\": [\n [\n {\n \"node\": \"Answer the query based on chunks\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Compose citations\": {\n \"main\": [\n [\n {\n \"node\": \"Generate response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Get top chunks matching query\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Answer the query based on chunks\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"Set max chunks to send to model\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set file URL in Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Download file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get top chunks matching query\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare chunks\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set max chunks to send to model\": {\n \"main\": [\n [\n {\n \"node\": \"Get top chunks matching query\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Answer the query based on chunks\": {\n \"main\": [\n [\n {\n \"node\": \"Compose citations\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Set file URL in Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
32
1
2
true
combined_workflows.json
{ "input": "This workflow aims to create a chatbot that answers questions based on the content of a file, providing citations for its answers. It first loads and processes the file, stores it in a vector database, and then uses OpenAI to answer user queries, referencing specific parts of the file.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9853, "processed_size": 9853, "processed_timestamp": "2025-04-09T03:08:38.158331", "timestamp": "2025-04-09T02:36:33.737822", "token_count": 1615, "tokens": 954, "workflow_chunk_info": { "is_truncated": false, "original_size": 9853, "processed_size": 9853, "workflow_hash": "a4b0ff4810b9ea13cb6e201eb561adf7" }, "workflow_hash": "a4b0ff4810b9ea13cb6e201eb561adf7" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To build a WhatsApp chatbot that answers user questions about a product brochure using AI. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9" }, "nodes": [ { "id": "77ee6494-4898-47dc-81d9-35daf6f0beea", "name": "WhatsApp Trigger", "type": "n8n-nodes-base.whatsAppTrigger", "position": [ 1360, -280 ], "webhookId": "aaa71f03-f7af-4d18-8d9a-0afb86f1b554", "parameters": { "updates": [ "messages" ] }, "credentials": { "whatsAppTriggerApi": { "id": "H3uYNtpeczKMqtYm", "name": "WhatsApp OAuth account" } }, "typeVersion": 1 }, { "id": "57210e27-1f89-465a-98cc-43f890a4bf58", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 1960, -200 ], "parameters": { "model": "gpt-4o-2024-08-06", "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "e1053235-0ade-4e36-9ad2-8b29c78fced8", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 2080, -200 ], "parameters": { "sessionKey": "=whatsapp-75-{{ $json.messages[0].from }}", "sessionIdType": "customKey" }, "typeVersion": 1.2 }, { "id": "69f1b78b-7c93-4713-863a-27e04809996f", "name": "Vector Store Tool", "type": "@n8n/n8n-nodes-langchain.toolVectorStore", "position": [ 2200, -200 ], "parameters": { "name": "query_product_brochure", "description": "Call this tool to query the product brochure. Valid for the year 2024." }, "typeVersion": 1 }, { "id": "170e8f7d-7e14-48dd-9f80-5352cc411fc1", "name": "Embeddings OpenAI", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 2200, 80 ], "parameters": { "model": "text-embedding-3-small", "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "ee78320b-d407-49e8-b4b8-417582a44709", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 2440, -60 ], "parameters": { "model": "gpt-4o-2024-08-06", "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "9dd89378-5acf-4ca6-8d84-e6e64254ed02", "name": "When clicking β€˜Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ 0, -240 ], "parameters": {}, "typeVersion": 1 }, { "id": "e68fc137-1bcb-43f0-b597-3ae07f380c15", "name": "Embeddings OpenAI1", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ 760, -20 ], "parameters": { "model": "text-embedding-3-small", "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "2d31e92b-18d4-4f6b-8cdb-bed0056d50d7", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 900, -20 ], "parameters": { "options": {}, "jsonData": "={{ $('Extract from File').item.json.text }}", "jsonMode": "expressionData" }, "typeVersion": 1 }, { "id": "ca0c015e-fba2-4dca-b0fe-bac66681725a", "name": "Recursive Character Text Splitter", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 900, 100 ], "parameters": { "options": {}, "chunkSize": 2000, "chunkOverlap": {} }, "typeVersion": 1 }, { "id": "63abb6b2-b955-4e65-9c63-3211dca65613", "name": "Extract from File", "type": "n8n-nodes-base.extractFromFile", "position": [ 360, -240 ], "parameters": { "options": {}, "operation": "pdf" }, "typeVersion": 1 }, { "id": "be2add9c-3670-4196-8c38-82742bf4f283", "name": "get Product Brochure", "type": "n8n-nodes-base.httpRequest", "position": [ 180, -240 ], "parameters": { "url": "https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf", "options": {} }, "typeVersion": 4.2 }, { "id": "1ae5a311-36d7-4454-ab14-6788d1331780", "name": "Reply To User", "type": "n8n-nodes-base.whatsApp", "position": [ 2820, -280 ], "parameters": { "textBody": "={{ $json.output }}", "operation": "send", "phoneNumberId": "477115632141067", "requestOptions": {}, "additionalFields": { "previewUrl": false }, "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}" }, "credentials": { "whatsAppApi": { "id": "9SFJPeqrpChOkAmw", "name": "WhatsApp account" } }, "typeVersion": 1 }, { "id": "b6efba81-18b0-4378-bb91-51f39ca57f3e", "name": "Reply To User1", "type": "n8n-nodes-base.whatsApp", "position": [ 1760, 80 ], "parameters": { "textBody": "=I'm unable to process non-text messages. Please send only text messages. Thanks!", "operation": "send", "phoneNumberId": "477115632141067", "requestOptions": {}, "additionalFields": { "previewUrl": false }, "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}" }, "credentials": { "whatsAppApi": { "id": "9SFJPeqrpChOkAmw", "name": "WhatsApp account" } }, "typeVersion": 1 }, { "id": "52decd86-ac6c-4d91-a938-86f93ec5f822", "name": "Product Catalogue", "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory", "position": [ 2200, -60 ], "parameters": { "memoryKey": "whatsapp-75" }, "typeVersion": 1 }, { "id": "6dd5a652-2464-4ab8-8e5f-568529299523", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -88.75, -473.4375 ], "parameters": { "color": 7, "width": 640.4375, "height": 434.6875, "content": "## 1. Download Product Brochure PDF\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\n\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. " }, "typeVersion": 1 }, { "id": "116663bc-d8d6-41a5-93dc-b219adbb2235", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 580, -476 ], "parameters": { "color": 7, "width": 614.6875, "height": 731.1875, "content": "## 2. Create Product Brochure Vector Store\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\n\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\n\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io)." }, "typeVersion": 1 }, { "id": "86bd5334-d735-4650-aeff-06230119d705", "name": "Create Product Catalogue", "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory", "position": [ 760, -200 ], "parameters": { "mode": "insert", "memoryKey": "whatsapp-75", "clearStore": true }, "typeVersion": 1 }, { "id": "b8078b0d-cbd7-423f-bb30-13902988be38", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1254, -552 ], "parameters": { "color": 7, "width": 546.6875, "height": 484.1875, "content": "## 3. Use the WhatsApp Trigger\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\n\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\n\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages." }, "typeVersion": 1 }, { "id": "5bf7ed07-282b-4198-aa90-3
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\"\n },\n \"nodes\": [\n {\n \"id\": \"77ee6494-4898-47dc-81d9-35daf6f0beea\",\n \"name\": \"WhatsApp Trigger\",\n \"type\": \"n8n-nodes-base.whatsAppTrigger\",\n \"position\": [\n 1360,\n -280\n ],\n \"webhookId\": \"aaa71f03-f7af-4d18-8d9a-0afb86f1b554\",\n \"parameters\": {\n \"updates\": [\n \"messages\"\n ]\n },\n \"credentials\": {\n \"whatsAppTriggerApi\": {\n \"id\": \"H3uYNtpeczKMqtYm\",\n \"name\": \"WhatsApp OAuth account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"57210e27-1f89-465a-98cc-43f890a4bf58\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1960,\n -200\n ],\n \"parameters\": {\n \"model\": \"gpt-4o-2024-08-06\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e1053235-0ade-4e36-9ad2-8b29c78fced8\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 2080,\n -200\n ],\n \"parameters\": {\n \"sessionKey\": \"=whatsapp-75-{{ $json.messages[0].from }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"69f1b78b-7c93-4713-863a-27e04809996f\",\n \"name\": \"Vector Store Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 2200,\n -200\n ],\n \"parameters\": {\n \"name\": \"query_product_brochure\",\n \"description\": \"Call this tool to query the product brochure. Valid for the year 2024.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"170e8f7d-7e14-48dd-9f80-5352cc411fc1\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 2200,\n 80\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ee78320b-d407-49e8-b4b8-417582a44709\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 2440,\n -60\n ],\n \"parameters\": {\n \"model\": \"gpt-4o-2024-08-06\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9dd89378-5acf-4ca6-8d84-e6e64254ed02\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 0,\n -240\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"e68fc137-1bcb-43f0-b597-3ae07f380c15\",\n \"name\": \"Embeddings OpenAI1\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 760,\n -20\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2d31e92b-18d4-4f6b-8cdb-bed0056d50d7\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 900,\n -20\n ],\n \"parameters\": {\n \"options\": {},\n \"jsonData\": \"={{ $('Extract from File').item.json.text }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ca0c015e-fba2-4dca-b0fe-bac66681725a\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 900,\n 100\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 2000,\n \"chunkOverlap\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"63abb6b2-b955-4e65-9c63-3211dca65613\",\n \"name\": \"Extract from File\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n 360,\n -240\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"be2add9c-3670-4196-8c38-82742bf4f283\",\n \"name\": \"get Product Brochure\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 180,\n -240\n ],\n \"parameters\": {\n \"url\": \"https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"1ae5a311-36d7-4454-ab14-6788d1331780\",\n \"name\": \"Reply To User\",\n \"type\": \"n8n-nodes-base.whatsApp\",\n \"position\": [\n 2820,\n -280\n ],\n \"parameters\": {\n \"textBody\": \"={{ $json.output }}\",\n \"operation\": \"send\",\n \"phoneNumberId\": \"477115632141067\",\n \"requestOptions\": {},\n \"additionalFields\": {\n \"previewUrl\": false\n },\n \"recipientPhoneNumber\": \"={{ $('WhatsApp Trigger').item.json.messages[0].from }}\"\n },\n \"credentials\": {\n \"whatsAppApi\": {\n \"id\": \"9SFJPeqrpChOkAmw\",\n \"name\": \"WhatsApp account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b6efba81-18b0-4378-bb91-51f39ca57f3e\",\n \"name\": \"Reply To User1\",\n \"type\": \"n8n-nodes-base.whatsApp\",\n \"position\": [\n 1760,\n 80\n ],\n \"parameters\": {\n \"textBody\": \"=I'm unable to process non-text messages. Please send only text messages. Thanks!\",\n \"operation\": \"send\",\n \"phoneNumberId\": \"477115632141067\",\n \"requestOptions\": {},\n \"additionalFields\": {\n \"previewUrl\": false\n },\n \"recipientPhoneNumber\": \"={{ $('WhatsApp Trigger').item.json.messages[0].from }}\"\n },\n \"credentials\": {\n \"whatsAppApi\": {\n \"id\": \"9SFJPeqrpChOkAmw\",\n \"name\": \"WhatsApp account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"52decd86-ac6c-4d91-a938-86f93ec5f822\",\n \"name\": \"Product Catalogue\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreInMemory\",\n \"position\": [\n 2200,\n -60\n ],\n \"parameters\": {\n \"memoryKey\": \"whatsapp-75\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6dd5a652-2464-4ab8-8e5f-568529299523\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -88.75,\n -473.4375\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 640.4375,\n \"height\": 434.6875,\n \"content\": \"## 1. Download Product Brochure PDF\\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\\n\\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\\n\\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"116663bc-d8d6-41a5-93dc-b219adbb2235\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 580,\n -476\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 614.6875,\n \"height\": 731.1875,\n \"content\": \"## 2. Create Product Brochure Vector Store\\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\\n\\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\\n\\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io).\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"86bd5334-d735-4650-aeff-06230119d705\",\n \"name\": \"Create Product Catalogue\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreInMemory\",\n \"position\": [\n 760,\n -200\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"memoryKey\": \"whatsapp-75\",\n \"clearStore\": true\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8078b0d-cbd7-423f-bb30-13902988be38\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1254,\n -552\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 546.6875,\n \"height\": 484.1875,\n \"content\": \"## 3. Use the WhatsApp Trigger\\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\\n\\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\\n\\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5bf7ed07-282b-4198-aa90-3e5ae5180404\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1640,\n 280\n ],\n \"parameters\": {\n \"width\": 338,\n \"height\": 92,\n \"content\": \"### Want to handle all message types?\\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a3661b59-25d2-446e-8462-32b4d692b69d\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1640,\n -40\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 337.6875,\n \"height\": 311.1875,\n \"content\": \"### 3a. Handle Unsupported Message Types\\nFor non-text messages, we'll just reply with a simple message to inform the sender.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ea3c9ee1-505a-40e7-82fe-9169bdbb80af\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1840,\n -682.5\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 746.6875,\n \"height\": 929.1875,\n \"content\": \"## 4. Sales AI Agent Responds To Customers\\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\\n\\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\\n\\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c72df8d-bca1-4634-b1ed-61ffec8bd103\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2620,\n -560\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 495.4375,\n \"height\": 484.1875,\n \"content\": \"## 5. Repond to WhatsApp User\\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\\n\\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\\n\\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"48ec809f-ca0e-4052-b403-9ad7077b3fff\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -520,\n -620\n ],\n \"parameters\": {\n \"width\": 401.25,\n \"height\": 582.6283033962263,\n \"content\": \"## Try It Out!\\n\\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\\n\\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\\n* A product brochure is imported via HTTP request node and its text contents extracted.\\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\\n* The Agent's response is sent back to the user via the WhatsApp node.\\n\\n### Need Help?\\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"87cf9b41-66de-49a7-aeb0-c8809191b5a0\",\n \"name\": \"Handle Message Types\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 1560,\n -280\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Supported\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.messages[0].type }}\",\n \"rightValue\": \"text\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Not Supported\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"89971d8c-a386-4e77-8f6c-f491a8e84cb6\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.messages[0].type }}\",\n \"rightValue\": \"text\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"e52f0a50-0c34-4c4a-b493-4c42ba112277\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -80,\n -20\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 345.10906976744184,\n \"height\": 114.53583720930231,\n \"content\": \"### You only have to run this part once!\\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1260,\n -40\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 364.6293255813954,\n \"height\": 107.02804651162779,\n \"content\": \"### Activate your workflow to use!\\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a36524d0-22a6-48cc-93fe-b4571cec428a\",\n \"name\": \"AI Sales Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1960,\n -400\n ],\n \"parameters\": {\n \"text\": \"={{ $json.messages[0].text.body }}\",\n \"options\": {\n \"systemMessage\": \"You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\\n\\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.6\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Sales Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Reply To User\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"WhatsApp Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Handle Message Types\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Product Catalogue\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract from File\": {\n \"main\": [\n [\n {\n \"node\": \"Create Product Catalogue\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Product Catalogue\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vector Store Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI1\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Create Product Catalogue\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Create Product Catalogue\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Handle Message Types\": {\n \"main\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Reply To User1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get Product Brochure\": {\n \"main\": [\n [\n {\n \"node\": \"Extract from File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"get Product Brochure\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
33
0
2
true
combined_workflows.json
{ "input": "To build a WhatsApp chatbot that answers user questions about a product brochure using AI.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 15549, "processed_size": 15549, "processed_timestamp": "2025-04-09T03:08:38.248336", "timestamp": "2025-04-09T02:36:34.342165", "token_count": 4095, "tokens": 1592, "workflow_chunk_info": { "is_truncated": false, "original_size": 15549, "processed_size": 15549, "workflow_hash": "8ba5460cc5147ea6fb532de3bbc5dc3a" }, "workflow_hash": "8ba5460cc5147ea6fb532de3bbc5dc3a" }
": "## 3. Use the WhatsApp Trigger\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\n\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\n\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages." }, "typeVersion": 1 }, { "id": "5bf7ed07-282b-4198-aa90-3e5ae5180404", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1640, 280 ], "parameters": { "width": 338, "height": 92, "content": "### Want to handle all message types?\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/" }, "typeVersion": 1 }, { "id": "a3661b59-25d2-446e-8462-32b4d692b69d", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1640, -40 ], "parameters": { "color": 7, "width": 337.6875, "height": 311.1875, "content": "### 3a. Handle Unsupported Message Types\nFor non-text messages, we'll just reply with a simple message to inform the sender." }, "typeVersion": 1 }, { "id": "ea3c9ee1-505a-40e7-82fe-9169bdbb80af", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1840, -682.5 ], "parameters": { "color": 7, "width": 746.6875, "height": 929.1875, "content": "## 4. Sales AI Agent Responds To Customers\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\n\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier." }, "typeVersion": 1 }, { "id": "5c72df8d-bca1-4634-b1ed-61ffec8bd103", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 2620, -560 ], "parameters": { "color": 7, "width": 495.4375, "height": 484.1875, "content": "## 5. Repond to WhatsApp User\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\n\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\n\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent." }, "typeVersion": 1 }, { "id": "48ec809f-ca0e-4052-b403-9ad7077b3fff", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ -520, -620 ], "parameters": { "width": 401.25, "height": 582.6283033962263, "content": "## Try It Out!\n\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\n\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\n* A product brochure is imported via HTTP request node and its text contents extracted.\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\n* The Agent's response is sent back to the user via the WhatsApp node.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!" }, "typeVersion": 1 }, { "id": "87cf9b41-66de-49a7-aeb0-c8809191b5a0", "name": "Handle Message Types", "type": "n8n-nodes-base.switch", "position": [ 1560, -280 ], "parameters": { "rules": { "values": [ { "outputKey": "Supported", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ $json.messages[0].type }}", "rightValue": "text" } ] }, "renameOutput": true }, { "outputKey": "Not Supported", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "89971d8c-a386-4e77-8f6c-f491a8e84cb6", "operator": { "type": "string", "operation": "notEquals" }, "leftValue": "={{ $json.messages[0].type }}", "rightValue": "text" } ] }, "renameOutput": true } ] }, "options": {} }, "typeVersion": 3.2 }, { "id": "e52f0a50-0c34-4c4a-b493-4c42ba112277", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ -80, -20 ], "parameters": { "color": 5, "width": 345.10906976744184, "height": 114.53583720930231, "content": "### You only have to run this part once!\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version." }, "typeVersion": 1 }, { "id": "c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49", "name": "Sticky Note9", "type": "n8n-nodes-base.stickyNote", "position": [ 1260, -40 ], "parameters": { "color": 5, "width": 364.6293255813954, "height": 107.02804651162779, "content": "### Activate your workflow to use!\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server." }, "typeVersion": 1 }, { "id": "a36524d0-22a6-48cc-93fe-b4571cec428a", "name": "AI Sales Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 1960, -400 ], "parameters": { "text": "={{ $json.messages[0].text.body }}", "options": { "systemMessage": "You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\n\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so." }, "promptType": "define" }, "typeVersion": 1.6 } ], "pinData": {}, "connections": { "AI Sales Agent": { "main": [ [ { "node": "Reply To User", "type": "main", "index": 0 } ] ] }, "WhatsApp Trigger": { "main": [ [ { "node": "Handle Message Types", "type": "main", "index": 0 } ] ] }, "Embeddings OpenAI": { "ai_embedding": [ [ { "node": "Product Catalogue", "type": "ai_embedding", "index": 0 } ] ] }, "Extract from File": { "main": [ [ { "node": "Create Product Catalogue", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Sales Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Product Catalogue": { "ai_vectorStore": [ [ { "node": "Vector Store Tool", "type": "ai_vectorStore", "index": 0 } ] ] }, "Vector Store Tool": { "ai_tool": [ [ { "node": "AI Sales Agent", "type": "ai_tool", "index": 0 } ] ] }, "Embeddings OpenAI1": { "ai_embedding": [ [ { "node": "Create Product Catalogue", "type": "ai_embedding", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "Vector Store Tool", "type": "ai_languageModel", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Create Product Catalogue", "type": "ai_document", "index": 0 } ] ] }, "Handle Message Types": { "main": [ [ { "node": "AI Sales Agent", "type": "main", "index": 0 } ], [ { "node": "Reply To User1", "type": "main", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Sales Agent", "type": "ai_memory", "index": 0 } ] ] }, "get Product Brochure": { "main": [ [ { "node": "Extract from File", "type": "main", "index": 0 } ] ] }, "Recursive Character Text Splitter": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] }, "When clicking β€˜Test workflow’": { "main": [ [ { "node": "get Product Brochure", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\"\n },\n \"nodes\": [\n {\n \"id\": \"77ee6494-4898-47dc-81d9-35daf6f0beea\",\n \"name\": \"WhatsApp Trigger\",\n \"type\": \"n8n-nodes-base.whatsAppTrigger\",\n \"position\": [\n 1360,\n -280\n ],\n \"webhookId\": \"aaa71f03-f7af-4d18-8d9a-0afb86f1b554\",\n \"parameters\": {\n \"updates\": [\n \"messages\"\n ]\n },\n \"credentials\": {\n \"whatsAppTriggerApi\": {\n \"id\": \"H3uYNtpeczKMqtYm\",\n \"name\": \"WhatsApp OAuth account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"57210e27-1f89-465a-98cc-43f890a4bf58\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1960,\n -200\n ],\n \"parameters\": {\n \"model\": \"gpt-4o-2024-08-06\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e1053235-0ade-4e36-9ad2-8b29c78fced8\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 2080,\n -200\n ],\n \"parameters\": {\n \"sessionKey\": \"=whatsapp-75-{{ $json.messages[0].from }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"69f1b78b-7c93-4713-863a-27e04809996f\",\n \"name\": \"Vector Store Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 2200,\n -200\n ],\n \"parameters\": {\n \"name\": \"query_product_brochure\",\n \"description\": \"Call this tool to query the product brochure. Valid for the year 2024.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"170e8f7d-7e14-48dd-9f80-5352cc411fc1\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 2200,\n 80\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ee78320b-d407-49e8-b4b8-417582a44709\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 2440,\n -60\n ],\n \"parameters\": {\n \"model\": \"gpt-4o-2024-08-06\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9dd89378-5acf-4ca6-8d84-e6e64254ed02\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 0,\n -240\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"e68fc137-1bcb-43f0-b597-3ae07f380c15\",\n \"name\": \"Embeddings OpenAI1\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n 760,\n -20\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-small\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2d31e92b-18d4-4f6b-8cdb-bed0056d50d7\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 900,\n -20\n ],\n \"parameters\": {\n \"options\": {},\n \"jsonData\": \"={{ $('Extract from File').item.json.text }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ca0c015e-fba2-4dca-b0fe-bac66681725a\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 900,\n 100\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 2000,\n \"chunkOverlap\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"63abb6b2-b955-4e65-9c63-3211dca65613\",\n \"name\": \"Extract from File\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n 360,\n -240\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"pdf\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"be2add9c-3670-4196-8c38-82742bf4f283\",\n \"name\": \"get Product Brochure\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 180,\n -240\n ],\n \"parameters\": {\n \"url\": \"https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"1ae5a311-36d7-4454-ab14-6788d1331780\",\n \"name\": \"Reply To User\",\n \"type\": \"n8n-nodes-base.whatsApp\",\n \"position\": [\n 2820,\n -280\n ],\n \"parameters\": {\n \"textBody\": \"={{ $json.output }}\",\n \"operation\": \"send\",\n \"phoneNumberId\": \"477115632141067\",\n \"requestOptions\": {},\n \"additionalFields\": {\n \"previewUrl\": false\n },\n \"recipientPhoneNumber\": \"={{ $('WhatsApp Trigger').item.json.messages[0].from }}\"\n },\n \"credentials\": {\n \"whatsAppApi\": {\n \"id\": \"9SFJPeqrpChOkAmw\",\n \"name\": \"WhatsApp account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b6efba81-18b0-4378-bb91-51f39ca57f3e\",\n \"name\": \"Reply To User1\",\n \"type\": \"n8n-nodes-base.whatsApp\",\n \"position\": [\n 1760,\n 80\n ],\n \"parameters\": {\n \"textBody\": \"=I'm unable to process non-text messages. Please send only text messages. Thanks!\",\n \"operation\": \"send\",\n \"phoneNumberId\": \"477115632141067\",\n \"requestOptions\": {},\n \"additionalFields\": {\n \"previewUrl\": false\n },\n \"recipientPhoneNumber\": \"={{ $('WhatsApp Trigger').item.json.messages[0].from }}\"\n },\n \"credentials\": {\n \"whatsAppApi\": {\n \"id\": \"9SFJPeqrpChOkAmw\",\n \"name\": \"WhatsApp account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"52decd86-ac6c-4d91-a938-86f93ec5f822\",\n \"name\": \"Product Catalogue\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreInMemory\",\n \"position\": [\n 2200,\n -60\n ],\n \"parameters\": {\n \"memoryKey\": \"whatsapp-75\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6dd5a652-2464-4ab8-8e5f-568529299523\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -88.75,\n -473.4375\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 640.4375,\n \"height\": 434.6875,\n \"content\": \"## 1. Download Product Brochure PDF\\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\\n\\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\\n\\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"116663bc-d8d6-41a5-93dc-b219adbb2235\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 580,\n -476\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 614.6875,\n \"height\": 731.1875,\n \"content\": \"## 2. Create Product Brochure Vector Store\\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\\n\\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\\n\\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io).\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"86bd5334-d735-4650-aeff-06230119d705\",\n \"name\": \"Create Product Catalogue\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreInMemory\",\n \"position\": [\n 760,\n -200\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"memoryKey\": \"whatsapp-75\",\n \"clearStore\": true\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8078b0d-cbd7-423f-bb30-13902988be38\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1254,\n -552\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 546.6875,\n \"height\": 484.1875,\n \"content\": \"## 3. Use the WhatsApp Trigger\\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\\n\\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\\n\\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5bf7ed07-282b-4198-aa90-3e5ae5180404\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1640,\n 280\n ],\n \"parameters\": {\n \"width\": 338,\n \"height\": 92,\n \"content\": \"### Want to handle all message types?\\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a3661b59-25d2-446e-8462-32b4d692b69d\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1640,\n -40\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 337.6875,\n \"height\": 311.1875,\n \"content\": \"### 3a. Handle Unsupported Message Types\\nFor non-text messages, we'll just reply with a simple message to inform the sender.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ea3c9ee1-505a-40e7-82fe-9169bdbb80af\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1840,\n -682.5\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 746.6875,\n \"height\": 929.1875,\n \"content\": \"## 4. Sales AI Agent Responds To Customers\\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\\n\\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\\n\\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c72df8d-bca1-4634-b1ed-61ffec8bd103\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2620,\n -560\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 495.4375,\n \"height\": 484.1875,\n \"content\": \"## 5. Repond to WhatsApp User\\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\\n\\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\\n\\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"48ec809f-ca0e-4052-b403-9ad7077b3fff\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -520,\n -620\n ],\n \"parameters\": {\n \"width\": 401.25,\n \"height\": 582.6283033962263,\n \"content\": \"## Try It Out!\\n\\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\\n\\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\\n* A product brochure is imported via HTTP request node and its text contents extracted.\\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\\n* The Agent's response is sent back to the user via the WhatsApp node.\\n\\n### Need Help?\\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"87cf9b41-66de-49a7-aeb0-c8809191b5a0\",\n \"name\": \"Handle Message Types\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 1560,\n -280\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Supported\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.messages[0].type }}\",\n \"rightValue\": \"text\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Not Supported\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"89971d8c-a386-4e77-8f6c-f491a8e84cb6\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.messages[0].type }}\",\n \"rightValue\": \"text\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"e52f0a50-0c34-4c4a-b493-4c42ba112277\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -80,\n -20\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 345.10906976744184,\n \"height\": 114.53583720930231,\n \"content\": \"### You only have to run this part once!\\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1260,\n -40\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 364.6293255813954,\n \"height\": 107.02804651162779,\n \"content\": \"### Activate your workflow to use!\\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a36524d0-22a6-48cc-93fe-b4571cec428a\",\n \"name\": \"AI Sales Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1960,\n -400\n ],\n \"parameters\": {\n \"text\": \"={{ $json.messages[0].text.body }}\",\n \"options\": {\n \"systemMessage\": \"You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\\n\\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so.\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.6\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Sales Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Reply To User\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"WhatsApp Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Handle Message Types\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Product Catalogue\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract from File\": {\n \"main\": [\n [\n {\n \"node\": \"Create Product Catalogue\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Product Catalogue\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vector Store Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI1\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Create Product Catalogue\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Create Product Catalogue\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Handle Message Types\": {\n \"main\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Reply To User1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Sales Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get Product Brochure\": {\n \"main\": [\n [\n {\n \"node\": \"Extract from File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"get Product Brochure\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
33
1
2
true
combined_workflows.json
{ "input": "To build a WhatsApp chatbot that answers user questions about a product brochure using AI.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 15549, "processed_size": 15549, "processed_timestamp": "2025-04-09T03:08:38.258371", "timestamp": "2025-04-09T02:36:34.342165", "token_count": 3827, "tokens": 1592, "workflow_chunk_info": { "is_truncated": false, "original_size": 15549, "processed_size": 15549, "workflow_hash": "8ba5460cc5147ea6fb532de3bbc5dc3a" }, "workflow_hash": "8ba5460cc5147ea6fb532de3bbc5dc3a" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow aims to create an AI-powered tool that fetches and processes web page content based on a user's query. It converts the query string into parameters, makes an HTTP request, extracts and cleans the HTML, simplifies it if requested, converts to Markdown, and returns the content, handling errors and page length limits. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "02072c77-9eee-43bc-a046-bdc31bf1bc51", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -240, 1280 ], "parameters": { "width": 616, "height": 236, "content": "### Convert the query string into JSON, apply the limit for a page length" }, "typeVersion": 1 }, { "id": "31e7582c-9289-4bd3-b89d-c3d866754313", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 820, 980 ], "parameters": { "width": 491, "height": 285.7, "content": "## Send an error message:\n1. If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.\n2. If the query is OK and an error was during the HTTP Request, then send back the original error message." }, "typeVersion": 1 }, { "id": "0f3ec3c8-076a-4f22-a9ab-4623494914ff", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 820, 1300 ], "parameters": { "width": 1200, "height": 493, "content": "## Post-processing of the HTML page:\n1. Keep only <BODY> content\n2. Remove inline <SCRIPT> tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.\n3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length\n4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text.\n5. Finally, check the page length. If it's too long, send an \"ERROR: PAGE CONTENT TOO LONG\" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them." }, "typeVersion": 1 }, { "id": "139733cc-7954-459e-9b55-15a3bde4d8b7", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -240, 680 ], "parameters": { "width": 617, "height": 503, "content": "## Example ReAct AI Agent\n1. Agent Prompt is default\n2. Check the description of the HTTP_Request_Tool, it guides the agent to provide a query string with several parameters instead of a JSON object" }, "typeVersion": 1 }, { "id": "2b5ee7e4-061d-4a17-8581-54e02086a49a", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -200, 840 ], "webhookId": "e0a11ea2-9dd7-496a-8078-1a96f05fc04b", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "adc5e4d7-bccf-4ee7-9464-5cbb7b1409ba", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 20, 840 ], "parameters": { "options": {} }, "typeVersion": 1.8 }, { "id": "10ccad7d-2c83-4fd9-beb9-a99e1c034947", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 20, 1040 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "4btCKq9GjcZHsUb1", "name": "x.ai compat" } }, "typeVersion": 1.2 }, { "id": "5d582c5f-35d3-4cdb-96ad-fa750be0b889", "name": "When Executed by Another Workflow", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ -160, 1340 ], "parameters": { "inputSource": "passthrough" }, "typeVersion": 1.1 }, { "id": "1f073e7d-2cdd-426e-8d05-287fdf20f564", "name": "QUERY_PARAMS", "type": "n8n-nodes-base.set", "position": [ 20, 1340 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "f3a339da-66dc-45f1-852a-cdfe0daa4552", "name": "query", "type": "object", "value": "={{ $json.query.substring($json.query.indexOf('?') + 1).split('&').reduce((result, item) => (result[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]), result), {}) }}" } ] } }, "typeVersion": 3.4 }, { "id": "e9f627af-e935-478e-a2b1-b50ea57d14b1", "name": "CONFIG", "type": "n8n-nodes-base.set", "position": [ 200, 1340 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "ce4bb35a-c5ac-430e-b11a-6bf04de2dd90", "name": "query.maxlimit", "type": "number", "value": "={{ $json?.query?.maxlimit == null ? 70000 : Number($json?.query?.maxlimit) }}" } ] } }, "typeVersion": 3.4 }, { "id": "0309fb92-6785-4e38-aaeb-05ee4b6a64e2", "name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "position": [ 440, 1340 ], "parameters": { "url": "={{ encodeURI($json.query.url) }}", "options": { "response": { "response": { "neverError": true } }, "allowUnauthorizedCerts": true } }, "typeVersion": 4.2 }, { "id": "9c8b9856-a403-405c-afd4-9e9fecaa5913", "name": "Is error?", "type": "n8n-nodes-base.if", "position": [ 620, 1340 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "33937446-5010-47d2-b98f-2f0ceae3fbf5", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.hasOwnProperty('error') }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "d7275d78-2c59-4b8f-bb8e-481f73827fd5", "name": "Stringify error message", "type": "n8n-nodes-base.set", "position": [ 880, 1120 ], "parameters": { "include": "selected", "options": {}, "assignments": { "assignments": [ { "id": "510f74a1-17da-4a2a-b207-9eda19f97ee0", "name": "page_content", "type": "string", "value": "={{ $('QUERY_PARAMS').first()?.json?.query?.url == null ? \"INVALID action_input. This should be an HTTP query string like this: \\\"?url=VALIDURL&method=SELECTEDMETHOD\\\". Only a simple string value is accepted. JSON object as an action_input is NOT supported!\" : JSON.stringify($json.error) }}" } ] }, "includeFields": "HTML", "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "f7ca9e36-5edb-4573-a258-150c5bdcc644", "name": "Exctract HTML Body", "type": "n8n-nodes-base.set", "position": [ 900, 1620 ], "parameters": { "include": "selected", "options": {}, "assignments": { "assignments": [ { "id": "3639b76e-3ae9-4461-8d4c-552bf1c8a6bf", "name": "HTML", "type": "string", "value": "={{ $json?.data.match(/<body[^>]*>([\\s\\S]*?)<\\/body>/i)[1] }}" } ] }, "includeFields": "HTML", "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "9fef995b-d8ab-4d01-b2fb-01a605062fd1", "name": "Remove extra tags", "type": "n8n-nodes-base.set", "position": [ 1080, 1620 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "89b927c9-ddc1-4735-a0ea-c1e50a057f76", "name": "HTML", "type": "string", "value": "={{ ($json.HTML || \"HTML BODY CONTENT FOR THIS SEARCH RESULT IS NOT AVAILABLE\").replace(/<script[^>]*>([\\s\\S]*?)<\\/script>|<style[^>]*>([\\s\\S]*?)<\\/style>|<noscript[^>]*>([\\s\\S]*?)<\\/noscript>|<!--[\\s\\S]*?-->|<iframe[^>]*>([\\s\\S]*?)<\\/iframe>|<object[^>]*>([\\s\\S]*?)<\\/object>|<embed[^>]*>([\\s\\S]*?)<\\/embed>|<video[^>]*>([\\s\\S]*?)<\\/video>|<audio[^>]*>([\\s\\S]*?)<\\/audio>|<svg[^>]*>([\\s\\S]*?)<\\/svg>/ig, '')}}" } ] } }, "typeVersion": 3.4 }, { "id": "4897d31a-6425-4838-b934-95b1451cae61", "name": "Simplify?", "type": "n8n-nodes-base.if", "position": [ 1260, 1620 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "9c3a2a78-b236-4f47-89b0-34967965e01c", "operator": { "type": "string", "operation": "contains" }, "leftValue": "={{ $('CONFIG').first()?.json?.query?.method }}", "rightValue": "simplify" } ] } }, "typeVersion": 2.2 }, { "id": "997c724c-ea
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"02072c77-9eee-43bc-a046-bdc31bf1bc51\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -240,\n 1280\n ],\n \"parameters\": {\n \"width\": 616,\n \"height\": 236,\n \"content\": \"### Convert the query string into JSON, apply the limit for a page length\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"31e7582c-9289-4bd3-b89d-c3d866754313\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n 980\n ],\n \"parameters\": {\n \"width\": 491,\n \"height\": 285.7,\n \"content\": \"## Send an error message:\\n1. If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.\\n2. If the query is OK and an error was during the HTTP Request, then send back the original error message.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0f3ec3c8-076a-4f22-a9ab-4623494914ff\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n 1300\n ],\n \"parameters\": {\n \"width\": 1200,\n \"height\": 493,\n \"content\": \"## Post-processing of the HTML page:\\n1. Keep only <BODY> content\\n2. Remove inline <SCRIPT> tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.\\n3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length\\n4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text.\\n5. Finally, check the page length. If it's too long, send an \\\"ERROR: PAGE CONTENT TOO LONG\\\" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"139733cc-7954-459e-9b55-15a3bde4d8b7\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -240,\n 680\n ],\n \"parameters\": {\n \"width\": 617,\n \"height\": 503,\n \"content\": \"## Example ReAct AI Agent\\n1. Agent Prompt is default\\n2. Check the description of the HTTP_Request_Tool, it guides the agent to provide a query string with several parameters instead of a JSON object\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b5ee7e4-061d-4a17-8581-54e02086a49a\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -200,\n 840\n ],\n \"webhookId\": \"e0a11ea2-9dd7-496a-8078-1a96f05fc04b\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"adc5e4d7-bccf-4ee7-9464-5cbb7b1409ba\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 20,\n 840\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"10ccad7d-2c83-4fd9-beb9-a99e1c034947\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 20,\n 1040\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"4btCKq9GjcZHsUb1\",\n \"name\": \"x.ai compat\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"5d582c5f-35d3-4cdb-96ad-fa750be0b889\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n -160,\n 1340\n ],\n \"parameters\": {\n \"inputSource\": \"passthrough\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"1f073e7d-2cdd-426e-8d05-287fdf20f564\",\n \"name\": \"QUERY_PARAMS\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 20,\n 1340\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"f3a339da-66dc-45f1-852a-cdfe0daa4552\",\n \"name\": \"query\",\n \"type\": \"object\",\n \"value\": \"={{ $json.query.substring($json.query.indexOf('?') + 1).split('&').reduce((result, item) => (result[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]), result), {}) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"e9f627af-e935-478e-a2b1-b50ea57d14b1\",\n \"name\": \"CONFIG\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 200,\n 1340\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"ce4bb35a-c5ac-430e-b11a-6bf04de2dd90\",\n \"name\": \"query.maxlimit\",\n \"type\": \"number\",\n \"value\": \"={{ $json?.query?.maxlimit == null ? 70000 : Number($json?.query?.maxlimit) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"0309fb92-6785-4e38-aaeb-05ee4b6a64e2\",\n \"name\": \"HTTP Request\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 440,\n 1340\n ],\n \"parameters\": {\n \"url\": \"={{ encodeURI($json.query.url) }}\",\n \"options\": {\n \"response\": {\n \"response\": {\n \"neverError\": true\n }\n },\n \"allowUnauthorizedCerts\": true\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"9c8b9856-a403-405c-afd4-9e9fecaa5913\",\n \"name\": \"Is error?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 620,\n 1340\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"33937446-5010-47d2-b98f-2f0ceae3fbf5\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.hasOwnProperty('error') }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"d7275d78-2c59-4b8f-bb8e-481f73827fd5\",\n \"name\": \"Stringify error message\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 880,\n 1120\n ],\n \"parameters\": {\n \"include\": \"selected\",\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"510f74a1-17da-4a2a-b207-9eda19f97ee0\",\n \"name\": \"page_content\",\n \"type\": \"string\",\n \"value\": \"={{ $('QUERY_PARAMS').first()?.json?.query?.url == null ? \\\"INVALID action_input. This should be an HTTP query string like this: \\\\\\\"?url=VALIDURL&method=SELECTEDMETHOD\\\\\\\". Only a simple string value is accepted. JSON object as an action_input is NOT supported!\\\" : JSON.stringify($json.error) }}\"\n }\n ]\n },\n \"includeFields\": \"HTML\",\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"f7ca9e36-5edb-4573-a258-150c5bdcc644\",\n \"name\": \"Exctract HTML Body\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 900,\n 1620\n ],\n \"parameters\": {\n \"include\": \"selected\",\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"3639b76e-3ae9-4461-8d4c-552bf1c8a6bf\",\n \"name\": \"HTML\",\n \"type\": \"string\",\n \"value\": \"={{ $json?.data.match(/<body[^>]*>([\\\\s\\\\S]*?)<\\\\/body>/i)[1] }}\"\n }\n ]\n },\n \"includeFields\": \"HTML\",\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9fef995b-d8ab-4d01-b2fb-01a605062fd1\",\n \"name\": \"Remove extra tags\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1080,\n 1620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"89b927c9-ddc1-4735-a0ea-c1e50a057f76\",\n \"name\": \"HTML\",\n \"type\": \"string\",\n \"value\": \"={{ ($json.HTML || \\\"HTML BODY CONTENT FOR THIS SEARCH RESULT IS NOT AVAILABLE\\\").replace(/<script[^>]*>([\\\\s\\\\S]*?)<\\\\/script>|<style[^>]*>([\\\\s\\\\S]*?)<\\\\/style>|<noscript[^>]*>([\\\\s\\\\S]*?)<\\\\/noscript>|<!--[\\\\s\\\\S]*?-->|<iframe[^>]*>([\\\\s\\\\S]*?)<\\\\/iframe>|<object[^>]*>([\\\\s\\\\S]*?)<\\\\/object>|<embed[^>]*>([\\\\s\\\\S]*?)<\\\\/embed>|<video[^>]*>([\\\\s\\\\S]*?)<\\\\/video>|<audio[^>]*>([\\\\s\\\\S]*?)<\\\\/audio>|<svg[^>]*>([\\\\s\\\\S]*?)<\\\\/svg>/ig, '')}}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4897d31a-6425-4838-b934-95b1451cae61\",\n \"name\": \"Simplify?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1260,\n 1620\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9c3a2a78-b236-4f47-89b0-34967965e01c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"contains\"\n },\n \"leftValue\": \"={{ $('CONFIG').first()?.json?.query?.method }}\",\n \"rightValue\": \"simplify\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"997c724c-ea8f-4536-a389-ac8429d57448\",\n \"name\": \"Simplify output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1440,\n 1520\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"92b08041-799b-4335-aefe-3781a42f8ec0\",\n \"name\": \"HTML\",\n \"type\": \"string\",\n \"value\": \"={{ $json.HTML.replace(/href\\\\s*=\\\\s*\\\"(.+?)\\\"/gi, 'href=\\\"NOURL\\\"').replace(/src\\\\s*=\\\\s*\\\"(.+?)\\\"/gi, 'src=\\\"NOIMG\\\"')}}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"440a8076-3901-42e2-a36a-bc47ff588dd4\",\n \"name\": \"Convert to Markdown\",\n \"type\": \"n8n-nodes-base.markdown\",\n \"position\": [\n 1620,\n 1620\n ],\n \"parameters\": {\n \"html\": \"={{ $json.HTML }}\",\n \"options\": {},\n \"destinationKey\": \"page_content\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a2fbeb5e-3e82-4777-bb61-3e475ffe2fc8\",\n \"name\": \"Send Page Content\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1820,\n 1620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"48a78432-2103-44ed-b4d6-7e429ae9e742\",\n \"name\": \"page_content\",\n \"type\": \"string\",\n \"value\": \"={{ $json.page_content.length < $('CONFIG').first()?.json?.query?.maxlimit ? $json.page_content : \\\"ERROR: PAGE CONTENT TOO LONG\\\" }}\"\n },\n {\n \"id\": \"ec0130f1-16a2-474f-a7cb-96d0e6fc644f\",\n \"name\": \"page_length\",\n \"type\": \"string\",\n \"value\": \"={{ $json.page_content.length }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"d367adfd-efd8-49e3-bed3-d65f23a60a9a\",\n \"name\": \"HTTP_Request_Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 200,\n 1040\n ],\n \"parameters\": {\n \"name\": \"HTTP_Request_Tool\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\",\n \"cachedResultName\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Call this tool to fetch a webpage content. The input should be a stringified HTTP query parameter like this: \\\"?url=VALIDURL&method=SELECTEDMETHOD\\\". \\\"url\\\" parameter should contain the valid URL string. \\\"method\\\" key can be either \\\"full\\\" or \\\"simplified\\\". method=full will fetch the whole webpage content in the Markdown format, including page links and image links. method=simplified will return the Markdown content of the page but remove urls and image links from the page content for simplicity. Before calling this tool, think strategically which \\\"method\\\" to call. Best of all to use method=simplified. However, if you anticipate that the page request is not final or if you need to extract links from the page, pick method=full.\",\n \"workflowInputs\": {\n \"value\": {},\n \"schema\": [],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"CONFIG\": {\n \"main\": [\n [\n {\n \"node\": \"HTTP Request\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Is error?\": {\n \"main\": [\n [\n {\n \"node\": \"Stringify error message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Exctract HTML Body\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simplify?\": {\n \"main\": [\n [\n {\n \"node\": \"Simplify output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Convert to Markdown\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"HTTP Request\": {\n \"main\": [\n [\n {\n \"node\": \"Is error?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"QUERY_PARAMS\": {\n \"main\": [\n [\n {\n \"node\": \"CONFIG\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simplify output\": {\n \"main\": [\n [\n {\n \"node\": \"Convert to Markdown\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"HTTP_Request_Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Remove extra tags\": {\n \"main\": [\n [\n {\n \"node\": \"Simplify?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Exctract HTML Body\": {\n \"main\": [\n [\n {\n \"node\": \"Remove extra tags\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert to Markdown\": {\n \"main\": [\n [\n {\n \"node\": \"Send Page Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"QUERY_PARAMS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
34
0
2
true
combined_workflows.json
{ "input": "This workflow aims to create an AI-powered tool that fetches and processes web page content based on a user's query. It converts the query string into parameters, makes an HTTP request, extracts and cleans the HTML, simplifies it if requested, converts to Markdown, and returns the content, handling errors and page length limits.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11431, "processed_size": 11431, "processed_timestamp": "2025-04-09T03:08:38.333333", "timestamp": "2025-04-09T02:36:34.505653", "token_count": 4095, "tokens": 1123, "workflow_chunk_info": { "is_truncated": false, "original_size": 11431, "processed_size": 11431, "workflow_hash": "8c4b1d46469f2762f26e6369939e298f" }, "workflow_hash": "8c4b1d46469f2762f26e6369939e298f" }
"version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "9c3a2a78-b236-4f47-89b0-34967965e01c", "operator": { "type": "string", "operation": "contains" }, "leftValue": "={{ $('CONFIG').first()?.json?.query?.method }}", "rightValue": "simplify" } ] } }, "typeVersion": 2.2 }, { "id": "997c724c-ea8f-4536-a389-ac8429d57448", "name": "Simplify output", "type": "n8n-nodes-base.set", "position": [ 1440, 1520 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "92b08041-799b-4335-aefe-3781a42f8ec0", "name": "HTML", "type": "string", "value": "={{ $json.HTML.replace(/href\\s*=\\s*\"(.+?)\"/gi, 'href=\"NOURL\"').replace(/src\\s*=\\s*\"(.+?)\"/gi, 'src=\"NOIMG\"')}}" } ] } }, "typeVersion": 3.4 }, { "id": "440a8076-3901-42e2-a36a-bc47ff588dd4", "name": "Convert to Markdown", "type": "n8n-nodes-base.markdown", "position": [ 1620, 1620 ], "parameters": { "html": "={{ $json.HTML }}", "options": {}, "destinationKey": "page_content" }, "typeVersion": 1 }, { "id": "a2fbeb5e-3e82-4777-bb61-3e475ffe2fc8", "name": "Send Page Content", "type": "n8n-nodes-base.set", "position": [ 1820, 1620 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "48a78432-2103-44ed-b4d6-7e429ae9e742", "name": "page_content", "type": "string", "value": "={{ $json.page_content.length < $('CONFIG').first()?.json?.query?.maxlimit ? $json.page_content : \"ERROR: PAGE CONTENT TOO LONG\" }}" }, { "id": "ec0130f1-16a2-474f-a7cb-96d0e6fc644f", "name": "page_length", "type": "string", "value": "={{ $json.page_content.length }}" } ] } }, "typeVersion": 3.4 }, { "id": "d367adfd-efd8-49e3-bed3-d65f23a60a9a", "name": "HTTP_Request_Tool", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 200, 1040 ], "parameters": { "name": "HTTP_Request_Tool", "workflowId": { "__rl": true, "mode": "id", "value": "={{ $workflow.id }}", "cachedResultName": "={{ $workflow.id }}" }, "description": "Call this tool to fetch a webpage content. The input should be a stringified HTTP query parameter like this: \"?url=VALIDURL&method=SELECTEDMETHOD\". \"url\" parameter should contain the valid URL string. \"method\" key can be either \"full\" or \"simplified\". method=full will fetch the whole webpage content in the Markdown format, including page links and image links. method=simplified will return the Markdown content of the page but remove urls and image links from the page content for simplicity. Before calling this tool, think strategically which \"method\" to call. Best of all to use method=simplified. However, if you anticipate that the page request is not final or if you need to extract links from the page, pick method=full.", "workflowInputs": { "value": {}, "schema": [], "mappingMode": "defineBelow", "matchingColumns": [], "attemptToConvertTypes": false, "convertFieldsToString": false } }, "typeVersion": 2 } ], "pinData": {}, "connections": { "CONFIG": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "Is error?": { "main": [ [ { "node": "Stringify error message", "type": "main", "index": 0 } ], [ { "node": "Exctract HTML Body", "type": "main", "index": 0 } ] ] }, "Simplify?": { "main": [ [ { "node": "Simplify output", "type": "main", "index": 0 } ], [ { "node": "Convert to Markdown", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Is error?", "type": "main", "index": 0 } ] ] }, "QUERY_PARAMS": { "main": [ [ { "node": "CONFIG", "type": "main", "index": 0 } ] ] }, "Simplify output": { "main": [ [ { "node": "Convert to Markdown", "type": "main", "index": 0 } ] ] }, "HTTP_Request_Tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Remove extra tags": { "main": [ [ { "node": "Simplify?", "type": "main", "index": 0 } ] ] }, "Exctract HTML Body": { "main": [ [ { "node": "Remove extra tags", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Convert to Markdown": { "main": [ [ { "node": "Send Page Content", "type": "main", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "When Executed by Another Workflow": { "main": [ [ { "node": "QUERY_PARAMS", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"02072c77-9eee-43bc-a046-bdc31bf1bc51\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -240,\n 1280\n ],\n \"parameters\": {\n \"width\": 616,\n \"height\": 236,\n \"content\": \"### Convert the query string into JSON, apply the limit for a page length\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"31e7582c-9289-4bd3-b89d-c3d866754313\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n 980\n ],\n \"parameters\": {\n \"width\": 491,\n \"height\": 285.7,\n \"content\": \"## Send an error message:\\n1. If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.\\n2. If the query is OK and an error was during the HTTP Request, then send back the original error message.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0f3ec3c8-076a-4f22-a9ab-4623494914ff\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n 1300\n ],\n \"parameters\": {\n \"width\": 1200,\n \"height\": 493,\n \"content\": \"## Post-processing of the HTML page:\\n1. Keep only <BODY> content\\n2. Remove inline <SCRIPT> tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.\\n3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length\\n4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text.\\n5. Finally, check the page length. If it's too long, send an \\\"ERROR: PAGE CONTENT TOO LONG\\\" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"139733cc-7954-459e-9b55-15a3bde4d8b7\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -240,\n 680\n ],\n \"parameters\": {\n \"width\": 617,\n \"height\": 503,\n \"content\": \"## Example ReAct AI Agent\\n1. Agent Prompt is default\\n2. Check the description of the HTTP_Request_Tool, it guides the agent to provide a query string with several parameters instead of a JSON object\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b5ee7e4-061d-4a17-8581-54e02086a49a\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -200,\n 840\n ],\n \"webhookId\": \"e0a11ea2-9dd7-496a-8078-1a96f05fc04b\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"adc5e4d7-bccf-4ee7-9464-5cbb7b1409ba\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 20,\n 840\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"10ccad7d-2c83-4fd9-beb9-a99e1c034947\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 20,\n 1040\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"4btCKq9GjcZHsUb1\",\n \"name\": \"x.ai compat\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"5d582c5f-35d3-4cdb-96ad-fa750be0b889\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n -160,\n 1340\n ],\n \"parameters\": {\n \"inputSource\": \"passthrough\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"1f073e7d-2cdd-426e-8d05-287fdf20f564\",\n \"name\": \"QUERY_PARAMS\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 20,\n 1340\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"f3a339da-66dc-45f1-852a-cdfe0daa4552\",\n \"name\": \"query\",\n \"type\": \"object\",\n \"value\": \"={{ $json.query.substring($json.query.indexOf('?') + 1).split('&').reduce((result, item) => (result[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]), result), {}) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"e9f627af-e935-478e-a2b1-b50ea57d14b1\",\n \"name\": \"CONFIG\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 200,\n 1340\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"ce4bb35a-c5ac-430e-b11a-6bf04de2dd90\",\n \"name\": \"query.maxlimit\",\n \"type\": \"number\",\n \"value\": \"={{ $json?.query?.maxlimit == null ? 70000 : Number($json?.query?.maxlimit) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"0309fb92-6785-4e38-aaeb-05ee4b6a64e2\",\n \"name\": \"HTTP Request\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 440,\n 1340\n ],\n \"parameters\": {\n \"url\": \"={{ encodeURI($json.query.url) }}\",\n \"options\": {\n \"response\": {\n \"response\": {\n \"neverError\": true\n }\n },\n \"allowUnauthorizedCerts\": true\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"9c8b9856-a403-405c-afd4-9e9fecaa5913\",\n \"name\": \"Is error?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 620,\n 1340\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"33937446-5010-47d2-b98f-2f0ceae3fbf5\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.hasOwnProperty('error') }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"d7275d78-2c59-4b8f-bb8e-481f73827fd5\",\n \"name\": \"Stringify error message\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 880,\n 1120\n ],\n \"parameters\": {\n \"include\": \"selected\",\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"510f74a1-17da-4a2a-b207-9eda19f97ee0\",\n \"name\": \"page_content\",\n \"type\": \"string\",\n \"value\": \"={{ $('QUERY_PARAMS').first()?.json?.query?.url == null ? \\\"INVALID action_input. This should be an HTTP query string like this: \\\\\\\"?url=VALIDURL&method=SELECTEDMETHOD\\\\\\\". Only a simple string value is accepted. JSON object as an action_input is NOT supported!\\\" : JSON.stringify($json.error) }}\"\n }\n ]\n },\n \"includeFields\": \"HTML\",\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"f7ca9e36-5edb-4573-a258-150c5bdcc644\",\n \"name\": \"Exctract HTML Body\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 900,\n 1620\n ],\n \"parameters\": {\n \"include\": \"selected\",\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"3639b76e-3ae9-4461-8d4c-552bf1c8a6bf\",\n \"name\": \"HTML\",\n \"type\": \"string\",\n \"value\": \"={{ $json?.data.match(/<body[^>]*>([\\\\s\\\\S]*?)<\\\\/body>/i)[1] }}\"\n }\n ]\n },\n \"includeFields\": \"HTML\",\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9fef995b-d8ab-4d01-b2fb-01a605062fd1\",\n \"name\": \"Remove extra tags\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1080,\n 1620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"89b927c9-ddc1-4735-a0ea-c1e50a057f76\",\n \"name\": \"HTML\",\n \"type\": \"string\",\n \"value\": \"={{ ($json.HTML || \\\"HTML BODY CONTENT FOR THIS SEARCH RESULT IS NOT AVAILABLE\\\").replace(/<script[^>]*>([\\\\s\\\\S]*?)<\\\\/script>|<style[^>]*>([\\\\s\\\\S]*?)<\\\\/style>|<noscript[^>]*>([\\\\s\\\\S]*?)<\\\\/noscript>|<!--[\\\\s\\\\S]*?-->|<iframe[^>]*>([\\\\s\\\\S]*?)<\\\\/iframe>|<object[^>]*>([\\\\s\\\\S]*?)<\\\\/object>|<embed[^>]*>([\\\\s\\\\S]*?)<\\\\/embed>|<video[^>]*>([\\\\s\\\\S]*?)<\\\\/video>|<audio[^>]*>([\\\\s\\\\S]*?)<\\\\/audio>|<svg[^>]*>([\\\\s\\\\S]*?)<\\\\/svg>/ig, '')}}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4897d31a-6425-4838-b934-95b1451cae61\",\n \"name\": \"Simplify?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1260,\n 1620\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9c3a2a78-b236-4f47-89b0-34967965e01c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"contains\"\n },\n \"leftValue\": \"={{ $('CONFIG').first()?.json?.query?.method }}\",\n \"rightValue\": \"simplify\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"997c724c-ea8f-4536-a389-ac8429d57448\",\n \"name\": \"Simplify output\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1440,\n 1520\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"92b08041-799b-4335-aefe-3781a42f8ec0\",\n \"name\": \"HTML\",\n \"type\": \"string\",\n \"value\": \"={{ $json.HTML.replace(/href\\\\s*=\\\\s*\\\"(.+?)\\\"/gi, 'href=\\\"NOURL\\\"').replace(/src\\\\s*=\\\\s*\\\"(.+?)\\\"/gi, 'src=\\\"NOIMG\\\"')}}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"440a8076-3901-42e2-a36a-bc47ff588dd4\",\n \"name\": \"Convert to Markdown\",\n \"type\": \"n8n-nodes-base.markdown\",\n \"position\": [\n 1620,\n 1620\n ],\n \"parameters\": {\n \"html\": \"={{ $json.HTML }}\",\n \"options\": {},\n \"destinationKey\": \"page_content\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a2fbeb5e-3e82-4777-bb61-3e475ffe2fc8\",\n \"name\": \"Send Page Content\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1820,\n 1620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"48a78432-2103-44ed-b4d6-7e429ae9e742\",\n \"name\": \"page_content\",\n \"type\": \"string\",\n \"value\": \"={{ $json.page_content.length < $('CONFIG').first()?.json?.query?.maxlimit ? $json.page_content : \\\"ERROR: PAGE CONTENT TOO LONG\\\" }}\"\n },\n {\n \"id\": \"ec0130f1-16a2-474f-a7cb-96d0e6fc644f\",\n \"name\": \"page_length\",\n \"type\": \"string\",\n \"value\": \"={{ $json.page_content.length }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"d367adfd-efd8-49e3-bed3-d65f23a60a9a\",\n \"name\": \"HTTP_Request_Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 200,\n 1040\n ],\n \"parameters\": {\n \"name\": \"HTTP_Request_Tool\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\",\n \"cachedResultName\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Call this tool to fetch a webpage content. The input should be a stringified HTTP query parameter like this: \\\"?url=VALIDURL&method=SELECTEDMETHOD\\\". \\\"url\\\" parameter should contain the valid URL string. \\\"method\\\" key can be either \\\"full\\\" or \\\"simplified\\\". method=full will fetch the whole webpage content in the Markdown format, including page links and image links. method=simplified will return the Markdown content of the page but remove urls and image links from the page content for simplicity. Before calling this tool, think strategically which \\\"method\\\" to call. Best of all to use method=simplified. However, if you anticipate that the page request is not final or if you need to extract links from the page, pick method=full.\",\n \"workflowInputs\": {\n \"value\": {},\n \"schema\": [],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"CONFIG\": {\n \"main\": [\n [\n {\n \"node\": \"HTTP Request\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Is error?\": {\n \"main\": [\n [\n {\n \"node\": \"Stringify error message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Exctract HTML Body\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simplify?\": {\n \"main\": [\n [\n {\n \"node\": \"Simplify output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Convert to Markdown\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"HTTP Request\": {\n \"main\": [\n [\n {\n \"node\": \"Is error?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"QUERY_PARAMS\": {\n \"main\": [\n [\n {\n \"node\": \"CONFIG\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simplify output\": {\n \"main\": [\n [\n {\n \"node\": \"Convert to Markdown\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"HTTP_Request_Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Remove extra tags\": {\n \"main\": [\n [\n {\n \"node\": \"Simplify?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Exctract HTML Body\": {\n \"main\": [\n [\n {\n \"node\": \"Remove extra tags\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert to Markdown\": {\n \"main\": [\n [\n {\n \"node\": \"Send Page Content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"QUERY_PARAMS\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
34
1
2
true
combined_workflows.json
{ "input": "This workflow aims to create an AI-powered tool that fetches and processes web page content based on a user's query. It converts the query string into parameters, makes an HTTP request, extracts and cleans the HTML, simplifies it if requested, converts to Markdown, and returns the content, handling errors and page length limits.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11431, "processed_size": 11431, "processed_timestamp": "2025-04-09T03:08:38.339333", "timestamp": "2025-04-09T02:36:34.505653", "token_count": 2253, "tokens": 1123, "workflow_chunk_info": { "is_truncated": false, "original_size": 11431, "processed_size": 11431, "workflow_hash": "8c4b1d46469f2762f26e6369939e298f" }, "workflow_hash": "8c4b1d46469f2762f26e6369939e298f" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow scrapes the latest Paul Graham essays, summarizes them using GPT, and cleans up the output. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "a9048293-787d-44d6-b995-d329b2495048", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ -1920, 1380 ], "parameters": {}, "typeVersion": 1 }, { "id": "56017e8b-2f2e-4f40-9325-184ea01a18be", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1720, 1260 ], "parameters": { "width": 1071.752021563343, "height": 285.66037735849045, "content": "## Scrape latest Paul Graham essays" }, "typeVersion": 1 }, { "id": "aa855d7c-6602-4242-bc84-56fed7c27c26", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -600, 1260 ], "parameters": { "width": 625, "height": 607, "content": "## Summarize them with GPT" }, "typeVersion": 1 }, { "id": "1a38e545-6d3b-40b2-a3ff-6f91fdd772de", "name": "Fetch Essay List", "type": "n8n-nodes-base.httpRequest", "position": [ -1640, 1380 ], "parameters": { "url": "http://www.paulgraham.com/articles.html", "options": {} }, "typeVersion": 4.2 }, { "id": "bd713892-356b-4a9c-b076-000bd4f1f1ba", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ -380, 1600 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "4d7359ab-ba87-4756-8168-f2b987aac2fc", "name": "Extract essay names", "type": "n8n-nodes-base.html", "position": [ -1440, 1380 ], "parameters": { "options": {}, "operation": "extractHtmlContent", "extractionValues": { "values": [ { "key": "essay", "attribute": "href", "cssSelector": "table table a", "returnArray": true, "returnValue": "attribute" } ] } }, "typeVersion": 1.2 }, { "id": "8342d13f-879d-426b-ba28-ab696dd7f155", "name": "Split out into items", "type": "n8n-nodes-base.splitOut", "position": [ -1240, 1380 ], "parameters": { "options": {}, "fieldToSplitOut": "essay" }, "typeVersion": 1 }, { "id": "a057d3cb-b7fb-4b4d-810a-e4de3ac10702", "name": "Fetch essay texts", "type": "n8n-nodes-base.httpRequest", "position": [ -840, 1380 ], "parameters": { "url": "=http://www.paulgraham.com/{{ $json.essay }}", "options": {} }, "typeVersion": 4.2 }, { "id": "98164d8c-3d6f-485d-93b6-1da3e8ae7ca8", "name": "Extract title", "type": "n8n-nodes-base.html", "position": [ -340, 1080 ], "parameters": { "options": {}, "operation": "extractHtmlContent", "extractionValues": { "values": [ { "key": "title", "cssSelector": "title" } ] } }, "typeVersion": 1.2 }, { "id": "fc0b6230-d169-4b20-803b-1896982c37c3", "name": "Summarization Chain", "type": "@n8n/n8n-nodes-langchain.chainSummarization", "position": [ -340, 1380 ], "parameters": { "options": {}, "operationMode": "documentLoader" }, "typeVersion": 2 }, { "id": "a656524a-9f77-4922-9de7-e2221ac82b70", "name": "Clean up", "type": "n8n-nodes-base.set", "position": [ 360, 1380 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "7b337b47-a1c6-470e-881f-0c038b4917e5", "name": "title", "type": "string", "value": "={{ $json.title }}" }, { "id": "ca820521-4fff-4971-84b5-e6e2dbd8bb7a", "name": "summary", "type": "string", "value": "={{ $json.response.text }}" }, { "id": "0fd9b5e3-44dd-49a3-82c1-3a4aa4698376", "name": "url", "type": "string", "value": "=http://www.paulgraham.com/{{ $('Limit to first 3').first().json.essay }}" } ] } }, "typeVersion": 3.4 }, { "id": "da738af0-7302-442d-bdc8-c9771be10794", "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ 160, 1380 ], "parameters": { "mode": "combine", "options": {}, "combineBy": "combineByPosition" }, "typeVersion": 3 }, { "id": "adf51f27-8d3e-49a8-b850-7990d355dc81", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ -260, 1600 ], "parameters": { "options": {}, "jsonData": "={{ $('Extract Text Only').item.json.data }}", "jsonMode": "expressionData" }, "typeVersion": 1 }, { "id": "f57c5908-4ae3-4ce1-a74b-0fc393792c21", "name": "Recursive Character Text Splitter", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ -180, 1720 ], "parameters": { "options": {}, "chunkSize": 6000 }, "typeVersion": 1 }, { "id": "278eed78-3489-41e3-b4d2-a2de788fcd21", "name": "Limit to first 3", "type": "n8n-nodes-base.limit", "position": [ -1040, 1380 ], "parameters": { "maxItems": 3 }, "typeVersion": 1 }, { "id": "028147d1-2a45-416d-91d0-40a0af2747f5", "name": "Extract Text Only", "type": "n8n-nodes-base.html", "position": [ -520, 1380 ], "parameters": { "options": {}, "operation": "extractHtmlContent", "extractionValues": { "values": [ { "key": "data", "cssSelector": "body", "skipSelectors": "img,nav" } ] } }, "typeVersion": 1.2 } ], "pinData": {}, "connections": { "Merge": { "main": [ [ { "node": "Clean up", "type": "main", "index": 0 } ] ] }, "Extract title": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Fetch Essay List": { "main": [ [ { "node": "Extract essay names", "type": "main", "index": 0 } ] ] }, "Limit to first 3": { "main": [ [ { "node": "Fetch essay texts", "type": "main", "index": 0 } ] ] }, "Extract Text Only": { "main": [ [ { "node": "Summarization Chain", "type": "main", "index": 0 } ] ] }, "Fetch essay texts": { "main": [ [ { "node": "Extract title", "type": "main", "index": 0 }, { "node": "Extract Text Only", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "Summarization Chain", "type": "ai_languageModel", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Summarization Chain", "type": "ai_document", "index": 0 } ] ] }, "Extract essay names": { "main": [ [ { "node": "Split out into items", "type": "main", "index": 0 } ] ] }, "Summarization Chain": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "Split out into items": { "main": [ [ { "node": "Limit to first 3", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Fetch Essay List", "type": "main", "index": 0 } ] ] }, "Recursive Character Text Splitter": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"a9048293-787d-44d6-b995-d329b2495048\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1920,\n 1380\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"56017e8b-2f2e-4f40-9325-184ea01a18be\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1720,\n 1260\n ],\n \"parameters\": {\n \"width\": 1071.752021563343,\n \"height\": 285.66037735849045,\n \"content\": \"## Scrape latest Paul Graham essays\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"aa855d7c-6602-4242-bc84-56fed7c27c26\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n 1260\n ],\n \"parameters\": {\n \"width\": 625,\n \"height\": 607,\n \"content\": \"## Summarize them with GPT\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a38e545-6d3b-40b2-a3ff-6f91fdd772de\",\n \"name\": \"Fetch Essay List\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n -1640,\n 1380\n ],\n \"parameters\": {\n \"url\": \"http://www.paulgraham.com/articles.html\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"bd713892-356b-4a9c-b076-000bd4f1f1ba\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -380,\n 1600\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"4d7359ab-ba87-4756-8168-f2b987aac2fc\",\n \"name\": \"Extract essay names\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n -1440,\n 1380\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"extractHtmlContent\",\n \"extractionValues\": {\n \"values\": [\n {\n \"key\": \"essay\",\n \"attribute\": \"href\",\n \"cssSelector\": \"table table a\",\n \"returnArray\": true,\n \"returnValue\": \"attribute\"\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"8342d13f-879d-426b-ba28-ab696dd7f155\",\n \"name\": \"Split out into items\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n -1240,\n 1380\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"essay\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a057d3cb-b7fb-4b4d-810a-e4de3ac10702\",\n \"name\": \"Fetch essay texts\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n -840,\n 1380\n ],\n \"parameters\": {\n \"url\": \"=http://www.paulgraham.com/{{ $json.essay }}\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"98164d8c-3d6f-485d-93b6-1da3e8ae7ca8\",\n \"name\": \"Extract title\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n -340,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"extractHtmlContent\",\n \"extractionValues\": {\n \"values\": [\n {\n \"key\": \"title\",\n \"cssSelector\": \"title\"\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"fc0b6230-d169-4b20-803b-1896982c37c3\",\n \"name\": \"Summarization Chain\",\n \"type\": \"@n8n/n8n-nodes-langchain.chainSummarization\",\n \"position\": [\n -340,\n 1380\n ],\n \"parameters\": {\n \"options\": {},\n \"operationMode\": \"documentLoader\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"a656524a-9f77-4922-9de7-e2221ac82b70\",\n \"name\": \"Clean up\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 360,\n 1380\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"7b337b47-a1c6-470e-881f-0c038b4917e5\",\n \"name\": \"title\",\n \"type\": \"string\",\n \"value\": \"={{ $json.title }}\"\n },\n {\n \"id\": \"ca820521-4fff-4971-84b5-e6e2dbd8bb7a\",\n \"name\": \"summary\",\n \"type\": \"string\",\n \"value\": \"={{ $json.response.text }}\"\n },\n {\n \"id\": \"0fd9b5e3-44dd-49a3-82c1-3a4aa4698376\",\n \"name\": \"url\",\n \"type\": \"string\",\n \"value\": \"=http://www.paulgraham.com/{{ $('Limit to first 3').first().json.essay }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"da738af0-7302-442d-bdc8-c9771be10794\",\n \"name\": \"Merge\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 160,\n 1380\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combineBy\": \"combineByPosition\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"adf51f27-8d3e-49a8-b850-7990d355dc81\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n -260,\n 1600\n ],\n \"parameters\": {\n \"options\": {},\n \"jsonData\": \"={{ $('Extract Text Only').item.json.data }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f57c5908-4ae3-4ce1-a74b-0fc393792c21\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n -180,\n 1720\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkSize\": 6000\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"278eed78-3489-41e3-b4d2-a2de788fcd21\",\n \"name\": \"Limit to first 3\",\n \"type\": \"n8n-nodes-base.limit\",\n \"position\": [\n -1040,\n 1380\n ],\n \"parameters\": {\n \"maxItems\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"028147d1-2a45-416d-91d0-40a0af2747f5\",\n \"name\": \"Extract Text Only\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n -520,\n 1380\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"extractHtmlContent\",\n \"extractionValues\": {\n \"values\": [\n {\n \"key\": \"data\",\n \"cssSelector\": \"body\",\n \"skipSelectors\": \"img,nav\"\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Merge\": {\n \"main\": [\n [\n {\n \"node\": \"Clean up\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract title\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Fetch Essay List\": {\n \"main\": [\n [\n {\n \"node\": \"Extract essay names\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Limit to first 3\": {\n \"main\": [\n [\n {\n \"node\": \"Fetch essay texts\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract Text Only\": {\n \"main\": [\n [\n {\n \"node\": \"Summarization Chain\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Fetch essay texts\": {\n \"main\": [\n [\n {\n \"node\": \"Extract title\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Extract Text Only\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Summarization Chain\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Summarization Chain\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract essay names\": {\n \"main\": [\n [\n {\n \"node\": \"Split out into items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Summarization Chain\": {\n \"main\": [\n [\n {\n \"node\": \"Merge\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Split out into items\": {\n \"main\": [\n [\n {\n \"node\": \"Limit to first 3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Fetch Essay List\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
35
0
1
false
combined_workflows.json
{ "input": "This workflow scrapes the latest Paul Graham essays, summarizes them using GPT, and cleans up the output.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6112, "processed_size": 6112, "processed_timestamp": "2025-04-09T03:08:38.356314", "timestamp": "2025-04-09T02:36:35.349758", "token_count": 3773, "tokens": 542, "workflow_chunk_info": { "is_truncated": false, "original_size": 6112, "processed_size": 6112, "workflow_hash": "42fb4bf069712784630349f6837cf4b0" }, "workflow_hash": "42fb4bf069712784630349f6837cf4b0" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To create a chatbot that responds to chat messages using an AI agent, incorporating memory and search capabilities. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "ef4c6982-f746-4d48-944b-449f8bdbb69f", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -180, -380 ], "webhookId": "53c136fe-3e77-4709-a143-fe82746dd8b6", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "e6183978-5077-4252-9718-6b36b6a7cd74", "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 160, -160 ], "parameters": {}, "typeVersion": 1.3 }, { "id": "1719e956-f9c8-48f5-9744-ee62345a9f7d", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 20, -160 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "f0815af7-da61-4863-9cfa-b35be836b59c", "name": "SerpAPI", "type": "@n8n/n8n-nodes-langchain.toolSerpApi", "position": [ 300, -160 ], "parameters": { "options": {} }, "credentials": { "serpApi": { "id": "aJCKjxx6U3K7ydDe", "name": "SerpAPI account" } }, "typeVersion": 1 }, { "id": "2d3b4012-bd5f-46d5-be6d-af1ede6c155b", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 60, -380 ], "parameters": { "options": {} }, "typeVersion": 1.8 } ], "pinData": {}, "connections": { "SerpAPI": { "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 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"ef4c6982-f746-4d48-944b-449f8bdbb69f\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -180,\n -380\n ],\n \"webhookId\": \"53c136fe-3e77-4709-a143-fe82746dd8b6\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"e6183978-5077-4252-9718-6b36b6a7cd74\",\n \"name\": \"Simple Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 160,\n -160\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"1719e956-f9c8-48f5-9744-ee62345a9f7d\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 20,\n -160\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"f0815af7-da61-4863-9cfa-b35be836b59c\",\n \"name\": \"SerpAPI\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolSerpApi\",\n \"position\": [\n 300,\n -160\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"serpApi\": {\n \"id\": \"aJCKjxx6U3K7ydDe\",\n \"name\": \"SerpAPI account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2d3b4012-bd5f-46d5-be6d-af1ede6c155b\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 60,\n -380\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"SerpAPI\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simple Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
36
0
1
false
combined_workflows.json
{ "input": "To create a chatbot that responds to chat messages using an AI agent, incorporating memory and search capabilities.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 1809, "processed_size": 1809, "processed_timestamp": "2025-04-09T03:08:38.364319", "timestamp": "2025-04-09T02:36:35.478841", "token_count": 1273, "tokens": 150, "workflow_chunk_info": { "is_truncated": false, "original_size": 1809, "processed_size": 1809, "workflow_hash": "ba784e1c509d05f31a4d939df34dc67a" }, "workflow_hash": "ba784e1c509d05f31a4d939df34dc67a" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow creates a Telegram bot that uses AI to chat with users and generate images based on their requests. Analyze this workflow: ```json { "id": "ax8PJlp1UDb6EGFt", "meta": { "instanceId": "fb924c73af8f703905bc09c9ee8076f48c17b596ed05b18c0ff86915ef8a7c4a" }, "name": "Telegram AI Langchain bot", "tags": [], "nodes": [ { "id": "e275f31f-6a5f-4444-8bf7-6c003a8e53df", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 1100, 600 ], "parameters": { "model": "gpt-4-1106-preview", "options": { "temperature": 0.7, "frequencyPenalty": 0.2 } }, "credentials": { "openAiApi": { "id": "63", "name": "OpenAi account" } }, "typeVersion": 1 }, { "id": "f25a6666-ff23-4372-afd0-4920a99aab6a", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 1220, 600 ], "parameters": { "sessionKey": "=chat_with_{{ $('Listen for incoming events').first().json.message.chat.id }}", "contextWindowLength": 10 }, "typeVersion": 1 }, { "id": "96faef5d-0349-47fe-a7cf-150953490e90", "name": "Telegram", "type": "n8n-nodes-base.telegram", "onError": "continueErrorOutput", "position": [ 1500, 380 ], "parameters": { "text": "={{ $json.output }}", "chatId": "={{ $('Listen for incoming events').first().json.message.from.id }}", "additionalFields": { "parse_mode": "HTML", "appendAttribution": false } }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram sdfsdfsdfsdfsfd_bot" } }, "typeVersion": 1.1 }, { "id": "5ad43039-aaa6-43cd-9b0f-1d02f4d9c4ff", "name": "Correct errors", "type": "n8n-nodes-base.telegram", "position": [ 1700, 380 ], "parameters": { "text": "={{ $('AI Agent').item.json.output.replace(/&/g, \"&amp;\").replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\").replace(/\"/g, \"&quot;\") }}", "chatId": "={{ $('Listen for incoming events').first().json.message.from.id }}", "additionalFields": { "parse_mode": "HTML", "appendAttribution": false } }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram sdfsdfsdfsdfsfd_bot" } }, "typeVersion": 1.1 }, { "id": "0349a250-966a-4064-970a-8bcfba1647ad", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 940, 900 ], "parameters": {}, "typeVersion": 1 }, { "id": "69a45c1f-838f-49ce-9b89-75db6a8b876f", "name": "Listen for incoming events", "type": "n8n-nodes-base.telegramTrigger", "position": [ 940, 380 ], "webhookId": "322dce18-f93e-4f86-b9b1-3305519b7834", "parameters": { "updates": [ "message" ], "additionalFields": {} }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram sdfsdfsdfsdfsfd_bot" } }, "typeVersion": 1 }, { "id": "2f5d5f25-9870-40d6-ad42-52750e62de63", "name": "Send back an image", "type": "n8n-nodes-base.telegram", "position": [ 1300, 900 ], "parameters": { "file": "={{ $json.data[0].url }}", "chatId": "={{ $('Execute Workflow Trigger').first().json.chat_id }}", "operation": "sendPhoto", "additionalFields": { "parse_mode": "HTML" } }, "credentials": { "telegramApi": { "id": "70", "name": "Telegram sdfsdfsdfsdfsfd_bot" } }, "typeVersion": 1.1 }, { "id": "50b43dbf-39e3-4d00-8e47-01e8c193cd1a", "name": "add response field", "type": "n8n-nodes-base.set", "position": [ 1480, 900 ], "parameters": { "fields": { "values": [ { "name": "response", "stringValue": "Success" } ] }, "options": {} }, "typeVersion": 3.2 }, { "id": "171bee83-c8e1-4af3-9d1c-12cb6ede4943", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 900, 840 ], "parameters": { "width": 752.0361990950231, "height": 247.42081447963798, "content": "## Generate an image with Dall-E 3 and send it via Telegram" }, "typeVersion": 1 }, { "id": "4d81d201-70bf-4c80-9689-4b65851ad770", "name": "Dall-E 3 Tool", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 1360, 600 ], "parameters": { "name": "Draw_Dalle_image", "fields": { "values": [ { "name": "chat_id", "stringValue": "={{ $('Listen for incoming events').first().json.message.chat.id }}" } ] }, "workflowId": "={{ $workflow.id }}", "description": "Call this tool to request a Dall-E 3 model, when the user asks to draw something. Please send the user request for an image as an inline query string." }, "typeVersion": 1 }, { "id": "39d532d3-8c96-4722-9cb0-cad92ff39e94", "name": "Generate image in Dall-E 3", "type": "n8n-nodes-base.httpRequest", "position": [ 1120, 900 ], "parameters": { "url": "https://api.openai.com/v1/images/generations", "method": "POST", "options": {}, "sendBody": true, "authentication": "predefinedCredentialType", "bodyParameters": { "parameters": [ { "name": "model", "value": "dall-e-3" }, { "name": "prompt", "value": "={{ $json.query }}" }, { "name": "n", "value": 1 }, { "name": "size", "value": "1024x1024" } ] }, "nodeCredentialType": "openAiApi" }, "credentials": { "openAiApi": { "id": "63", "name": "OpenAi account" } }, "typeVersion": 4.1 }, { "id": "e5aa496d-55d3-456b-82bb-fe10a06c7338", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 1140, 380 ], "parameters": { "text": "={{ $json.message.text }}", "options": { "humanMessage": "TOOLS\n------\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\n\n{tools}\n\n{format_instructions}\n\nUSER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):\n\n{{input}}", "systemMessage": "=You are a helpful AI assistant. You are chatting with the user named `{{ $json.message.from.first_name }}`. Today is {{ DateTime.fromISO($now).toLocaleString(DateTime.DATETIME_FULL) }}\n\nFrom time to time call a user by name (if the user name is provided). In your reply, always send a message in Telegram-supported HTML format. Here are the formatting instructions:\n1. The following tags are currently supported:\n<b>bold</b>, <strong>bold</strong>\n<i>italic</i>, <em>italic</em>\n<u>underline</u>, <ins>underline</ins>\n<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>\n<span class=\"tg-spoiler\">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>\n<b>bold <i>italic bold <s>italic bold strikethrough <span class=\"tg-spoiler\">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>\n<a href=\"http://www.example.com/\">inline URL</a>\n<code>inline fixed-width code</code>\n<pre>pre-formatted fixed-width code block</pre>\n2. Any code that you send should be wrapped in these tags: <pre><code class=\"language-python\">pre-formatted fixed-width code block written in the Python programming language</code></pre>\nOther programming languages are supported as well.\n3. All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;)\n4. If the user sends you a message starting with / sign, it means this is a Telegram bot command. For example, all users send /start command as their first message. Try to figure out what these commands mean and reply accodringly\n" } }, "typeVersion": 1.1 } ], "active": true, "pinData": {}, "settings": { "callerPolicy": "workflowsFromSameOwner", "executionOrder": "v1", "saveManualExecutions": true, "saveDataSuccessExecution": "all" }, "versionId": "3e9c27eb-1d2f-40bf-b284-4f6a1bece30c", "connections": { "AI Agent": { "main": [ [ { "node": "Telegram", "type": "main", "index": 0 } ] ] }, "Telegram": { "main": [ [], [ { "node": "Correct errors", "type": "main", "index": 0 } ] ] }, "Dall-E 3 Tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Send back an image": { "main": [ [ { "node": "add response field", "type": "main", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Execute Workflow Trigger": { "main": [ [ { "node": "Generate image in Dall-E 3", "type": "main", "index": 0 } ] ] }, "Generate image in Dall-E 3": { "main": [ [ { "node": "Send back an image", "type": "main", "index": 0 } ] ] }, "Listen for incoming events": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"ax8PJlp1UDb6EGFt\",\n \"meta\": {\n \"instanceId\": \"fb924c73af8f703905bc09c9ee8076f48c17b596ed05b18c0ff86915ef8a7c4a\"\n },\n \"name\": \"Telegram AI Langchain bot\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"e275f31f-6a5f-4444-8bf7-6c003a8e53df\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 1100,\n 600\n ],\n \"parameters\": {\n \"model\": \"gpt-4-1106-preview\",\n \"options\": {\n \"temperature\": 0.7,\n \"frequencyPenalty\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f25a6666-ff23-4372-afd0-4920a99aab6a\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 1220,\n 600\n ],\n \"parameters\": {\n \"sessionKey\": \"=chat_with_{{ $('Listen for incoming events').first().json.message.chat.id }}\",\n \"contextWindowLength\": 10\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"96faef5d-0349-47fe-a7cf-150953490e90\",\n \"name\": \"Telegram\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 1500,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.output }}\",\n \"chatId\": \"={{ $('Listen for incoming events').first().json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"HTML\",\n \"appendAttribution\": false\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram sdfsdfsdfsdfsfd_bot\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"5ad43039-aaa6-43cd-9b0f-1d02f4d9c4ff\",\n \"name\": \"Correct errors\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1700,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $('AI Agent').item.json.output.replace(/&/g, \\\"&amp;\\\").replace(/>/g, \\\"&gt;\\\").replace(/</g, \\\"&lt;\\\").replace(/\\\"/g, \\\"&quot;\\\") }}\",\n \"chatId\": \"={{ $('Listen for incoming events').first().json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"HTML\",\n \"appendAttribution\": false\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram sdfsdfsdfsdfsfd_bot\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"0349a250-966a-4064-970a-8bcfba1647ad\",\n \"name\": \"Execute Workflow Trigger\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 940,\n 900\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"69a45c1f-838f-49ce-9b89-75db6a8b876f\",\n \"name\": \"Listen for incoming events\",\n \"type\": \"n8n-nodes-base.telegramTrigger\",\n \"position\": [\n 940,\n 380\n ],\n \"webhookId\": \"322dce18-f93e-4f86-b9b1-3305519b7834\",\n \"parameters\": {\n \"updates\": [\n \"message\"\n ],\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram sdfsdfsdfsdfsfd_bot\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2f5d5f25-9870-40d6-ad42-52750e62de63\",\n \"name\": \"Send back an image\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 1300,\n 900\n ],\n \"parameters\": {\n \"file\": \"={{ $json.data[0].url }}\",\n \"chatId\": \"={{ $('Execute Workflow Trigger').first().json.chat_id }}\",\n \"operation\": \"sendPhoto\",\n \"additionalFields\": {\n \"parse_mode\": \"HTML\"\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"70\",\n \"name\": \"Telegram sdfsdfsdfsdfsfd_bot\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"50b43dbf-39e3-4d00-8e47-01e8c193cd1a\",\n \"name\": \"add response field\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1480,\n 900\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"response\",\n \"stringValue\": \"Success\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"171bee83-c8e1-4af3-9d1c-12cb6ede4943\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 900,\n 840\n ],\n \"parameters\": {\n \"width\": 752.0361990950231,\n \"height\": 247.42081447963798,\n \"content\": \"## Generate an image with Dall-E 3 and send it via Telegram\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4d81d201-70bf-4c80-9689-4b65851ad770\",\n \"name\": \"Dall-E 3 Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 1360,\n 600\n ],\n \"parameters\": {\n \"name\": \"Draw_Dalle_image\",\n \"fields\": {\n \"values\": [\n {\n \"name\": \"chat_id\",\n \"stringValue\": \"={{ $('Listen for incoming events').first().json.message.chat.id }}\"\n }\n ]\n },\n \"workflowId\": \"={{ $workflow.id }}\",\n \"description\": \"Call this tool to request a Dall-E 3 model, when the user asks to draw something. Please send the user request for an image as an inline query string.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"39d532d3-8c96-4722-9cb0-cad92ff39e94\",\n \"name\": \"Generate image in Dall-E 3\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1120,\n 900\n ],\n \"parameters\": {\n \"url\": \"https://api.openai.com/v1/images/generations\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"model\",\n \"value\": \"dall-e-3\"\n },\n {\n \"name\": \"prompt\",\n \"value\": \"={{ $json.query }}\"\n },\n {\n \"name\": \"n\",\n \"value\": 1\n },\n {\n \"name\": \"size\",\n \"value\": \"1024x1024\"\n }\n ]\n },\n \"nodeCredentialType\": \"openAiApi\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"63\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"e5aa496d-55d3-456b-82bb-fe10a06c7338\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 1140,\n 380\n ],\n \"parameters\": {\n \"text\": \"={{ $json.message.text }}\",\n \"options\": {\n \"humanMessage\": \"TOOLS\\n------\\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\\n\\n{tools}\\n\\n{format_instructions}\\n\\nUSER'S INPUT\\n--------------------\\nHere is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):\\n\\n{{input}}\",\n \"systemMessage\": \"=You are a helpful AI assistant. You are chatting with the user named `{{ $json.message.from.first_name }}`. Today is {{ DateTime.fromISO($now).toLocaleString(DateTime.DATETIME_FULL) }}\\n\\nFrom time to time call a user by name (if the user name is provided). In your reply, always send a message in Telegram-supported HTML format. Here are the formatting instructions:\\n1. The following tags are currently supported:\\n<b>bold</b>, <strong>bold</strong>\\n<i>italic</i>, <em>italic</em>\\n<u>underline</u>, <ins>underline</ins>\\n<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>\\n<span class=\\\"tg-spoiler\\\">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>\\n<b>bold <i>italic bold <s>italic bold strikethrough <span class=\\\"tg-spoiler\\\">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>\\n<a href=\\\"http://www.example.com/\\\">inline URL</a>\\n<code>inline fixed-width code</code>\\n<pre>pre-formatted fixed-width code block</pre>\\n2. Any code that you send should be wrapped in these tags: <pre><code class=\\\"language-python\\\">pre-formatted fixed-width code block written in the Python programming language</code></pre>\\nOther programming languages are supported as well.\\n3. All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;)\\n4. If the user sends you a message starting with / sign, it means this is a Telegram bot command. For example, all users send /start command as their first message. Try to figure out what these commands mean and reply accodringly\\n\"\n }\n },\n \"typeVersion\": 1.1\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"callerPolicy\": \"workflowsFromSameOwner\",\n \"executionOrder\": \"v1\",\n \"saveManualExecutions\": true,\n \"saveDataSuccessExecution\": \"all\"\n },\n \"versionId\": \"3e9c27eb-1d2f-40bf-b284-4f6a1bece30c\",\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n [\n {\n \"node\": \"Telegram\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Telegram\": {\n \"main\": [\n [],\n [\n {\n \"node\": \"Correct errors\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Dall-E 3 Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Send back an image\": {\n \"main\": [\n [\n {\n \"node\": \"add response field\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute Workflow Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Generate image in Dall-E 3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate image in Dall-E 3\": {\n \"main\": [\n [\n {\n \"node\": \"Send back an image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Listen for incoming events\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
37
0
1
false
combined_workflows.json
{ "input": "The workflow creates a Telegram bot that uses AI to chat with users and generate images based on their requests.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 7996, "processed_size": 7996, "processed_timestamp": "2025-04-09T03:08:38.383269", "timestamp": "2025-04-09T02:36:35.603998", "token_count": 4089, "tokens": 775, "workflow_chunk_info": { "is_truncated": false, "original_size": 7996, "processed_size": 7996, "workflow_hash": "ca44592d464444f586ae0ba80d2166c7" }, "workflow_hash": "ca44592d464444f586ae0ba80d2166c7" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow aims to create a chatbot that analyzes data from a Google Sheet and answers user questions about the data using an AI agent. Analyze this workflow: ```json { "meta": { "instanceId": "d6b502dfa4d9dd072cdc5c2bb763558661053f651289291352a84403e01b3d1b", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "0951fd33-1811-4a89-b84f-f46dc9e6fde1", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 20, -340 ], "webhookId": "cdc03fce-33b6-4eed-86b5-f628994e5e31", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "699c2f89-5547-4d28-92a9-5e216aecb251", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 240, -340 ], "parameters": { "options": { "maxIterations": 15, "systemMessage": "=You are a helpful assistant.\nCurrent timestamp is {{ $now }}" } }, "typeVersion": 1.7 }, { "id": "640c29f7-b67e-49f6-a864-c9b396c446b7", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 160, -100 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o", "cachedResultName": "gpt-4o" }, "options": { "temperature": 0.2 } }, "credentials": { "openAiApi": { "id": "5LVOlVwHUgB8MAj2", "name": "OpenAI - n8n project" } }, "typeVersion": 1.2 }, { "id": "807630b4-c138-4b66-a438-fb70eab12a07", "name": "Calculator", "type": "@n8n/n8n-nodes-langchain.toolCalculator", "position": [ 840, 60 ], "parameters": {}, "typeVersion": 1 }, { "id": "132a97a3-239c-403f-843f-55b652e3efc5", "name": "Code", "type": "n8n-nodes-base.code", "position": [ 840, 640 ], "parameters": { "jsCode": "// Ensure there's at least one input item.\nif (!items || items.length === 0) {\n throw new Error(\"No input items found.\");\n}\n\n// Our input is expected to have a 'data' property containing the JSONP string.\nconst input = items[0].json;\n\nif (!input.data) {\n throw new Error(\"Input JSON does not have a 'data' property.\");\n}\n\nconst rawData = input.data;\n\n// Use a regex to extract the JSON content from the Google Visualization JSONP response.\nconst regex = /google\\.visualization\\.Query\\.setResponse\\((.*)\\);?$/s;\nconst match = rawData.match(regex);\n\nif (!match) {\n throw new Error(\"Input data does not match the expected Google Visualization JSONP format.\");\n}\n\nconst jsonString = match[1];\n\n// Parse the extracted JSON string.\nlet parsed;\ntry {\n parsed = JSON.parse(jsonString);\n} catch (error) {\n throw new Error(\"Failed to parse JSON: \" + error.message);\n}\n\n// Verify that the parsed JSON has the expected 'table' structure with 'cols' and 'rows'.\nif (!parsed.table || !Array.isArray(parsed.table.cols) || !Array.isArray(parsed.table.rows)) {\n throw new Error(\"Parsed JSON does not have the expected 'table' structure with 'cols' and 'rows'.\");\n}\n\nconst cols = parsed.table.cols;\nconst rows = parsed.table.rows;\n\n// Helper function to convert date string from \"Date(YYYY,M,D)\" to \"YYYY-MM-DD\"\nfunction formatDate(dateStr) {\n const match = dateStr.match(/^Date\\((\\d+),(\\d+),(\\d+)\\)$/);\n if (!match) return dateStr;\n const year = parseInt(match[1], 10);\n const month = parseInt(match[2], 10) + 1; // JavaScript months are 0-indexed\n const day = parseInt(match[3], 10);\n // Format with leading zeros\n return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;\n}\n\n// Map each row into an object using the column labels as keys.\nconst newItems = rows.map(row => {\n const obj = {};\n cols.forEach((col, index) => {\n let value = row.c && row.c[index] ? row.c[index].v : null;\n // If the column type is \"date\" and the value is a string that looks like \"Date(YYYY,M,D)\"\n if (col.type === \"date\" && typeof value === \"string\") {\n value = formatDate(value);\n }\n obj[col.label] = value;\n });\n return { json: obj };\n});\n\n// Return the new array of items.\nreturn newItems;\n" }, "typeVersion": 2 }, { "id": "3dc1e670-bfb1-4b63-b9c8-85656134c843", "name": "When Executed by Another Workflow", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 280, 640 ], "parameters": { "workflowInputs": { "values": [ { "name": "start_date" }, { "name": "end_date" }, { "name": "status" } ] } }, "typeVersion": 1.1 }, { "id": "52a26e43-12a5-4b4a-a224-d70cdabf6aaf", "name": "Records by date", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 1020, -120 ], "parameters": { "name": "records_by_date_and_or_status", "workflowId": { "__rl": true, "mode": "list", "value": "a2BIIjr2gLBay06M", "cachedResultName": "Template | Your first AI Data Analyst" }, "description": "Use this tool to get records filtered by date. You can also filter by status at the same time, if you want.", "workflowInputs": { "value": { "status": "={{ $fromAI(\"status\", \"Status of the transaction. Can be Completed, Refund or Error. Leave empty if you don't need this now.\", \"string\") }}", "end_date": "={{ $fromAI(\"end_date\", \"End date in format YYYY-MM-DD\", \"string\") }}", "start_date": "={{ $fromAI(\"start_date\", \"Start date in format YYYY-MM-DD\", \"string\") }}" }, "schema": [ { "id": "start_date", "type": "string", "display": true, "required": false, "displayName": "start_date", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "end_date", "type": "string", "display": true, "required": false, "displayName": "end_date", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "status", "type": "string", "display": true, "removed": false, "required": false, "displayName": "status", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [], "attemptToConvertTypes": false, "convertFieldsToString": false } }, "typeVersion": 2 }, { "id": "e1811519-8699-4243-8c64-0db1ab26004d", "name": "Aggregate", "type": "n8n-nodes-base.aggregate", "position": [ 1280, 640 ], "parameters": { "options": {}, "aggregate": "aggregateAllItemData" }, "typeVersion": 1 }, { "id": "3b129abd-ac9a-460c-abb3-007e2c94e284", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1220, 400 ], "parameters": { "color": 7, "width": 220, "height": 400, "content": "To send all the items back to the AI, we need to finish with everything aggregated into one single item.\n\nOtherwise it will respond with one item at a time, and the AI will only get the first item that arrives." }, "typeVersion": 1 }, { "id": "645ac0f9-8022-4f2c-8c6c-5aadd6cf09cc", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 460, 400 ], "parameters": { "color": 7, "width": 300, "height": 400, "content": "This node sends a custom HTTP Request to the Google Sheets API.\n\nFiltering by date range in the Google Sheets API is very complicated.\n\nThis node solves that problem.\n\nBut doing the same in a database is much simpler. A tool could do it without needing a sub-workflow." }, "typeVersion": 1 }, { "id": "14221a72-914d-4c75-866a-d64ba7f8109f", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 780, 400 ], "parameters": { "color": 7, "width": 220, "height": 400, "content": "The output from this complex request is also messy.\n\nSo we use some code generated by ChatGPT to transform the data into JSON objects." }, "typeVersion": 1 }, { "id": "f12668ea-b59d-4caf-a997-381f78b7cfe7", "name": "Google Sheets request", "type": "n8n-nodes-base.httpRequest", "position": [ 560, 640 ], "parameters": { "url": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/gviz/tq", "options": {}, "sendQuery": true, "authentication": "predefinedCredentialType", "queryParameters": { "parameters": [ { "name": "sheet", "value": "Sheet1" }, { "name": "tq", "value": "=SELECT * WHERE A >= DATE \"{{ $json.start_date }}\" AND A <= DATE \"{{ $json.end_date }}\"" } ] }, "nodeCredentialType": "googleSheetsOAuth2Api" }, "credentials": { "googleSheetsOAuth2Api": { "id": "YR4pbjuZM5Xs4CTD", "name": "Google Sheets" } }, "typeVersion": 4.2 }, { "id": "f59a2606-0981-43d1-9a07-b802891b9220", "name": "Get transactions by product name", "type": "n8n-nodes-base.googleSheetsTool", "position": [ 1020, -320 ], "parameters": { "options": {}, "filtersUI": { "values": [ { "lookupValue": "={{ $fromAI(\"product_name\", \"The product name\", \"string\") }}", "lookupColumn": "Product" } ] }, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0", "cachedResultName": "Sheet1" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing" }, "descriptionType": "manual", "toolDescription": "Find transactions by product.\nOur products are:\n- Widget A\n- Widget B\n- Widget C\n- Widget D
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"d6b502dfa4d9dd072cdc5c2bb763558661053f651289291352a84403e01b3d1b\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"0951fd33-1811-4a89-b84f-f46dc9e6fde1\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 20,\n -340\n ],\n \"webhookId\": \"cdc03fce-33b6-4eed-86b5-f628994e5e31\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"699c2f89-5547-4d28-92a9-5e216aecb251\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 240,\n -340\n ],\n \"parameters\": {\n \"options\": {\n \"maxIterations\": 15,\n \"systemMessage\": \"=You are a helpful assistant.\\nCurrent timestamp is {{ $now }}\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"640c29f7-b67e-49f6-a864-c9b396c446b7\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 160,\n -100\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o\",\n \"cachedResultName\": \"gpt-4o\"\n },\n \"options\": {\n \"temperature\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5LVOlVwHUgB8MAj2\",\n \"name\": \"OpenAI - n8n project\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"807630b4-c138-4b66-a438-fb70eab12a07\",\n \"name\": \"Calculator\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolCalculator\",\n \"position\": [\n 840,\n 60\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"132a97a3-239c-403f-843f-55b652e3efc5\",\n \"name\": \"Code\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 840,\n 640\n ],\n \"parameters\": {\n \"jsCode\": \"// Ensure there's at least one input item.\\nif (!items || items.length === 0) {\\n throw new Error(\\\"No input items found.\\\");\\n}\\n\\n// Our input is expected to have a 'data' property containing the JSONP string.\\nconst input = items[0].json;\\n\\nif (!input.data) {\\n throw new Error(\\\"Input JSON does not have a 'data' property.\\\");\\n}\\n\\nconst rawData = input.data;\\n\\n// Use a regex to extract the JSON content from the Google Visualization JSONP response.\\nconst regex = /google\\\\.visualization\\\\.Query\\\\.setResponse\\\\((.*)\\\\);?$/s;\\nconst match = rawData.match(regex);\\n\\nif (!match) {\\n throw new Error(\\\"Input data does not match the expected Google Visualization JSONP format.\\\");\\n}\\n\\nconst jsonString = match[1];\\n\\n// Parse the extracted JSON string.\\nlet parsed;\\ntry {\\n parsed = JSON.parse(jsonString);\\n} catch (error) {\\n throw new Error(\\\"Failed to parse JSON: \\\" + error.message);\\n}\\n\\n// Verify that the parsed JSON has the expected 'table' structure with 'cols' and 'rows'.\\nif (!parsed.table || !Array.isArray(parsed.table.cols) || !Array.isArray(parsed.table.rows)) {\\n throw new Error(\\\"Parsed JSON does not have the expected 'table' structure with 'cols' and 'rows'.\\\");\\n}\\n\\nconst cols = parsed.table.cols;\\nconst rows = parsed.table.rows;\\n\\n// Helper function to convert date string from \\\"Date(YYYY,M,D)\\\" to \\\"YYYY-MM-DD\\\"\\nfunction formatDate(dateStr) {\\n const match = dateStr.match(/^Date\\\\((\\\\d+),(\\\\d+),(\\\\d+)\\\\)$/);\\n if (!match) return dateStr;\\n const year = parseInt(match[1], 10);\\n const month = parseInt(match[2], 10) + 1; // JavaScript months are 0-indexed\\n const day = parseInt(match[3], 10);\\n // Format with leading zeros\\n return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;\\n}\\n\\n// Map each row into an object using the column labels as keys.\\nconst newItems = rows.map(row => {\\n const obj = {};\\n cols.forEach((col, index) => {\\n let value = row.c && row.c[index] ? row.c[index].v : null;\\n // If the column type is \\\"date\\\" and the value is a string that looks like \\\"Date(YYYY,M,D)\\\"\\n if (col.type === \\\"date\\\" && typeof value === \\\"string\\\") {\\n value = formatDate(value);\\n }\\n obj[col.label] = value;\\n });\\n return { json: obj };\\n});\\n\\n// Return the new array of items.\\nreturn newItems;\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"3dc1e670-bfb1-4b63-b9c8-85656134c843\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 280,\n 640\n ],\n \"parameters\": {\n \"workflowInputs\": {\n \"values\": [\n {\n \"name\": \"start_date\"\n },\n {\n \"name\": \"end_date\"\n },\n {\n \"name\": \"status\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"52a26e43-12a5-4b4a-a224-d70cdabf6aaf\",\n \"name\": \"Records by date\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 1020,\n -120\n ],\n \"parameters\": {\n \"name\": \"records_by_date_and_or_status\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"a2BIIjr2gLBay06M\",\n \"cachedResultName\": \"Template | Your first AI Data Analyst\"\n },\n \"description\": \"Use this tool to get records filtered by date. You can also filter by status at the same time, if you want.\",\n \"workflowInputs\": {\n \"value\": {\n \"status\": \"={{ $fromAI(\\\"status\\\", \\\"Status of the transaction. Can be Completed, Refund or Error. Leave empty if you don't need this now.\\\", \\\"string\\\") }}\",\n \"end_date\": \"={{ $fromAI(\\\"end_date\\\", \\\"End date in format YYYY-MM-DD\\\", \\\"string\\\") }}\",\n \"start_date\": \"={{ $fromAI(\\\"start_date\\\", \\\"Start date in format YYYY-MM-DD\\\", \\\"string\\\") }}\"\n },\n \"schema\": [\n {\n \"id\": \"start_date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"start_date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"end_date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"end_date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"status\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"status\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"e1811519-8699-4243-8c64-0db1ab26004d\",\n \"name\": \"Aggregate\",\n \"type\": \"n8n-nodes-base.aggregate\",\n \"position\": [\n 1280,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"aggregate\": \"aggregateAllItemData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3b129abd-ac9a-460c-abb3-007e2c94e284\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1220,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 400,\n \"content\": \"To send all the items back to the AI, we need to finish with everything aggregated into one single item.\\n\\nOtherwise it will respond with one item at a time, and the AI will only get the first item that arrives.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"645ac0f9-8022-4f2c-8c6c-5aadd6cf09cc\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 300,\n \"height\": 400,\n \"content\": \"This node sends a custom HTTP Request to the Google Sheets API.\\n\\nFiltering by date range in the Google Sheets API is very complicated.\\n\\nThis node solves that problem.\\n\\nBut doing the same in a database is much simpler. A tool could do it without needing a sub-workflow.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"14221a72-914d-4c75-866a-d64ba7f8109f\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 780,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 400,\n \"content\": \"The output from this complex request is also messy.\\n\\nSo we use some code generated by ChatGPT to transform the data into JSON objects.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f12668ea-b59d-4caf-a997-381f78b7cfe7\",\n \"name\": \"Google Sheets request\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 560,\n 640\n ],\n \"parameters\": {\n \"url\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/gviz/tq\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"sheet\",\n \"value\": \"Sheet1\"\n },\n {\n \"name\": \"tq\",\n \"value\": \"=SELECT * WHERE A >= DATE \\\"{{ $json.start_date }}\\\" AND A <= DATE \\\"{{ $json.end_date }}\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"googleSheetsOAuth2Api\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"f59a2606-0981-43d1-9a07-b802891b9220\",\n \"name\": \"Get transactions by product name\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 1020,\n -320\n ],\n \"parameters\": {\n \"options\": {},\n \"filtersUI\": {\n \"values\": [\n {\n \"lookupValue\": \"={{ $fromAI(\\\"product_name\\\", \\\"The product name\\\", \\\"string\\\") }}\",\n \"lookupColumn\": \"Product\"\n }\n ]\n },\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Find transactions by product.\\nOur products are:\\n- Widget A\\n- Widget B\\n- Widget C\\n- Widget D\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"1ed7168c-1639-4b3b-a3b4-ed162bcef880\",\n \"name\": \"Get all transactions\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 840,\n -120\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Only use this as last resort, because it will pull all data at once.\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"798453da-8a65-4d14-ae0a-778d64ab02ad\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -360,\n -340\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 320,\n \"height\": 340,\n \"content\": \"## Some questions to try\\nThere's a red button on this page that you can click to chat with the AI.\\n\\nTry asking it these questions:\\n\\n- How many refunds in January and what was the amount refunded?\\n\\n- How many successful sales did we have in January 2025 and what was the final income of those?\\n\\n- What is the most frequent reason for refunds?\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8336f1a-3855-4247-9589-2f9aa35d211f\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n -340\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 400,\n \"content\": \"## Copy this Sheets file to your Google Drive\\nhttps://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?gid=0#gid=0\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"99a55b39-965b-4454-b416-d3991f0bdfbc\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 940,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 200,\n \"height\": 140,\n \"content\": \"### πŸ‘ˆ\\nThe Calculator is a tool that allows an agent to run mathematical calculations.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7ebebf56-e065-41c4-8270-f636785b0def\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n -160\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 400,\n \"content\": \"### How to connect to Google Sheets?\\nTo connect your n8n to your Google Sheets you're gonna need Google OAuth credentials\\n\\nSee documentation **[here](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b64df0dd-6425-4fc2-9f60-8c5a85412d61\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 20\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 170,\n \"height\": 260,\n \"content\": \"## πŸ‘†\\nYou can use many models here, including the free Google Gemini options.\\n\\nMake sure to test it thoroughly. Some models are better for data analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"23c7bb52-b189-45f1-949b-ea588f065583\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n 20\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 150,\n \"height\": 260,\n \"content\": \"## πŸ‘†\\nThis is a short term memory. It will remember the 5 previous interactions during the chat\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6097e5a1-139b-4329-81ff-4fda16ea5221\",\n \"name\": \"Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 360,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"6de4a7f2-5c58-4401-bd7c-19c5a73ba775\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n -320\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 180,\n \"content\": \"The **AI Tools Agent** has access to all the tools at the same time. It uses the name and description to decide when to use each tool.\\n\\nNotice I'm using `$fromAI` function in all of them.\\n\\nSee documentations **[here](https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a983b82-d65b-4a93-b7c8-97954afd7f02\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n 20\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 740,\n \"height\": 100,\n \"content\": \"## Want more templates like this?\\n### πŸ‘‰ **[Check out all my templates](https://n8n.io/creators/solomon/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a308d895-bc18-4b2c-9567-78f6c29f79e8\",\n \"name\": \"Sticky Note11\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n -120\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 320,\n \"content\": \"## πŸ‘ˆ This is a special tool\\nIt is used to call another workflow.\\nThis concept is called sub-workflow.\\n\\nSee documentation [here](https://docs.n8n.io/flow-logic/subworkflows/).\\n\\nInstead of running a completely separate workflow, we are calling the one below.\\n\\nIt's contained in the same workflow, but we are using the trigger to define it will run only when called by this tool.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a6d94bc-21e1-4949-b7f4-c93abbecf08c\",\n \"name\": \"Sticky Note12\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 340\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 520,\n \"content\": \"# Sub-workflow\\nThe AI can call this sub-workflow anytime,\\nby using the **Records by date** tool.\\n\\nThe sub-workflow automatically return\\n the result of the last executed node to the AI.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3e424615-6e49-4bd3-b066-005b9f0f773e\",\n \"name\": \"Filter by status\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1060,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"e50da873-bbbd-41d3-a418-83193907977c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"contains\"\n },\n \"leftValue\": \"={{ $json.Status }}\",\n \"rightValue\": \"={{ $('When Executed by Another Workflow').item.json.status }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"0ad0102c-adb9-4ec9-bdf3-b1ce425b88ba\",\n \"name\": \"Get transactions by status\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 840,\n -320\n ],\n \"parameters\": {\n \"options\": {},\n \"filtersUI\": {\n \"values\": [\n {\n \"lookupValue\": \"={{ $fromAI(\\\"transaction_status\\\", \\\"Transaction status can be Refund, Completed or Error\\\", \\\"string\\\") }}\",\n \"lookupColumn\": \"Status\"\n }\n ]\n },\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Find transactions by status\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"5b80cb08-6e19-47b2-8146-c299e709a34a\",\n \"name\": \"Sticky Note13\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n -540\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 300,\n \"content\": \"## Change the URL of the Sheets file in all the Sheets tools πŸ‘‡\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ddc1351e-0ad0-480f-9742-30f2aa860d61\",\n \"name\": \"Sticky Note14\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 500,\n 820\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 260,\n \"height\": 100,\n \"content\": \"## πŸ‘† Change the URL of the Sheets file\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Code\": {\n \"main\": [\n [\n {\n \"node\": \"Filter by status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Calculator\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Records by date\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter by status\": {\n \"main\": [\n [\n {\n \"node\": \"Aggregate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get all transactions\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Sheets request\": {\n \"main\": [\n [\n {\n \"node\": \"Code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get transactions by status\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get transactions by product name\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Google Sheets request\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
38
0
3
true
combined_workflows.json
{ "input": "This workflow aims to create a chatbot that analyzes data from a Google Sheet and answers user questions about the data using an AI agent.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17169, "processed_size": 17169, "processed_timestamp": "2025-04-09T03:08:38.495269", "timestamp": "2025-04-09T02:36:35.741560", "token_count": 4095, "tokens": 1742, "workflow_chunk_info": { "is_truncated": false, "original_size": 17169, "processed_size": 17169, "workflow_hash": "b73ae03c572ceef31540bef556e411ee" }, "workflow_hash": "b73ae03c572ceef31540bef556e411ee" }
/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0", "cachedResultName": "Sheet1" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing" }, "descriptionType": "manual", "toolDescription": "Find transactions by product.\nOur products are:\n- Widget A\n- Widget B\n- Widget C\n- Widget D" }, "credentials": { "googleSheetsOAuth2Api": { "id": "YR4pbjuZM5Xs4CTD", "name": "Google Sheets" } }, "typeVersion": 4.5 }, { "id": "1ed7168c-1639-4b3b-a3b4-ed162bcef880", "name": "Get all transactions", "type": "n8n-nodes-base.googleSheetsTool", "position": [ 840, -120 ], "parameters": { "options": {}, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0", "cachedResultName": "Sheet1" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing" }, "descriptionType": "manual", "toolDescription": "Only use this as last resort, because it will pull all data at once." }, "credentials": { "googleSheetsOAuth2Api": { "id": "YR4pbjuZM5Xs4CTD", "name": "Google Sheets" } }, "typeVersion": 4.5 }, { "id": "798453da-8a65-4d14-ae0a-778d64ab02ad", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -360, -340 ], "parameters": { "color": 4, "width": 320, "height": 340, "content": "## Some questions to try\nThere's a red button on this page that you can click to chat with the AI.\n\nTry asking it these questions:\n\n- How many refunds in January and what was the amount refunded?\n\n- How many successful sales did we have in January 2025 and what was the final income of those?\n\n- What is the most frequent reason for refunds?" }, "typeVersion": 1 }, { "id": "b8336f1a-3855-4247-9589-2f9aa35d211f", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -780, -340 ], "parameters": { "color": 4, "width": 400, "content": "## Copy this Sheets file to your Google Drive\nhttps://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?gid=0#gid=0" }, "typeVersion": 1 }, { "id": "99a55b39-965b-4454-b416-d3991f0bdfbc", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 940, 60 ], "parameters": { "color": 7, "width": 200, "height": 140, "content": "### πŸ‘ˆ\nThe Calculator is a tool that allows an agent to run mathematical calculations." }, "typeVersion": 1 }, { "id": "7ebebf56-e065-41c4-8270-f636785b0def", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -780, -160 ], "parameters": { "color": 4, "width": 400, "content": "### How to connect to Google Sheets?\nTo connect your n8n to your Google Sheets you're gonna need Google OAuth credentials\n\nSee documentation **[here](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/)**" }, "typeVersion": 1 }, { "id": "b64df0dd-6425-4fc2-9f60-8c5a85412d61", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 120, 20 ], "parameters": { "color": 7, "width": 170, "height": 260, "content": "## πŸ‘†\nYou can use many models here, including the free Google Gemini options.\n\nMake sure to test it thoroughly. Some models are better for data analysis." }, "typeVersion": 1 }, { "id": "23c7bb52-b189-45f1-949b-ea588f065583", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ 340, 20 ], "parameters": { "color": 7, "width": 150, "height": 260, "content": "## πŸ‘†\nThis is a short term memory. It will remember the 5 previous interactions during the chat" }, "typeVersion": 1 }, { "id": "6097e5a1-139b-4329-81ff-4fda16ea5221", "name": "Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 360, -100 ], "parameters": {}, "typeVersion": 1.3 }, { "id": "6de4a7f2-5c58-4401-bd7c-19c5a73ba775", "name": "Sticky Note9", "type": "n8n-nodes-base.stickyNote", "position": [ 1160, -320 ], "parameters": { "color": 7, "width": 340, "height": 180, "content": "The **AI Tools Agent** has access to all the tools at the same time. It uses the name and description to decide when to use each tool.\n\nNotice I'm using `$fromAI` function in all of them.\n\nSee documentations **[here](https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/)**" }, "typeVersion": 1 }, { "id": "1a983b82-d65b-4a93-b7c8-97954afd7f02", "name": "Sticky Note10", "type": "n8n-nodes-base.stickyNote", "position": [ -780, 20 ], "parameters": { "color": 5, "width": 740, "height": 100, "content": "## Want more templates like this?\n### πŸ‘‰ **[Check out all my templates](https://n8n.io/creators/solomon/)**" }, "typeVersion": 1 }, { "id": "a308d895-bc18-4b2c-9567-78f6c29f79e8", "name": "Sticky Note11", "type": "n8n-nodes-base.stickyNote", "position": [ 1160, -120 ], "parameters": { "color": 7, "width": 340, "height": 320, "content": "## πŸ‘ˆ This is a special tool\nIt is used to call another workflow.\nThis concept is called sub-workflow.\n\nSee documentation [here](https://docs.n8n.io/flow-logic/subworkflows/).\n\nInstead of running a completely separate workflow, we are calling the one below.\n\nIt's contained in the same workflow, but we are using the trigger to define it will run only when called by this tool." }, "typeVersion": 1 }, { "id": "0a6d94bc-21e1-4949-b7f4-c93abbecf08c", "name": "Sticky Note12", "type": "n8n-nodes-base.stickyNote", "position": [ 120, 340 ], "parameters": { "color": 7, "width": 1380, "height": 520, "content": "# Sub-workflow\nThe AI can call this sub-workflow anytime,\nby using the **Records by date** tool.\n\nThe sub-workflow automatically return\n the result of the last executed node to the AI." }, "typeVersion": 1 }, { "id": "3e424615-6e49-4bd3-b066-005b9f0f773e", "name": "Filter by status", "type": "n8n-nodes-base.filter", "position": [ 1060, 640 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "e50da873-bbbd-41d3-a418-83193907977c", "operator": { "type": "string", "operation": "contains" }, "leftValue": "={{ $json.Status }}", "rightValue": "={{ $('When Executed by Another Workflow').item.json.status }}" } ] } }, "typeVersion": 2.2 }, { "id": "0ad0102c-adb9-4ec9-bdf3-b1ce425b88ba", "name": "Get transactions by status", "type": "n8n-nodes-base.googleSheetsTool", "position": [ 840, -320 ], "parameters": { "options": {}, "filtersUI": { "values": [ { "lookupValue": "={{ $fromAI(\"transaction_status\", \"Transaction status can be Refund, Completed or Error\", \"string\") }}", "lookupColumn": "Status" } ] }, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0", "cachedResultName": "Sheet1" }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing" }, "descriptionType": "manual", "toolDescription": "Find transactions by status" }, "credentials": { "googleSheetsOAuth2Api": { "id": "YR4pbjuZM5Xs4CTD", "name": "Google Sheets" } }, "typeVersion": 4.5 }, { "id": "5b80cb08-6e19-47b2-8146-c299e709a34a", "name": "Sticky Note13", "type": "n8n-nodes-base.stickyNote", "position": [ 820, -540 ], "parameters": { "color": 4, "width": 300, "content": "## Change the URL of the Sheets file in all the Sheets tools πŸ‘‡" }, "typeVersion": 1 }, { "id": "ddc1351e-0ad0-480f-9742-30f2aa860d61", "name": "Sticky Note14", "type": "n8n-nodes-base.stickyNote", "position": [ 500, 820 ], "parameters": { "color": 4, "width": 260, "height": 100, "content": "## πŸ‘† Change the URL of the Sheets file" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Code": { "main": [ [ { "node": "Filter by status", "type": "main", "index": 0 } ] ] }, "Calculator": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool",
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"d6b502dfa4d9dd072cdc5c2bb763558661053f651289291352a84403e01b3d1b\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"0951fd33-1811-4a89-b84f-f46dc9e6fde1\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 20,\n -340\n ],\n \"webhookId\": \"cdc03fce-33b6-4eed-86b5-f628994e5e31\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"699c2f89-5547-4d28-92a9-5e216aecb251\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 240,\n -340\n ],\n \"parameters\": {\n \"options\": {\n \"maxIterations\": 15,\n \"systemMessage\": \"=You are a helpful assistant.\\nCurrent timestamp is {{ $now }}\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"640c29f7-b67e-49f6-a864-c9b396c446b7\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 160,\n -100\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o\",\n \"cachedResultName\": \"gpt-4o\"\n },\n \"options\": {\n \"temperature\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5LVOlVwHUgB8MAj2\",\n \"name\": \"OpenAI - n8n project\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"807630b4-c138-4b66-a438-fb70eab12a07\",\n \"name\": \"Calculator\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolCalculator\",\n \"position\": [\n 840,\n 60\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"132a97a3-239c-403f-843f-55b652e3efc5\",\n \"name\": \"Code\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 840,\n 640\n ],\n \"parameters\": {\n \"jsCode\": \"// Ensure there's at least one input item.\\nif (!items || items.length === 0) {\\n throw new Error(\\\"No input items found.\\\");\\n}\\n\\n// Our input is expected to have a 'data' property containing the JSONP string.\\nconst input = items[0].json;\\n\\nif (!input.data) {\\n throw new Error(\\\"Input JSON does not have a 'data' property.\\\");\\n}\\n\\nconst rawData = input.data;\\n\\n// Use a regex to extract the JSON content from the Google Visualization JSONP response.\\nconst regex = /google\\\\.visualization\\\\.Query\\\\.setResponse\\\\((.*)\\\\);?$/s;\\nconst match = rawData.match(regex);\\n\\nif (!match) {\\n throw new Error(\\\"Input data does not match the expected Google Visualization JSONP format.\\\");\\n}\\n\\nconst jsonString = match[1];\\n\\n// Parse the extracted JSON string.\\nlet parsed;\\ntry {\\n parsed = JSON.parse(jsonString);\\n} catch (error) {\\n throw new Error(\\\"Failed to parse JSON: \\\" + error.message);\\n}\\n\\n// Verify that the parsed JSON has the expected 'table' structure with 'cols' and 'rows'.\\nif (!parsed.table || !Array.isArray(parsed.table.cols) || !Array.isArray(parsed.table.rows)) {\\n throw new Error(\\\"Parsed JSON does not have the expected 'table' structure with 'cols' and 'rows'.\\\");\\n}\\n\\nconst cols = parsed.table.cols;\\nconst rows = parsed.table.rows;\\n\\n// Helper function to convert date string from \\\"Date(YYYY,M,D)\\\" to \\\"YYYY-MM-DD\\\"\\nfunction formatDate(dateStr) {\\n const match = dateStr.match(/^Date\\\\((\\\\d+),(\\\\d+),(\\\\d+)\\\\)$/);\\n if (!match) return dateStr;\\n const year = parseInt(match[1], 10);\\n const month = parseInt(match[2], 10) + 1; // JavaScript months are 0-indexed\\n const day = parseInt(match[3], 10);\\n // Format with leading zeros\\n return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;\\n}\\n\\n// Map each row into an object using the column labels as keys.\\nconst newItems = rows.map(row => {\\n const obj = {};\\n cols.forEach((col, index) => {\\n let value = row.c && row.c[index] ? row.c[index].v : null;\\n // If the column type is \\\"date\\\" and the value is a string that looks like \\\"Date(YYYY,M,D)\\\"\\n if (col.type === \\\"date\\\" && typeof value === \\\"string\\\") {\\n value = formatDate(value);\\n }\\n obj[col.label] = value;\\n });\\n return { json: obj };\\n});\\n\\n// Return the new array of items.\\nreturn newItems;\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"3dc1e670-bfb1-4b63-b9c8-85656134c843\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 280,\n 640\n ],\n \"parameters\": {\n \"workflowInputs\": {\n \"values\": [\n {\n \"name\": \"start_date\"\n },\n {\n \"name\": \"end_date\"\n },\n {\n \"name\": \"status\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"52a26e43-12a5-4b4a-a224-d70cdabf6aaf\",\n \"name\": \"Records by date\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 1020,\n -120\n ],\n \"parameters\": {\n \"name\": \"records_by_date_and_or_status\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"a2BIIjr2gLBay06M\",\n \"cachedResultName\": \"Template | Your first AI Data Analyst\"\n },\n \"description\": \"Use this tool to get records filtered by date. You can also filter by status at the same time, if you want.\",\n \"workflowInputs\": {\n \"value\": {\n \"status\": \"={{ $fromAI(\\\"status\\\", \\\"Status of the transaction. Can be Completed, Refund or Error. Leave empty if you don't need this now.\\\", \\\"string\\\") }}\",\n \"end_date\": \"={{ $fromAI(\\\"end_date\\\", \\\"End date in format YYYY-MM-DD\\\", \\\"string\\\") }}\",\n \"start_date\": \"={{ $fromAI(\\\"start_date\\\", \\\"Start date in format YYYY-MM-DD\\\", \\\"string\\\") }}\"\n },\n \"schema\": [\n {\n \"id\": \"start_date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"start_date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"end_date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"end_date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"status\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"status\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"e1811519-8699-4243-8c64-0db1ab26004d\",\n \"name\": \"Aggregate\",\n \"type\": \"n8n-nodes-base.aggregate\",\n \"position\": [\n 1280,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"aggregate\": \"aggregateAllItemData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3b129abd-ac9a-460c-abb3-007e2c94e284\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1220,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 400,\n \"content\": \"To send all the items back to the AI, we need to finish with everything aggregated into one single item.\\n\\nOtherwise it will respond with one item at a time, and the AI will only get the first item that arrives.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"645ac0f9-8022-4f2c-8c6c-5aadd6cf09cc\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 300,\n \"height\": 400,\n \"content\": \"This node sends a custom HTTP Request to the Google Sheets API.\\n\\nFiltering by date range in the Google Sheets API is very complicated.\\n\\nThis node solves that problem.\\n\\nBut doing the same in a database is much simpler. A tool could do it without needing a sub-workflow.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"14221a72-914d-4c75-866a-d64ba7f8109f\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 780,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 400,\n \"content\": \"The output from this complex request is also messy.\\n\\nSo we use some code generated by ChatGPT to transform the data into JSON objects.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f12668ea-b59d-4caf-a997-381f78b7cfe7\",\n \"name\": \"Google Sheets request\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 560,\n 640\n ],\n \"parameters\": {\n \"url\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/gviz/tq\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"sheet\",\n \"value\": \"Sheet1\"\n },\n {\n \"name\": \"tq\",\n \"value\": \"=SELECT * WHERE A >= DATE \\\"{{ $json.start_date }}\\\" AND A <= DATE \\\"{{ $json.end_date }}\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"googleSheetsOAuth2Api\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"f59a2606-0981-43d1-9a07-b802891b9220\",\n \"name\": \"Get transactions by product name\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 1020,\n -320\n ],\n \"parameters\": {\n \"options\": {},\n \"filtersUI\": {\n \"values\": [\n {\n \"lookupValue\": \"={{ $fromAI(\\\"product_name\\\", \\\"The product name\\\", \\\"string\\\") }}\",\n \"lookupColumn\": \"Product\"\n }\n ]\n },\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Find transactions by product.\\nOur products are:\\n- Widget A\\n- Widget B\\n- Widget C\\n- Widget D\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"1ed7168c-1639-4b3b-a3b4-ed162bcef880\",\n \"name\": \"Get all transactions\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 840,\n -120\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Only use this as last resort, because it will pull all data at once.\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"798453da-8a65-4d14-ae0a-778d64ab02ad\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -360,\n -340\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 320,\n \"height\": 340,\n \"content\": \"## Some questions to try\\nThere's a red button on this page that you can click to chat with the AI.\\n\\nTry asking it these questions:\\n\\n- How many refunds in January and what was the amount refunded?\\n\\n- How many successful sales did we have in January 2025 and what was the final income of those?\\n\\n- What is the most frequent reason for refunds?\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8336f1a-3855-4247-9589-2f9aa35d211f\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n -340\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 400,\n \"content\": \"## Copy this Sheets file to your Google Drive\\nhttps://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?gid=0#gid=0\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"99a55b39-965b-4454-b416-d3991f0bdfbc\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 940,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 200,\n \"height\": 140,\n \"content\": \"### πŸ‘ˆ\\nThe Calculator is a tool that allows an agent to run mathematical calculations.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7ebebf56-e065-41c4-8270-f636785b0def\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n -160\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 400,\n \"content\": \"### How to connect to Google Sheets?\\nTo connect your n8n to your Google Sheets you're gonna need Google OAuth credentials\\n\\nSee documentation **[here](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b64df0dd-6425-4fc2-9f60-8c5a85412d61\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 20\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 170,\n \"height\": 260,\n \"content\": \"## πŸ‘†\\nYou can use many models here, including the free Google Gemini options.\\n\\nMake sure to test it thoroughly. Some models are better for data analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"23c7bb52-b189-45f1-949b-ea588f065583\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n 20\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 150,\n \"height\": 260,\n \"content\": \"## πŸ‘†\\nThis is a short term memory. It will remember the 5 previous interactions during the chat\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6097e5a1-139b-4329-81ff-4fda16ea5221\",\n \"name\": \"Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 360,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"6de4a7f2-5c58-4401-bd7c-19c5a73ba775\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n -320\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 180,\n \"content\": \"The **AI Tools Agent** has access to all the tools at the same time. It uses the name and description to decide when to use each tool.\\n\\nNotice I'm using `$fromAI` function in all of them.\\n\\nSee documentations **[here](https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a983b82-d65b-4a93-b7c8-97954afd7f02\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n 20\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 740,\n \"height\": 100,\n \"content\": \"## Want more templates like this?\\n### πŸ‘‰ **[Check out all my templates](https://n8n.io/creators/solomon/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a308d895-bc18-4b2c-9567-78f6c29f79e8\",\n \"name\": \"Sticky Note11\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n -120\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 320,\n \"content\": \"## πŸ‘ˆ This is a special tool\\nIt is used to call another workflow.\\nThis concept is called sub-workflow.\\n\\nSee documentation [here](https://docs.n8n.io/flow-logic/subworkflows/).\\n\\nInstead of running a completely separate workflow, we are calling the one below.\\n\\nIt's contained in the same workflow, but we are using the trigger to define it will run only when called by this tool.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a6d94bc-21e1-4949-b7f4-c93abbecf08c\",\n \"name\": \"Sticky Note12\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 340\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 520,\n \"content\": \"# Sub-workflow\\nThe AI can call this sub-workflow anytime,\\nby using the **Records by date** tool.\\n\\nThe sub-workflow automatically return\\n the result of the last executed node to the AI.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3e424615-6e49-4bd3-b066-005b9f0f773e\",\n \"name\": \"Filter by status\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1060,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"e50da873-bbbd-41d3-a418-83193907977c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"contains\"\n },\n \"leftValue\": \"={{ $json.Status }}\",\n \"rightValue\": \"={{ $('When Executed by Another Workflow').item.json.status }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"0ad0102c-adb9-4ec9-bdf3-b1ce425b88ba\",\n \"name\": \"Get transactions by status\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 840,\n -320\n ],\n \"parameters\": {\n \"options\": {},\n \"filtersUI\": {\n \"values\": [\n {\n \"lookupValue\": \"={{ $fromAI(\\\"transaction_status\\\", \\\"Transaction status can be Refund, Completed or Error\\\", \\\"string\\\") }}\",\n \"lookupColumn\": \"Status\"\n }\n ]\n },\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Find transactions by status\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"5b80cb08-6e19-47b2-8146-c299e709a34a\",\n \"name\": \"Sticky Note13\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n -540\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 300,\n \"content\": \"## Change the URL of the Sheets file in all the Sheets tools πŸ‘‡\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ddc1351e-0ad0-480f-9742-30f2aa860d61\",\n \"name\": \"Sticky Note14\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 500,\n 820\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 260,\n \"height\": 100,\n \"content\": \"## πŸ‘† Change the URL of the Sheets file\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Code\": {\n \"main\": [\n [\n {\n \"node\": \"Filter by status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Calculator\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Records by date\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter by status\": {\n \"main\": [\n [\n {\n \"node\": \"Aggregate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get all transactions\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Sheets request\": {\n \"main\": [\n [\n {\n \"node\": \"Code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get transactions by status\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get transactions by product name\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Google Sheets request\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
38
1
3
true
combined_workflows.json
{ "input": "This workflow aims to create a chatbot that analyzes data from a Google Sheet and answers user questions about the data using an AI agent.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17169, "processed_size": 17169, "processed_timestamp": "2025-04-09T03:08:38.504269", "timestamp": "2025-04-09T02:36:35.741560", "token_count": 4097, "tokens": 1742, "workflow_chunk_info": { "is_truncated": false, "original_size": 17169, "processed_size": 17169, "workflow_hash": "b73ae03c572ceef31540bef556e411ee" }, "workflow_hash": "b73ae03c572ceef31540bef556e411ee" }
position": [ 500, 820 ], "parameters": { "color": 4, "width": 260, "height": 100, "content": "## πŸ‘† Change the URL of the Sheets file" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Code": { "main": [ [ { "node": "Filter by status", "type": "main", "index": 0 } ] ] }, "Calculator": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Records by date": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Filter by status": { "main": [ [ { "node": "Aggregate", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Get all transactions": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Google Sheets request": { "main": [ [ { "node": "Code", "type": "main", "index": 0 } ] ] }, "Get transactions by status": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Get transactions by product name": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "When Executed by Another Workflow": { "main": [ [ { "node": "Google Sheets request", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"d6b502dfa4d9dd072cdc5c2bb763558661053f651289291352a84403e01b3d1b\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"0951fd33-1811-4a89-b84f-f46dc9e6fde1\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 20,\n -340\n ],\n \"webhookId\": \"cdc03fce-33b6-4eed-86b5-f628994e5e31\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"699c2f89-5547-4d28-92a9-5e216aecb251\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 240,\n -340\n ],\n \"parameters\": {\n \"options\": {\n \"maxIterations\": 15,\n \"systemMessage\": \"=You are a helpful assistant.\\nCurrent timestamp is {{ $now }}\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"640c29f7-b67e-49f6-a864-c9b396c446b7\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 160,\n -100\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o\",\n \"cachedResultName\": \"gpt-4o\"\n },\n \"options\": {\n \"temperature\": 0.2\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5LVOlVwHUgB8MAj2\",\n \"name\": \"OpenAI - n8n project\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"807630b4-c138-4b66-a438-fb70eab12a07\",\n \"name\": \"Calculator\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolCalculator\",\n \"position\": [\n 840,\n 60\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"132a97a3-239c-403f-843f-55b652e3efc5\",\n \"name\": \"Code\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 840,\n 640\n ],\n \"parameters\": {\n \"jsCode\": \"// Ensure there's at least one input item.\\nif (!items || items.length === 0) {\\n throw new Error(\\\"No input items found.\\\");\\n}\\n\\n// Our input is expected to have a 'data' property containing the JSONP string.\\nconst input = items[0].json;\\n\\nif (!input.data) {\\n throw new Error(\\\"Input JSON does not have a 'data' property.\\\");\\n}\\n\\nconst rawData = input.data;\\n\\n// Use a regex to extract the JSON content from the Google Visualization JSONP response.\\nconst regex = /google\\\\.visualization\\\\.Query\\\\.setResponse\\\\((.*)\\\\);?$/s;\\nconst match = rawData.match(regex);\\n\\nif (!match) {\\n throw new Error(\\\"Input data does not match the expected Google Visualization JSONP format.\\\");\\n}\\n\\nconst jsonString = match[1];\\n\\n// Parse the extracted JSON string.\\nlet parsed;\\ntry {\\n parsed = JSON.parse(jsonString);\\n} catch (error) {\\n throw new Error(\\\"Failed to parse JSON: \\\" + error.message);\\n}\\n\\n// Verify that the parsed JSON has the expected 'table' structure with 'cols' and 'rows'.\\nif (!parsed.table || !Array.isArray(parsed.table.cols) || !Array.isArray(parsed.table.rows)) {\\n throw new Error(\\\"Parsed JSON does not have the expected 'table' structure with 'cols' and 'rows'.\\\");\\n}\\n\\nconst cols = parsed.table.cols;\\nconst rows = parsed.table.rows;\\n\\n// Helper function to convert date string from \\\"Date(YYYY,M,D)\\\" to \\\"YYYY-MM-DD\\\"\\nfunction formatDate(dateStr) {\\n const match = dateStr.match(/^Date\\\\((\\\\d+),(\\\\d+),(\\\\d+)\\\\)$/);\\n if (!match) return dateStr;\\n const year = parseInt(match[1], 10);\\n const month = parseInt(match[2], 10) + 1; // JavaScript months are 0-indexed\\n const day = parseInt(match[3], 10);\\n // Format with leading zeros\\n return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;\\n}\\n\\n// Map each row into an object using the column labels as keys.\\nconst newItems = rows.map(row => {\\n const obj = {};\\n cols.forEach((col, index) => {\\n let value = row.c && row.c[index] ? row.c[index].v : null;\\n // If the column type is \\\"date\\\" and the value is a string that looks like \\\"Date(YYYY,M,D)\\\"\\n if (col.type === \\\"date\\\" && typeof value === \\\"string\\\") {\\n value = formatDate(value);\\n }\\n obj[col.label] = value;\\n });\\n return { json: obj };\\n});\\n\\n// Return the new array of items.\\nreturn newItems;\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"3dc1e670-bfb1-4b63-b9c8-85656134c843\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 280,\n 640\n ],\n \"parameters\": {\n \"workflowInputs\": {\n \"values\": [\n {\n \"name\": \"start_date\"\n },\n {\n \"name\": \"end_date\"\n },\n {\n \"name\": \"status\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"52a26e43-12a5-4b4a-a224-d70cdabf6aaf\",\n \"name\": \"Records by date\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 1020,\n -120\n ],\n \"parameters\": {\n \"name\": \"records_by_date_and_or_status\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"a2BIIjr2gLBay06M\",\n \"cachedResultName\": \"Template | Your first AI Data Analyst\"\n },\n \"description\": \"Use this tool to get records filtered by date. You can also filter by status at the same time, if you want.\",\n \"workflowInputs\": {\n \"value\": {\n \"status\": \"={{ $fromAI(\\\"status\\\", \\\"Status of the transaction. Can be Completed, Refund or Error. Leave empty if you don't need this now.\\\", \\\"string\\\") }}\",\n \"end_date\": \"={{ $fromAI(\\\"end_date\\\", \\\"End date in format YYYY-MM-DD\\\", \\\"string\\\") }}\",\n \"start_date\": \"={{ $fromAI(\\\"start_date\\\", \\\"Start date in format YYYY-MM-DD\\\", \\\"string\\\") }}\"\n },\n \"schema\": [\n {\n \"id\": \"start_date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"start_date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"end_date\",\n \"type\": \"string\",\n \"display\": true,\n \"required\": false,\n \"displayName\": \"end_date\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"status\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"status\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"e1811519-8699-4243-8c64-0db1ab26004d\",\n \"name\": \"Aggregate\",\n \"type\": \"n8n-nodes-base.aggregate\",\n \"position\": [\n 1280,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"aggregate\": \"aggregateAllItemData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3b129abd-ac9a-460c-abb3-007e2c94e284\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1220,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 400,\n \"content\": \"To send all the items back to the AI, we need to finish with everything aggregated into one single item.\\n\\nOtherwise it will respond with one item at a time, and the AI will only get the first item that arrives.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"645ac0f9-8022-4f2c-8c6c-5aadd6cf09cc\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 300,\n \"height\": 400,\n \"content\": \"This node sends a custom HTTP Request to the Google Sheets API.\\n\\nFiltering by date range in the Google Sheets API is very complicated.\\n\\nThis node solves that problem.\\n\\nBut doing the same in a database is much simpler. A tool could do it without needing a sub-workflow.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"14221a72-914d-4c75-866a-d64ba7f8109f\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 780,\n 400\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 400,\n \"content\": \"The output from this complex request is also messy.\\n\\nSo we use some code generated by ChatGPT to transform the data into JSON objects.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f12668ea-b59d-4caf-a997-381f78b7cfe7\",\n \"name\": \"Google Sheets request\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 560,\n 640\n ],\n \"parameters\": {\n \"url\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/gviz/tq\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"sheet\",\n \"value\": \"Sheet1\"\n },\n {\n \"name\": \"tq\",\n \"value\": \"=SELECT * WHERE A >= DATE \\\"{{ $json.start_date }}\\\" AND A <= DATE \\\"{{ $json.end_date }}\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"googleSheetsOAuth2Api\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"f59a2606-0981-43d1-9a07-b802891b9220\",\n \"name\": \"Get transactions by product name\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 1020,\n -320\n ],\n \"parameters\": {\n \"options\": {},\n \"filtersUI\": {\n \"values\": [\n {\n \"lookupValue\": \"={{ $fromAI(\\\"product_name\\\", \\\"The product name\\\", \\\"string\\\") }}\",\n \"lookupColumn\": \"Product\"\n }\n ]\n },\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Find transactions by product.\\nOur products are:\\n- Widget A\\n- Widget B\\n- Widget C\\n- Widget D\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"1ed7168c-1639-4b3b-a3b4-ed162bcef880\",\n \"name\": \"Get all transactions\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 840,\n -120\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Only use this as last resort, because it will pull all data at once.\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"798453da-8a65-4d14-ae0a-778d64ab02ad\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -360,\n -340\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 320,\n \"height\": 340,\n \"content\": \"## Some questions to try\\nThere's a red button on this page that you can click to chat with the AI.\\n\\nTry asking it these questions:\\n\\n- How many refunds in January and what was the amount refunded?\\n\\n- How many successful sales did we have in January 2025 and what was the final income of those?\\n\\n- What is the most frequent reason for refunds?\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b8336f1a-3855-4247-9589-2f9aa35d211f\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n -340\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 400,\n \"content\": \"## Copy this Sheets file to your Google Drive\\nhttps://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?gid=0#gid=0\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"99a55b39-965b-4454-b416-d3991f0bdfbc\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 940,\n 60\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 200,\n \"height\": 140,\n \"content\": \"### πŸ‘ˆ\\nThe Calculator is a tool that allows an agent to run mathematical calculations.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7ebebf56-e065-41c4-8270-f636785b0def\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n -160\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 400,\n \"content\": \"### How to connect to Google Sheets?\\nTo connect your n8n to your Google Sheets you're gonna need Google OAuth credentials\\n\\nSee documentation **[here](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b64df0dd-6425-4fc2-9f60-8c5a85412d61\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 20\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 170,\n \"height\": 260,\n \"content\": \"## πŸ‘†\\nYou can use many models here, including the free Google Gemini options.\\n\\nMake sure to test it thoroughly. Some models are better for data analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"23c7bb52-b189-45f1-949b-ea588f065583\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n 20\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 150,\n \"height\": 260,\n \"content\": \"## πŸ‘†\\nThis is a short term memory. It will remember the 5 previous interactions during the chat\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6097e5a1-139b-4329-81ff-4fda16ea5221\",\n \"name\": \"Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 360,\n -100\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"6de4a7f2-5c58-4401-bd7c-19c5a73ba775\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n -320\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 180,\n \"content\": \"The **AI Tools Agent** has access to all the tools at the same time. It uses the name and description to decide when to use each tool.\\n\\nNotice I'm using `$fromAI` function in all of them.\\n\\nSee documentations **[here](https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1a983b82-d65b-4a93-b7c8-97954afd7f02\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -780,\n 20\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 740,\n \"height\": 100,\n \"content\": \"## Want more templates like this?\\n### πŸ‘‰ **[Check out all my templates](https://n8n.io/creators/solomon/)**\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a308d895-bc18-4b2c-9567-78f6c29f79e8\",\n \"name\": \"Sticky Note11\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n -120\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 320,\n \"content\": \"## πŸ‘ˆ This is a special tool\\nIt is used to call another workflow.\\nThis concept is called sub-workflow.\\n\\nSee documentation [here](https://docs.n8n.io/flow-logic/subworkflows/).\\n\\nInstead of running a completely separate workflow, we are calling the one below.\\n\\nIt's contained in the same workflow, but we are using the trigger to define it will run only when called by this tool.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0a6d94bc-21e1-4949-b7f4-c93abbecf08c\",\n \"name\": \"Sticky Note12\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 340\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 520,\n \"content\": \"# Sub-workflow\\nThe AI can call this sub-workflow anytime,\\nby using the **Records by date** tool.\\n\\nThe sub-workflow automatically return\\n the result of the last executed node to the AI.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3e424615-6e49-4bd3-b066-005b9f0f773e\",\n \"name\": \"Filter by status\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1060,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"e50da873-bbbd-41d3-a418-83193907977c\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"contains\"\n },\n \"leftValue\": \"={{ $json.Status }}\",\n \"rightValue\": \"={{ $('When Executed by Another Workflow').item.json.status }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"0ad0102c-adb9-4ec9-bdf3-b1ce425b88ba\",\n \"name\": \"Get transactions by status\",\n \"type\": \"n8n-nodes-base.googleSheetsTool\",\n \"position\": [\n 840,\n -320\n ],\n \"parameters\": {\n \"options\": {},\n \"filtersUI\": {\n \"values\": [\n {\n \"lookupValue\": \"={{ $fromAI(\\\"transaction_status\\\", \\\"Transaction status can be Refund, Completed or Error\\\", \\\"string\\\") }}\",\n \"lookupColumn\": \"Status\"\n }\n ]\n },\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gid=0\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit#gid=0\",\n \"cachedResultName\": \"Sheet1\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://docs.google.com/spreadsheets/d/18A4d7KYrk8-uEMbu7shoQe_UIzmbTLV1FMN43bjA7qc/edit?usp=sharing\"\n },\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Find transactions by status\"\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"YR4pbjuZM5Xs4CTD\",\n \"name\": \"Google Sheets\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"5b80cb08-6e19-47b2-8146-c299e709a34a\",\n \"name\": \"Sticky Note13\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 820,\n -540\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 300,\n \"content\": \"## Change the URL of the Sheets file in all the Sheets tools πŸ‘‡\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ddc1351e-0ad0-480f-9742-30f2aa860d61\",\n \"name\": \"Sticky Note14\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 500,\n 820\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 260,\n \"height\": 100,\n \"content\": \"## πŸ‘† Change the URL of the Sheets file\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Code\": {\n \"main\": [\n [\n {\n \"node\": \"Filter by status\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Calculator\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Records by date\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter by status\": {\n \"main\": [\n [\n {\n \"node\": \"Aggregate\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get all transactions\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Sheets request\": {\n \"main\": [\n [\n {\n \"node\": \"Code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get transactions by status\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get transactions by product name\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Google Sheets request\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
38
2
3
true
combined_workflows.json
{ "input": "This workflow aims to create a chatbot that analyzes data from a Google Sheet and answers user questions about the data using an AI agent.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17169, "processed_size": 17169, "processed_timestamp": "2025-04-09T03:08:38.508267", "timestamp": "2025-04-09T02:36:35.741560", "token_count": 855, "tokens": 1742, "workflow_chunk_info": { "is_truncated": false, "original_size": 17169, "processed_size": 17169, "workflow_hash": "b73ae03c572ceef31540bef556e411ee" }, "workflow_hash": "b73ae03c572ceef31540bef556e411ee" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow aims to create a chatbot that answers employee questions using information from company documents stored in Google Drive. It uses Google Gemini for embeddings and chat, Pinecone for vector storage, and Langchain tools for document processing and retrieval. Analyze this workflow: ```json { "id": "7cXvgkl9170QXzT2", "meta": { "instanceId": "69133932b9ba8e1ef14816d0b63297bb44feb97c19f759b5d153ff6b0c59e18d", "templateCredsSetupCompleted": true }, "name": "RAG Workflow For Company Documents stored in Google Drive", "tags": [], "nodes": [ { "id": "753455a3-ddc8-4a74-b043-70a0af38ff9e", "name": "Pinecone Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 680, 0 ], "parameters": { "mode": "insert", "options": {}, "pineconeIndex": { "__rl": true, "mode": "list", "value": "company-files", "cachedResultName": "company-files" } }, "credentials": { "pineconeApi": { "id": "bQTNry52ypGLqt47", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "a7c8fa7f-cad2-4497-a295-30aa2e98cacc", "name": "Embeddings Google Gemini", "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", "position": [ 640, 280 ], "parameters": { "modelName": "models/text-embedding-004" }, "credentials": { "googlePalmApi": { "id": "jLOqyTR4yTT1nYKi", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "215f0519-4359-4e4b-a90c-7e54b1cc52b5", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ 840, 220 ], "parameters": { "options": {}, "dataType": "binary", "binaryMode": "specificField" }, "typeVersion": 1 }, { "id": "863d3d1d-1621-406e-8320-688f64b07b09", "name": "Recursive Character Text Splitter", "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", "position": [ 820, 420 ], "parameters": { "options": {}, "chunkOverlap": 100 }, "typeVersion": 1 }, { "id": "5af1efb1-ea69-466e-bb3b-2b7e6b1ceef7", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 420, 840 ], "parameters": { "options": { "systemMessage": "You are a helpful HR assistant designed to answer employee questions based on company policies.\n\nRetrieve relevant information from the provided internal documents and provide a concise, accurate, and informative answer to the employee's question.\n\nUse the tool called \"company_documents_tool\" to retrieve any information from the company's documents.\n\nIf the answer cannot be found in the provided documents, respond with \"I cannot find the answer in the available resources.\"" } }, "typeVersion": 1.7 }, { "id": "825632ac-1edf-4e63-948d-b1a498b2b962", "name": "Vector Store Tool", "type": "@n8n/n8n-nodes-langchain.toolVectorStore", "position": [ 820, 1060 ], "parameters": { "name": "company_documents_tool", "description": "Retrieve information from any company documents" }, "typeVersion": 1 }, { "id": "72d2f685-bcc3-4e62-a5e3-72c0fe65f8e8", "name": "Pinecone Vector Store (Retrieval)", "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", "position": [ 720, 1240 ], "parameters": { "options": {}, "pineconeIndex": { "__rl": true, "mode": "list", "value": "company-files", "cachedResultName": "company-files" } }, "credentials": { "pineconeApi": { "id": "bQTNry52ypGLqt47", "name": "PineconeApi account" } }, "typeVersion": 1 }, { "id": "eeff81cb-6aec-4e7f-afe0-432d87085fb2", "name": "Embeddings Google Gemini (retrieval)", "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", "position": [ 700, 1400 ], "parameters": { "modelName": "models/text-embedding-004" }, "credentials": { "googlePalmApi": { "id": "jLOqyTR4yTT1nYKi", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "8bb6ebb1-1deb-498b-8da4-b809a736e097", "name": "Download File From Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ 460, 0 ], "parameters": { "fileId": { "__rl": true, "mode": "id", "value": "={{ $json.id }}" }, "options": { "fileName": "={{ $json.name }}" }, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "uixLsi5TmrfwXPeB", "name": "Google Drive account" } }, "typeVersion": 3 }, { "id": "bd83bacf-dff1-4b7c-af5c-b249fb16c113", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 420, 660 ], "parameters": { "content": "## Chat with company documents" }, "typeVersion": 1 }, { "id": "7b90daab-0fb2-4c8a-93e6-b138bb04f282", "name": "Google Drive File Updated", "type": "n8n-nodes-base.googleDriveTrigger", "position": [ 140, 140 ], "parameters": { "event": "fileUpdated", "options": {}, "pollTimes": { "item": [ { "mode": "everyMinute" } ] }, "triggerOn": "specificFolder", "folderToWatch": { "__rl": true, "mode": "list", "value": "1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W", "cachedResultUrl": "https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W", "cachedResultName": "INNOVI PRO" } }, "credentials": { "googleDriveOAuth2Api": { "id": "uixLsi5TmrfwXPeB", "name": "Google Drive account" } }, "typeVersion": 1 }, { "id": "3a6c6cef-7a19-42ef-8092-eaf57dae4cdd", "name": "Google Drive File Created", "type": "n8n-nodes-base.googleDriveTrigger", "position": [ 140, -120 ], "parameters": { "event": "fileCreated", "options": { "fileType": "all" }, "pollTimes": { "item": [ { "mode": "everyMinute" } ] }, "triggerOn": "specificFolder", "folderToWatch": { "__rl": true, "mode": "list", "value": "1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W", "cachedResultUrl": "https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W", "cachedResultName": "INNOVI PRO" } }, "credentials": { "googleDriveOAuth2Api": { "id": "uixLsi5TmrfwXPeB", "name": "Google Drive account" } }, "typeVersion": 1 }, { "id": "1e38f1c8-7bd0-4eeb-addc-62339582d350", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 500, 1140 ], "parameters": {}, "typeVersion": 1.3 }, { "id": "4b0ab858-99b1-4337-8c5c-a223519e3662", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 80, 840 ], "webhookId": "5f1c0c82-0ff9-40c7-9e2e-b1a96ffe24cd", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "bfb684d1-e5c1-41da-8305-b2606a2eade6", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 440, -240 ], "parameters": { "width": 320, "content": "## Add docuemnts to vector store when updating or creating new documents in Google Drive" }, "typeVersion": 1 }, { "id": "8f627ec6-4b3f-43ad-a4a3-e2b199a7fe58", "name": "Google Gemini Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", "position": [ 320, 1140 ], "parameters": { "options": {}, "modelName": "models/gemini-2.0-flash-exp" }, "credentials": { "googlePalmApi": { "id": "jLOqyTR4yTT1nYKi", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "f2133a06-0088-46de-9f74-a3f9fe478f98", "name": "Google Gemini Chat Model (retrieval)", "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", "position": [ 1080, 1240 ], "parameters": { "options": {}, "modelName": "models/gemini-2.0-flash-exp" }, "credentials": { "googlePalmApi": { "id": "jLOqyTR4yTT1nYKi", "name": "Google Gemini(PaLM) Api account" } }, "typeVersion": 1 }, { "id": "578deb96-8393-4850-9757-fa97b2bc9992", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -540, 220 ], "parameters": { "width": 420, "height": 720, "content": "## Set up steps\n\n1. Google Cloud Project and Vertex AI API:\n* Create a Google Cloud project.\n* Enable the Vertex AI API for your project.\n2. Google AI API Key:\n* Obtain a Google AI API key from Google AI Studio.\n3. Pinecone Account:\n* Create a free account on the Pinecone website.\nObtain your API key from your Pinecone dashboard.\n* Create an index named company-files in your Pinecone project.\n4. Google Drive:\n* Create a dedicated folder in your Google Drive where company documents will be stored.\n5. Credentials in n8n: Configure credentials in your n8n environment for:\n* Google Drive OAuth2\n* Google Gemini(PaLM) Api (using your Google AI API key)\n* Pinecone API (using your Pinecone API key)\n5. Import the Workflow:\n* Import this workflow into your n8n instance.\n6. Configure the Workflow:\n* Update both Google Drive Trigger nodes to watch the specific folder you created
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"7cXvgkl9170QXzT2\",\n \"meta\": {\n \"instanceId\": \"69133932b9ba8e1ef14816d0b63297bb44feb97c19f759b5d153ff6b0c59e18d\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"RAG Workflow For Company Documents stored in Google Drive\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"753455a3-ddc8-4a74-b043-70a0af38ff9e\",\n \"name\": \"Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 680,\n 0\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"company-files\",\n \"cachedResultName\": \"company-files\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"bQTNry52ypGLqt47\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a7c8fa7f-cad2-4497-a295-30aa2e98cacc\",\n \"name\": \"Embeddings Google Gemini\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 640,\n 280\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"215f0519-4359-4e4b-a90c-7e54b1cc52b5\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 840,\n 220\n ],\n \"parameters\": {\n \"options\": {},\n \"dataType\": \"binary\",\n \"binaryMode\": \"specificField\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"863d3d1d-1621-406e-8320-688f64b07b09\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 820,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkOverlap\": 100\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5af1efb1-ea69-466e-bb3b-2b7e6b1ceef7\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 420,\n 840\n ],\n \"parameters\": {\n \"options\": {\n \"systemMessage\": \"You are a helpful HR assistant designed to answer employee questions based on company policies.\\n\\nRetrieve relevant information from the provided internal documents and provide a concise, accurate, and informative answer to the employee's question.\\n\\nUse the tool called \\\"company_documents_tool\\\" to retrieve any information from the company's documents.\\n\\nIf the answer cannot be found in the provided documents, respond with \\\"I cannot find the answer in the available resources.\\\"\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"825632ac-1edf-4e63-948d-b1a498b2b962\",\n \"name\": \"Vector Store Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 820,\n 1060\n ],\n \"parameters\": {\n \"name\": \"company_documents_tool\",\n \"description\": \"Retrieve information from any company documents\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"72d2f685-bcc3-4e62-a5e3-72c0fe65f8e8\",\n \"name\": \"Pinecone Vector Store (Retrieval)\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 720,\n 1240\n ],\n \"parameters\": {\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"company-files\",\n \"cachedResultName\": \"company-files\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"bQTNry52ypGLqt47\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eeff81cb-6aec-4e7f-afe0-432d87085fb2\",\n \"name\": \"Embeddings Google Gemini (retrieval)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 700,\n 1400\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8bb6ebb1-1deb-498b-8da4-b809a736e097\",\n \"name\": \"Download File From Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n 460,\n 0\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {\n \"fileName\": \"={{ $json.name }}\"\n },\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"uixLsi5TmrfwXPeB\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"bd83bacf-dff1-4b7c-af5c-b249fb16c113\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n 660\n ],\n \"parameters\": {\n \"content\": \"## Chat with company documents\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7b90daab-0fb2-4c8a-93e6-b138bb04f282\",\n \"name\": \"Google Drive File Updated\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n 140,\n 140\n ],\n \"parameters\": {\n \"event\": \"fileUpdated\",\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultName\": \"INNOVI PRO\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"uixLsi5TmrfwXPeB\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3a6c6cef-7a19-42ef-8092-eaf57dae4cdd\",\n \"name\": \"Google Drive File Created\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n 140,\n -120\n ],\n \"parameters\": {\n \"event\": \"fileCreated\",\n \"options\": {\n \"fileType\": \"all\"\n },\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultName\": \"INNOVI PRO\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"uixLsi5TmrfwXPeB\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1e38f1c8-7bd0-4eeb-addc-62339582d350\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 500,\n 1140\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"4b0ab858-99b1-4337-8c5c-a223519e3662\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 80,\n 840\n ],\n \"webhookId\": \"5f1c0c82-0ff9-40c7-9e2e-b1a96ffe24cd\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"bfb684d1-e5c1-41da-8305-b2606a2eade6\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 440,\n -240\n ],\n \"parameters\": {\n \"width\": 320,\n \"content\": \"## Add docuemnts to vector store when updating or creating new documents in Google Drive\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8f627ec6-4b3f-43ad-a4a3-e2b199a7fe58\",\n \"name\": \"Google Gemini Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatGoogleGemini\",\n \"position\": [\n 320,\n 1140\n ],\n \"parameters\": {\n \"options\": {},\n \"modelName\": \"models/gemini-2.0-flash-exp\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f2133a06-0088-46de-9f74-a3f9fe478f98\",\n \"name\": \"Google Gemini Chat Model (retrieval)\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatGoogleGemini\",\n \"position\": [\n 1080,\n 1240\n ],\n \"parameters\": {\n \"options\": {},\n \"modelName\": \"models/gemini-2.0-flash-exp\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"578deb96-8393-4850-9757-fa97b2bc9992\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -540,\n 220\n ],\n \"parameters\": {\n \"width\": 420,\n \"height\": 720,\n \"content\": \"## Set up steps\\n\\n1. Google Cloud Project and Vertex AI API:\\n* Create a Google Cloud project.\\n* Enable the Vertex AI API for your project.\\n2. Google AI API Key:\\n* Obtain a Google AI API key from Google AI Studio.\\n3. Pinecone Account:\\n* Create a free account on the Pinecone website.\\nObtain your API key from your Pinecone dashboard.\\n* Create an index named company-files in your Pinecone project.\\n4. Google Drive:\\n* Create a dedicated folder in your Google Drive where company documents will be stored.\\n5. Credentials in n8n: Configure credentials in your n8n environment for:\\n* Google Drive OAuth2\\n* Google Gemini(PaLM) Api (using your Google AI API key)\\n* Pinecone API (using your Pinecone API key)\\n5. Import the Workflow:\\n* Import this workflow into your n8n instance.\\n6. Configure the Workflow:\\n* Update both Google Drive Trigger nodes to watch the specific folder you created in your Google Drive.\\n* Configure the Pinecone Vector Store nodes to use your company-files index.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"33b252fb-5d87-4a29-a0a7-97308140699c\",\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n []\n ]\n },\n \"Vector Store Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pinecone Vector Store\": {\n \"main\": [\n []\n ]\n },\n \"Embeddings Google Gemini\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Gemini Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Drive File Created\": {\n \"main\": [\n [\n {\n \"node\": \"Download File From Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Drive File Updated\": {\n \"main\": [\n [\n {\n \"node\": \"Download File From Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download File From Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pinecone Vector Store (Retrieval)\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings Google Gemini (retrieval)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store (Retrieval)\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Gemini Chat Model (retrieval)\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
39
0
2
true
combined_workflows.json
{ "input": "The workflow aims to create a chatbot that answers employee questions using information from company documents stored in Google Drive. It uses Google Gemini for embeddings and chat, Pinecone for vector storage, and Langchain tools for document processing and retrieval.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9668, "processed_size": 9668, "processed_timestamp": "2025-04-09T03:08:38.582126", "timestamp": "2025-04-09T02:36:36.465360", "token_count": 4095, "tokens": 908, "workflow_chunk_info": { "is_truncated": false, "original_size": 9668, "processed_size": 9668, "workflow_hash": "735bfac1dad0d013a97700d85fb953eb" }, "workflow_hash": "735bfac1dad0d013a97700d85fb953eb" }
a Google AI API key from Google AI Studio.\n3. Pinecone Account:\n* Create a free account on the Pinecone website.\nObtain your API key from your Pinecone dashboard.\n* Create an index named company-files in your Pinecone project.\n4. Google Drive:\n* Create a dedicated folder in your Google Drive where company documents will be stored.\n5. Credentials in n8n: Configure credentials in your n8n environment for:\n* Google Drive OAuth2\n* Google Gemini(PaLM) Api (using your Google AI API key)\n* Pinecone API (using your Pinecone API key)\n5. Import the Workflow:\n* Import this workflow into your n8n instance.\n6. Configure the Workflow:\n* Update both Google Drive Trigger nodes to watch the specific folder you created in your Google Drive.\n* Configure the Pinecone Vector Store nodes to use your company-files index." }, "typeVersion": 1 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "33b252fb-5d87-4a29-a0a7-97308140699c", "connections": { "AI Agent": { "main": [ [] ] }, "Vector Store Tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Pinecone Vector Store", "type": "ai_document", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Pinecone Vector Store": { "main": [ [] ] }, "Embeddings Google Gemini": { "ai_embedding": [ [ { "node": "Pinecone Vector Store", "type": "ai_embedding", "index": 0 } ] ] }, "Google Gemini Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Google Drive File Created": { "main": [ [ { "node": "Download File From Google Drive", "type": "main", "index": 0 } ] ] }, "Google Drive File Updated": { "main": [ [ { "node": "Download File From Google Drive", "type": "main", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Download File From Google Drive": { "main": [ [ { "node": "Pinecone Vector Store", "type": "main", "index": 0 } ] ] }, "Pinecone Vector Store (Retrieval)": { "ai_vectorStore": [ [ { "node": "Vector Store Tool", "type": "ai_vectorStore", "index": 0 } ] ] }, "Recursive Character Text Splitter": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] }, "Embeddings Google Gemini (retrieval)": { "ai_embedding": [ [ { "node": "Pinecone Vector Store (Retrieval)", "type": "ai_embedding", "index": 0 } ] ] }, "Google Gemini Chat Model (retrieval)": { "ai_languageModel": [ [ { "node": "Vector Store Tool", "type": "ai_languageModel", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"7cXvgkl9170QXzT2\",\n \"meta\": {\n \"instanceId\": \"69133932b9ba8e1ef14816d0b63297bb44feb97c19f759b5d153ff6b0c59e18d\",\n \"templateCredsSetupCompleted\": true\n },\n \"name\": \"RAG Workflow For Company Documents stored in Google Drive\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"753455a3-ddc8-4a74-b043-70a0af38ff9e\",\n \"name\": \"Pinecone Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 680,\n 0\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"company-files\",\n \"cachedResultName\": \"company-files\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"bQTNry52ypGLqt47\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a7c8fa7f-cad2-4497-a295-30aa2e98cacc\",\n \"name\": \"Embeddings Google Gemini\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 640,\n 280\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"215f0519-4359-4e4b-a90c-7e54b1cc52b5\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n 840,\n 220\n ],\n \"parameters\": {\n \"options\": {},\n \"dataType\": \"binary\",\n \"binaryMode\": \"specificField\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"863d3d1d-1621-406e-8320-688f64b07b09\",\n \"name\": \"Recursive Character Text Splitter\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter\",\n \"position\": [\n 820,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"chunkOverlap\": 100\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5af1efb1-ea69-466e-bb3b-2b7e6b1ceef7\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 420,\n 840\n ],\n \"parameters\": {\n \"options\": {\n \"systemMessage\": \"You are a helpful HR assistant designed to answer employee questions based on company policies.\\n\\nRetrieve relevant information from the provided internal documents and provide a concise, accurate, and informative answer to the employee's question.\\n\\nUse the tool called \\\"company_documents_tool\\\" to retrieve any information from the company's documents.\\n\\nIf the answer cannot be found in the provided documents, respond with \\\"I cannot find the answer in the available resources.\\\"\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"825632ac-1edf-4e63-948d-b1a498b2b962\",\n \"name\": \"Vector Store Tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolVectorStore\",\n \"position\": [\n 820,\n 1060\n ],\n \"parameters\": {\n \"name\": \"company_documents_tool\",\n \"description\": \"Retrieve information from any company documents\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"72d2f685-bcc3-4e62-a5e3-72c0fe65f8e8\",\n \"name\": \"Pinecone Vector Store (Retrieval)\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStorePinecone\",\n \"position\": [\n 720,\n 1240\n ],\n \"parameters\": {\n \"options\": {},\n \"pineconeIndex\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"company-files\",\n \"cachedResultName\": \"company-files\"\n }\n },\n \"credentials\": {\n \"pineconeApi\": {\n \"id\": \"bQTNry52ypGLqt47\",\n \"name\": \"PineconeApi account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eeff81cb-6aec-4e7f-afe0-432d87085fb2\",\n \"name\": \"Embeddings Google Gemini (retrieval)\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini\",\n \"position\": [\n 700,\n 1400\n ],\n \"parameters\": {\n \"modelName\": \"models/text-embedding-004\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8bb6ebb1-1deb-498b-8da4-b809a736e097\",\n \"name\": \"Download File From Google Drive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n 460,\n 0\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n \"options\": {\n \"fileName\": \"={{ $json.name }}\"\n },\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"uixLsi5TmrfwXPeB\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"bd83bacf-dff1-4b7c-af5c-b249fb16c113\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 420,\n 660\n ],\n \"parameters\": {\n \"content\": \"## Chat with company documents\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7b90daab-0fb2-4c8a-93e6-b138bb04f282\",\n \"name\": \"Google Drive File Updated\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n 140,\n 140\n ],\n \"parameters\": {\n \"event\": \"fileUpdated\",\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultName\": \"INNOVI PRO\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"uixLsi5TmrfwXPeB\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3a6c6cef-7a19-42ef-8092-eaf57dae4cdd\",\n \"name\": \"Google Drive File Created\",\n \"type\": \"n8n-nodes-base.googleDriveTrigger\",\n \"position\": [\n 140,\n -120\n ],\n \"parameters\": {\n \"event\": \"fileCreated\",\n \"options\": {\n \"fileType\": \"all\"\n },\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n },\n \"triggerOn\": \"specificFolder\",\n \"folderToWatch\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultUrl\": \"https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W\",\n \"cachedResultName\": \"INNOVI PRO\"\n }\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"uixLsi5TmrfwXPeB\",\n \"name\": \"Google Drive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1e38f1c8-7bd0-4eeb-addc-62339582d350\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 500,\n 1140\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"4b0ab858-99b1-4337-8c5c-a223519e3662\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 80,\n 840\n ],\n \"webhookId\": \"5f1c0c82-0ff9-40c7-9e2e-b1a96ffe24cd\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"bfb684d1-e5c1-41da-8305-b2606a2eade6\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 440,\n -240\n ],\n \"parameters\": {\n \"width\": 320,\n \"content\": \"## Add docuemnts to vector store when updating or creating new documents in Google Drive\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8f627ec6-4b3f-43ad-a4a3-e2b199a7fe58\",\n \"name\": \"Google Gemini Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatGoogleGemini\",\n \"position\": [\n 320,\n 1140\n ],\n \"parameters\": {\n \"options\": {},\n \"modelName\": \"models/gemini-2.0-flash-exp\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f2133a06-0088-46de-9f74-a3f9fe478f98\",\n \"name\": \"Google Gemini Chat Model (retrieval)\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatGoogleGemini\",\n \"position\": [\n 1080,\n 1240\n ],\n \"parameters\": {\n \"options\": {},\n \"modelName\": \"models/gemini-2.0-flash-exp\"\n },\n \"credentials\": {\n \"googlePalmApi\": {\n \"id\": \"jLOqyTR4yTT1nYKi\",\n \"name\": \"Google Gemini(PaLM) Api account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"578deb96-8393-4850-9757-fa97b2bc9992\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -540,\n 220\n ],\n \"parameters\": {\n \"width\": 420,\n \"height\": 720,\n \"content\": \"## Set up steps\\n\\n1. Google Cloud Project and Vertex AI API:\\n* Create a Google Cloud project.\\n* Enable the Vertex AI API for your project.\\n2. Google AI API Key:\\n* Obtain a Google AI API key from Google AI Studio.\\n3. Pinecone Account:\\n* Create a free account on the Pinecone website.\\nObtain your API key from your Pinecone dashboard.\\n* Create an index named company-files in your Pinecone project.\\n4. Google Drive:\\n* Create a dedicated folder in your Google Drive where company documents will be stored.\\n5. Credentials in n8n: Configure credentials in your n8n environment for:\\n* Google Drive OAuth2\\n* Google Gemini(PaLM) Api (using your Google AI API key)\\n* Pinecone API (using your Pinecone API key)\\n5. Import the Workflow:\\n* Import this workflow into your n8n instance.\\n6. Configure the Workflow:\\n* Update both Google Drive Trigger nodes to watch the specific folder you created in your Google Drive.\\n* Configure the Pinecone Vector Store nodes to use your company-files index.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"33b252fb-5d87-4a29-a0a7-97308140699c\",\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n []\n ]\n },\n \"Vector Store Tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pinecone Vector Store\": {\n \"main\": [\n []\n ]\n },\n \"Embeddings Google Gemini\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Gemini Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Drive File Created\": {\n \"main\": [\n [\n {\n \"node\": \"Download File From Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Drive File Updated\": {\n \"main\": [\n [\n {\n \"node\": \"Download File From Google Drive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Download File From Google Drive\": {\n \"main\": [\n [\n {\n \"node\": \"Pinecone Vector Store\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pinecone Vector Store (Retrieval)\": {\n \"ai_vectorStore\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_vectorStore\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Recursive Character Text Splitter\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings Google Gemini (retrieval)\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Pinecone Vector Store (Retrieval)\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Gemini Chat Model (retrieval)\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Vector Store Tool\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
39
1
2
true
combined_workflows.json
{ "input": "The workflow aims to create a chatbot that answers employee questions using information from company documents stored in Google Drive. It uses Google Gemini for embeddings and chat, Pinecone for vector storage, and Langchain tools for document processing and retrieval.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9668, "processed_size": 9668, "processed_timestamp": "2025-04-09T03:08:38.586115", "timestamp": "2025-04-09T02:36:36.465360", "token_count": 1262, "tokens": 908, "workflow_chunk_info": { "is_truncated": false, "original_size": 9668, "processed_size": 9668, "workflow_hash": "735bfac1dad0d013a97700d85fb953eb" }, "workflow_hash": "735bfac1dad0d013a97700d85fb953eb" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow creates a Telegram-based AI assistant that processes text and voice messages, accesses email, calendar, and task information, and responds to user queries. Analyze this workflow: ```json { "meta": { "instanceId": "2723a3a635131edfcb16103f3d4dbaadf3658e386b4762989cbf49528dccbdbd" }, "nodes": [ { "id": "c70236ea-91ab-4e47-b6f6-63a70ede5d3c", "name": "Google Calendar", "type": "n8n-nodes-base.googleCalendarTool", "position": [ 1000, 680 ], "parameters": { "options": { "fields": "=items(summary, start(dateTime))", "timeMin": "={{$fromAI(\"date\",\"the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS\")}}" }, "calendar": { "__rl": true, "mode": "list", "value": "derekcheungsa@gmail.com", "cachedResultName": "derekcheungsa@gmail.com" }, "operation": "getAll" }, "credentials": { "googleCalendarOAuth2Api": { "id": "qx8JdPX4I5Xk9c46", "name": "Google Calendar account" } }, "typeVersion": 1.1 }, { "id": "d2287bea-de47-4180-8ee6-55d4ab1a89da", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 760, 680 ], "parameters": { "sessionKey": "={{ $('Listen for incoming events').first().json.message.from.id }}", "sessionIdType": "customKey" }, "typeVersion": 1.2 }, { "id": "fa955731-86f6-4e4d-8604-dab5f52dee87", "name": "Get Email", "type": "n8n-nodes-base.gmailTool", "position": [ 880, 680 ], "parameters": { "filters": { "labelIds": [ "INBOX", "UNREAD" ], "readStatus": "unread", "receivedAfter": "={{$fromAI(\"date\",\"the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS\")}}" }, "operation": "getAll" }, "credentials": { "gmailOAuth2": { "id": "tojOpzEqFprdxS46", "name": "Gmail account" } }, "typeVersion": 2.1 }, { "id": "46511f47-1687-4cbe-ae41-ceb205ed1f11", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 640, 680 ], "parameters": { "model": "gpt-4o-mini", "options": {} }, "credentials": { "openAiApi": { "id": "5oYe8Cxj7liOPAKk", "name": "Derek T" } }, "typeVersion": 1 }, { "id": "64fe44db-af19-43eb-9ff1-de0a72a9e645", "name": "Listen for incoming events", "type": "n8n-nodes-base.telegramTrigger", "position": [ -160, 360 ], "webhookId": "322dce18-f93e-4f86-b9b1-3305519b7834", "parameters": { "updates": [ "message" ], "additionalFields": {} }, "credentials": { "telegramApi": { "id": "Ov00cT0t4h4AFtZ0", "name": "Telegram account" } }, "typeVersion": 1 }, { "id": "e35c04ff-a050-4564-8c1b-5b22b556872f", "name": "Telegram", "type": "n8n-nodes-base.telegram", "onError": "continueErrorOutput", "position": [ 1280, 360 ], "parameters": { "text": "={{ $json.output }}", "chatId": "={{ $('Listen for incoming events').first().json.message.from.id }}", "additionalFields": { "parse_mode": "Markdown", "appendAttribution": false } }, "credentials": { "telegramApi": { "id": "Ov00cT0t4h4AFtZ0", "name": "Telegram account" } }, "typeVersion": 1.1 }, { "id": "e791d4f8-2c19-4c14-a71e-39a04f22e944", "name": "If", "type": "n8n-nodes-base.if", "position": [ 200, 360 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "a0bf9719-4272-46f6-ab3b-eda6f7b44fd8", "operator": { "type": "string", "operation": "empty", "singleValue": true }, "leftValue": "={{ $json.message.text }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "5bd1788a-3d08-4eb3-8e03-3ce82f44d2a7", "name": "Speech to Text", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 620, 360 ], "parameters": { "options": {}, "resource": "audio", "operation": "transcribe" }, "credentials": { "openAiApi": { "id": "5oYe8Cxj7liOPAKk", "name": "Derek T" } }, "typeVersion": 1.3 }, { "id": "b67a2a93-517b-469e-aaa4-32c422710743", "name": "Voice or Text", "type": "n8n-nodes-base.set", "position": [ 40, 360 ], "parameters": { "fields": { "values": [ { "name": "text", "stringValue": "={{ $json?.message?.text || \"\" }}" } ] }, "options": {} }, "typeVersion": 3.2 }, { "id": "8105c39f-9e87-44c4-9215-b3777f0b4164", "name": "Get Voice File", "type": "n8n-nodes-base.telegram", "position": [ 380, 360 ], "parameters": { "fileId": "={{ $('Listen for incoming events').item.json.message.voice.file_id }}", "resource": "file" }, "credentials": { "telegramApi": { "id": "Ov00cT0t4h4AFtZ0", "name": "Telegram account" } }, "typeVersion": 1.1 }, { "id": "759b975f-d17c-4386-a5b3-12413f0361f4", "name": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 780, 360 ], "parameters": { "text": "={{ $json.text }}", "options": { "systemMessage": "=You are a helpful assistant.\n\nToday's date is {{ $now }}.\n\nGuidelines:\n- When fetching emails, filter out any promotional emails. \n- When summarizing emails, include Sender, Message date, subject, and brief summary of email.\n- if the user did not specify a date in the request assume they are asking for today\n- Use baserow tool to answer questions about tasks\n- When answering questions about calendar events, filter out events that don't apply to the question. For example, the question is about events for today, only reply with events for today. Don't mention future events if it's more than 1 week away" }, "promptType": "define" }, "typeVersion": 1.6 }, { "id": "5537c777-f003-4673-b48a-4993a0c10520", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 20, 260 ], "parameters": { "color": 5, "width": 496.25, "height": 278.75, "content": "## Process Telegram Request\n" }, "typeVersion": 1 }, { "id": "40e92679-b47a-4213-bb23-3f8d086459f2", "name": "Tasks", "type": "n8n-nodes-base.baserowTool", "position": [ 1120, 680 ], "parameters": { "tableId": 372174, "databaseId": 146496, "additionalOptions": {} }, "credentials": { "baserowApi": { "id": "jsgACn0VxAPoD0E2", "name": "Baserow account" } }, "typeVersion": 1 }, { "id": "570a0647-b571-4ebc-9dfe-40244b5a0b2a", "name": "Contacts", "type": "n8n-nodes-base.baserowTool", "position": [ 1240, 680 ], "parameters": { "tableId": 372177, "databaseId": 146496, "descriptionType": "manual", "toolDescription": "Useful for getting contact information. For example emails or phone numbers.", "additionalOptions": {} }, "credentials": { "baserowApi": { "id": "jsgACn0VxAPoD0E2", "name": "Baserow account" } }, "typeVersion": 1 }, { "id": "7fb1d95a-a8d6-4040-9271-5197296be7da", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ -620, 220 ], "parameters": { "color": 5, "width": 386.9292441979969, "height": 389.78268107403096, "content": "## Start here: Step-by Step Youtube Tutorial :star:\n\n[![Building an AI Personal Assistant](https://img.youtube.com/vi/pXjowPc6V2s/sddefault.jpg)](https://youtu.be/pXjowPc6V2s)\n" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "If": { "main": [ [ { "node": "Get Voice File", "type": "main", "index": 0 } ], [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "main", "index": 0 } ] ] }, "Tasks": { "ai_tool": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_tool", "index": 0 } ] ] }, "Contacts": { "ai_tool": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_tool", "index": 0 } ] ] }, "Get Email": { "ai_tool": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_tool", "index": 0 } ] ] }, "Voice or Text": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Get Voice File": { "main": [ [ { "node": "Speech to Text", "type": "main", "index": 0 } ] ] }, "Speech to Text": { "main": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€οΏ½
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"2723a3a635131edfcb16103f3d4dbaadf3658e386b4762989cbf49528dccbdbd\"\n },\n \"nodes\": [\n {\n \"id\": \"c70236ea-91ab-4e47-b6f6-63a70ede5d3c\",\n \"name\": \"Google Calendar\",\n \"type\": \"n8n-nodes-base.googleCalendarTool\",\n \"position\": [\n 1000,\n 680\n ],\n \"parameters\": {\n \"options\": {\n \"fields\": \"=items(summary, start(dateTime))\",\n \"timeMin\": \"={{$fromAI(\\\"date\\\",\\\"the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS\\\")}}\"\n },\n \"calendar\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"derekcheungsa@gmail.com\",\n \"cachedResultName\": \"derekcheungsa@gmail.com\"\n },\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"googleCalendarOAuth2Api\": {\n \"id\": \"qx8JdPX4I5Xk9c46\",\n \"name\": \"Google Calendar account\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"d2287bea-de47-4180-8ee6-55d4ab1a89da\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 760,\n 680\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('Listen for incoming events').first().json.message.from.id }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"fa955731-86f6-4e4d-8604-dab5f52dee87\",\n \"name\": \"Get Email\",\n \"type\": \"n8n-nodes-base.gmailTool\",\n \"position\": [\n 880,\n 680\n ],\n \"parameters\": {\n \"filters\": {\n \"labelIds\": [\n \"INBOX\",\n \"UNREAD\"\n ],\n \"readStatus\": \"unread\",\n \"receivedAfter\": \"={{$fromAI(\\\"date\\\",\\\"the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS\\\")}}\"\n },\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"tojOpzEqFprdxS46\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"46511f47-1687-4cbe-ae41-ceb205ed1f11\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 640,\n 680\n ],\n \"parameters\": {\n \"model\": \"gpt-4o-mini\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5oYe8Cxj7liOPAKk\",\n \"name\": \"Derek T\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"64fe44db-af19-43eb-9ff1-de0a72a9e645\",\n \"name\": \"Listen for incoming events\",\n \"type\": \"n8n-nodes-base.telegramTrigger\",\n \"position\": [\n -160,\n 360\n ],\n \"webhookId\": \"322dce18-f93e-4f86-b9b1-3305519b7834\",\n \"parameters\": {\n \"updates\": [\n \"message\"\n ],\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"Ov00cT0t4h4AFtZ0\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e35c04ff-a050-4564-8c1b-5b22b556872f\",\n \"name\": \"Telegram\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 1280,\n 360\n ],\n \"parameters\": {\n \"text\": \"={{ $json.output }}\",\n \"chatId\": \"={{ $('Listen for incoming events').first().json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"Markdown\",\n \"appendAttribution\": false\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"Ov00cT0t4h4AFtZ0\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"e791d4f8-2c19-4c14-a71e-39a04f22e944\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 200,\n 360\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a0bf9719-4272-46f6-ab3b-eda6f7b44fd8\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"empty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.text }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"5bd1788a-3d08-4eb3-8e03-3ce82f44d2a7\",\n \"name\": \"Speech to Text\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 620,\n 360\n ],\n \"parameters\": {\n \"options\": {},\n \"resource\": \"audio\",\n \"operation\": \"transcribe\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5oYe8Cxj7liOPAKk\",\n \"name\": \"Derek T\"\n }\n },\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"b67a2a93-517b-469e-aaa4-32c422710743\",\n \"name\": \"Voice or Text\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 40,\n 360\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"text\",\n \"stringValue\": \"={{ $json?.message?.text || \\\"\\\" }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"8105c39f-9e87-44c4-9215-b3777f0b4164\",\n \"name\": \"Get Voice File\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 380,\n 360\n ],\n \"parameters\": {\n \"fileId\": \"={{ $('Listen for incoming events').item.json.message.voice.file_id }}\",\n \"resource\": \"file\"\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"Ov00cT0t4h4AFtZ0\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"759b975f-d17c-4386-a5b3-12413f0361f4\",\n \"name\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 780,\n 360\n ],\n \"parameters\": {\n \"text\": \"={{ $json.text }}\",\n \"options\": {\n \"systemMessage\": \"=You are a helpful assistant.\\n\\nToday's date is {{ $now }}.\\n\\nGuidelines:\\n- When fetching emails, filter out any promotional emails. \\n- When summarizing emails, include Sender, Message date, subject, and brief summary of email.\\n- if the user did not specify a date in the request assume they are asking for today\\n- Use baserow tool to answer questions about tasks\\n- When answering questions about calendar events, filter out events that don't apply to the question. For example, the question is about events for today, only reply with events for today. Don't mention future events if it's more than 1 week away\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"5537c777-f003-4673-b48a-4993a0c10520\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 20,\n 260\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 496.25,\n \"height\": 278.75,\n \"content\": \"## Process Telegram Request\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"40e92679-b47a-4213-bb23-3f8d086459f2\",\n \"name\": \"Tasks\",\n \"type\": \"n8n-nodes-base.baserowTool\",\n \"position\": [\n 1120,\n 680\n ],\n \"parameters\": {\n \"tableId\": 372174,\n \"databaseId\": 146496,\n \"additionalOptions\": {}\n },\n \"credentials\": {\n \"baserowApi\": {\n \"id\": \"jsgACn0VxAPoD0E2\",\n \"name\": \"Baserow account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"570a0647-b571-4ebc-9dfe-40244b5a0b2a\",\n \"name\": \"Contacts\",\n \"type\": \"n8n-nodes-base.baserowTool\",\n \"position\": [\n 1240,\n 680\n ],\n \"parameters\": {\n \"tableId\": 372177,\n \"databaseId\": 146496,\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Useful for getting contact information. For example emails or phone numbers.\",\n \"additionalOptions\": {}\n },\n \"credentials\": {\n \"baserowApi\": {\n \"id\": \"jsgACn0VxAPoD0E2\",\n \"name\": \"Baserow account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7fb1d95a-a8d6-4040-9271-5197296be7da\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -620,\n 220\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 386.9292441979969,\n \"height\": 389.78268107403096,\n \"content\": \"## Start here: Step-by Step Youtube Tutorial :star:\\n\\n[![Building an AI Personal Assistant](https://img.youtube.com/vi/pXjowPc6V2s/sddefault.jpg)](https://youtu.be/pXjowPc6V2s)\\n\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Get Voice File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Tasks\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Contacts\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Email\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Voice or Text\": {\n \"main\": [\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Voice File\": {\n \"main\": [\n [\n {\n \"node\": \"Speech to Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Speech to Text\": {\n \"main\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Calendar\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Listen for incoming events\": {\n \"main\": [\n [\n {\n \"node\": \"Voice or Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\": {\n \"main\": [\n [\n {\n \"node\": \"Telegram\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
40
0
2
true
combined_workflows.json
{ "input": "This workflow creates a Telegram-based AI assistant that processes text and voice messages, accesses email, calendar, and task information, and responds to user queries.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8068, "processed_size": 8068, "processed_timestamp": "2025-04-09T03:08:38.649306", "timestamp": "2025-04-09T02:36:36.669065", "token_count": 4095, "tokens": 724, "workflow_chunk_info": { "is_truncated": false, "original_size": 8068, "processed_size": 8068, "workflow_hash": "b683f29e4ebb9cf8cfa4cf0035b8a5d7" }, "workflow_hash": "b683f29e4ebb9cf8cfa4cf0035b8a5d7" }
Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_tool", "index": 0 } ] ] }, "Voice or Text": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Get Voice File": { "main": [ [ { "node": "Speech to Text", "type": "main", "index": 0 } ] ] }, "Speech to Text": { "main": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "main", "index": 0 } ] ] }, "Google Calendar": { "ai_tool": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_tool", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_languageModel", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«", "type": "ai_memory", "index": 0 } ] ] }, "Listen for incoming events": { "main": [ [ { "node": "Voice or Text", "type": "main", "index": 0 } ] ] }, "Angie, AI Assistant πŸ‘©πŸ»β€πŸ«": { "main": [ [ { "node": "Telegram", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"2723a3a635131edfcb16103f3d4dbaadf3658e386b4762989cbf49528dccbdbd\"\n },\n \"nodes\": [\n {\n \"id\": \"c70236ea-91ab-4e47-b6f6-63a70ede5d3c\",\n \"name\": \"Google Calendar\",\n \"type\": \"n8n-nodes-base.googleCalendarTool\",\n \"position\": [\n 1000,\n 680\n ],\n \"parameters\": {\n \"options\": {\n \"fields\": \"=items(summary, start(dateTime))\",\n \"timeMin\": \"={{$fromAI(\\\"date\\\",\\\"the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS\\\")}}\"\n },\n \"calendar\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"derekcheungsa@gmail.com\",\n \"cachedResultName\": \"derekcheungsa@gmail.com\"\n },\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"googleCalendarOAuth2Api\": {\n \"id\": \"qx8JdPX4I5Xk9c46\",\n \"name\": \"Google Calendar account\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"d2287bea-de47-4180-8ee6-55d4ab1a89da\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 760,\n 680\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('Listen for incoming events').first().json.message.from.id }}\",\n \"sessionIdType\": \"customKey\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"fa955731-86f6-4e4d-8604-dab5f52dee87\",\n \"name\": \"Get Email\",\n \"type\": \"n8n-nodes-base.gmailTool\",\n \"position\": [\n 880,\n 680\n ],\n \"parameters\": {\n \"filters\": {\n \"labelIds\": [\n \"INBOX\",\n \"UNREAD\"\n ],\n \"readStatus\": \"unread\",\n \"receivedAfter\": \"={{$fromAI(\\\"date\\\",\\\"the date after which to fetch the messages in format YYYY-MM-DDTHH:MM:SS\\\")}}\"\n },\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"tojOpzEqFprdxS46\",\n \"name\": \"Gmail account\"\n }\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"46511f47-1687-4cbe-ae41-ceb205ed1f11\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 640,\n 680\n ],\n \"parameters\": {\n \"model\": \"gpt-4o-mini\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5oYe8Cxj7liOPAKk\",\n \"name\": \"Derek T\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"64fe44db-af19-43eb-9ff1-de0a72a9e645\",\n \"name\": \"Listen for incoming events\",\n \"type\": \"n8n-nodes-base.telegramTrigger\",\n \"position\": [\n -160,\n 360\n ],\n \"webhookId\": \"322dce18-f93e-4f86-b9b1-3305519b7834\",\n \"parameters\": {\n \"updates\": [\n \"message\"\n ],\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"Ov00cT0t4h4AFtZ0\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e35c04ff-a050-4564-8c1b-5b22b556872f\",\n \"name\": \"Telegram\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 1280,\n 360\n ],\n \"parameters\": {\n \"text\": \"={{ $json.output }}\",\n \"chatId\": \"={{ $('Listen for incoming events').first().json.message.from.id }}\",\n \"additionalFields\": {\n \"parse_mode\": \"Markdown\",\n \"appendAttribution\": false\n }\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"Ov00cT0t4h4AFtZ0\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"e791d4f8-2c19-4c14-a71e-39a04f22e944\",\n \"name\": \"If\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 200,\n 360\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a0bf9719-4272-46f6-ab3b-eda6f7b44fd8\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"empty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.text }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"5bd1788a-3d08-4eb3-8e03-3ce82f44d2a7\",\n \"name\": \"Speech to Text\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 620,\n 360\n ],\n \"parameters\": {\n \"options\": {},\n \"resource\": \"audio\",\n \"operation\": \"transcribe\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"5oYe8Cxj7liOPAKk\",\n \"name\": \"Derek T\"\n }\n },\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"b67a2a93-517b-469e-aaa4-32c422710743\",\n \"name\": \"Voice or Text\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 40,\n 360\n ],\n \"parameters\": {\n \"fields\": {\n \"values\": [\n {\n \"name\": \"text\",\n \"stringValue\": \"={{ $json?.message?.text || \\\"\\\" }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"8105c39f-9e87-44c4-9215-b3777f0b4164\",\n \"name\": \"Get Voice File\",\n \"type\": \"n8n-nodes-base.telegram\",\n \"position\": [\n 380,\n 360\n ],\n \"parameters\": {\n \"fileId\": \"={{ $('Listen for incoming events').item.json.message.voice.file_id }}\",\n \"resource\": \"file\"\n },\n \"credentials\": {\n \"telegramApi\": {\n \"id\": \"Ov00cT0t4h4AFtZ0\",\n \"name\": \"Telegram account\"\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"759b975f-d17c-4386-a5b3-12413f0361f4\",\n \"name\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 780,\n 360\n ],\n \"parameters\": {\n \"text\": \"={{ $json.text }}\",\n \"options\": {\n \"systemMessage\": \"=You are a helpful assistant.\\n\\nToday's date is {{ $now }}.\\n\\nGuidelines:\\n- When fetching emails, filter out any promotional emails. \\n- When summarizing emails, include Sender, Message date, subject, and brief summary of email.\\n- if the user did not specify a date in the request assume they are asking for today\\n- Use baserow tool to answer questions about tasks\\n- When answering questions about calendar events, filter out events that don't apply to the question. For example, the question is about events for today, only reply with events for today. Don't mention future events if it's more than 1 week away\"\n },\n \"promptType\": \"define\"\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"5537c777-f003-4673-b48a-4993a0c10520\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 20,\n 260\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 496.25,\n \"height\": 278.75,\n \"content\": \"## Process Telegram Request\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"40e92679-b47a-4213-bb23-3f8d086459f2\",\n \"name\": \"Tasks\",\n \"type\": \"n8n-nodes-base.baserowTool\",\n \"position\": [\n 1120,\n 680\n ],\n \"parameters\": {\n \"tableId\": 372174,\n \"databaseId\": 146496,\n \"additionalOptions\": {}\n },\n \"credentials\": {\n \"baserowApi\": {\n \"id\": \"jsgACn0VxAPoD0E2\",\n \"name\": \"Baserow account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"570a0647-b571-4ebc-9dfe-40244b5a0b2a\",\n \"name\": \"Contacts\",\n \"type\": \"n8n-nodes-base.baserowTool\",\n \"position\": [\n 1240,\n 680\n ],\n \"parameters\": {\n \"tableId\": 372177,\n \"databaseId\": 146496,\n \"descriptionType\": \"manual\",\n \"toolDescription\": \"Useful for getting contact information. For example emails or phone numbers.\",\n \"additionalOptions\": {}\n },\n \"credentials\": {\n \"baserowApi\": {\n \"id\": \"jsgACn0VxAPoD0E2\",\n \"name\": \"Baserow account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7fb1d95a-a8d6-4040-9271-5197296be7da\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -620,\n 220\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 386.9292441979969,\n \"height\": 389.78268107403096,\n \"content\": \"## Start here: Step-by Step Youtube Tutorial :star:\\n\\n[![Building an AI Personal Assistant](https://img.youtube.com/vi/pXjowPc6V2s/sddefault.jpg)](https://youtu.be/pXjowPc6V2s)\\n\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"If\": {\n \"main\": [\n [\n {\n \"node\": \"Get Voice File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Tasks\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Contacts\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Email\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Voice or Text\": {\n \"main\": [\n [\n {\n \"node\": \"If\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Voice File\": {\n \"main\": [\n [\n {\n \"node\": \"Speech to Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Speech to Text\": {\n \"main\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Google Calendar\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Listen for incoming events\": {\n \"main\": [\n [\n {\n \"node\": \"Voice or Text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Angie, AI Assistant πŸ‘©πŸ»β€πŸ«\": {\n \"main\": [\n [\n {\n \"node\": \"Telegram\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
40
1
2
true
combined_workflows.json
{ "input": "This workflow creates a Telegram-based AI assistant that processes text and voice messages, accesses email, calendar, and task information, and responds to user queries.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8068, "processed_size": 8068, "processed_timestamp": "2025-04-09T03:08:38.651305", "timestamp": "2025-04-09T02:36:36.669065", "token_count": 625, "tokens": 724, "workflow_chunk_info": { "is_truncated": false, "original_size": 8068, "processed_size": 8068, "workflow_hash": "b683f29e4ebb9cf8cfa4cf0035b8a5d7" }, "workflow_hash": "b683f29e4ebb9cf8cfa4cf0035b8a5d7" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: Create a chatbot that uses OpenAI's assistant and remembers past chat messages. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "b26e5f35-214a-4eba-83f6-a61736a2f017", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 240, 560 ], "parameters": { "color": 7, "width": 398, "height": 217, "content": "Call the assistant, passing in the previous chat messages" }, "typeVersion": 1 }, { "id": "7cba00f3-7824-47eb-a17f-6e34fab51c0d", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -440, 460 ], "parameters": { "height": 300.48941882630095, "content": "## Try me out\n1. In the OpenAI Assistant node, make sure your OpenAI credentials are set and choose an assistant to use (you'll need to create one if you don't have one already)\n2. Click the 'Chat' button below\n\n - In the first message, tell the AI what your name is\n - In a second message, ask the AI what your name is" }, "typeVersion": 1 }, { "id": "a71b8aef-5ee9-4ff2-9a77-5154fee67cc8", "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 180, 920 ], "parameters": { "sessionKey": "={{ $('When chat message received').first().json.sessionId }}", "sessionIdType": "customKey", "contextWindowLength": 20 }, "typeVersion": 1.3 }, { "id": "24faa70e-52e7-40e4-abc1-05c8b18df583", "name": "OpenAI", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 300, 640 ], "parameters": { "text": "={{ $('When chat message received').item.json.chatInput }}", "prompt": "define", "options": {}, "resource": "assistant", "assistantId": { "__rl": true, "mode": "id", "value": "asst_HDSAnzsp4WqY4UC1iI9auH5z" } }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.8 }, { "id": "37b70475-f28b-4e5f-a7e2-3dad715b2e8d", "name": "Calculator1", "type": "@n8n/n8n-nodes-langchain.toolCalculator", "position": [ 600, 920 ], "parameters": {}, "typeVersion": 1 }, { "id": "79d644c4-6d24-4f1e-9c43-08fa8b20da0e", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -100, 640 ], "webhookId": "9eab0524-6cd7-4b81-8bd8-4d050a972a08", "parameters": { "public": true, "options": { "loadPreviousSession": "memory" } }, "typeVersion": 1.1 } ], "pinData": {}, "connections": { "Calculator1": { "ai_tool": [ [ { "node": "OpenAI", "type": "ai_tool", "index": 0 } ] ] }, "Simple Memory": { "ai_memory": [ [ { "node": "OpenAI", "type": "ai_memory", "index": 0 }, { "node": "When chat message received", "type": "ai_memory", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "OpenAI", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"b26e5f35-214a-4eba-83f6-a61736a2f017\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 240,\n 560\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 398,\n \"height\": 217,\n \"content\": \"Call the assistant, passing in the previous chat messages\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7cba00f3-7824-47eb-a17f-6e34fab51c0d\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -440,\n 460\n ],\n \"parameters\": {\n \"height\": 300.48941882630095,\n \"content\": \"## Try me out\\n1. In the OpenAI Assistant node, make sure your OpenAI credentials are set and choose an assistant to use (you'll need to create one if you don't have one already)\\n2. Click the 'Chat' button below\\n\\n - In the first message, tell the AI what your name is\\n - In a second message, ask the AI what your name is\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a71b8aef-5ee9-4ff2-9a77-5154fee67cc8\",\n \"name\": \"Simple Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 180,\n 920\n ],\n \"parameters\": {\n \"sessionKey\": \"={{ $('When chat message received').first().json.sessionId }}\",\n \"sessionIdType\": \"customKey\",\n \"contextWindowLength\": 20\n },\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"24faa70e-52e7-40e4-abc1-05c8b18df583\",\n \"name\": \"OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 300,\n 640\n ],\n \"parameters\": {\n \"text\": \"={{ $('When chat message received').item.json.chatInput }}\",\n \"prompt\": \"define\",\n \"options\": {},\n \"resource\": \"assistant\",\n \"assistantId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"asst_HDSAnzsp4WqY4UC1iI9auH5z\"\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"37b70475-f28b-4e5f-a7e2-3dad715b2e8d\",\n \"name\": \"Calculator1\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolCalculator\",\n \"position\": [\n 600,\n 920\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"79d644c4-6d24-4f1e-9c43-08fa8b20da0e\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -100,\n 640\n ],\n \"webhookId\": \"9eab0524-6cd7-4b81-8bd8-4d050a972a08\",\n \"parameters\": {\n \"public\": true,\n \"options\": {\n \"loadPreviousSession\": \"memory\"\n }\n },\n \"typeVersion\": 1.1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Calculator1\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simple Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"ai_memory\",\n \"index\": 0\n },\n {\n \"node\": \"When chat message received\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
41
0
1
false
combined_workflows.json
{ "input": "Create a chatbot that uses OpenAI's assistant and remembers past chat messages.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 2614, "processed_size": 2614, "processed_timestamp": "2025-04-09T03:08:38.658305", "timestamp": "2025-04-09T02:36:37.026169", "token_count": 1567, "tokens": 251, "workflow_chunk_info": { "is_truncated": false, "original_size": 2614, "processed_size": 2614, "workflow_hash": "8c65e3be70781beefaebbfac2f8e27aa" }, "workflow_hash": "8c65e3be70781beefaebbfac2f8e27aa" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow generates images based on user-provided prompts and styles using an AI image generation API, then displays the generated image on a webpage. Analyze this workflow: ```json { "nodes": [ { "id": "6abe578b-d503-4da5-9af8-f9977de71139", "name": "Vivid Pop Explosion", "type": "n8n-nodes-base.set", "notes": " ", "position": [ 380, 980 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9ec60f33-b940-40a6-9f8a-cb944b7065f1", "name": "stylePrompt", "type": "string", "value": "=rule of thirds, golden ratio, hyper-maximalist, vibrant neon, high-contrast, octane render, photorealism, 8k ::7 --ar 16:9 --s 1000\n\nDesign a fun, energetic scene filled with bold, neon colors, and playful shapes that pop off the screen. The image should evoke a sense of joy and movement, using fluid, organic forms and exaggerated, cartoon-like proportions. Focus on creating a lively atmosphere with contrasting, saturated tones and dynamic lighting. Use a mix of asymmetrical and balanced compositions to create a playful visual flow. Render in 8K with a hyper-maximalist approach using Octane Render for vibrant, high-gloss textures and photorealistic lighting effects. Include:" } ] }, "includeOtherFields": true }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "7de1ea42-3b18-4bfb-8ea4-a8b6c8d16763", "name": "AI Dystopia", "type": "n8n-nodes-base.set", "notes": " ", "position": [ 380, 620 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9ec60f33-b940-40a6-9f8a-cb944b7065f1", "name": "stylePrompt", "type": "string", "value": "=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\n\nGenerate a futuristic, cyberpunk dystopia with metallic textures, digital glitches, and neon lights. Blend cold, dystopian structures with traces of organic life. Use photorealistic lighting and dynamic reflections to enhance the visual depth of the scene. Include:" } ] }, "includeOtherFields": true }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "aa17c288-78e0-48d9-9c60-0e63e351d0b6", "name": "Post-Analog Glitchscape", "type": "n8n-nodes-base.set", "notes": " ", "position": [ 380, 420 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9ec60f33-b940-40a6-9f8a-cb944b7065f1", "name": "stylePrompt", "type": "string", "value": "=rule of thirds, asymmetric composition, glitch art, pixelation, VHS noise, octane render, unreal engine, 8k ::7 --ar 16:9 --s 1200\nDesign a glitchy, post-analog world with digital decay and broken visuals. Utilize pixelated elements, VHS noise, and neon glitches to create a fragmented aesthetic. Use bold, contrasting colors against muted backgrounds for a high-contrast, otherworldly feel. The composition should follow asymmetrical rules, focusing on chaotic yet intentional visual balance. Include:" } ] }, "includeOtherFields": true }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "769ff46c-630f-456d-ae19-4c6496270fda", "name": "Neon Fauvism", "type": "n8n-nodes-base.set", "notes": " ", "position": [ 380, 800 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9ec60f33-b940-40a6-9f8a-cb944b7065f1", "name": "stylePrompt", "type": "string", "value": "=asymmetric composition, golden ratio, neon colors, abstract forms, octane render, cinematic realism, unreal engine, 8k ::7 --ar 16:9 --s 1000\nCreate a bold, vivid composition using neon colors and fluid shapes that break away from reality. Focus on abstract forms, blending Fauvism's exaggerated color palette with modern digital art techniques. Use asymmetric composition and dynamic lighting. Render with a vibrant, high-energy aesthetic. Include:" } ] }, "includeOtherFields": true }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "ccc67dcb-84e6-476a-9bc2-b5382b700d5e", "name": "None", "type": "n8n-nodes-base.set", "notes": " ", "position": [ 380, 1160 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9ec60f33-b940-40a6-9f8a-cb944b7065f1", "name": "stylePrompt", "type": "string", "value": "=Include: " } ] }, "includeOtherFields": true }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "fea2039c-48e5-4077-af2c-ea72838e1a5d", "name": "Serve webpage", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1460, 580 ], "parameters": { "options": {}, "respondWith": "text", "responseBody": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Flux Image Generation Result</title>\n <style>\n body {\n font-family: 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n background-color: #121212;\n color: #e0e0e0;\n }\n .container {\n margin-top: 2em;\n width: 90%;\n max-width: 670px; /* Increased the max-width for the main image area */\n text-align: center;\n background: #1e1e1e;\n padding: 24px;\n border-radius: 12px;\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);\n margin-bottom: 24px;\n }\n .image-container {\n margin-bottom: 20px;\n }\n .image-container img {\n max-width: 100%;\n height: auto;\n border-radius: 12px;\n border: 2px solid #333;\n }\n .style-text {\n font-size: 18px;\n margin-bottom: 20px;\n color: #bbb;\n }\n .cta {\n display: block;\n width: 100%;\n margin: 20px 0 0;\n padding: 18px 0;\n border: none;\n border-radius: 6px;\n text-decoration: none;\n color: #fff;\n background-color: #1C9985;\n font-size: 18px;\n font-weight: 400;\n cursor: pointer;\n transition: all 0.3s ease;\n }\n .cta:hover {\n background-color: #20B69E;\n transform: translateY(-2px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n }\n /* New section for recent renders */\n .recent-renders {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 16px;\n margin-top: 24px;\n max-width: 670px;\n }\n .recent-render img {\n width: 100%;\n max-width: 180px;\n height: auto;\n border-radius: 8px;\n border: 2px solid #333;\n }\n .recent-render {\n flex: 1;\n max-width: 200px;\n background-color: #2c2c2c;\n padding: 10px;\n border-radius: 10px;\n margin-bottom: 3 rem;\n }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <div class=\"image-container\">\n <img src=\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id }}.jpg\" alt=\"Generated Image\" />\n </div>\n <div class=\"style-text\">Style: {{ $('Route by style').item.json.Style }}</div>\n <a href=\"https://n8n.io/workflows/2417-flux-ai-image-generator?utm_source=30day\" class=\"cta\">Duplicate this AI template</a>\n </div>\n \n <!-- New section to display the last 4 renders -->\n <div class=\"recent-renders\">\n <div class=\"recent-render\">\n <img src=\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 1 }}.jpg\" alt=\"Recent Render 1\">\n </div>\n <div class=\"recent-render\">\n <img src=\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 2 }}.jpg\" alt=\"Recent Render 2\">\n </div>\n <div class=\"recent-render\">\n <img src=\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id .toNumber() - 3}}.jpg\" alt=\"Recent Render 3\">\n </div>\n <div class=\"recent-render\">\n <img src=\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 4 }}.jpg\">\n </div>\n </div>\n</body>\n</html>\n" }, "typeVersion": 1.1 }, { "id": "2df7b738-9584-48b4-8adc-cafb0c026928", "name": "Respond with error", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1460, 820 ], "parameters": { "options": {}, "respondWith": "json", "responseBody": "{\n \"formSubmittedText\": \"Flux API failed. It does this ~10% of the time. Refresh and try again.\"\n}" }, "typeVersion": 1.1 }, { "id": "54cba7c4-db24-4abb-9638-ee66236d8676", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -20, 440 ], "parameters": { "color": 7, "width": 205.9419250888625, "height": 107.99633347519193, "content": "### Set style prompt\nEach Edit fields node after the Switch sets `stylePrompt`, used in huggingface node." }, "typeVersion": 1 }, { "id": "f4aa76f8-d35f-4332-aa39-0c34582618eb", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 720, 840 ], "parameters": { "color": 7, "width": 419.0156901664085, "height": 226.2264013670822, "content": "### Run flux model\nIn `Call huggingface inference api` You can change `black-forest-labs/FLUX.1-schnell` in URL parameter to other models:\n- `black-forest-labs/FLUX.1-dev`\n- `Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur`\n- `XLabs-AI/flux-RealismLora`\n- `ByteDance/Hyper-SD`\n\n[See more models on huggingface.co](https://huggingface.co/models
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"id\": \"6abe578b-d503-4da5-9af8-f9977de71139\",\n \"name\": \"Vivid Pop Explosion\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=rule of thirds, golden ratio, hyper-maximalist, vibrant neon, high-contrast, octane render, photorealism, 8k ::7 --ar 16:9 --s 1000\\n\\nDesign a fun, energetic scene filled with bold, neon colors, and playful shapes that pop off the screen. The image should evoke a sense of joy and movement, using fluid, organic forms and exaggerated, cartoon-like proportions. Focus on creating a lively atmosphere with contrasting, saturated tones and dynamic lighting. Use a mix of asymmetrical and balanced compositions to create a playful visual flow. Render in 8K with a hyper-maximalist approach using Octane Render for vibrant, high-gloss textures and photorealistic lighting effects. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7de1ea42-3b18-4bfb-8ea4-a8b6c8d16763\",\n \"name\": \"AI Dystopia\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\\n\\nGenerate a futuristic, cyberpunk dystopia with metallic textures, digital glitches, and neon lights. Blend cold, dystopian structures with traces of organic life. Use photorealistic lighting and dynamic reflections to enhance the visual depth of the scene. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"aa17c288-78e0-48d9-9c60-0e63e351d0b6\",\n \"name\": \"Post-Analog Glitchscape\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=rule of thirds, asymmetric composition, glitch art, pixelation, VHS noise, octane render, unreal engine, 8k ::7 --ar 16:9 --s 1200\\nDesign a glitchy, post-analog world with digital decay and broken visuals. Utilize pixelated elements, VHS noise, and neon glitches to create a fragmented aesthetic. Use bold, contrasting colors against muted backgrounds for a high-contrast, otherworldly feel. The composition should follow asymmetrical rules, focusing on chaotic yet intentional visual balance. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"769ff46c-630f-456d-ae19-4c6496270fda\",\n \"name\": \"Neon Fauvism\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=asymmetric composition, golden ratio, neon colors, abstract forms, octane render, cinematic realism, unreal engine, 8k ::7 --ar 16:9 --s 1000\\nCreate a bold, vivid composition using neon colors and fluid shapes that break away from reality. Focus on abstract forms, blending Fauvism's exaggerated color palette with modern digital art techniques. Use asymmetric composition and dynamic lighting. Render with a vibrant, high-energy aesthetic. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"ccc67dcb-84e6-476a-9bc2-b5382b700d5e\",\n \"name\": \"None\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 1160\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=Include: \"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"fea2039c-48e5-4077-af2c-ea72838e1a5d\",\n \"name\": \"Serve webpage\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1460,\n 580\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"=<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n <meta charset=\\\"UTF-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n <title>Flux Image Generation Result</title>\\n <style>\\n body {\\n font-family: 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n min-height: 100vh;\\n background-color: #121212;\\n color: #e0e0e0;\\n }\\n .container {\\n margin-top: 2em;\\n width: 90%;\\n max-width: 670px; /* Increased the max-width for the main image area */\\n text-align: center;\\n background: #1e1e1e;\\n padding: 24px;\\n border-radius: 12px;\\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);\\n margin-bottom: 24px;\\n }\\n .image-container {\\n margin-bottom: 20px;\\n }\\n .image-container img {\\n max-width: 100%;\\n height: auto;\\n border-radius: 12px;\\n border: 2px solid #333;\\n }\\n .style-text {\\n font-size: 18px;\\n margin-bottom: 20px;\\n color: #bbb;\\n }\\n .cta {\\n display: block;\\n width: 100%;\\n margin: 20px 0 0;\\n padding: 18px 0;\\n border: none;\\n border-radius: 6px;\\n text-decoration: none;\\n color: #fff;\\n background-color: #1C9985;\\n font-size: 18px;\\n font-weight: 400;\\n cursor: pointer;\\n transition: all 0.3s ease;\\n }\\n .cta:hover {\\n background-color: #20B69E;\\n transform: translateY(-2px);\\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\\n }\\n /* New section for recent renders */\\n .recent-renders {\\n display: flex;\\n justify-content: space-between;\\n flex-wrap: wrap;\\n gap: 16px;\\n margin-top: 24px;\\n max-width: 670px;\\n }\\n .recent-render img {\\n width: 100%;\\n max-width: 180px;\\n height: auto;\\n border-radius: 8px;\\n border: 2px solid #333;\\n }\\n .recent-render {\\n flex: 1;\\n max-width: 200px;\\n background-color: #2c2c2c;\\n padding: 10px;\\n border-radius: 10px;\\n margin-bottom: 3 rem;\\n }\\n </style>\\n</head>\\n<body>\\n <div class=\\\"container\\\">\\n <div class=\\\"image-container\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id }}.jpg\\\" alt=\\\"Generated Image\\\" />\\n </div>\\n <div class=\\\"style-text\\\">Style: {{ $('Route by style').item.json.Style }}</div>\\n <a href=\\\"https://n8n.io/workflows/2417-flux-ai-image-generator?utm_source=30day\\\" class=\\\"cta\\\">Duplicate this AI template</a>\\n </div>\\n \\n <!-- New section to display the last 4 renders -->\\n <div class=\\\"recent-renders\\\">\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 1 }}.jpg\\\" alt=\\\"Recent Render 1\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 2 }}.jpg\\\" alt=\\\"Recent Render 2\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id .toNumber() - 3}}.jpg\\\" alt=\\\"Recent Render 3\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 4 }}.jpg\\\">\\n </div>\\n </div>\\n</body>\\n</html>\\n\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2df7b738-9584-48b4-8adc-cafb0c026928\",\n \"name\": \"Respond with error\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1460,\n 820\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"json\",\n \"responseBody\": \"{\\n \\\"formSubmittedText\\\": \\\"Flux API failed. It does this ~10% of the time. Refresh and try again.\\\"\\n}\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"54cba7c4-db24-4abb-9638-ee66236d8676\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -20,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 205.9419250888625,\n \"height\": 107.99633347519193,\n \"content\": \"### Set style prompt\\nEach Edit fields node after the Switch sets `stylePrompt`, used in huggingface node.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f4aa76f8-d35f-4332-aa39-0c34582618eb\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 720,\n 840\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 419.0156901664085,\n \"height\": 226.2264013670822,\n \"content\": \"### Run flux model\\nIn `Call huggingface inference api` You can change `black-forest-labs/FLUX.1-schnell` in URL parameter to other models:\\n- `black-forest-labs/FLUX.1-dev`\\n- `Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur`\\n- `XLabs-AI/flux-RealismLora`\\n- `ByteDance/Hyper-SD`\\n\\n[See more models on huggingface.co](https://huggingface.co/models?pipeline_tag=text-to-image&sort=trending)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b0b29ce-82c2-4428-bf12-cb25262e5291\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1120,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 247.37323750873333,\n \"height\": 90.99855957953969,\n \"content\": \"### Host image on S3\\n[Cloudflare](https://cloudflare.com) has free S3 compatible hosting. They call it \\\"R2\\\".\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6fccc88f-9e72-49a3-952d-b7b1d9612091\",\n \"name\": \"Upload image to S3\",\n \"type\": \"n8n-nodes-base.s3\",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 1120,\n 580\n ],\n \"parameters\": {\n \"fileName\": \"=fg-{{ $execution.id }}.jpg\",\n \"operation\": \"upload\",\n \"bucketName\": \"flux-generator\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"s3\": {\n \"id\": \"HZqaz9hPFlZp3BZ7\",\n \"name\": \"S3 account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7824dc49-c546-424e-8ba9-5f34b190d5f0\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1460,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 302.9292231993488,\n \"height\": 90.99855957953969,\n \"content\": \"### Respond to Form\\nServe a webform with image on success. On error, send message to form.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71739ba4-b8db-439e-b8c3-06f3208126e3\",\n \"name\": \"Hyper-Surreal Escape\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\\nCreate a hyper-realistic yet surreal landscape that bends reality, incorporating dreamlike elements and exaggerated proportions. Use vibrant, almost neon colors, and focus on a sense of wonder, play, and fantasy. Include:\\n\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"dcfdb152-a055-4f0f-baa5-7cf8afba36ae\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -320,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 186.9444130878394,\n \"height\": 103.99685726445023,\n \"content\": \"### Serve form to user\\nCaptures `Prompt to flux` and `Style` from user.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"310f6c63-9441-4332-82dc-09b56e4f625a\",\n \"name\": \"n8n Form Trigger\",\n \"type\": \"n8n-nodes-base.formTrigger\",\n \"position\": [\n -280,\n 660\n ],\n \"webhookId\": \"a35eb005-f795-4c85-9d00-0fe9797cb509\",\n \"parameters\": {\n \"path\": \"flux4free\",\n \"options\": {},\n \"formTitle\": \"flux.schnell image generator\",\n \"formFields\": {\n \"values\": [\n {\n \"fieldType\": \"textarea\",\n \"fieldLabel\": \"Prompt to flux\",\n \"placeholder\": \" An astronaut riding a horse in 35mm style\",\n \"requiredField\": true\n },\n {\n \"fieldType\": \"dropdown\",\n \"fieldLabel\": \"Style\",\n \"fieldOptions\": {\n \"values\": [\n {\n \"option\": \"Hyper-Surreal Escape\"\n },\n {\n \"option\": \"Neon Fauvism\"\n },\n {\n \"option\": \"Post-Analog Glitchscape\"\n },\n {\n \"option\": \"AI Dystopia\"\n },\n {\n \"option\": \"Vivid Pop Explosion\"\n }\n ]\n }\n }\n ]\n },\n \"responseMode\": \"responseNode\",\n \"formDescription\": \"No ads, no BS. Uses hugginface inference API.\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"ad10a84f-851a-40f8-b10e-18356c4eeed6\",\n \"name\": \"Call hugginface inference api\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \" \",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 740,\n 660\n ],\n \"parameters\": {\n \"url\": \"https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"inputs\",\n \"value\": \"=Depict {{ $json['Prompt to flux'] }}\\n\\nStyle: {{ $json.stylePrompt }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"r98SNEAnA5arilQO\",\n \"name\": \"huggingface-nathan\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e740dd3c-e23e-485b-bb4c-bb0515897a08\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -880,\n 600\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 506.8102696237577,\n \"height\": 337.24177957113216,\n \"content\": \"### Watch Set Up Video πŸ‘‡\\n[![Flux Generator](https://uploads.n8n.io/devrel/fluxgenerator.png#full-width)](https://youtu.be/Rv_1jt5WvtY)\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71d01821-3e0d-4c08-8571-58a158817e2c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -880,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 506.8102696237577,\n \"height\": 134.27496896630808,\n \"content\": \"# flux image generator\\nBuilt by [@maxtkacz](https://x.com/maxtkacz) as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/)\\nCheck out the project's [Notion page](https://30dayaisprint.notion.site/Flux-image-generator-bc94a8d2de8447c6ab70aacf2c4179f2) for more details\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0cc26680-ba63-464f-ba84-68c2616f95e2\",\n \"name\": \"Route by style\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 0,\n 640\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Hyper-Surreal Escape\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Hyper-Surreal Escape\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Post-Analog Glitchscape\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"106969fa-994c-4b1e-b693-fc0b48ce5f3d\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Post-Analog Glitchscape\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"AI Dystopia\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"24318e7d-4dc1-4369-b045-bb7d0a484def\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"AI Dystopia\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Neon Fauvism\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a80911ff-67fc-416d-b135-0401c336d6d8\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Neon Fauvism\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Vivid Pop Explosion\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"7fdeec28-194e-415e-8da2-8bac90e4c011\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Vivid Pop Explosion\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {\n \"fallbackOutput\": \"extra\"\n }\n },\n \"typeVersion\": 3.1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"None\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"AI Dystopia\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Neon Fauvism\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Route by style\": {\n \"main\": [\n [\n {\n \"node\": \"Hyper-Surreal Escape\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Post-Analog Glitchscape\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"AI Dystopia\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Neon Fauvism\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Vivid Pop Explosion\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"None\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"n8n Form Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Route by style\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload image to S3\": {\n \"main\": [\n [\n {\n \"node\": \"Serve webpage\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Respond with error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vivid Pop Explosion\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Hyper-Surreal Escape\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Post-Analog Glitchscape\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Call hugginface inference api\": {\n \"main\": [\n [\n {\n \"node\": \"Upload image to S3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Respond with error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
42
0
3
true
combined_workflows.json
{ "input": "This workflow generates images based on user-provided prompts and styles using an AI image generation API, then displays the generated image on a webpage.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17796, "processed_size": 17796, "processed_timestamp": "2025-04-09T03:08:38.780400", "timestamp": "2025-04-09T02:36:37.347698", "token_count": 4095, "tokens": 1641, "workflow_chunk_info": { "is_truncated": false, "original_size": 17796, "processed_size": 17796, "workflow_hash": "f25273903ca59a3439c439af3c3c41bf" }, "workflow_hash": "f25273903ca59a3439c439af3c3c41bf" }
7, "width": 419.0156901664085, "height": 226.2264013670822, "content": "### Run flux model\nIn `Call huggingface inference api` You can change `black-forest-labs/FLUX.1-schnell` in URL parameter to other models:\n- `black-forest-labs/FLUX.1-dev`\n- `Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur`\n- `XLabs-AI/flux-RealismLora`\n- `ByteDance/Hyper-SD`\n\n[See more models on huggingface.co](https://huggingface.co/models?pipeline_tag=text-to-image&sort=trending)\n" }, "typeVersion": 1 }, { "id": "2b0b29ce-82c2-4428-bf12-cb25262e5291", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1120, 440 ], "parameters": { "color": 7, "width": 247.37323750873333, "height": 90.99855957953969, "content": "### Host image on S3\n[Cloudflare](https://cloudflare.com) has free S3 compatible hosting. They call it \"R2\"." }, "typeVersion": 1 }, { "id": "6fccc88f-9e72-49a3-952d-b7b1d9612091", "name": "Upload image to S3", "type": "n8n-nodes-base.s3", "onError": "continueErrorOutput", "position": [ 1120, 580 ], "parameters": { "fileName": "=fg-{{ $execution.id }}.jpg", "operation": "upload", "bucketName": "flux-generator", "additionalFields": {} }, "credentials": { "s3": { "id": "HZqaz9hPFlZp3BZ7", "name": "S3 account" } }, "typeVersion": 1 }, { "id": "7824dc49-c546-424e-8ba9-5f34b190d5f0", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1460, 440 ], "parameters": { "color": 7, "width": 302.9292231993488, "height": 90.99855957953969, "content": "### Respond to Form\nServe a webform with image on success. On error, send message to form." }, "typeVersion": 1 }, { "id": "71739ba4-b8db-439e-b8c3-06f3208126e3", "name": "Hyper-Surreal Escape", "type": "n8n-nodes-base.set", "notes": " ", "position": [ 380, 240 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "9ec60f33-b940-40a6-9f8a-cb944b7065f1", "name": "stylePrompt", "type": "string", "value": "=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\nCreate a hyper-realistic yet surreal landscape that bends reality, incorporating dreamlike elements and exaggerated proportions. Use vibrant, almost neon colors, and focus on a sense of wonder, play, and fantasy. Include:\n" } ] }, "includeOtherFields": true }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "dcfdb152-a055-4f0f-baa5-7cf8afba36ae", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -320, 440 ], "parameters": { "color": 7, "width": 186.9444130878394, "height": 103.99685726445023, "content": "### Serve form to user\nCaptures `Prompt to flux` and `Style` from user." }, "typeVersion": 1 }, { "id": "310f6c63-9441-4332-82dc-09b56e4f625a", "name": "n8n Form Trigger", "type": "n8n-nodes-base.formTrigger", "position": [ -280, 660 ], "webhookId": "a35eb005-f795-4c85-9d00-0fe9797cb509", "parameters": { "path": "flux4free", "options": {}, "formTitle": "flux.schnell image generator", "formFields": { "values": [ { "fieldType": "textarea", "fieldLabel": "Prompt to flux", "placeholder": " An astronaut riding a horse in 35mm style", "requiredField": true }, { "fieldType": "dropdown", "fieldLabel": "Style", "fieldOptions": { "values": [ { "option": "Hyper-Surreal Escape" }, { "option": "Neon Fauvism" }, { "option": "Post-Analog Glitchscape" }, { "option": "AI Dystopia" }, { "option": "Vivid Pop Explosion" } ] } } ] }, "responseMode": "responseNode", "formDescription": "No ads, no BS. Uses hugginface inference API." }, "typeVersion": 2.1 }, { "id": "ad10a84f-851a-40f8-b10e-18356c4eeed6", "name": "Call hugginface inference api", "type": "n8n-nodes-base.httpRequest", "notes": " ", "onError": "continueErrorOutput", "position": [ 740, 660 ], "parameters": { "url": "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell", "method": "POST", "options": {}, "sendBody": true, "sendHeaders": true, "authentication": "genericCredentialType", "bodyParameters": { "parameters": [ { "name": "inputs", "value": "=Depict {{ $json['Prompt to flux'] }}\n\nStyle: {{ $json.stylePrompt }}" } ] }, "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ {} ] } }, "credentials": { "httpHeaderAuth": { "id": "r98SNEAnA5arilQO", "name": "huggingface-nathan" } }, "notesInFlow": true, "typeVersion": 4.2 }, { "id": "e740dd3c-e23e-485b-bb4c-bb0515897a08", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ -880, 600 ], "parameters": { "color": 7, "width": 506.8102696237577, "height": 337.24177957113216, "content": "### Watch Set Up Video πŸ‘‡\n[![Flux Generator](https://uploads.n8n.io/devrel/fluxgenerator.png#full-width)](https://youtu.be/Rv_1jt5WvtY)\n\n" }, "typeVersion": 1 }, { "id": "71d01821-3e0d-4c08-8571-58a158817e2c", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -880, 440 ], "parameters": { "color": 7, "width": 506.8102696237577, "height": 134.27496896630808, "content": "# flux image generator\nBuilt by [@maxtkacz](https://x.com/maxtkacz) as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/)\nCheck out the project's [Notion page](https://30dayaisprint.notion.site/Flux-image-generator-bc94a8d2de8447c6ab70aacf2c4179f2) for more details" }, "typeVersion": 1 }, { "id": "0cc26680-ba63-464f-ba84-68c2616f95e2", "name": "Route by style", "type": "n8n-nodes-base.switch", "position": [ 0, 640 ], "parameters": { "rules": { "values": [ { "outputKey": "Hyper-Surreal Escape", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ $json.Style }}", "rightValue": "Hyper-Surreal Escape" } ] }, "renameOutput": true }, { "outputKey": "Post-Analog Glitchscape", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "106969fa-994c-4b1e-b693-fc0b48ce5f3d", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $json.Style }}", "rightValue": "Post-Analog Glitchscape" } ] }, "renameOutput": true }, { "outputKey": "AI Dystopia", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "24318e7d-4dc1-4369-b045-bb7d0a484def", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $json.Style }}", "rightValue": "AI Dystopia" } ] }, "renameOutput": true }, { "outputKey": "Neon Fauvism", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "a80911ff-67fc-416d-b135-0401c336d6d8", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $json.Style }}", "rightValue": "Neon Fauvism" } ] }, "renameOutput": true }, { "outputKey": "Vivid Pop Explosion", "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "7fdeec28-194e-415e-8da2-8bac90e4c011", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $json.Style }}", "rightValue": "Vivid Pop Explosion" } ] }, "renameOutput": true } ] }, "options": { "fallbackOutput": "extra" } }, "typeVersion": 3.1 } ], "pinData": {}, "connections": { "None": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "AI Dystopia": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ]
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"id\": \"6abe578b-d503-4da5-9af8-f9977de71139\",\n \"name\": \"Vivid Pop Explosion\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=rule of thirds, golden ratio, hyper-maximalist, vibrant neon, high-contrast, octane render, photorealism, 8k ::7 --ar 16:9 --s 1000\\n\\nDesign a fun, energetic scene filled with bold, neon colors, and playful shapes that pop off the screen. The image should evoke a sense of joy and movement, using fluid, organic forms and exaggerated, cartoon-like proportions. Focus on creating a lively atmosphere with contrasting, saturated tones and dynamic lighting. Use a mix of asymmetrical and balanced compositions to create a playful visual flow. Render in 8K with a hyper-maximalist approach using Octane Render for vibrant, high-gloss textures and photorealistic lighting effects. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7de1ea42-3b18-4bfb-8ea4-a8b6c8d16763\",\n \"name\": \"AI Dystopia\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\\n\\nGenerate a futuristic, cyberpunk dystopia with metallic textures, digital glitches, and neon lights. Blend cold, dystopian structures with traces of organic life. Use photorealistic lighting and dynamic reflections to enhance the visual depth of the scene. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"aa17c288-78e0-48d9-9c60-0e63e351d0b6\",\n \"name\": \"Post-Analog Glitchscape\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=rule of thirds, asymmetric composition, glitch art, pixelation, VHS noise, octane render, unreal engine, 8k ::7 --ar 16:9 --s 1200\\nDesign a glitchy, post-analog world with digital decay and broken visuals. Utilize pixelated elements, VHS noise, and neon glitches to create a fragmented aesthetic. Use bold, contrasting colors against muted backgrounds for a high-contrast, otherworldly feel. The composition should follow asymmetrical rules, focusing on chaotic yet intentional visual balance. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"769ff46c-630f-456d-ae19-4c6496270fda\",\n \"name\": \"Neon Fauvism\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=asymmetric composition, golden ratio, neon colors, abstract forms, octane render, cinematic realism, unreal engine, 8k ::7 --ar 16:9 --s 1000\\nCreate a bold, vivid composition using neon colors and fluid shapes that break away from reality. Focus on abstract forms, blending Fauvism's exaggerated color palette with modern digital art techniques. Use asymmetric composition and dynamic lighting. Render with a vibrant, high-energy aesthetic. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"ccc67dcb-84e6-476a-9bc2-b5382b700d5e\",\n \"name\": \"None\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 1160\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=Include: \"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"fea2039c-48e5-4077-af2c-ea72838e1a5d\",\n \"name\": \"Serve webpage\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1460,\n 580\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"=<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n <meta charset=\\\"UTF-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n <title>Flux Image Generation Result</title>\\n <style>\\n body {\\n font-family: 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n min-height: 100vh;\\n background-color: #121212;\\n color: #e0e0e0;\\n }\\n .container {\\n margin-top: 2em;\\n width: 90%;\\n max-width: 670px; /* Increased the max-width for the main image area */\\n text-align: center;\\n background: #1e1e1e;\\n padding: 24px;\\n border-radius: 12px;\\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);\\n margin-bottom: 24px;\\n }\\n .image-container {\\n margin-bottom: 20px;\\n }\\n .image-container img {\\n max-width: 100%;\\n height: auto;\\n border-radius: 12px;\\n border: 2px solid #333;\\n }\\n .style-text {\\n font-size: 18px;\\n margin-bottom: 20px;\\n color: #bbb;\\n }\\n .cta {\\n display: block;\\n width: 100%;\\n margin: 20px 0 0;\\n padding: 18px 0;\\n border: none;\\n border-radius: 6px;\\n text-decoration: none;\\n color: #fff;\\n background-color: #1C9985;\\n font-size: 18px;\\n font-weight: 400;\\n cursor: pointer;\\n transition: all 0.3s ease;\\n }\\n .cta:hover {\\n background-color: #20B69E;\\n transform: translateY(-2px);\\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\\n }\\n /* New section for recent renders */\\n .recent-renders {\\n display: flex;\\n justify-content: space-between;\\n flex-wrap: wrap;\\n gap: 16px;\\n margin-top: 24px;\\n max-width: 670px;\\n }\\n .recent-render img {\\n width: 100%;\\n max-width: 180px;\\n height: auto;\\n border-radius: 8px;\\n border: 2px solid #333;\\n }\\n .recent-render {\\n flex: 1;\\n max-width: 200px;\\n background-color: #2c2c2c;\\n padding: 10px;\\n border-radius: 10px;\\n margin-bottom: 3 rem;\\n }\\n </style>\\n</head>\\n<body>\\n <div class=\\\"container\\\">\\n <div class=\\\"image-container\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id }}.jpg\\\" alt=\\\"Generated Image\\\" />\\n </div>\\n <div class=\\\"style-text\\\">Style: {{ $('Route by style').item.json.Style }}</div>\\n <a href=\\\"https://n8n.io/workflows/2417-flux-ai-image-generator?utm_source=30day\\\" class=\\\"cta\\\">Duplicate this AI template</a>\\n </div>\\n \\n <!-- New section to display the last 4 renders -->\\n <div class=\\\"recent-renders\\\">\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 1 }}.jpg\\\" alt=\\\"Recent Render 1\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 2 }}.jpg\\\" alt=\\\"Recent Render 2\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id .toNumber() - 3}}.jpg\\\" alt=\\\"Recent Render 3\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 4 }}.jpg\\\">\\n </div>\\n </div>\\n</body>\\n</html>\\n\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2df7b738-9584-48b4-8adc-cafb0c026928\",\n \"name\": \"Respond with error\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1460,\n 820\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"json\",\n \"responseBody\": \"{\\n \\\"formSubmittedText\\\": \\\"Flux API failed. It does this ~10% of the time. Refresh and try again.\\\"\\n}\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"54cba7c4-db24-4abb-9638-ee66236d8676\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -20,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 205.9419250888625,\n \"height\": 107.99633347519193,\n \"content\": \"### Set style prompt\\nEach Edit fields node after the Switch sets `stylePrompt`, used in huggingface node.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f4aa76f8-d35f-4332-aa39-0c34582618eb\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 720,\n 840\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 419.0156901664085,\n \"height\": 226.2264013670822,\n \"content\": \"### Run flux model\\nIn `Call huggingface inference api` You can change `black-forest-labs/FLUX.1-schnell` in URL parameter to other models:\\n- `black-forest-labs/FLUX.1-dev`\\n- `Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur`\\n- `XLabs-AI/flux-RealismLora`\\n- `ByteDance/Hyper-SD`\\n\\n[See more models on huggingface.co](https://huggingface.co/models?pipeline_tag=text-to-image&sort=trending)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b0b29ce-82c2-4428-bf12-cb25262e5291\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1120,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 247.37323750873333,\n \"height\": 90.99855957953969,\n \"content\": \"### Host image on S3\\n[Cloudflare](https://cloudflare.com) has free S3 compatible hosting. They call it \\\"R2\\\".\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6fccc88f-9e72-49a3-952d-b7b1d9612091\",\n \"name\": \"Upload image to S3\",\n \"type\": \"n8n-nodes-base.s3\",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 1120,\n 580\n ],\n \"parameters\": {\n \"fileName\": \"=fg-{{ $execution.id }}.jpg\",\n \"operation\": \"upload\",\n \"bucketName\": \"flux-generator\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"s3\": {\n \"id\": \"HZqaz9hPFlZp3BZ7\",\n \"name\": \"S3 account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7824dc49-c546-424e-8ba9-5f34b190d5f0\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1460,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 302.9292231993488,\n \"height\": 90.99855957953969,\n \"content\": \"### Respond to Form\\nServe a webform with image on success. On error, send message to form.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71739ba4-b8db-439e-b8c3-06f3208126e3\",\n \"name\": \"Hyper-Surreal Escape\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\\nCreate a hyper-realistic yet surreal landscape that bends reality, incorporating dreamlike elements and exaggerated proportions. Use vibrant, almost neon colors, and focus on a sense of wonder, play, and fantasy. Include:\\n\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"dcfdb152-a055-4f0f-baa5-7cf8afba36ae\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -320,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 186.9444130878394,\n \"height\": 103.99685726445023,\n \"content\": \"### Serve form to user\\nCaptures `Prompt to flux` and `Style` from user.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"310f6c63-9441-4332-82dc-09b56e4f625a\",\n \"name\": \"n8n Form Trigger\",\n \"type\": \"n8n-nodes-base.formTrigger\",\n \"position\": [\n -280,\n 660\n ],\n \"webhookId\": \"a35eb005-f795-4c85-9d00-0fe9797cb509\",\n \"parameters\": {\n \"path\": \"flux4free\",\n \"options\": {},\n \"formTitle\": \"flux.schnell image generator\",\n \"formFields\": {\n \"values\": [\n {\n \"fieldType\": \"textarea\",\n \"fieldLabel\": \"Prompt to flux\",\n \"placeholder\": \" An astronaut riding a horse in 35mm style\",\n \"requiredField\": true\n },\n {\n \"fieldType\": \"dropdown\",\n \"fieldLabel\": \"Style\",\n \"fieldOptions\": {\n \"values\": [\n {\n \"option\": \"Hyper-Surreal Escape\"\n },\n {\n \"option\": \"Neon Fauvism\"\n },\n {\n \"option\": \"Post-Analog Glitchscape\"\n },\n {\n \"option\": \"AI Dystopia\"\n },\n {\n \"option\": \"Vivid Pop Explosion\"\n }\n ]\n }\n }\n ]\n },\n \"responseMode\": \"responseNode\",\n \"formDescription\": \"No ads, no BS. Uses hugginface inference API.\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"ad10a84f-851a-40f8-b10e-18356c4eeed6\",\n \"name\": \"Call hugginface inference api\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \" \",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 740,\n 660\n ],\n \"parameters\": {\n \"url\": \"https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"inputs\",\n \"value\": \"=Depict {{ $json['Prompt to flux'] }}\\n\\nStyle: {{ $json.stylePrompt }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"r98SNEAnA5arilQO\",\n \"name\": \"huggingface-nathan\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e740dd3c-e23e-485b-bb4c-bb0515897a08\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -880,\n 600\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 506.8102696237577,\n \"height\": 337.24177957113216,\n \"content\": \"### Watch Set Up Video πŸ‘‡\\n[![Flux Generator](https://uploads.n8n.io/devrel/fluxgenerator.png#full-width)](https://youtu.be/Rv_1jt5WvtY)\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71d01821-3e0d-4c08-8571-58a158817e2c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -880,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 506.8102696237577,\n \"height\": 134.27496896630808,\n \"content\": \"# flux image generator\\nBuilt by [@maxtkacz](https://x.com/maxtkacz) as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/)\\nCheck out the project's [Notion page](https://30dayaisprint.notion.site/Flux-image-generator-bc94a8d2de8447c6ab70aacf2c4179f2) for more details\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0cc26680-ba63-464f-ba84-68c2616f95e2\",\n \"name\": \"Route by style\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 0,\n 640\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Hyper-Surreal Escape\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Hyper-Surreal Escape\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Post-Analog Glitchscape\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"106969fa-994c-4b1e-b693-fc0b48ce5f3d\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Post-Analog Glitchscape\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"AI Dystopia\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"24318e7d-4dc1-4369-b045-bb7d0a484def\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"AI Dystopia\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Neon Fauvism\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a80911ff-67fc-416d-b135-0401c336d6d8\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Neon Fauvism\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Vivid Pop Explosion\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"7fdeec28-194e-415e-8da2-8bac90e4c011\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Vivid Pop Explosion\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {\n \"fallbackOutput\": \"extra\"\n }\n },\n \"typeVersion\": 3.1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"None\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"AI Dystopia\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Neon Fauvism\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Route by style\": {\n \"main\": [\n [\n {\n \"node\": \"Hyper-Surreal Escape\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Post-Analog Glitchscape\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"AI Dystopia\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Neon Fauvism\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Vivid Pop Explosion\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"None\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"n8n Form Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Route by style\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload image to S3\": {\n \"main\": [\n [\n {\n \"node\": \"Serve webpage\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Respond with error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vivid Pop Explosion\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Hyper-Surreal Escape\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Post-Analog Glitchscape\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Call hugginface inference api\": {\n \"main\": [\n [\n {\n \"node\": \"Upload image to S3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Respond with error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
42
1
3
true
combined_workflows.json
{ "input": "This workflow generates images based on user-provided prompts and styles using an AI image generation API, then displays the generated image on a webpage.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17796, "processed_size": 17796, "processed_timestamp": "2025-04-09T03:08:38.790360", "timestamp": "2025-04-09T02:36:37.347698", "token_count": 4098, "tokens": 1641, "workflow_chunk_info": { "is_truncated": false, "original_size": 17796, "processed_size": 17796, "workflow_hash": "f25273903ca59a3439c439af3c3c41bf" }, "workflow_hash": "f25273903ca59a3439c439af3c3c41bf" }
} ] }, "renameOutput": true } ] }, "options": { "fallbackOutput": "extra" } }, "typeVersion": 3.1 } ], "pinData": {}, "connections": { "None": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "AI Dystopia": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "Neon Fauvism": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "Route by style": { "main": [ [ { "node": "Hyper-Surreal Escape", "type": "main", "index": 0 } ], [ { "node": "Post-Analog Glitchscape", "type": "main", "index": 0 } ], [ { "node": "AI Dystopia", "type": "main", "index": 0 } ], [ { "node": "Neon Fauvism", "type": "main", "index": 0 } ], [ { "node": "Vivid Pop Explosion", "type": "main", "index": 0 } ], [ { "node": "None", "type": "main", "index": 0 } ] ] }, "n8n Form Trigger": { "main": [ [ { "node": "Route by style", "type": "main", "index": 0 } ] ] }, "Upload image to S3": { "main": [ [ { "node": "Serve webpage", "type": "main", "index": 0 } ], [ { "node": "Respond with error", "type": "main", "index": 0 } ] ] }, "Vivid Pop Explosion": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "Hyper-Surreal Escape": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "Post-Analog Glitchscape": { "main": [ [ { "node": "Call hugginface inference api", "type": "main", "index": 0 } ] ] }, "Call hugginface inference api": { "main": [ [ { "node": "Upload image to S3", "type": "main", "index": 0 } ], [ { "node": "Respond with error", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"id\": \"6abe578b-d503-4da5-9af8-f9977de71139\",\n \"name\": \"Vivid Pop Explosion\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=rule of thirds, golden ratio, hyper-maximalist, vibrant neon, high-contrast, octane render, photorealism, 8k ::7 --ar 16:9 --s 1000\\n\\nDesign a fun, energetic scene filled with bold, neon colors, and playful shapes that pop off the screen. The image should evoke a sense of joy and movement, using fluid, organic forms and exaggerated, cartoon-like proportions. Focus on creating a lively atmosphere with contrasting, saturated tones and dynamic lighting. Use a mix of asymmetrical and balanced compositions to create a playful visual flow. Render in 8K with a hyper-maximalist approach using Octane Render for vibrant, high-gloss textures and photorealistic lighting effects. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7de1ea42-3b18-4bfb-8ea4-a8b6c8d16763\",\n \"name\": \"AI Dystopia\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\\n\\nGenerate a futuristic, cyberpunk dystopia with metallic textures, digital glitches, and neon lights. Blend cold, dystopian structures with traces of organic life. Use photorealistic lighting and dynamic reflections to enhance the visual depth of the scene. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"aa17c288-78e0-48d9-9c60-0e63e351d0b6\",\n \"name\": \"Post-Analog Glitchscape\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=rule of thirds, asymmetric composition, glitch art, pixelation, VHS noise, octane render, unreal engine, 8k ::7 --ar 16:9 --s 1200\\nDesign a glitchy, post-analog world with digital decay and broken visuals. Utilize pixelated elements, VHS noise, and neon glitches to create a fragmented aesthetic. Use bold, contrasting colors against muted backgrounds for a high-contrast, otherworldly feel. The composition should follow asymmetrical rules, focusing on chaotic yet intentional visual balance. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"769ff46c-630f-456d-ae19-4c6496270fda\",\n \"name\": \"Neon Fauvism\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=asymmetric composition, golden ratio, neon colors, abstract forms, octane render, cinematic realism, unreal engine, 8k ::7 --ar 16:9 --s 1000\\nCreate a bold, vivid composition using neon colors and fluid shapes that break away from reality. Focus on abstract forms, blending Fauvism's exaggerated color palette with modern digital art techniques. Use asymmetric composition and dynamic lighting. Render with a vibrant, high-energy aesthetic. Include:\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"ccc67dcb-84e6-476a-9bc2-b5382b700d5e\",\n \"name\": \"None\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 1160\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=Include: \"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"fea2039c-48e5-4077-af2c-ea72838e1a5d\",\n \"name\": \"Serve webpage\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1460,\n 580\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"=<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n <meta charset=\\\"UTF-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n <title>Flux Image Generation Result</title>\\n <style>\\n body {\\n font-family: 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n min-height: 100vh;\\n background-color: #121212;\\n color: #e0e0e0;\\n }\\n .container {\\n margin-top: 2em;\\n width: 90%;\\n max-width: 670px; /* Increased the max-width for the main image area */\\n text-align: center;\\n background: #1e1e1e;\\n padding: 24px;\\n border-radius: 12px;\\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);\\n margin-bottom: 24px;\\n }\\n .image-container {\\n margin-bottom: 20px;\\n }\\n .image-container img {\\n max-width: 100%;\\n height: auto;\\n border-radius: 12px;\\n border: 2px solid #333;\\n }\\n .style-text {\\n font-size: 18px;\\n margin-bottom: 20px;\\n color: #bbb;\\n }\\n .cta {\\n display: block;\\n width: 100%;\\n margin: 20px 0 0;\\n padding: 18px 0;\\n border: none;\\n border-radius: 6px;\\n text-decoration: none;\\n color: #fff;\\n background-color: #1C9985;\\n font-size: 18px;\\n font-weight: 400;\\n cursor: pointer;\\n transition: all 0.3s ease;\\n }\\n .cta:hover {\\n background-color: #20B69E;\\n transform: translateY(-2px);\\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\\n }\\n /* New section for recent renders */\\n .recent-renders {\\n display: flex;\\n justify-content: space-between;\\n flex-wrap: wrap;\\n gap: 16px;\\n margin-top: 24px;\\n max-width: 670px;\\n }\\n .recent-render img {\\n width: 100%;\\n max-width: 180px;\\n height: auto;\\n border-radius: 8px;\\n border: 2px solid #333;\\n }\\n .recent-render {\\n flex: 1;\\n max-width: 200px;\\n background-color: #2c2c2c;\\n padding: 10px;\\n border-radius: 10px;\\n margin-bottom: 3 rem;\\n }\\n </style>\\n</head>\\n<body>\\n <div class=\\\"container\\\">\\n <div class=\\\"image-container\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id }}.jpg\\\" alt=\\\"Generated Image\\\" />\\n </div>\\n <div class=\\\"style-text\\\">Style: {{ $('Route by style').item.json.Style }}</div>\\n <a href=\\\"https://n8n.io/workflows/2417-flux-ai-image-generator?utm_source=30day\\\" class=\\\"cta\\\">Duplicate this AI template</a>\\n </div>\\n \\n <!-- New section to display the last 4 renders -->\\n <div class=\\\"recent-renders\\\">\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 1 }}.jpg\\\" alt=\\\"Recent Render 1\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 2 }}.jpg\\\" alt=\\\"Recent Render 2\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id .toNumber() - 3}}.jpg\\\" alt=\\\"Recent Render 3\\\">\\n </div>\\n <div class=\\\"recent-render\\\">\\n <img src=\\\"https://pub-d2d94462851644a78ea607e05f8a2d25.r2.dev/fg-{{ $execution.id.toNumber() - 4 }}.jpg\\\">\\n </div>\\n </div>\\n</body>\\n</html>\\n\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2df7b738-9584-48b4-8adc-cafb0c026928\",\n \"name\": \"Respond with error\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1460,\n 820\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"json\",\n \"responseBody\": \"{\\n \\\"formSubmittedText\\\": \\\"Flux API failed. It does this ~10% of the time. Refresh and try again.\\\"\\n}\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"54cba7c4-db24-4abb-9638-ee66236d8676\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -20,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 205.9419250888625,\n \"height\": 107.99633347519193,\n \"content\": \"### Set style prompt\\nEach Edit fields node after the Switch sets `stylePrompt`, used in huggingface node.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f4aa76f8-d35f-4332-aa39-0c34582618eb\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 720,\n 840\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 419.0156901664085,\n \"height\": 226.2264013670822,\n \"content\": \"### Run flux model\\nIn `Call huggingface inference api` You can change `black-forest-labs/FLUX.1-schnell` in URL parameter to other models:\\n- `black-forest-labs/FLUX.1-dev`\\n- `Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur`\\n- `XLabs-AI/flux-RealismLora`\\n- `ByteDance/Hyper-SD`\\n\\n[See more models on huggingface.co](https://huggingface.co/models?pipeline_tag=text-to-image&sort=trending)\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2b0b29ce-82c2-4428-bf12-cb25262e5291\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1120,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 247.37323750873333,\n \"height\": 90.99855957953969,\n \"content\": \"### Host image on S3\\n[Cloudflare](https://cloudflare.com) has free S3 compatible hosting. They call it \\\"R2\\\".\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6fccc88f-9e72-49a3-952d-b7b1d9612091\",\n \"name\": \"Upload image to S3\",\n \"type\": \"n8n-nodes-base.s3\",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 1120,\n 580\n ],\n \"parameters\": {\n \"fileName\": \"=fg-{{ $execution.id }}.jpg\",\n \"operation\": \"upload\",\n \"bucketName\": \"flux-generator\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"s3\": {\n \"id\": \"HZqaz9hPFlZp3BZ7\",\n \"name\": \"S3 account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7824dc49-c546-424e-8ba9-5f34b190d5f0\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1460,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 302.9292231993488,\n \"height\": 90.99855957953969,\n \"content\": \"### Respond to Form\\nServe a webform with image on success. On error, send message to form.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71739ba4-b8db-439e-b8c3-06f3208126e3\",\n \"name\": \"Hyper-Surreal Escape\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \" \",\n \"position\": [\n 380,\n 240\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"9ec60f33-b940-40a6-9f8a-cb944b7065f1\",\n \"name\": \"stylePrompt\",\n \"type\": \"string\",\n \"value\": \"=golden ratio, rule of thirds, cyberpunk, glitch art, octane render, cinematic realism, 8k ::7 --ar 16:9 --s 1000\\nCreate a hyper-realistic yet surreal landscape that bends reality, incorporating dreamlike elements and exaggerated proportions. Use vibrant, almost neon colors, and focus on a sense of wonder, play, and fantasy. Include:\\n\"\n }\n ]\n },\n \"includeOtherFields\": true\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"dcfdb152-a055-4f0f-baa5-7cf8afba36ae\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -320,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 186.9444130878394,\n \"height\": 103.99685726445023,\n \"content\": \"### Serve form to user\\nCaptures `Prompt to flux` and `Style` from user.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"310f6c63-9441-4332-82dc-09b56e4f625a\",\n \"name\": \"n8n Form Trigger\",\n \"type\": \"n8n-nodes-base.formTrigger\",\n \"position\": [\n -280,\n 660\n ],\n \"webhookId\": \"a35eb005-f795-4c85-9d00-0fe9797cb509\",\n \"parameters\": {\n \"path\": \"flux4free\",\n \"options\": {},\n \"formTitle\": \"flux.schnell image generator\",\n \"formFields\": {\n \"values\": [\n {\n \"fieldType\": \"textarea\",\n \"fieldLabel\": \"Prompt to flux\",\n \"placeholder\": \" An astronaut riding a horse in 35mm style\",\n \"requiredField\": true\n },\n {\n \"fieldType\": \"dropdown\",\n \"fieldLabel\": \"Style\",\n \"fieldOptions\": {\n \"values\": [\n {\n \"option\": \"Hyper-Surreal Escape\"\n },\n {\n \"option\": \"Neon Fauvism\"\n },\n {\n \"option\": \"Post-Analog Glitchscape\"\n },\n {\n \"option\": \"AI Dystopia\"\n },\n {\n \"option\": \"Vivid Pop Explosion\"\n }\n ]\n }\n }\n ]\n },\n \"responseMode\": \"responseNode\",\n \"formDescription\": \"No ads, no BS. Uses hugginface inference API.\"\n },\n \"typeVersion\": 2.1\n },\n {\n \"id\": \"ad10a84f-851a-40f8-b10e-18356c4eeed6\",\n \"name\": \"Call hugginface inference api\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"notes\": \" \",\n \"onError\": \"continueErrorOutput\",\n \"position\": [\n 740,\n 660\n ],\n \"parameters\": {\n \"url\": \"https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendHeaders\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"inputs\",\n \"value\": \"=Depict {{ $json['Prompt to flux'] }}\\n\\nStyle: {{ $json.stylePrompt }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpHeaderAuth\",\n \"headerParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"r98SNEAnA5arilQO\",\n \"name\": \"huggingface-nathan\"\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e740dd3c-e23e-485b-bb4c-bb0515897a08\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -880,\n 600\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 506.8102696237577,\n \"height\": 337.24177957113216,\n \"content\": \"### Watch Set Up Video πŸ‘‡\\n[![Flux Generator](https://uploads.n8n.io/devrel/fluxgenerator.png#full-width)](https://youtu.be/Rv_1jt5WvtY)\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71d01821-3e0d-4c08-8571-58a158817e2c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -880,\n 440\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 506.8102696237577,\n \"height\": 134.27496896630808,\n \"content\": \"# flux image generator\\nBuilt by [@maxtkacz](https://x.com/maxtkacz) as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/)\\nCheck out the project's [Notion page](https://30dayaisprint.notion.site/Flux-image-generator-bc94a8d2de8447c6ab70aacf2c4179f2) for more details\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0cc26680-ba63-464f-ba84-68c2616f95e2\",\n \"name\": \"Route by style\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 0,\n 640\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Hyper-Surreal Escape\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Hyper-Surreal Escape\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Post-Analog Glitchscape\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"106969fa-994c-4b1e-b693-fc0b48ce5f3d\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Post-Analog Glitchscape\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"AI Dystopia\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"24318e7d-4dc1-4369-b045-bb7d0a484def\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"AI Dystopia\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Neon Fauvism\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"a80911ff-67fc-416d-b135-0401c336d6d8\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Neon Fauvism\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Vivid Pop Explosion\",\n \"conditions\": {\n \"options\": {\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"7fdeec28-194e-415e-8da2-8bac90e4c011\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.Style }}\",\n \"rightValue\": \"Vivid Pop Explosion\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {\n \"fallbackOutput\": \"extra\"\n }\n },\n \"typeVersion\": 3.1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"None\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"AI Dystopia\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Neon Fauvism\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Route by style\": {\n \"main\": [\n [\n {\n \"node\": \"Hyper-Surreal Escape\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Post-Analog Glitchscape\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"AI Dystopia\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Neon Fauvism\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Vivid Pop Explosion\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"None\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"n8n Form Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Route by style\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload image to S3\": {\n \"main\": [\n [\n {\n \"node\": \"Serve webpage\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Respond with error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Vivid Pop Explosion\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Hyper-Surreal Escape\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Post-Analog Glitchscape\": {\n \"main\": [\n [\n {\n \"node\": \"Call hugginface inference api\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Call hugginface inference api\": {\n \"main\": [\n [\n {\n \"node\": \"Upload image to S3\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Respond with error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
42
2
3
true
combined_workflows.json
{ "input": "This workflow generates images based on user-provided prompts and styles using an AI image generation API, then displays the generated image on a webpage.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17796, "processed_size": 17796, "processed_timestamp": "2025-04-09T03:08:38.794360", "timestamp": "2025-04-09T02:36:37.347698", "token_count": 1016, "tokens": 1641, "workflow_chunk_info": { "is_truncated": false, "original_size": 17796, "processed_size": 17796, "workflow_hash": "f25273903ca59a3439c439af3c3c41bf" }, "workflow_hash": "f25273903ca59a3439c439af3c3c41bf" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: To create an AI chatbot that uses a custom tool to retrieve and answer questions about the most popular Hacker News posts. Analyze this workflow: ```json { "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 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"b6836974-0d4b-482b-8a8a-c00f229f1136\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 100,\n 500\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 150,\n \"height\": 293,\n \"content\": \"### Replace me\\nwith any other service, e.g. fetching your own data\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c0b8b657-24b8-4c0b-bfe9-d4fe2075dbe5\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -180,\n 420\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 927.5,\n \"height\": 406.875,\n \"content\": \"### Sub-workflow: Custom tool\\nThis can be called by the agent above. This example fetches the top 50 posts ever on Hacker News\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a1dab7b1-b028-44a2-ab55-d8edee62e261\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -180,\n -120\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 927.5,\n \"height\": 486.5625,\n \"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?'\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"84d91346-6b1d-4808-a6b3-ce212cd122d0\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n -20\n ],\n \"parameters\": {\n \"width\": 185.9375,\n \"height\": 218,\n \"content\": \"## Try me out\\n\\nClick the 'Chat' button and enter:\\n\\n_What is the 5th most popular post ever on Hacker News?_\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"50c7208d-d2dc-4380-9f81-6d7f4dee40b3\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -40,\n 20\n ],\n \"webhookId\": \"34a31e43-46b8-4c4b-a47e-ef5ad6e66af0\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"6170523b-ac2d-4541-9186-0f2932829a36\",\n \"name\": \"Custom tool to call the wf below1\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 480,\n 220\n ],\n \"parameters\": {\n \"name\": \"hn_tool\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Returns a list of the most popular posts ever on Hacker News, in json format\",\n \"workflowInputs\": {\n \"value\": {},\n \"schema\": [],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"3f40434e-4055-4d8f-be26-051da2911aa1\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n -120,\n 640\n ],\n \"parameters\": {\n \"inputSource\": \"passthrough\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"4a6cf195-6862-4007-b791-d021583a771e\",\n \"name\": \"Hacker News\",\n \"type\": \"n8n-nodes-base.hackerNews\",\n \"position\": [\n 120,\n 640\n ],\n \"parameters\": {\n \"limit\": 50,\n \"resource\": \"all\",\n \"additionalFields\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"03095e43-0d6e-47c0-8936-dceb2fb0dfb1\",\n \"name\": \"Clean up data\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 340,\n 640\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"171d5a66-fc72-42ab-9f6c-0c137f6b3415\",\n \"name\": \"title\",\n \"type\": \"string\",\n \"value\": \"={{ $json._highlightResult.title.value }}\"\n },\n {\n \"id\": \"e6662f7e-8e44-43d6-8e8b-6162bfec34bc\",\n \"name\": \"points\",\n \"type\": \"string\",\n \"value\": \"={{ $json.points }}\"\n },\n {\n \"id\": \"7415a9f0-7cd4-4bad-bbcf-1903520af155\",\n \"name\": \"url\",\n \"type\": \"string\",\n \"value\": \"={{ $json.url }}\"\n },\n {\n \"id\": \"8b0c67a6-89b0-40de-85f2-b80c9298d81f\",\n \"name\": \"created_at\",\n \"type\": \"string\",\n \"value\": \"={{ $json.created_at }}\"\n },\n {\n \"id\": \"b7847fbb-4428-4a5b-980e-08e6069b0ac4\",\n \"name\": \"author\",\n \"type\": \"string\",\n \"value\": \"={{ $json.author }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"50ee96c0-36d6-4774-b5cf-b653f5b56868\",\n \"name\": \"Stringify\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 560,\n 640\n ],\n \"parameters\": {\n \"jsCode\": \"return {\\n 'response': JSON.stringify($input.all().map(x => x.json))\\n}\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"ba221fc3-5249-4295-b64e-2c7370c6dad4\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 260,\n 20\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"e8c45847-cc26-47b3-898c-8063b9c4b3a9\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 220,\n 200\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Hacker News\": {\n \"main\": [\n [\n {\n \"node\": \"Clean up data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Clean up data\": {\n \"main\": [\n [\n {\n \"node\": \"Stringify\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Custom tool to call the wf below1\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Hacker News\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
43
0
1
false
combined_workflows.json
{ "input": "To create an AI chatbot that uses a custom tool to retrieve and answer questions about the most popular Hacker News posts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 4967, "processed_size": 4967, "processed_timestamp": "2025-04-09T03:08:38.807361", "timestamp": "2025-04-09T02:36:38.357880", "token_count": 3029, "tokens": 483, "workflow_chunk_info": { "is_truncated": false, "original_size": 4967, "processed_size": 4967, "workflow_hash": "33c3091a25bafcb0f30beed3076c5e4b" }, "workflow_hash": "33c3091a25bafcb0f30beed3076c5e4b" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: Create a conversational AI agent that answers prompts using tools like search and Wikipedia, while remembering the conversation history. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "a8211c61-5ca5-4b0a-adce-b7954a387aba", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -540, 900 ], "parameters": { "width": 300, "height": 225, "content": "### The conversation history (last 20 messages) is stored in a buffer memory" }, "typeVersion": 1 }, { "id": "639ef27d-3e6e-4d2b-804a-5d1c95d509fc", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -200, 900 ], "parameters": { "width": 340, "height": 225, "content": "### Tools which agent can use to accomplish the task" }, "typeVersion": 1 }, { "id": "dcb7ade3-005c-44e3-a369-526baa5b8813", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -500, 500 ], "parameters": { "width": 422, "height": 211, "content": "### Conversational agent will utilise available tools to answer the prompt. " }, "typeVersion": 1 }, { "id": "2830de15-bdd2-48f4-8957-659014cd0a82", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -800, 580 ], "webhookId": "d48f9e07-3c05-4be8-86ca-5cee4c27b78f", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "bd1865fc-c37f-4b81-8ee1-83205e67e42b", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ -720, 1000 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "d9ee6da6-f2cd-4077-913c-9215433dfc31", "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ -440, 1000 ], "parameters": { "contextWindowLength": 20 }, "typeVersion": 1.3 }, { "id": "fe8ddba3-37ba-43c3-9797-021b14a1be49", "name": "SerpAPI", "type": "@n8n/n8n-nodes-langchain.toolSerpApi", "position": [ -140, 1000 ], "parameters": { "options": {} }, "credentials": { "serpApi": { "id": "aJCKjxx6U3K7ydDe", "name": "SerpAPI account" } }, "typeVersion": 1 }, { "id": "f7cee7ea-6a21-4eae-a1c6-36716683a3eb", "name": "Wikipedia", "type": "@n8n/n8n-nodes-langchain.toolWikipedia", "position": [ 0, 1000 ], "parameters": {}, "typeVersion": 1 }, { "id": "e6f6fe48-3ad0-4bfe-a2f2-922e4c652306", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ -420, 580 ], "parameters": { "options": {} }, "typeVersion": 1.8 } ], "pinData": {}, "connections": { "SerpAPI": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Wikipedia": { "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 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"a8211c61-5ca5-4b0a-adce-b7954a387aba\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -540,\n 900\n ],\n \"parameters\": {\n \"width\": 300,\n \"height\": 225,\n \"content\": \"### The conversation history (last 20 messages) is stored in a buffer memory\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"639ef27d-3e6e-4d2b-804a-5d1c95d509fc\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -200,\n 900\n ],\n \"parameters\": {\n \"width\": 340,\n \"height\": 225,\n \"content\": \"### Tools which agent can use to accomplish the task\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"dcb7ade3-005c-44e3-a369-526baa5b8813\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -500,\n 500\n ],\n \"parameters\": {\n \"width\": 422,\n \"height\": 211,\n \"content\": \"### Conversational agent will utilise available tools to answer the prompt. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2830de15-bdd2-48f4-8957-659014cd0a82\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -800,\n 580\n ],\n \"webhookId\": \"d48f9e07-3c05-4be8-86ca-5cee4c27b78f\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"bd1865fc-c37f-4b81-8ee1-83205e67e42b\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -720,\n 1000\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"d9ee6da6-f2cd-4077-913c-9215433dfc31\",\n \"name\": \"Simple Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n -440,\n 1000\n ],\n \"parameters\": {\n \"contextWindowLength\": 20\n },\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"fe8ddba3-37ba-43c3-9797-021b14a1be49\",\n \"name\": \"SerpAPI\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolSerpApi\",\n \"position\": [\n -140,\n 1000\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"serpApi\": {\n \"id\": \"aJCKjxx6U3K7ydDe\",\n \"name\": \"SerpAPI account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f7cee7ea-6a21-4eae-a1c6-36716683a3eb\",\n \"name\": \"Wikipedia\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWikipedia\",\n \"position\": [\n 0,\n 1000\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"e6f6fe48-3ad0-4bfe-a2f2-922e4c652306\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -420,\n 580\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"SerpAPI\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Wikipedia\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simple Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
44
0
1
false
combined_workflows.json
{ "input": "Create a conversational AI agent that answers prompts using tools like search and Wikipedia, while remembering the conversation history.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 2939, "processed_size": 2939, "processed_timestamp": "2025-04-09T03:08:38.814360", "timestamp": "2025-04-09T02:36:38.491297", "token_count": 1918, "tokens": 262, "workflow_chunk_info": { "is_truncated": false, "original_size": 2939, "processed_size": 2939, "workflow_hash": "b7afa2d43645ae35b9116586a91a68a2" }, "workflow_hash": "b7afa2d43645ae35b9116586a91a68a2" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow automates the creation of a draft WordPress article based on user-provided keywords and settings. It generates the article structure, chapter content, and a featured image using AI, then posts the article to WordPress. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "8eaf0925-1394-4771-bf43-281ad14fefb4", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 540, 880 ], "parameters": { "color": 4, "width": 301.3874093724939, "height": 371.765663140765, "content": "## Data check" }, "typeVersion": 1 }, { "id": "ab31ac7c-6bd4-44f6-8c0c-8e41463a3983", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 560, 940 ], "parameters": { "color": 7, "width": 272.8190508599808, "height": 80, "content": "Checks that the data returned by OpenAI is correct" }, "typeVersion": 1 }, { "id": "306ffdb5-d6b6-4e49-a26d-a256e32f7c67", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1940, 880 ], "parameters": { "color": 5, "width": 302, "height": 392, "content": "## Draft on WordPress" }, "typeVersion": 1 }, { "id": "928da5f9-194c-461d-a5dd-7fd5c8563345", "name": "Sticky Note9", "type": "n8n-nodes-base.stickyNote", "position": [ 1960, 960 ], "parameters": { "color": 7, "width": 254.77269221373095, "height": 80, "content": "The article is posted as a draft on WordPress" }, "typeVersion": 1 }, { "id": "271f6b4d-cf7c-49b8-9479-dd753d7c5199", "name": "Sticky Note10", "type": "n8n-nodes-base.stickyNote", "position": [ 2260, 880 ], "parameters": { "color": 3, "width": 678, "height": 389, "content": "## Featured image" }, "typeVersion": 1 }, { "id": "efb047c4-b835-4706-af6a-b40c6cd76757", "name": "Sticky Note11", "type": "n8n-nodes-base.stickyNote", "position": [ 2280, 960 ], "parameters": { "color": 7, "width": 517.9195082760601, "height": 80, "content": "The image is generated with Dall-E, uploaded to WordPress, and then connected to the post as its featured image" }, "typeVersion": 1 }, { "id": "4f78eb2c-a501-4774-b5ab-29d7aa83817d", "name": "Sticky Note12", "type": "n8n-nodes-base.stickyNote", "position": [ 160, 940 ], "parameters": { "color": 7, "width": 287.370178643191, "height": 80, "content": "Starting from the given keywords, generates the article title, subtitle, chapters, and image prompt" }, "typeVersion": 1 }, { "id": "536d265a-1c0b-4262-adab-96edd5924530", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 140, 880 ], "parameters": { "color": 6, "width": 360, "height": 371, "content": "## Article structure" }, "typeVersion": 1 }, { "id": "8b4b7cf6-4809-44e7-af9a-c72919981698", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -400, 880 ], "parameters": { "color": 7, "width": 239.97343293577688, "height": 370.512611879577, "content": "## User form" }, "typeVersion": 1 }, { "id": "734b8ac2-2148-4d56-ab04-84f12991cf44", "name": "Sticky Note13", "type": "n8n-nodes-base.stickyNote", "position": [ -380, 940 ], "parameters": { "color": 7, "width": 199.7721486302032, "height": 80, "content": "The user triggers the post creation" }, "typeVersion": 1 }, { "id": "c54f91a7-ac3d-4029-a19f-3fa3794d581a", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 2960, 880 ], "parameters": { "color": 7, "width": 220, "height": 391, "content": "## User feedback" }, "typeVersion": 1 }, { "id": "509e89e7-8916-4228-91ae-baae25a75be7", "name": "Sticky Note14", "type": "n8n-nodes-base.stickyNote", "position": [ 2980, 960 ], "parameters": { "color": 7, "width": 183.38125554060056, "height": 80, "content": "Final confirmation to the user" }, "typeVersion": 1 }, { "id": "5c6e90c4-9714-43db-a82c-54fcbf43a26c", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 880, 1280 ], "parameters": { "color": 7, "width": 281.2716777103785, "height": 288.4116890365125, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nUser is notified to try again since some data is missing" }, "typeVersion": 1 }, { "id": "54e10057-b300-475b-8280-cb761acc303a", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 140, 1280 ], "parameters": { "color": 7, "width": 340, "height": 275, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWikipedia is used to write the article" }, "typeVersion": 1 }, { "id": "5f5b9ad9-1da5-4321-b6b4-e1985ff257ca", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ -120, 880 ], "parameters": { "color": 2, "width": 226.71615243495023, "height": 370.512611879577, "content": "## Settings" }, "typeVersion": 1 }, { "id": "6e298414-634f-45fb-b931-2abcae9c6db1", "name": "Sticky Note15", "type": "n8n-nodes-base.stickyNote", "position": [ -100, 940 ], "parameters": { "color": 7, "width": 179.37633247508526, "height": 80, "content": "Set the URL of your WordPress here" }, "typeVersion": 1 }, { "id": "94b09f31-31aa-4284-936e-c37fb3088acc", "name": "Sticky Note16", "type": "n8n-nodes-base.stickyNote", "position": [ 880, 880 ], "parameters": { "color": 2, "width": 225.47038972308582, "height": 370.512611879577, "content": "## Chapters split" }, "typeVersion": 1 }, { "id": "633cba39-ec92-410c-b010-083048487b2b", "name": "Sticky Note17", "type": "n8n-nodes-base.stickyNote", "position": [ 900, 940 ], "parameters": { "color": 7, "width": 185.6051460344073, "height": 80, "content": "Splits out chapter contents from the previous node" }, "typeVersion": 1 }, { "id": "4c9fd35f-d69d-4ced-a759-175336f43c8a", "name": "Sticky Note18", "type": "n8n-nodes-base.stickyNote", "position": [ 1160, 940 ], "parameters": { "color": 7, "width": 287.370178643191, "height": 80, "content": "Writes the text for each chapter" }, "typeVersion": 1 }, { "id": "0d751d84-117a-4bf4-a9a7-d5ad1b557fec", "name": "Sticky Note19", "type": "n8n-nodes-base.stickyNote", "position": [ 1140, 880 ], "parameters": { "color": 6, "width": 333.40108076977657, "height": 370.512611879577, "content": "## Chapters text" }, "typeVersion": 1 }, { "id": "ce36a500-136b-4082-988c-5f9b6dd6d971", "name": "Sticky Note21", "type": "n8n-nodes-base.stickyNote", "position": [ 1500, 880 ], "parameters": { "color": 4, "width": 420.4253447940705, "height": 514.2177254645992, "content": "## Content preparation" }, "typeVersion": 1 }, { "id": "9da83dc4-9e99-42a4-88a1-27ef87df6d09", "name": "Sticky Note22", "type": "n8n-nodes-base.stickyNote", "position": [ 1520, 960 ], "parameters": { "color": 7, "width": 368.1523541074699, "height": 80, "content": "Merges the content and prepare it before sending it to WordPress" }, "typeVersion": 1 }, { "id": "8591f4cb-edc4-4582-96b4-bcb2214a27a7", "name": "On form submission", "type": "n8n-nodes-base.formTrigger", "position":
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"8eaf0925-1394-4771-bf43-281ad14fefb4\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 540,\n 880\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 301.3874093724939,\n \"height\": 371.765663140765,\n \"content\": \"## Data check\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ab31ac7c-6bd4-44f6-8c0c-8e41463a3983\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 560,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 272.8190508599808,\n \"height\": 80,\n \"content\": \"Checks that the data returned by OpenAI is correct\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"306ffdb5-d6b6-4e49-a26d-a256e32f7c67\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1940,\n 880\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 302,\n \"height\": 392,\n \"content\": \"## Draft on WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"928da5f9-194c-461d-a5dd-7fd5c8563345\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1960,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 254.77269221373095,\n \"height\": 80,\n \"content\": \"The article is posted as a draft on WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"271f6b4d-cf7c-49b8-9479-dd753d7c5199\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2260,\n 880\n ],\n \"parameters\": {\n \"color\": 3,\n \"width\": 678,\n \"height\": 389,\n \"content\": \"## Featured image\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"efb047c4-b835-4706-af6a-b40c6cd76757\",\n \"name\": \"Sticky Note11\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2280,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 517.9195082760601,\n \"height\": 80,\n \"content\": \"The image is generated with Dall-E, uploaded to WordPress, and then connected to the post as its featured image\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4f78eb2c-a501-4774-b5ab-29d7aa83817d\",\n \"name\": \"Sticky Note12\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 287.370178643191,\n \"height\": 80,\n \"content\": \"Starting from the given keywords, generates the article title, subtitle, chapters, and image prompt\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"536d265a-1c0b-4262-adab-96edd5924530\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 140,\n 880\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 360,\n \"height\": 371,\n \"content\": \"## Article structure\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8b4b7cf6-4809-44e7-af9a-c72919981698\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -400,\n 880\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 239.97343293577688,\n \"height\": 370.512611879577,\n \"content\": \"## User form\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"734b8ac2-2148-4d56-ab04-84f12991cf44\",\n \"name\": \"Sticky Note13\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -380,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 199.7721486302032,\n \"height\": 80,\n \"content\": \"The user triggers the post creation\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c54f91a7-ac3d-4029-a19f-3fa3794d581a\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2960,\n 880\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 391,\n \"content\": \"## User feedback\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"509e89e7-8916-4228-91ae-baae25a75be7\",\n \"name\": \"Sticky Note14\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2980,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 183.38125554060056,\n \"height\": 80,\n \"content\": \"Final confirmation to the user\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c6e90c4-9714-43db-a82c-54fcbf43a26c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 1280\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 281.2716777103785,\n \"height\": 288.4116890365125,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nUser is notified to try again since some data is missing\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"54e10057-b300-475b-8280-cb761acc303a\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 140,\n 1280\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 275,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nWikipedia is used to write the article\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5f5b9ad9-1da5-4321-b6b4-e1985ff257ca\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -120,\n 880\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 226.71615243495023,\n \"height\": 370.512611879577,\n \"content\": \"## Settings\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e298414-634f-45fb-b931-2abcae9c6db1\",\n \"name\": \"Sticky Note15\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -100,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 179.37633247508526,\n \"height\": 80,\n \"content\": \"Set the URL of your WordPress here\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"94b09f31-31aa-4284-936e-c37fb3088acc\",\n \"name\": \"Sticky Note16\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 880\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 225.47038972308582,\n \"height\": 370.512611879577,\n \"content\": \"## Chapters split\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"633cba39-ec92-410c-b010-083048487b2b\",\n \"name\": \"Sticky Note17\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 900,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 185.6051460344073,\n \"height\": 80,\n \"content\": \"Splits out chapter contents from the previous node\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c9fd35f-d69d-4ced-a759-175336f43c8a\",\n \"name\": \"Sticky Note18\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 287.370178643191,\n \"height\": 80,\n \"content\": \"Writes the text for each chapter\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0d751d84-117a-4bf4-a9a7-d5ad1b557fec\",\n \"name\": \"Sticky Note19\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1140,\n 880\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 333.40108076977657,\n \"height\": 370.512611879577,\n \"content\": \"## Chapters text\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ce36a500-136b-4082-988c-5f9b6dd6d971\",\n \"name\": \"Sticky Note21\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1500,\n 880\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 420.4253447940705,\n \"height\": 514.2177254645992,\n \"content\": \"## Content preparation\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9da83dc4-9e99-42a4-88a1-27ef87df6d09\",\n \"name\": \"Sticky Note22\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1520,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 368.1523541074699,\n \"height\": 80,\n \"content\": \"Merges the content and prepare it before sending it to WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8591f4cb-edc4-4582-96b4-bcb2214a27a7\",\n \"name\": \"On form submission\",\n \"type\": \"n8n-nodes-base.formTrigger\",\n \"position\": [\n -340,\n 1080\n ],\n \"webhookId\": \"080f8376-cc82-49cc-8dd0-6db36bb887ab\",\n \"parameters\": {\n \"options\": {\n \"path\": \"create-wordpress-post\"\n },\n \"formTitle\": \"Create a WordPress post with AI\",\n \"formFields\": {\n \"values\": [\n {\n \"fieldLabel\": \"Keywords (comma-separated)\",\n \"requiredField\": true\n },\n {\n \"fieldType\": \"dropdown\",\n \"fieldLabel\": \"Number of chapters\",\n \"fieldOptions\": {\n \"values\": [\n {\n \"option\": \"1\"\n },\n {\n \"option\": \"2\"\n },\n {\n \"option\": \"3\"\n },\n {\n \"option\": \"4\"\n },\n {\n \"option\": \"5\"\n },\n {\n \"option\": \"6\"\n },\n {\n \"option\": \"7\"\n },\n {\n \"option\": \"8\"\n },\n {\n \"option\": \"9\"\n },\n {\n \"option\": \"10\"\n }\n ]\n },\n \"requiredField\": true\n },\n {\n \"fieldType\": \"number\",\n \"fieldLabel\": \"Max words count\",\n \"requiredField\": true\n }\n ]\n },\n \"responseMode\": \"lastNode\",\n \"formDescription\": \"Fill this form with the required information to create a draft post on WordPress\"\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"59619ea3-ac29-4188-9050-a6711c3f0921\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 940,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"message.content.chapters\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"728b7e4c-7b4a-46d9-ac86-98c23bda6c98\",\n \"name\": \"OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 1180,\n 1080\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Write a chapter for the article: {{ $('Create post title and structure').item.json.message.content.title }}, {{ $('Create post title and structure').item.json.message.content.subtitle }}, that talks about {{ $('Settings').item.json[\\\"keywords\\\"] }}\\n\\nThis is the prompt for the chapter titled {{ $json.title }}: {{ $json.prompt }}.\\n\\nGuidelines:\\n- Just return the plain text for each chapter (no JSON structure).\\n- Don't use markdown for formatting.\\n- Use HTML for formatting, but limited to bold, italic and lists.\\n- Don't add internal titles or headings.\\n- The length of each chapther should be around {{ Math.round(($('Settings').item.json.words - 120)/ $('Settings').item.json.chapters) }} words long\\n- Go deep in the topic you treat, don't just throw some superficial info\\n{{ $itemIndex > 0 ? \\\"- The previous chapter talks about \\\" + $input.all()[$itemIndex-1].json.title : \\\"\\\" }}\\n{{ $itemIndex > 0 ? \\\"- The promt for the previous chapter is \\\" + $input.all()[$itemIndex-1].json.prompt : \\\"\\\" }}\\n{{ $itemIndex < $input.all().length ? \\\"- The following chapter will talk about \\\" + $input.all()[$itemIndex+1].json.title: \\\"\\\" }}\\n{{ $itemIndex < $input.all().length ? \\\"- The prompt for the following chapter is \\\" + $input.all()[$itemIndex+1].json.prompt : \\\"\\\" }}\\n- Consider the previous and following chapters what writing the text for this chapter. The text must be coherent with the previous and following chapters.\\n- This chapter should not repeat the concepts already exposed in the previous chapter.\\n- This chapter is a part of a larger article so don't include an introduction or conclusions. This chapter should merge with the rest of the article.\\n\"\n }\n ]\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"85007abe-b4b1-4263-a7e6-62f0a2ebd7c3\",\n \"name\": \"Settings\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -60,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"c07386d7-9f51-4052-a62d-500e9aff9336\",\n \"name\": \"wordpress_url\",\n \"type\": \"string\",\n \"value\": \"https://you-wordpress-url-here.com/\"\n },\n {\n \"id\": \"2bbdd88a-3d66-4407-9b77-32af63f44e11\",\n \"name\": \"keywords\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Keywords (comma-separated)'] }}\"\n },\n {\n \"id\": \"4a199e44-1033-446a-a019-e2e1a694009e\",\n \"name\": \"chapters\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Number of chapters'] }}\"\n },\n {\n \"id\": \"312d2e97-d1b6-46d9-b2ae-35f7234b5404\",\n \"name\": \"words\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Max words count'] }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"d87b4460-1bf1-4c7f-8f5a-51993c1b7cd0\",\n \"name\": \"Create post title and structure\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 180,\n 1080\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Write the title, the subtitle, the chapters details, the introduction, the conclusions, and an image prompt for a SEO-friendly article about these topics:\\n{{ $json.keywords }}.\\n\\nInstructions:\\n- Place the article title in a JSON field called `title`\\n- Place the subtitle in a JSON field called `subtitle`\\n- Place the introduction in a JSON field called `introduction`\\n- In the introduction introduce the topic that is then explored in depth in the rest of the text\\n- The introduction should be around 60 words\\n- Place the conclusions in a JSON field called `conclusions`\\n- The conclusions should be around 60 words\\n- Use the conclusions to sum all said in the article and offer a conclusion to the reader\\n- The image prompt will be used to produce a photographic cover image for the article and should depict the topics discussed in the article\\n- Place the image prompt in a JSON field called `imagePrompt`\\n- There should be {{ $json.chapters.toString() }} chapters.\\n- For each chapter provide a title and an exaustive prompt that will be used to write the chapter text.\\n- Place the chapters in an array field called `chapters`\\n- For each chapter provide the fields `title` and `prompt`\\n- The chapters should follow a logical flow and not repeat the same concepts.\\n- The chapters should be one related to the other and not isolated blocks of text. The text should be fluent and folow a linear logic.\\n- Don't start the chapters with \\\"Chapter 1\\\", \\\"Chapter 2\\\", \\\"Chapter 3\\\"... just write the title of the chapter\\n- For the title and the capthers' titles don't use colons (`:`)\\n- For the text, use HTML for formatting, but limited to bold, italic and lists.\\n- Don't use markdown for formatting.\\n- Always search on Wikipedia for useful information or verify the accuracy of what you write.\\n- Never mention it if you don't find information on Wikipedia or the web\\n- Go deep in the topic you treat, don't just throw some superficial info\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"57f5811a-e82e-4dd3-8d53-0559b2716dac\",\n \"name\": \"Wikipedia\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWikipedia\",\n \"position\": [\n 280,\n 1360\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"1987ab2c-4b6e-451d-a831-0817004be72b\",\n \"name\": \"Check data consistency\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 620,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9523cb70-8467-4e65-9ecf-65cb91c29cb7\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.title }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"d754869d-10fe-4348-807f-2e1bc82a7b41\",\n \"operator\": {\n \"type\": \"array\",\n \"operation\": \"lengthGt\",\n \"rightType\": \"number\"\n },\n \"leftValue\": \"={{ $json.message.content.chapters }}\",\n \"rightValue\": 0\n },\n {\n \"id\": \"79a60fc1-66f8-4cfc-a61b-de528dfb7978\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.subtitle }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"c0c44d88-1c3d-44ba-9030-6e8fa9f2860f\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.introduction }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"338cd7e0-d2b8-40f4-838d-3aaf618268d2\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.conclusions }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"76eb9ba1-7675-403c-9287-ac1319791ffe\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.imagePrompt }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"6b22ae14-80c9-48ac-9a03-9266bc3a9aa4\",\n \"name\": \"Form\",\n \"type\": \"n8n-nodes-base.form\",\n \"position\": [\n 940,\n 1340\n ],\n \"webhookId\": \"691e1010-7083-46be-9e6e-4e77fb853a9a\",\n \"parameters\": {\n \"operation\": \"completion\",\n \"respondWith\": \"showText\",\n \"responseText\": \"There was a problem creating the article, please refresh the form and try again!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a22467a-6835-4a62-951f-e8cd43bef3af\",\n \"name\": \"Merge chapters title and text\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1580,\n 1200\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combineBy\": \"combineByPosition\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f4609858-7f65-4f2d-b222-f03ee207f166\",\n \"name\": \"Final article text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1760,\n 1080\n ],\n \"parameters\": {\n \"jsCode\": \"let article = \\\"\\\";\\n\\n// Introduction\\narticle += $('Create post title and structure').first().json.message.content.introduction;\\narticle += \\\"<br><br>\\\";\\n\\nfor (const item of $input.all()) {\\n article += \\\"<strong>\\\" + item.json.title + \\\"</strong>\\\";\\n article += \\\"<br><br>\\\";\\n article += item.json.message.content;\\n article += \\\"<br><br>\\\";\\n}\\n\\n// Conclusions\\narticle += \\\"<strong>Conclusions</strong>\\\";\\narticle += \\\"<br><br>\\\";\\narticle += $('Create post title and structure').first().json.message.content.conclusions;\\n\\n\\nreturn [\\n {\\n \\\"article\\\": article\\n }\\n];\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"e21a5519-315b-442e-97d0-8ee745138652\",\n \"name\": \"Post on Wordpress\",\n \"type\": \"n8n-nodes-base.wordpress\",\n \"position\": [\n 2040,\n 1080\n ],\n \"parameters\": {\n \"title\": \"={{ $('Create post title and structure').first().json.message.content.title }}\",\n \"additionalFields\": {\n \"status\": \"draft\",\n \"content\": \"={{ $json.article }}\"\n }\n },\n \"credentials\": {\n \"wordpressApi\": {\n \"id\": \"YMW8mGrekjfxKJUe\",\n \"name\": \"Wordpress account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d7de1e3-cff2-41f2-a8ae-123441d9b18c\",\n \"name\": \"Generate featured image\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 2340,\n 1080\n ],\n \"parameters\": {\n \"prompt\": \"=Generate a photographic image to be used as the cover image for the article titled: {{ $('Create post title and structure').first().json.message.content.title }}. This is the prompt for the image: {{ $('Create post title and structure').first().json.message.content.imagePrompt }}, photography, realistic, sigma 85mm f/1.4\",\n \"options\": {\n \"size\": \"1792x1024\",\n \"style\": \"natural\",\n \"quality\": \"hd\"\n },\n \"resource\": \"image\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"edbd0658-0edf-43e8-8428-3fea52639d62\",\n \"name\": \"Upload media\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2560,\n 1080\n ],\n \"parameters\": {\n \"url\": \"https://wp-demo.mondo.surf/wp-json/wp/v2/media\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"contentType\": \"binaryData\",\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Content-Disposition\",\n \"value\": \"attachment; filename=\\\"example.jpg\\\"\"\n }\n ]\n },\n \"inputDataFieldName\": \"data\",\n \"nodeCredentialType\": \"wordpressApi\"\n },\n \"credentials\": {\n \"wordpressApi\": {\n \"id\": \"YMW8mGrekjfxKJUe\",\n \"name\": \"Wordpress account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e2cd720b-03e6-4cee-8901-a6a06e4bd1ec\",\n \"name\": \"Set image ID for the post\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2780,\n 1080\n ],\n \"parameters\": {\n \"url\": \"=https://wp-demo.mondo.surf/wp-json/wp/v2/posts/{{ $('Post on Wordpress').first().json.id }}\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendQuery\": true,\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"featured_media\",\n \"value\": \"={{ $json.id }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"daddda39-db6a-4266-b823-8ae9080ca1a8\",\n \"name\": \"Form1\",\n \"type\": \"n8n-nodes-base.form\",\n \"position\": [\n 3020,\n 1080\n ],\n \"webhookId\": \"a9bf2986-4c9d-4d89-b5bf-ef6e93130b60\",\n \"parameters\": {\n \"options\": {},\n \"operation\": \"completion\",\n \"completionTitle\": \"Created Successfully!\",\n \"completionMessage\": \"=The article {{ $json.title.rendered }} was correctly created as a draft on WordPress!\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"OpenAI\": {\n \"main\": [\n [\n {\n \"node\": \"Merge chapters title and text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Settings\": {\n \"main\": [\n [\n {\n \"node\": \"Create post title and structure\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge chapters title and text\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Wikipedia\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Create post title and structure\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload media\": {\n \"main\": [\n [\n {\n \"node\": \"Set image ID for the post\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Post on Wordpress\": {\n \"main\": [\n [\n {\n \"node\": \"Generate featured image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Final article text\": {\n \"main\": [\n [\n {\n \"node\": \"Post on Wordpress\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"On form submission\": {\n \"main\": [\n [\n {\n \"node\": \"Settings\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check data consistency\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate featured image\": {\n \"main\": [\n [\n {\n \"node\": \"Upload media\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set image ID for the post\": {\n \"main\": [\n [\n {\n \"node\": \"Form1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge chapters title and text\": {\n \"main\": [\n [\n {\n \"node\": \"Final article text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create post title and structure\": {\n \"main\": [\n [\n {\n \"node\": \"Check data consistency\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
45
0
3
true
combined_workflows.json
{ "input": "This workflow automates the creation of a draft WordPress article based on user-provided keywords and settings. It generates the article structure, chapter content, and a featured image using AI, then posts the article to WordPress.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 19805, "processed_size": 19805, "processed_timestamp": "2025-04-09T03:08:38.950396", "timestamp": "2025-04-09T02:36:38.768259", "token_count": 4095, "tokens": 2024, "workflow_chunk_info": { "is_truncated": false, "original_size": 19805, "processed_size": 19805, "workflow_hash": "6a249f87d4e1e7ec4d0091894940bdfe" }, "workflow_hash": "6a249f87d4e1e7ec4d0091894940bdfe" }
Sticky Note22", "type": "n8n-nodes-base.stickyNote", "position": [ 1520, 960 ], "parameters": { "color": 7, "width": 368.1523541074699, "height": 80, "content": "Merges the content and prepare it before sending it to WordPress" }, "typeVersion": 1 }, { "id": "8591f4cb-edc4-4582-96b4-bcb2214a27a7", "name": "On form submission", "type": "n8n-nodes-base.formTrigger", "position": [ -340, 1080 ], "webhookId": "080f8376-cc82-49cc-8dd0-6db36bb887ab", "parameters": { "options": { "path": "create-wordpress-post" }, "formTitle": "Create a WordPress post with AI", "formFields": { "values": [ { "fieldLabel": "Keywords (comma-separated)", "requiredField": true }, { "fieldType": "dropdown", "fieldLabel": "Number of chapters", "fieldOptions": { "values": [ { "option": "1" }, { "option": "2" }, { "option": "3" }, { "option": "4" }, { "option": "5" }, { "option": "6" }, { "option": "7" }, { "option": "8" }, { "option": "9" }, { "option": "10" } ] }, "requiredField": true }, { "fieldType": "number", "fieldLabel": "Max words count", "requiredField": true } ] }, "responseMode": "lastNode", "formDescription": "Fill this form with the required information to create a draft post on WordPress" }, "typeVersion": 2.2 }, { "id": "59619ea3-ac29-4188-9050-a6711c3f0921", "name": "Split Out", "type": "n8n-nodes-base.splitOut", "position": [ 940, 1080 ], "parameters": { "options": {}, "fieldToSplitOut": "message.content.chapters" }, "typeVersion": 1 }, { "id": "728b7e4c-7b4a-46d9-ac86-98c23bda6c98", "name": "OpenAI", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 1180, 1080 ], "parameters": { "modelId": { "__rl": true, "mode": "list", "value": "gpt-4o-mini", "cachedResultName": "GPT-4O-MINI" }, "options": {}, "messages": { "values": [ { "content": "=Write a chapter for the article: {{ $('Create post title and structure').item.json.message.content.title }}, {{ $('Create post title and structure').item.json.message.content.subtitle }}, that talks about {{ $('Settings').item.json[\"keywords\"] }}\n\nThis is the prompt for the chapter titled {{ $json.title }}: {{ $json.prompt }}.\n\nGuidelines:\n- Just return the plain text for each chapter (no JSON structure).\n- Don't use markdown for formatting.\n- Use HTML for formatting, but limited to bold, italic and lists.\n- Don't add internal titles or headings.\n- The length of each chapther should be around {{ Math.round(($('Settings').item.json.words - 120)/ $('Settings').item.json.chapters) }} words long\n- Go deep in the topic you treat, don't just throw some superficial info\n{{ $itemIndex > 0 ? \"- The previous chapter talks about \" + $input.all()[$itemIndex-1].json.title : \"\" }}\n{{ $itemIndex > 0 ? \"- The promt for the previous chapter is \" + $input.all()[$itemIndex-1].json.prompt : \"\" }}\n{{ $itemIndex < $input.all().length ? \"- The following chapter will talk about \" + $input.all()[$itemIndex+1].json.title: \"\" }}\n{{ $itemIndex < $input.all().length ? \"- The prompt for the following chapter is \" + $input.all()[$itemIndex+1].json.prompt : \"\" }}\n- Consider the previous and following chapters what writing the text for this chapter. The text must be coherent with the previous and following chapters.\n- This chapter should not repeat the concepts already exposed in the previous chapter.\n- This chapter is a part of a larger article so don't include an introduction or conclusions. This chapter should merge with the rest of the article.\n" } ] } }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.8 }, { "id": "85007abe-b4b1-4263-a7e6-62f0a2ebd7c3", "name": "Settings", "type": "n8n-nodes-base.set", "position": [ -60, 1080 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "c07386d7-9f51-4052-a62d-500e9aff9336", "name": "wordpress_url", "type": "string", "value": "https://you-wordpress-url-here.com/" }, { "id": "2bbdd88a-3d66-4407-9b77-32af63f44e11", "name": "keywords", "type": "string", "value": "={{ $json['Keywords (comma-separated)'] }}" }, { "id": "4a199e44-1033-446a-a019-e2e1a694009e", "name": "chapters", "type": "string", "value": "={{ $json['Number of chapters'] }}" }, { "id": "312d2e97-d1b6-46d9-b2ae-35f7234b5404", "name": "words", "type": "string", "value": "={{ $json['Max words count'] }}" } ] } }, "typeVersion": 3.4 }, { "id": "d87b4460-1bf1-4c7f-8f5a-51993c1b7cd0", "name": "Create post title and structure", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 180, 1080 ], "parameters": { "modelId": { "__rl": true, "mode": "list", "value": "gpt-4o-mini", "cachedResultName": "GPT-4O-MINI" }, "options": {}, "messages": { "values": [ { "content": "=Write the title, the subtitle, the chapters details, the introduction, the conclusions, and an image prompt for a SEO-friendly article about these topics:\n{{ $json.keywords }}.\n\nInstructions:\n- Place the article title in a JSON field called `title`\n- Place the subtitle in a JSON field called `subtitle`\n- Place the introduction in a JSON field called `introduction`\n- In the introduction introduce the topic that is then explored in depth in the rest of the text\n- The introduction should be around 60 words\n- Place the conclusions in a JSON field called `conclusions`\n- The conclusions should be around 60 words\n- Use the conclusions to sum all said in the article and offer a conclusion to the reader\n- The image prompt will be used to produce a photographic cover image for the article and should depict the topics discussed in the article\n- Place the image prompt in a JSON field called `imagePrompt`\n- There should be {{ $json.chapters.toString() }} chapters.\n- For each chapter provide a title and an exaustive prompt that will be used to write the chapter text.\n- Place the chapters in an array field called `chapters`\n- For each chapter provide the fields `title` and `prompt`\n- The chapters should follow a logical flow and not repeat the same concepts.\n- The chapters should be one related to the other and not isolated blocks of text. The text should be fluent and folow a linear logic.\n- Don't start the chapters with \"Chapter 1\", \"Chapter 2\", \"Chapter 3\"... just write the title of the chapter\n- For the title and the capthers' titles don't use colons (`:`)\n- For the text, use HTML for formatting, but limited to bold, italic and lists.\n- Don't use markdown for formatting.\n- Always search on Wikipedia for useful information or verify the accuracy of what you write.\n- Never mention it if you don't find information on Wikipedia or the web\n- Go deep in the topic you treat, don't just throw some superficial info" } ] }, "jsonOutput": true }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.8 }, { "id": "57f5811a-e82e-4dd3-8d53-0559b2716dac", "name": "Wikipedia", "type": "@n8n/n8n-nodes-langchain.toolWikipedia", "position": [ 280, 1360 ], "parameters": {}, "typeVersion": 1 }, { "id": "1987ab2c-4b6e-451d-a831-0817004be72b", "name": "Check data consistency", "type": "n8n-nodes-base.if", "position": [ 620, 1080 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "9523cb70-8467-4e65-9ecf-65cb91c29cb7", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.message.content.title }}", "rightValue": "" }, { "id": "d754869d-10fe-4348-807f-2e1bc82a7b41", "operator": { "type": "array", "operation": "lengthGt", "rightType": "number" }, "leftValue": "={{ $json.message.content.chapters }}", "rightValue": 0 }, { "id": "79a60fc1-66f8-4cfc-a61b-de528dfb7978", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.message.content.subtitle }}", "rightValue": "" }, { "id": "c0c44d88-1c3d-44ba-9030-6e8fa9f2860f", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.message.content.introduction }}", "rightValue": "" }, { "id": "338cd7e0-d2b8-40f4-838d-3aaf618268d2", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.message.content.conclusions }}", "rightValue": "" }, { "id": "76eb9ba1-7675-403c-9287-ac1319791ffe", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.message.content.imagePrompt }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "6b22ae14-80c9-48ac-9a03-9266bc3a9aa4", "name": "Form", "type": "n8n-nodes-base.form", "position": [ 940, 1340 ], "webhookId": "691e1010-7083-46be-9e6e-4e77fb853a9a", "parameters": { "operation": "completion", "respondWith": "showText", "responseText": "There was a problem creating the article, please refresh the form and try again!" }, "typeVersion": 1 }, { "id": "5a22467a-6835-4a62-951f-e8cd43bef3af", "name": "Merge chapters title and text", "type": "n8n-nodes-base.merge", "position": [ 1580, 1200 ], "parameters": { "mode": "combine", "options": {}, "combineBy": "combineByPosition" }, "typeVersion": 3 }, { "id": "f4609858-7f65-4f2d-b222-f03ee207f166", "name": "Final
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"8eaf0925-1394-4771-bf43-281ad14fefb4\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 540,\n 880\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 301.3874093724939,\n \"height\": 371.765663140765,\n \"content\": \"## Data check\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ab31ac7c-6bd4-44f6-8c0c-8e41463a3983\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 560,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 272.8190508599808,\n \"height\": 80,\n \"content\": \"Checks that the data returned by OpenAI is correct\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"306ffdb5-d6b6-4e49-a26d-a256e32f7c67\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1940,\n 880\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 302,\n \"height\": 392,\n \"content\": \"## Draft on WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"928da5f9-194c-461d-a5dd-7fd5c8563345\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1960,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 254.77269221373095,\n \"height\": 80,\n \"content\": \"The article is posted as a draft on WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"271f6b4d-cf7c-49b8-9479-dd753d7c5199\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2260,\n 880\n ],\n \"parameters\": {\n \"color\": 3,\n \"width\": 678,\n \"height\": 389,\n \"content\": \"## Featured image\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"efb047c4-b835-4706-af6a-b40c6cd76757\",\n \"name\": \"Sticky Note11\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2280,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 517.9195082760601,\n \"height\": 80,\n \"content\": \"The image is generated with Dall-E, uploaded to WordPress, and then connected to the post as its featured image\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4f78eb2c-a501-4774-b5ab-29d7aa83817d\",\n \"name\": \"Sticky Note12\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 287.370178643191,\n \"height\": 80,\n \"content\": \"Starting from the given keywords, generates the article title, subtitle, chapters, and image prompt\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"536d265a-1c0b-4262-adab-96edd5924530\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 140,\n 880\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 360,\n \"height\": 371,\n \"content\": \"## Article structure\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8b4b7cf6-4809-44e7-af9a-c72919981698\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -400,\n 880\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 239.97343293577688,\n \"height\": 370.512611879577,\n \"content\": \"## User form\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"734b8ac2-2148-4d56-ab04-84f12991cf44\",\n \"name\": \"Sticky Note13\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -380,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 199.7721486302032,\n \"height\": 80,\n \"content\": \"The user triggers the post creation\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c54f91a7-ac3d-4029-a19f-3fa3794d581a\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2960,\n 880\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 391,\n \"content\": \"## User feedback\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"509e89e7-8916-4228-91ae-baae25a75be7\",\n \"name\": \"Sticky Note14\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2980,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 183.38125554060056,\n \"height\": 80,\n \"content\": \"Final confirmation to the user\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c6e90c4-9714-43db-a82c-54fcbf43a26c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 1280\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 281.2716777103785,\n \"height\": 288.4116890365125,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nUser is notified to try again since some data is missing\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"54e10057-b300-475b-8280-cb761acc303a\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 140,\n 1280\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 275,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nWikipedia is used to write the article\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5f5b9ad9-1da5-4321-b6b4-e1985ff257ca\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -120,\n 880\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 226.71615243495023,\n \"height\": 370.512611879577,\n \"content\": \"## Settings\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e298414-634f-45fb-b931-2abcae9c6db1\",\n \"name\": \"Sticky Note15\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -100,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 179.37633247508526,\n \"height\": 80,\n \"content\": \"Set the URL of your WordPress here\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"94b09f31-31aa-4284-936e-c37fb3088acc\",\n \"name\": \"Sticky Note16\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 880\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 225.47038972308582,\n \"height\": 370.512611879577,\n \"content\": \"## Chapters split\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"633cba39-ec92-410c-b010-083048487b2b\",\n \"name\": \"Sticky Note17\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 900,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 185.6051460344073,\n \"height\": 80,\n \"content\": \"Splits out chapter contents from the previous node\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c9fd35f-d69d-4ced-a759-175336f43c8a\",\n \"name\": \"Sticky Note18\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 287.370178643191,\n \"height\": 80,\n \"content\": \"Writes the text for each chapter\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0d751d84-117a-4bf4-a9a7-d5ad1b557fec\",\n \"name\": \"Sticky Note19\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1140,\n 880\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 333.40108076977657,\n \"height\": 370.512611879577,\n \"content\": \"## Chapters text\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ce36a500-136b-4082-988c-5f9b6dd6d971\",\n \"name\": \"Sticky Note21\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1500,\n 880\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 420.4253447940705,\n \"height\": 514.2177254645992,\n \"content\": \"## Content preparation\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9da83dc4-9e99-42a4-88a1-27ef87df6d09\",\n \"name\": \"Sticky Note22\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1520,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 368.1523541074699,\n \"height\": 80,\n \"content\": \"Merges the content and prepare it before sending it to WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8591f4cb-edc4-4582-96b4-bcb2214a27a7\",\n \"name\": \"On form submission\",\n \"type\": \"n8n-nodes-base.formTrigger\",\n \"position\": [\n -340,\n 1080\n ],\n \"webhookId\": \"080f8376-cc82-49cc-8dd0-6db36bb887ab\",\n \"parameters\": {\n \"options\": {\n \"path\": \"create-wordpress-post\"\n },\n \"formTitle\": \"Create a WordPress post with AI\",\n \"formFields\": {\n \"values\": [\n {\n \"fieldLabel\": \"Keywords (comma-separated)\",\n \"requiredField\": true\n },\n {\n \"fieldType\": \"dropdown\",\n \"fieldLabel\": \"Number of chapters\",\n \"fieldOptions\": {\n \"values\": [\n {\n \"option\": \"1\"\n },\n {\n \"option\": \"2\"\n },\n {\n \"option\": \"3\"\n },\n {\n \"option\": \"4\"\n },\n {\n \"option\": \"5\"\n },\n {\n \"option\": \"6\"\n },\n {\n \"option\": \"7\"\n },\n {\n \"option\": \"8\"\n },\n {\n \"option\": \"9\"\n },\n {\n \"option\": \"10\"\n }\n ]\n },\n \"requiredField\": true\n },\n {\n \"fieldType\": \"number\",\n \"fieldLabel\": \"Max words count\",\n \"requiredField\": true\n }\n ]\n },\n \"responseMode\": \"lastNode\",\n \"formDescription\": \"Fill this form with the required information to create a draft post on WordPress\"\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"59619ea3-ac29-4188-9050-a6711c3f0921\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 940,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"message.content.chapters\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"728b7e4c-7b4a-46d9-ac86-98c23bda6c98\",\n \"name\": \"OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 1180,\n 1080\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Write a chapter for the article: {{ $('Create post title and structure').item.json.message.content.title }}, {{ $('Create post title and structure').item.json.message.content.subtitle }}, that talks about {{ $('Settings').item.json[\\\"keywords\\\"] }}\\n\\nThis is the prompt for the chapter titled {{ $json.title }}: {{ $json.prompt }}.\\n\\nGuidelines:\\n- Just return the plain text for each chapter (no JSON structure).\\n- Don't use markdown for formatting.\\n- Use HTML for formatting, but limited to bold, italic and lists.\\n- Don't add internal titles or headings.\\n- The length of each chapther should be around {{ Math.round(($('Settings').item.json.words - 120)/ $('Settings').item.json.chapters) }} words long\\n- Go deep in the topic you treat, don't just throw some superficial info\\n{{ $itemIndex > 0 ? \\\"- The previous chapter talks about \\\" + $input.all()[$itemIndex-1].json.title : \\\"\\\" }}\\n{{ $itemIndex > 0 ? \\\"- The promt for the previous chapter is \\\" + $input.all()[$itemIndex-1].json.prompt : \\\"\\\" }}\\n{{ $itemIndex < $input.all().length ? \\\"- The following chapter will talk about \\\" + $input.all()[$itemIndex+1].json.title: \\\"\\\" }}\\n{{ $itemIndex < $input.all().length ? \\\"- The prompt for the following chapter is \\\" + $input.all()[$itemIndex+1].json.prompt : \\\"\\\" }}\\n- Consider the previous and following chapters what writing the text for this chapter. The text must be coherent with the previous and following chapters.\\n- This chapter should not repeat the concepts already exposed in the previous chapter.\\n- This chapter is a part of a larger article so don't include an introduction or conclusions. This chapter should merge with the rest of the article.\\n\"\n }\n ]\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"85007abe-b4b1-4263-a7e6-62f0a2ebd7c3\",\n \"name\": \"Settings\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -60,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"c07386d7-9f51-4052-a62d-500e9aff9336\",\n \"name\": \"wordpress_url\",\n \"type\": \"string\",\n \"value\": \"https://you-wordpress-url-here.com/\"\n },\n {\n \"id\": \"2bbdd88a-3d66-4407-9b77-32af63f44e11\",\n \"name\": \"keywords\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Keywords (comma-separated)'] }}\"\n },\n {\n \"id\": \"4a199e44-1033-446a-a019-e2e1a694009e\",\n \"name\": \"chapters\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Number of chapters'] }}\"\n },\n {\n \"id\": \"312d2e97-d1b6-46d9-b2ae-35f7234b5404\",\n \"name\": \"words\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Max words count'] }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"d87b4460-1bf1-4c7f-8f5a-51993c1b7cd0\",\n \"name\": \"Create post title and structure\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 180,\n 1080\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Write the title, the subtitle, the chapters details, the introduction, the conclusions, and an image prompt for a SEO-friendly article about these topics:\\n{{ $json.keywords }}.\\n\\nInstructions:\\n- Place the article title in a JSON field called `title`\\n- Place the subtitle in a JSON field called `subtitle`\\n- Place the introduction in a JSON field called `introduction`\\n- In the introduction introduce the topic that is then explored in depth in the rest of the text\\n- The introduction should be around 60 words\\n- Place the conclusions in a JSON field called `conclusions`\\n- The conclusions should be around 60 words\\n- Use the conclusions to sum all said in the article and offer a conclusion to the reader\\n- The image prompt will be used to produce a photographic cover image for the article and should depict the topics discussed in the article\\n- Place the image prompt in a JSON field called `imagePrompt`\\n- There should be {{ $json.chapters.toString() }} chapters.\\n- For each chapter provide a title and an exaustive prompt that will be used to write the chapter text.\\n- Place the chapters in an array field called `chapters`\\n- For each chapter provide the fields `title` and `prompt`\\n- The chapters should follow a logical flow and not repeat the same concepts.\\n- The chapters should be one related to the other and not isolated blocks of text. The text should be fluent and folow a linear logic.\\n- Don't start the chapters with \\\"Chapter 1\\\", \\\"Chapter 2\\\", \\\"Chapter 3\\\"... just write the title of the chapter\\n- For the title and the capthers' titles don't use colons (`:`)\\n- For the text, use HTML for formatting, but limited to bold, italic and lists.\\n- Don't use markdown for formatting.\\n- Always search on Wikipedia for useful information or verify the accuracy of what you write.\\n- Never mention it if you don't find information on Wikipedia or the web\\n- Go deep in the topic you treat, don't just throw some superficial info\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"57f5811a-e82e-4dd3-8d53-0559b2716dac\",\n \"name\": \"Wikipedia\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWikipedia\",\n \"position\": [\n 280,\n 1360\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"1987ab2c-4b6e-451d-a831-0817004be72b\",\n \"name\": \"Check data consistency\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 620,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9523cb70-8467-4e65-9ecf-65cb91c29cb7\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.title }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"d754869d-10fe-4348-807f-2e1bc82a7b41\",\n \"operator\": {\n \"type\": \"array\",\n \"operation\": \"lengthGt\",\n \"rightType\": \"number\"\n },\n \"leftValue\": \"={{ $json.message.content.chapters }}\",\n \"rightValue\": 0\n },\n {\n \"id\": \"79a60fc1-66f8-4cfc-a61b-de528dfb7978\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.subtitle }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"c0c44d88-1c3d-44ba-9030-6e8fa9f2860f\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.introduction }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"338cd7e0-d2b8-40f4-838d-3aaf618268d2\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.conclusions }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"76eb9ba1-7675-403c-9287-ac1319791ffe\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.imagePrompt }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"6b22ae14-80c9-48ac-9a03-9266bc3a9aa4\",\n \"name\": \"Form\",\n \"type\": \"n8n-nodes-base.form\",\n \"position\": [\n 940,\n 1340\n ],\n \"webhookId\": \"691e1010-7083-46be-9e6e-4e77fb853a9a\",\n \"parameters\": {\n \"operation\": \"completion\",\n \"respondWith\": \"showText\",\n \"responseText\": \"There was a problem creating the article, please refresh the form and try again!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a22467a-6835-4a62-951f-e8cd43bef3af\",\n \"name\": \"Merge chapters title and text\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1580,\n 1200\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combineBy\": \"combineByPosition\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f4609858-7f65-4f2d-b222-f03ee207f166\",\n \"name\": \"Final article text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1760,\n 1080\n ],\n \"parameters\": {\n \"jsCode\": \"let article = \\\"\\\";\\n\\n// Introduction\\narticle += $('Create post title and structure').first().json.message.content.introduction;\\narticle += \\\"<br><br>\\\";\\n\\nfor (const item of $input.all()) {\\n article += \\\"<strong>\\\" + item.json.title + \\\"</strong>\\\";\\n article += \\\"<br><br>\\\";\\n article += item.json.message.content;\\n article += \\\"<br><br>\\\";\\n}\\n\\n// Conclusions\\narticle += \\\"<strong>Conclusions</strong>\\\";\\narticle += \\\"<br><br>\\\";\\narticle += $('Create post title and structure').first().json.message.content.conclusions;\\n\\n\\nreturn [\\n {\\n \\\"article\\\": article\\n }\\n];\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"e21a5519-315b-442e-97d0-8ee745138652\",\n \"name\": \"Post on Wordpress\",\n \"type\": \"n8n-nodes-base.wordpress\",\n \"position\": [\n 2040,\n 1080\n ],\n \"parameters\": {\n \"title\": \"={{ $('Create post title and structure').first().json.message.content.title }}\",\n \"additionalFields\": {\n \"status\": \"draft\",\n \"content\": \"={{ $json.article }}\"\n }\n },\n \"credentials\": {\n \"wordpressApi\": {\n \"id\": \"YMW8mGrekjfxKJUe\",\n \"name\": \"Wordpress account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d7de1e3-cff2-41f2-a8ae-123441d9b18c\",\n \"name\": \"Generate featured image\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 2340,\n 1080\n ],\n \"parameters\": {\n \"prompt\": \"=Generate a photographic image to be used as the cover image for the article titled: {{ $('Create post title and structure').first().json.message.content.title }}. This is the prompt for the image: {{ $('Create post title and structure').first().json.message.content.imagePrompt }}, photography, realistic, sigma 85mm f/1.4\",\n \"options\": {\n \"size\": \"1792x1024\",\n \"style\": \"natural\",\n \"quality\": \"hd\"\n },\n \"resource\": \"image\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"edbd0658-0edf-43e8-8428-3fea52639d62\",\n \"name\": \"Upload media\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2560,\n 1080\n ],\n \"parameters\": {\n \"url\": \"https://wp-demo.mondo.surf/wp-json/wp/v2/media\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"contentType\": \"binaryData\",\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Content-Disposition\",\n \"value\": \"attachment; filename=\\\"example.jpg\\\"\"\n }\n ]\n },\n \"inputDataFieldName\": \"data\",\n \"nodeCredentialType\": \"wordpressApi\"\n },\n \"credentials\": {\n \"wordpressApi\": {\n \"id\": \"YMW8mGrekjfxKJUe\",\n \"name\": \"Wordpress account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e2cd720b-03e6-4cee-8901-a6a06e4bd1ec\",\n \"name\": \"Set image ID for the post\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2780,\n 1080\n ],\n \"parameters\": {\n \"url\": \"=https://wp-demo.mondo.surf/wp-json/wp/v2/posts/{{ $('Post on Wordpress').first().json.id }}\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendQuery\": true,\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"featured_media\",\n \"value\": \"={{ $json.id }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"daddda39-db6a-4266-b823-8ae9080ca1a8\",\n \"name\": \"Form1\",\n \"type\": \"n8n-nodes-base.form\",\n \"position\": [\n 3020,\n 1080\n ],\n \"webhookId\": \"a9bf2986-4c9d-4d89-b5bf-ef6e93130b60\",\n \"parameters\": {\n \"options\": {},\n \"operation\": \"completion\",\n \"completionTitle\": \"Created Successfully!\",\n \"completionMessage\": \"=The article {{ $json.title.rendered }} was correctly created as a draft on WordPress!\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"OpenAI\": {\n \"main\": [\n [\n {\n \"node\": \"Merge chapters title and text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Settings\": {\n \"main\": [\n [\n {\n \"node\": \"Create post title and structure\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge chapters title and text\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Wikipedia\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Create post title and structure\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload media\": {\n \"main\": [\n [\n {\n \"node\": \"Set image ID for the post\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Post on Wordpress\": {\n \"main\": [\n [\n {\n \"node\": \"Generate featured image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Final article text\": {\n \"main\": [\n [\n {\n \"node\": \"Post on Wordpress\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"On form submission\": {\n \"main\": [\n [\n {\n \"node\": \"Settings\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check data consistency\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate featured image\": {\n \"main\": [\n [\n {\n \"node\": \"Upload media\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set image ID for the post\": {\n \"main\": [\n [\n {\n \"node\": \"Form1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge chapters title and text\": {\n \"main\": [\n [\n {\n \"node\": \"Final article text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create post title and structure\": {\n \"main\": [\n [\n {\n \"node\": \"Check data consistency\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
45
1
3
true
combined_workflows.json
{ "input": "This workflow automates the creation of a draft WordPress article based on user-provided keywords and settings. It generates the article structure, chapter content, and a featured image using AI, then posts the article to WordPress.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 19805, "processed_size": 19805, "processed_timestamp": "2025-04-09T03:08:38.960405", "timestamp": "2025-04-09T02:36:38.768259", "token_count": 4097, "tokens": 2024, "workflow_chunk_info": { "is_truncated": false, "original_size": 19805, "processed_size": 19805, "workflow_hash": "6a249f87d4e1e7ec4d0091894940bdfe" }, "workflow_hash": "6a249f87d4e1e7ec4d0091894940bdfe" }
Version": 1 }, { "id": "5a22467a-6835-4a62-951f-e8cd43bef3af", "name": "Merge chapters title and text", "type": "n8n-nodes-base.merge", "position": [ 1580, 1200 ], "parameters": { "mode": "combine", "options": {}, "combineBy": "combineByPosition" }, "typeVersion": 3 }, { "id": "f4609858-7f65-4f2d-b222-f03ee207f166", "name": "Final article text", "type": "n8n-nodes-base.code", "position": [ 1760, 1080 ], "parameters": { "jsCode": "let article = \"\";\n\n// Introduction\narticle += $('Create post title and structure').first().json.message.content.introduction;\narticle += \"<br><br>\";\n\nfor (const item of $input.all()) {\n article += \"<strong>\" + item.json.title + \"</strong>\";\n article += \"<br><br>\";\n article += item.json.message.content;\n article += \"<br><br>\";\n}\n\n// Conclusions\narticle += \"<strong>Conclusions</strong>\";\narticle += \"<br><br>\";\narticle += $('Create post title and structure').first().json.message.content.conclusions;\n\n\nreturn [\n {\n \"article\": article\n }\n];" }, "typeVersion": 2 }, { "id": "e21a5519-315b-442e-97d0-8ee745138652", "name": "Post on Wordpress", "type": "n8n-nodes-base.wordpress", "position": [ 2040, 1080 ], "parameters": { "title": "={{ $('Create post title and structure').first().json.message.content.title }}", "additionalFields": { "status": "draft", "content": "={{ $json.article }}" } }, "credentials": { "wordpressApi": { "id": "YMW8mGrekjfxKJUe", "name": "Wordpress account" } }, "typeVersion": 1 }, { "id": "7d7de1e3-cff2-41f2-a8ae-123441d9b18c", "name": "Generate featured image", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 2340, 1080 ], "parameters": { "prompt": "=Generate a photographic image to be used as the cover image for the article titled: {{ $('Create post title and structure').first().json.message.content.title }}. This is the prompt for the image: {{ $('Create post title and structure').first().json.message.content.imagePrompt }}, photography, realistic, sigma 85mm f/1.4", "options": { "size": "1792x1024", "style": "natural", "quality": "hd" }, "resource": "image" }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.8 }, { "id": "edbd0658-0edf-43e8-8428-3fea52639d62", "name": "Upload media", "type": "n8n-nodes-base.httpRequest", "position": [ 2560, 1080 ], "parameters": { "url": "https://wp-demo.mondo.surf/wp-json/wp/v2/media", "method": "POST", "options": {}, "sendBody": true, "contentType": "binaryData", "sendHeaders": true, "authentication": "predefinedCredentialType", "headerParameters": { "parameters": [ { "name": "Content-Disposition", "value": "attachment; filename=\"example.jpg\"" } ] }, "inputDataFieldName": "data", "nodeCredentialType": "wordpressApi" }, "credentials": { "wordpressApi": { "id": "YMW8mGrekjfxKJUe", "name": "Wordpress account" } }, "typeVersion": 4.2 }, { "id": "e2cd720b-03e6-4cee-8901-a6a06e4bd1ec", "name": "Set image ID for the post", "type": "n8n-nodes-base.httpRequest", "position": [ 2780, 1080 ], "parameters": { "url": "=https://wp-demo.mondo.surf/wp-json/wp/v2/posts/{{ $('Post on Wordpress').first().json.id }}", "method": "POST", "options": {}, "sendQuery": true, "queryParameters": { "parameters": [ { "name": "featured_media", "value": "={{ $json.id }}" } ] } }, "typeVersion": 4.2 }, { "id": "daddda39-db6a-4266-b823-8ae9080ca1a8", "name": "Form1", "type": "n8n-nodes-base.form", "position": [ 3020, 1080 ], "webhookId": "a9bf2986-4c9d-4d89-b5bf-ef6e93130b60", "parameters": { "options": {}, "operation": "completion", "completionTitle": "Created Successfully!", "completionMessage": "=The article {{ $json.title.rendered }} was correctly created as a draft on WordPress!" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "OpenAI": { "main": [ [ { "node": "Merge chapters title and text", "type": "main", "index": 0 } ] ] }, "Settings": { "main": [ [ { "node": "Create post title and structure", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "OpenAI", "type": "main", "index": 0 }, { "node": "Merge chapters title and text", "type": "main", "index": 1 } ] ] }, "Wikipedia": { "ai_tool": [ [ { "node": "Create post title and structure", "type": "ai_tool", "index": 0 } ] ] }, "Upload media": { "main": [ [ { "node": "Set image ID for the post", "type": "main", "index": 0 } ] ] }, "Post on Wordpress": { "main": [ [ { "node": "Generate featured image", "type": "main", "index": 0 } ] ] }, "Final article text": { "main": [ [ { "node": "Post on Wordpress", "type": "main", "index": 0 } ] ] }, "On form submission": { "main": [ [ { "node": "Settings", "type": "main", "index": 0 } ] ] }, "Check data consistency": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ], [ { "node": "Form", "type": "main", "index": 0 } ] ] }, "Generate featured image": { "main": [ [ { "node": "Upload media", "type": "main", "index": 0 } ] ] }, "Set image ID for the post": { "main": [ [ { "node": "Form1", "type": "main", "index": 0 } ] ] }, "Merge chapters title and text": { "main": [ [ { "node": "Final article text", "type": "main", "index": 0 } ] ] }, "Create post title and structure": { "main": [ [ { "node": "Check data consistency", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"8eaf0925-1394-4771-bf43-281ad14fefb4\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 540,\n 880\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 301.3874093724939,\n \"height\": 371.765663140765,\n \"content\": \"## Data check\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ab31ac7c-6bd4-44f6-8c0c-8e41463a3983\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 560,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 272.8190508599808,\n \"height\": 80,\n \"content\": \"Checks that the data returned by OpenAI is correct\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"306ffdb5-d6b6-4e49-a26d-a256e32f7c67\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1940,\n 880\n ],\n \"parameters\": {\n \"color\": 5,\n \"width\": 302,\n \"height\": 392,\n \"content\": \"## Draft on WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"928da5f9-194c-461d-a5dd-7fd5c8563345\",\n \"name\": \"Sticky Note9\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1960,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 254.77269221373095,\n \"height\": 80,\n \"content\": \"The article is posted as a draft on WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"271f6b4d-cf7c-49b8-9479-dd753d7c5199\",\n \"name\": \"Sticky Note10\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2260,\n 880\n ],\n \"parameters\": {\n \"color\": 3,\n \"width\": 678,\n \"height\": 389,\n \"content\": \"## Featured image\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"efb047c4-b835-4706-af6a-b40c6cd76757\",\n \"name\": \"Sticky Note11\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2280,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 517.9195082760601,\n \"height\": 80,\n \"content\": \"The image is generated with Dall-E, uploaded to WordPress, and then connected to the post as its featured image\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4f78eb2c-a501-4774-b5ab-29d7aa83817d\",\n \"name\": \"Sticky Note12\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 160,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 287.370178643191,\n \"height\": 80,\n \"content\": \"Starting from the given keywords, generates the article title, subtitle, chapters, and image prompt\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"536d265a-1c0b-4262-adab-96edd5924530\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 140,\n 880\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 360,\n \"height\": 371,\n \"content\": \"## Article structure\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8b4b7cf6-4809-44e7-af9a-c72919981698\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -400,\n 880\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 239.97343293577688,\n \"height\": 370.512611879577,\n \"content\": \"## User form\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"734b8ac2-2148-4d56-ab04-84f12991cf44\",\n \"name\": \"Sticky Note13\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -380,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 199.7721486302032,\n \"height\": 80,\n \"content\": \"The user triggers the post creation\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c54f91a7-ac3d-4029-a19f-3fa3794d581a\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2960,\n 880\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 220,\n \"height\": 391,\n \"content\": \"## User feedback\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"509e89e7-8916-4228-91ae-baae25a75be7\",\n \"name\": \"Sticky Note14\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2980,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 183.38125554060056,\n \"height\": 80,\n \"content\": \"Final confirmation to the user\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c6e90c4-9714-43db-a82c-54fcbf43a26c\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 1280\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 281.2716777103785,\n \"height\": 288.4116890365125,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nUser is notified to try again since some data is missing\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"54e10057-b300-475b-8280-cb761acc303a\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 140,\n 1280\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 340,\n \"height\": 275,\n \"content\": \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nWikipedia is used to write the article\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5f5b9ad9-1da5-4321-b6b4-e1985ff257ca\",\n \"name\": \"Sticky Note8\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -120,\n 880\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 226.71615243495023,\n \"height\": 370.512611879577,\n \"content\": \"## Settings\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e298414-634f-45fb-b931-2abcae9c6db1\",\n \"name\": \"Sticky Note15\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -100,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 179.37633247508526,\n \"height\": 80,\n \"content\": \"Set the URL of your WordPress here\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"94b09f31-31aa-4284-936e-c37fb3088acc\",\n \"name\": \"Sticky Note16\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 880,\n 880\n ],\n \"parameters\": {\n \"color\": 2,\n \"width\": 225.47038972308582,\n \"height\": 370.512611879577,\n \"content\": \"## Chapters split\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"633cba39-ec92-410c-b010-083048487b2b\",\n \"name\": \"Sticky Note17\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 900,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 185.6051460344073,\n \"height\": 80,\n \"content\": \"Splits out chapter contents from the previous node\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c9fd35f-d69d-4ced-a759-175336f43c8a\",\n \"name\": \"Sticky Note18\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1160,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 287.370178643191,\n \"height\": 80,\n \"content\": \"Writes the text for each chapter\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0d751d84-117a-4bf4-a9a7-d5ad1b557fec\",\n \"name\": \"Sticky Note19\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1140,\n 880\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 333.40108076977657,\n \"height\": 370.512611879577,\n \"content\": \"## Chapters text\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ce36a500-136b-4082-988c-5f9b6dd6d971\",\n \"name\": \"Sticky Note21\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1500,\n 880\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 420.4253447940705,\n \"height\": 514.2177254645992,\n \"content\": \"## Content preparation\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9da83dc4-9e99-42a4-88a1-27ef87df6d09\",\n \"name\": \"Sticky Note22\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1520,\n 960\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 368.1523541074699,\n \"height\": 80,\n \"content\": \"Merges the content and prepare it before sending it to WordPress\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8591f4cb-edc4-4582-96b4-bcb2214a27a7\",\n \"name\": \"On form submission\",\n \"type\": \"n8n-nodes-base.formTrigger\",\n \"position\": [\n -340,\n 1080\n ],\n \"webhookId\": \"080f8376-cc82-49cc-8dd0-6db36bb887ab\",\n \"parameters\": {\n \"options\": {\n \"path\": \"create-wordpress-post\"\n },\n \"formTitle\": \"Create a WordPress post with AI\",\n \"formFields\": {\n \"values\": [\n {\n \"fieldLabel\": \"Keywords (comma-separated)\",\n \"requiredField\": true\n },\n {\n \"fieldType\": \"dropdown\",\n \"fieldLabel\": \"Number of chapters\",\n \"fieldOptions\": {\n \"values\": [\n {\n \"option\": \"1\"\n },\n {\n \"option\": \"2\"\n },\n {\n \"option\": \"3\"\n },\n {\n \"option\": \"4\"\n },\n {\n \"option\": \"5\"\n },\n {\n \"option\": \"6\"\n },\n {\n \"option\": \"7\"\n },\n {\n \"option\": \"8\"\n },\n {\n \"option\": \"9\"\n },\n {\n \"option\": \"10\"\n }\n ]\n },\n \"requiredField\": true\n },\n {\n \"fieldType\": \"number\",\n \"fieldLabel\": \"Max words count\",\n \"requiredField\": true\n }\n ]\n },\n \"responseMode\": \"lastNode\",\n \"formDescription\": \"Fill this form with the required information to create a draft post on WordPress\"\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"59619ea3-ac29-4188-9050-a6711c3f0921\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n 940,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"message.content.chapters\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"728b7e4c-7b4a-46d9-ac86-98c23bda6c98\",\n \"name\": \"OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 1180,\n 1080\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Write a chapter for the article: {{ $('Create post title and structure').item.json.message.content.title }}, {{ $('Create post title and structure').item.json.message.content.subtitle }}, that talks about {{ $('Settings').item.json[\\\"keywords\\\"] }}\\n\\nThis is the prompt for the chapter titled {{ $json.title }}: {{ $json.prompt }}.\\n\\nGuidelines:\\n- Just return the plain text for each chapter (no JSON structure).\\n- Don't use markdown for formatting.\\n- Use HTML for formatting, but limited to bold, italic and lists.\\n- Don't add internal titles or headings.\\n- The length of each chapther should be around {{ Math.round(($('Settings').item.json.words - 120)/ $('Settings').item.json.chapters) }} words long\\n- Go deep in the topic you treat, don't just throw some superficial info\\n{{ $itemIndex > 0 ? \\\"- The previous chapter talks about \\\" + $input.all()[$itemIndex-1].json.title : \\\"\\\" }}\\n{{ $itemIndex > 0 ? \\\"- The promt for the previous chapter is \\\" + $input.all()[$itemIndex-1].json.prompt : \\\"\\\" }}\\n{{ $itemIndex < $input.all().length ? \\\"- The following chapter will talk about \\\" + $input.all()[$itemIndex+1].json.title: \\\"\\\" }}\\n{{ $itemIndex < $input.all().length ? \\\"- The prompt for the following chapter is \\\" + $input.all()[$itemIndex+1].json.prompt : \\\"\\\" }}\\n- Consider the previous and following chapters what writing the text for this chapter. The text must be coherent with the previous and following chapters.\\n- This chapter should not repeat the concepts already exposed in the previous chapter.\\n- This chapter is a part of a larger article so don't include an introduction or conclusions. This chapter should merge with the rest of the article.\\n\"\n }\n ]\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"85007abe-b4b1-4263-a7e6-62f0a2ebd7c3\",\n \"name\": \"Settings\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -60,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"c07386d7-9f51-4052-a62d-500e9aff9336\",\n \"name\": \"wordpress_url\",\n \"type\": \"string\",\n \"value\": \"https://you-wordpress-url-here.com/\"\n },\n {\n \"id\": \"2bbdd88a-3d66-4407-9b77-32af63f44e11\",\n \"name\": \"keywords\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Keywords (comma-separated)'] }}\"\n },\n {\n \"id\": \"4a199e44-1033-446a-a019-e2e1a694009e\",\n \"name\": \"chapters\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Number of chapters'] }}\"\n },\n {\n \"id\": \"312d2e97-d1b6-46d9-b2ae-35f7234b5404\",\n \"name\": \"words\",\n \"type\": \"string\",\n \"value\": \"={{ $json['Max words count'] }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"d87b4460-1bf1-4c7f-8f5a-51993c1b7cd0\",\n \"name\": \"Create post title and structure\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 180,\n 1080\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\",\n \"cachedResultName\": \"GPT-4O-MINI\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Write the title, the subtitle, the chapters details, the introduction, the conclusions, and an image prompt for a SEO-friendly article about these topics:\\n{{ $json.keywords }}.\\n\\nInstructions:\\n- Place the article title in a JSON field called `title`\\n- Place the subtitle in a JSON field called `subtitle`\\n- Place the introduction in a JSON field called `introduction`\\n- In the introduction introduce the topic that is then explored in depth in the rest of the text\\n- The introduction should be around 60 words\\n- Place the conclusions in a JSON field called `conclusions`\\n- The conclusions should be around 60 words\\n- Use the conclusions to sum all said in the article and offer a conclusion to the reader\\n- The image prompt will be used to produce a photographic cover image for the article and should depict the topics discussed in the article\\n- Place the image prompt in a JSON field called `imagePrompt`\\n- There should be {{ $json.chapters.toString() }} chapters.\\n- For each chapter provide a title and an exaustive prompt that will be used to write the chapter text.\\n- Place the chapters in an array field called `chapters`\\n- For each chapter provide the fields `title` and `prompt`\\n- The chapters should follow a logical flow and not repeat the same concepts.\\n- The chapters should be one related to the other and not isolated blocks of text. The text should be fluent and folow a linear logic.\\n- Don't start the chapters with \\\"Chapter 1\\\", \\\"Chapter 2\\\", \\\"Chapter 3\\\"... just write the title of the chapter\\n- For the title and the capthers' titles don't use colons (`:`)\\n- For the text, use HTML for formatting, but limited to bold, italic and lists.\\n- Don't use markdown for formatting.\\n- Always search on Wikipedia for useful information or verify the accuracy of what you write.\\n- Never mention it if you don't find information on Wikipedia or the web\\n- Go deep in the topic you treat, don't just throw some superficial info\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"57f5811a-e82e-4dd3-8d53-0559b2716dac\",\n \"name\": \"Wikipedia\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWikipedia\",\n \"position\": [\n 280,\n 1360\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"1987ab2c-4b6e-451d-a831-0817004be72b\",\n \"name\": \"Check data consistency\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 620,\n 1080\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"9523cb70-8467-4e65-9ecf-65cb91c29cb7\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.title }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"d754869d-10fe-4348-807f-2e1bc82a7b41\",\n \"operator\": {\n \"type\": \"array\",\n \"operation\": \"lengthGt\",\n \"rightType\": \"number\"\n },\n \"leftValue\": \"={{ $json.message.content.chapters }}\",\n \"rightValue\": 0\n },\n {\n \"id\": \"79a60fc1-66f8-4cfc-a61b-de528dfb7978\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.subtitle }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"c0c44d88-1c3d-44ba-9030-6e8fa9f2860f\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.introduction }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"338cd7e0-d2b8-40f4-838d-3aaf618268d2\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.conclusions }}\",\n \"rightValue\": \"\"\n },\n {\n \"id\": \"76eb9ba1-7675-403c-9287-ac1319791ffe\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.imagePrompt }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"6b22ae14-80c9-48ac-9a03-9266bc3a9aa4\",\n \"name\": \"Form\",\n \"type\": \"n8n-nodes-base.form\",\n \"position\": [\n 940,\n 1340\n ],\n \"webhookId\": \"691e1010-7083-46be-9e6e-4e77fb853a9a\",\n \"parameters\": {\n \"operation\": \"completion\",\n \"respondWith\": \"showText\",\n \"responseText\": \"There was a problem creating the article, please refresh the form and try again!\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a22467a-6835-4a62-951f-e8cd43bef3af\",\n \"name\": \"Merge chapters title and text\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1580,\n 1200\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combineBy\": \"combineByPosition\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"f4609858-7f65-4f2d-b222-f03ee207f166\",\n \"name\": \"Final article text\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1760,\n 1080\n ],\n \"parameters\": {\n \"jsCode\": \"let article = \\\"\\\";\\n\\n// Introduction\\narticle += $('Create post title and structure').first().json.message.content.introduction;\\narticle += \\\"<br><br>\\\";\\n\\nfor (const item of $input.all()) {\\n article += \\\"<strong>\\\" + item.json.title + \\\"</strong>\\\";\\n article += \\\"<br><br>\\\";\\n article += item.json.message.content;\\n article += \\\"<br><br>\\\";\\n}\\n\\n// Conclusions\\narticle += \\\"<strong>Conclusions</strong>\\\";\\narticle += \\\"<br><br>\\\";\\narticle += $('Create post title and structure').first().json.message.content.conclusions;\\n\\n\\nreturn [\\n {\\n \\\"article\\\": article\\n }\\n];\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"e21a5519-315b-442e-97d0-8ee745138652\",\n \"name\": \"Post on Wordpress\",\n \"type\": \"n8n-nodes-base.wordpress\",\n \"position\": [\n 2040,\n 1080\n ],\n \"parameters\": {\n \"title\": \"={{ $('Create post title and structure').first().json.message.content.title }}\",\n \"additionalFields\": {\n \"status\": \"draft\",\n \"content\": \"={{ $json.article }}\"\n }\n },\n \"credentials\": {\n \"wordpressApi\": {\n \"id\": \"YMW8mGrekjfxKJUe\",\n \"name\": \"Wordpress account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"7d7de1e3-cff2-41f2-a8ae-123441d9b18c\",\n \"name\": \"Generate featured image\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 2340,\n 1080\n ],\n \"parameters\": {\n \"prompt\": \"=Generate a photographic image to be used as the cover image for the article titled: {{ $('Create post title and structure').first().json.message.content.title }}. This is the prompt for the image: {{ $('Create post title and structure').first().json.message.content.imagePrompt }}, photography, realistic, sigma 85mm f/1.4\",\n \"options\": {\n \"size\": \"1792x1024\",\n \"style\": \"natural\",\n \"quality\": \"hd\"\n },\n \"resource\": \"image\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"edbd0658-0edf-43e8-8428-3fea52639d62\",\n \"name\": \"Upload media\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2560,\n 1080\n ],\n \"parameters\": {\n \"url\": \"https://wp-demo.mondo.surf/wp-json/wp/v2/media\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"contentType\": \"binaryData\",\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Content-Disposition\",\n \"value\": \"attachment; filename=\\\"example.jpg\\\"\"\n }\n ]\n },\n \"inputDataFieldName\": \"data\",\n \"nodeCredentialType\": \"wordpressApi\"\n },\n \"credentials\": {\n \"wordpressApi\": {\n \"id\": \"YMW8mGrekjfxKJUe\",\n \"name\": \"Wordpress account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e2cd720b-03e6-4cee-8901-a6a06e4bd1ec\",\n \"name\": \"Set image ID for the post\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2780,\n 1080\n ],\n \"parameters\": {\n \"url\": \"=https://wp-demo.mondo.surf/wp-json/wp/v2/posts/{{ $('Post on Wordpress').first().json.id }}\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendQuery\": true,\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"featured_media\",\n \"value\": \"={{ $json.id }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"daddda39-db6a-4266-b823-8ae9080ca1a8\",\n \"name\": \"Form1\",\n \"type\": \"n8n-nodes-base.form\",\n \"position\": [\n 3020,\n 1080\n ],\n \"webhookId\": \"a9bf2986-4c9d-4d89-b5bf-ef6e93130b60\",\n \"parameters\": {\n \"options\": {},\n \"operation\": \"completion\",\n \"completionTitle\": \"Created Successfully!\",\n \"completionMessage\": \"=The article {{ $json.title.rendered }} was correctly created as a draft on WordPress!\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"OpenAI\": {\n \"main\": [\n [\n {\n \"node\": \"Merge chapters title and text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Settings\": {\n \"main\": [\n [\n {\n \"node\": \"Create post title and structure\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"OpenAI\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Merge chapters title and text\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Wikipedia\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"Create post title and structure\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload media\": {\n \"main\": [\n [\n {\n \"node\": \"Set image ID for the post\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Post on Wordpress\": {\n \"main\": [\n [\n {\n \"node\": \"Generate featured image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Final article text\": {\n \"main\": [\n [\n {\n \"node\": \"Post on Wordpress\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"On form submission\": {\n \"main\": [\n [\n {\n \"node\": \"Settings\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check data consistency\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Generate featured image\": {\n \"main\": [\n [\n {\n \"node\": \"Upload media\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set image ID for the post\": {\n \"main\": [\n [\n {\n \"node\": \"Form1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge chapters title and text\": {\n \"main\": [\n [\n {\n \"node\": \"Final article text\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create post title and structure\": {\n \"main\": [\n [\n {\n \"node\": \"Check data consistency\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
45
2
3
true
combined_workflows.json
{ "input": "This workflow automates the creation of a draft WordPress article based on user-provided keywords and settings. It generates the article structure, chapter content, and a featured image using AI, then posts the article to WordPress.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 19805, "processed_size": 19805, "processed_timestamp": "2025-04-09T03:08:38.967401", "timestamp": "2025-04-09T02:36:38.768259", "token_count": 2640, "tokens": 2024, "workflow_chunk_info": { "is_truncated": false, "original_size": 19805, "processed_size": 19805, "workflow_hash": "6a249f87d4e1e7ec4d0091894940bdfe" }, "workflow_hash": "6a249f87d4e1e7ec4d0091894940bdfe" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow builds an AI chatbot that can answer questions about data stored in a Google Sheet. It uses a language model and several tools to query the sheet and provide relevant information. Analyze this workflow: ```json { "meta": { "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "f3f7546a-8bb3-484c-b0a1-750a8d7d3a74", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 520 ], "parameters": { "color": 7, "width": 1549, "height": 612, "content": "### Sub-workflow: Custom tool\nThis can be called by the agent above. It returns three different types of data from the Google Sheet, which can be used together for more complex queries without returning the whole sheet (which might be too big for GPT to handle)" }, "typeVersion": 1 }, { "id": "a5afaa40-0b68-4d7c-8f78-5cb176fde81d", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 0, -40 ], "parameters": { "color": 7, "width": 1068, "height": 547, "content": "### Main workflow: AI agent using custom tool" }, "typeVersion": 1 }, { "id": "2dc0ce2f-a09c-4804-9962-f542ec78eb87", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -160, 40 ], "parameters": { "width": 185.9375, "height": 183.85014518022527, "content": "## Try me out\n\nClick the 'Chat' button at the bottom and enter:\n\n_Which is our biggest customer?_" }, "typeVersion": 1 }, { "id": "8fc97d52-1c18-47ed-ba6f-4c7c9ce8b7d4", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 480, 240 ], "parameters": { "color": 7, "width": 572, "height": 219, "content": "These tools all call the sub-workflow below" }, "typeVersion": 1 }, { "id": "60cafb69-818f-49fe-b75e-e770304a6aa9", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 260, 740 ], "parameters": { "width": 179.99762227826224, "height": 226.64416053838073, "content": "Change the URL of the Google Sheet here" }, "typeVersion": 1 }, { "id": "cd8d92fa-f7ef-47d8-a1a7-5b5aa6faaa96", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 120, 40 ], "webhookId": "7668b567-b983-479f-a3e0-ad945707ae6b", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "72ac3bdb-56dc-4634-a0ab-0b1c82e2b23d", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ 160, 320 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "credentials": { "openAiApi": { "id": "8gccIjcuf3gvaoEr", "name": "OpenAi account" } }, "typeVersion": 1.2 }, { "id": "37e5bca6-4274-4714-a9e7-a8e4b7d732e5", "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 340, 320 ], "parameters": {}, "typeVersion": 1.3 }, { "id": "81bf7de8-c4c6-49ce-a2cf-4afca5dce7e2", "name": "When Executed by Another Workflow", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 80, 800 ], "parameters": { "workflowInputs": { "values": [ { "name": "operation" }, { "name": "query" } ] } }, "typeVersion": 1.1 }, { "id": "24e5a49d-8f1f-4569-8072-c35f059ebd46", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 480, 40 ], "parameters": { "options": {} }, "typeVersion": 1.8 }, { "id": "8cc35cb9-3371-4034-86b6-3d125d70d81b", "name": "List columns tool", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 540, 320 ], "parameters": { "name": "list_columns", "workflowId": { "__rl": true, "mode": "id", "value": "={{ $workflow.id }}" }, "description": "List all column names in customer data\n\nCall this tool to find out what data is available for each customer. It should be called first at the beginning to understand which columns are available for querying.", "workflowInputs": { "value": { "query": "none", "operation": "column_names" }, "schema": [ { "id": "query", "type": "string", "display": true, "removed": false, "required": false, "displayName": "query", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "operation", "type": "string", "display": true, "removed": false, "required": false, "displayName": "operation", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [], "attemptToConvertTypes": false, "convertFieldsToString": false } }, "typeVersion": 2 }, { "id": "acf19978-dd84-4cfb-8034-eb9f14dd9c86", "name": "Get column values tool", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 720, 320 ], "parameters": { "name": "column_values", "workflowId": { "__rl": true, "mode": "id", "value": "={{ $workflow.id }}" }, "description": "Get the specified column value for all customers\n\nUse this tool to find out which customers have a certain value for a given column. Returns an array of JSON objects, one per customer. Each JSON object includes the column being requested plus the row_number column. Input should be a single string representing the name of the column to fetch.\n", "workflowInputs": { "value": { "query": "none", "operation": "column_values" }, "schema": [ { "id": "operation", "type": "string", "display": true, "removed": false, "required": false, "displayName": "operation", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "query", "type": "string", "display": true, "removed": false, "required": false, "displayName": "query", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [ "operation" ], "attemptToConvertTypes": false, "convertFieldsToString": false } }, "typeVersion": 2 }, { "id": "acd8dad6-2ce5-4a53-9909-da7bc03cf0e2", "name": "Get customer tool", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "position": [ 900, 320 ], "parameters": { "name": "get_customer", "workflowId": { "__rl": true, "mode": "id", "value": "={{ $workflow.id }}", "cachedResultName": "={{ $workflow.id }}" }, "description": "Get all columns for a given customer\n\nThe input should be a stringified row number of the customer to fetch; only single string inputs are allowed. Returns a JSON object with all the column names and their values.", "workflowInputs": { "value": { "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}", "operation": "row" }, "schema": [ { "id": "operation", "type": "string", "display": true, "removed": false, "required": false, "displayName": "operation", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "query", "type": "string", "display": true, "removed": false, "required": false, "displayName": "query", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "defineBelow", "matchingColumns": [ "operation" ], "attemptToConvertTypes": false, "convertFieldsToString": false } }, "typeVersion": 2 }, { "id": "43988dff-2270-4d09-a091-8b719c281faf", "name": "Set Google Sheet URL", "type": "n8n-nodes-base.set", "position": [ 300, 800 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "a96650f2-3a0c-45cb-afdd-ef7ca90b21cc", "name": "sheetUrl", "type": "string", "value": "https://docs.google.com/spreadsheets/d/1GjFBV8HpraNWG_JyuaQAgTb3zUGguh0S_25nO0CMd8A/edit#gid=736425281" } ] } }, "typeVersion": 3.4 }, { "id": "536225e9-e33c-4819-a2dc-994d8f7c3f30", "name": "Get Google sheet contents", "type": "n8n-nodes-base.googleSheets", "position": [ 520, 800 ], "parameters": { "options": {}, "sheetName": { "__rl": true, "mode": "name", "value": "customer_data" }, "documentId": { "__rl": true, "mode": "url", "value": "={{ $json.sheetUrl }}" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "XHvC7jIRR8A2TlUl", "name": "Google Sheets account" } }, "typeVersion": 4.5 }, { "id": "a5668364-8824-44cc-8a0f-516906d8f821", "name": "Check operation", "type": "n8n-nodes-base.switch", "position": [ 740, 800 ], "parameters": { "rules": { "values": [ { "outputKey": "Column Names", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "db07e0a3-0a1d-44bd-84a7-59a9442e63a6", "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ $('When Executed by Another Workflow').item.json.operation }}", "rightValue": "column_names"
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"f3f7546a-8bb3-484c-b0a1-750a8d7d3a74\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 0,\n 520\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1549,\n \"height\": 612,\n \"content\": \"### Sub-workflow: Custom tool\\nThis can be called by the agent above. It returns three different types of data from the Google Sheet, which can be used together for more complex queries without returning the whole sheet (which might be too big for GPT to handle)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5afaa40-0b68-4d7c-8f78-5cb176fde81d\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 0,\n -40\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1068,\n \"height\": 547,\n \"content\": \"### Main workflow: AI agent using custom tool\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2dc0ce2f-a09c-4804-9962-f542ec78eb87\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -160,\n 40\n ],\n \"parameters\": {\n \"width\": 185.9375,\n \"height\": 183.85014518022527,\n \"content\": \"## Try me out\\n\\nClick the 'Chat' button at the bottom and enter:\\n\\n_Which is our biggest customer?_\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8fc97d52-1c18-47ed-ba6f-4c7c9ce8b7d4\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 480,\n 240\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 572,\n \"height\": 219,\n \"content\": \"These tools all call the sub-workflow below\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"60cafb69-818f-49fe-b75e-e770304a6aa9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 260,\n 740\n ],\n \"parameters\": {\n \"width\": 179.99762227826224,\n \"height\": 226.64416053838073,\n \"content\": \"Change the URL of the Google Sheet here\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cd8d92fa-f7ef-47d8-a1a7-5b5aa6faaa96\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 120,\n 40\n ],\n \"webhookId\": \"7668b567-b983-479f-a3e0-ad945707ae6b\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"72ac3bdb-56dc-4634-a0ab-0b1c82e2b23d\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 160,\n 320\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"37e5bca6-4274-4714-a9e7-a8e4b7d732e5\",\n \"name\": \"Simple Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 340,\n 320\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"81bf7de8-c4c6-49ce-a2cf-4afca5dce7e2\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 80,\n 800\n ],\n \"parameters\": {\n \"workflowInputs\": {\n \"values\": [\n {\n \"name\": \"operation\"\n },\n {\n \"name\": \"query\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"24e5a49d-8f1f-4569-8072-c35f059ebd46\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 480,\n 40\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"8cc35cb9-3371-4034-86b6-3d125d70d81b\",\n \"name\": \"List columns tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 540,\n 320\n ],\n \"parameters\": {\n \"name\": \"list_columns\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n },\n \"description\": \"List all column names in customer data\\n\\nCall this tool to find out what data is available for each customer. It should be called first at the beginning to understand which columns are available for querying.\",\n \"workflowInputs\": {\n \"value\": {\n \"query\": \"none\",\n \"operation\": \"column_names\"\n },\n \"schema\": [\n {\n \"id\": \"query\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"query\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"operation\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"operation\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"acf19978-dd84-4cfb-8034-eb9f14dd9c86\",\n \"name\": \"Get column values tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 720,\n 320\n ],\n \"parameters\": {\n \"name\": \"column_values\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Get the specified column value for all customers\\n\\nUse this tool to find out which customers have a certain value for a given column. Returns an array of JSON objects, one per customer. Each JSON object includes the column being requested plus the row_number column. Input should be a single string representing the name of the column to fetch.\\n\",\n \"workflowInputs\": {\n \"value\": {\n \"query\": \"none\",\n \"operation\": \"column_values\"\n },\n \"schema\": [\n {\n \"id\": \"operation\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"operation\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"query\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"query\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"operation\"\n ],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"acd8dad6-2ce5-4a53-9909-da7bc03cf0e2\",\n \"name\": \"Get customer tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 900,\n 320\n ],\n \"parameters\": {\n \"name\": \"get_customer\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\",\n \"cachedResultName\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Get all columns for a given customer\\n\\nThe input should be a stringified row number of the customer to fetch; only single string inputs are allowed. Returns a JSON object with all the column names and their values.\",\n \"workflowInputs\": {\n \"value\": {\n \"query\": \"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}\",\n \"operation\": \"row\"\n },\n \"schema\": [\n {\n \"id\": \"operation\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"operation\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"query\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"query\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"operation\"\n ],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"43988dff-2270-4d09-a091-8b719c281faf\",\n \"name\": \"Set Google Sheet URL\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 300,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"a96650f2-3a0c-45cb-afdd-ef7ca90b21cc\",\n \"name\": \"sheetUrl\",\n \"type\": \"string\",\n \"value\": \"https://docs.google.com/spreadsheets/d/1GjFBV8HpraNWG_JyuaQAgTb3zUGguh0S_25nO0CMd8A/edit#gid=736425281\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"536225e9-e33c-4819-a2dc-994d8f7c3f30\",\n \"name\": \"Get Google sheet contents\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 520,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"customer_data\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"={{ $json.sheetUrl }}\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"a5668364-8824-44cc-8a0f-516906d8f821\",\n \"name\": \"Check operation\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 740,\n 800\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Column Names\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"db07e0a3-0a1d-44bd-84a7-59a9442e63a6\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $('When Executed by Another Workflow').item.json.operation }}\",\n \"rightValue\": \"column_names\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Column Values\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"96c82351-de4a-4299-903d-8b9b3a3bb931\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $('When Executed by Another Workflow').item.json.operation }}\",\n \"rightValue\": \"column_values\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Rows\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"fbc2afd0-361f-4181-94e3-4addc65a9086\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $('When Executed by Another Workflow').item.json.operation }}\",\n \"rightValue\": \"row\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"46c3a8c4-ffaf-4373-b421-4d7ee65567b2\",\n \"name\": \"Get column names\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1040,\n 620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"36a7be13-e792-4c0a-9997-f61fe2a7b225\",\n \"name\": \"response\",\n \"type\": \"array\",\n \"value\": \"={{ Object.keys($json) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"190c48e8-4d4b-4e95-a694-49ab76b730da\",\n \"name\": \"Prepare column data\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1040,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"bcb75b32-3253-4a31-9771-4faaf12cc2ed\",\n \"name\": \"row_number\",\n \"type\": \"number\",\n \"value\": \"={{ $json.row_number }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9c65e5e6-a3ac-4ed7-8546-b7f2b09b4f96\",\n \"name\": \"Filter\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1040,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"dbe89d36-e411-4765-8d4e-91a6425350ac\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.row_number.toString() }}\",\n \"rightValue\": \"={{ $('When Executed by Another Workflow').item.json.query }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"39265f3e-a2ea-4174-952a-3665747ff856\",\n \"name\": \"Prepare output\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1340,\n 800\n ],\n \"parameters\": {\n \"jsCode\": \"return {\\n 'response': JSON.stringify($input.all().map(x => x.json))\\n}\"\n },\n \"executeOnce\": true,\n \"typeVersion\": 2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Filter\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simple Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check operation\": {\n \"main\": [\n [\n {\n \"node\": \"Get column names\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Prepare column data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Filter\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get column names\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get customer tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"List columns tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prepare column data\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Google Sheet URL\": {\n \"main\": [\n [\n {\n \"node\": \"Get Google sheet contents\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get column values tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Google sheet contents\": {\n \"main\": [\n [\n {\n \"node\": \"Check operation\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Set Google Sheet URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
46
0
2
true
combined_workflows.json
{ "input": "This workflow builds an AI chatbot that can answer questions about data stored in a Google Sheet. It uses a language model and several tools to query the sheet and provide relevant information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11770, "processed_size": 11770, "processed_timestamp": "2025-04-09T03:08:39.048357", "timestamp": "2025-04-09T02:36:39.171763", "token_count": 4095, "tokens": 1131, "workflow_chunk_info": { "is_truncated": false, "original_size": 11770, "processed_size": 11770, "workflow_hash": "ca5b893b42034b709c6a0a3b60b97e6f" }, "workflow_hash": "ca5b893b42034b709c6a0a3b60b97e6f" }
{ "outputKey": "Column Names", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "db07e0a3-0a1d-44bd-84a7-59a9442e63a6", "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ $('When Executed by Another Workflow').item.json.operation }}", "rightValue": "column_names" } ] }, "renameOutput": true }, { "outputKey": "Column Values", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "96c82351-de4a-4299-903d-8b9b3a3bb931", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $('When Executed by Another Workflow').item.json.operation }}", "rightValue": "column_values" } ] }, "renameOutput": true }, { "outputKey": "Rows", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "fbc2afd0-361f-4181-94e3-4addc65a9086", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $('When Executed by Another Workflow').item.json.operation }}", "rightValue": "row" } ] }, "renameOutput": true } ] }, "options": {} }, "typeVersion": 3.2 }, { "id": "46c3a8c4-ffaf-4373-b421-4d7ee65567b2", "name": "Get column names", "type": "n8n-nodes-base.set", "position": [ 1040, 620 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "36a7be13-e792-4c0a-9997-f61fe2a7b225", "name": "response", "type": "array", "value": "={{ Object.keys($json) }}" } ] } }, "typeVersion": 3.4 }, { "id": "190c48e8-4d4b-4e95-a694-49ab76b730da", "name": "Prepare column data", "type": "n8n-nodes-base.set", "position": [ 1040, 800 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "bcb75b32-3253-4a31-9771-4faaf12cc2ed", "name": "row_number", "type": "number", "value": "={{ $json.row_number }}" } ] } }, "typeVersion": 3.4 }, { "id": "9c65e5e6-a3ac-4ed7-8546-b7f2b09b4f96", "name": "Filter", "type": "n8n-nodes-base.filter", "position": [ 1040, 980 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "dbe89d36-e411-4765-8d4e-91a6425350ac", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $json.row_number.toString() }}", "rightValue": "={{ $('When Executed by Another Workflow').item.json.query }}" } ] } }, "typeVersion": 2.2 }, { "id": "39265f3e-a2ea-4174-952a-3665747ff856", "name": "Prepare output", "type": "n8n-nodes-base.code", "position": [ 1340, 800 ], "parameters": { "jsCode": "return {\n 'response': JSON.stringify($input.all().map(x => x.json))\n}" }, "executeOnce": true, "typeVersion": 2 } ], "pinData": {}, "connections": { "Filter": { "main": [ [ { "node": "Prepare output", "type": "main", "index": 0 } ] ] }, "Simple Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Check operation": { "main": [ [ { "node": "Get column names", "type": "main", "index": 0 } ], [ { "node": "Prepare column data", "type": "main", "index": 0 } ], [ { "node": "Filter", "type": "main", "index": 0 } ] ] }, "Get column names": { "main": [ [ { "node": "Prepare output", "type": "main", "index": 0 } ] ] }, "Get customer tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "List columns tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Prepare column data": { "main": [ [ { "node": "Prepare output", "type": "main", "index": 0 } ] ] }, "Set Google Sheet URL": { "main": [ [ { "node": "Get Google sheet contents", "type": "main", "index": 0 } ] ] }, "Get column values tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Get Google sheet contents": { "main": [ [ { "node": "Check operation", "type": "main", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "When Executed by Another Workflow": { "main": [ [ { "node": "Set Google Sheet URL", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"f3f7546a-8bb3-484c-b0a1-750a8d7d3a74\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 0,\n 520\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1549,\n \"height\": 612,\n \"content\": \"### Sub-workflow: Custom tool\\nThis can be called by the agent above. It returns three different types of data from the Google Sheet, which can be used together for more complex queries without returning the whole sheet (which might be too big for GPT to handle)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5afaa40-0b68-4d7c-8f78-5cb176fde81d\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 0,\n -40\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1068,\n \"height\": 547,\n \"content\": \"### Main workflow: AI agent using custom tool\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2dc0ce2f-a09c-4804-9962-f542ec78eb87\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -160,\n 40\n ],\n \"parameters\": {\n \"width\": 185.9375,\n \"height\": 183.85014518022527,\n \"content\": \"## Try me out\\n\\nClick the 'Chat' button at the bottom and enter:\\n\\n_Which is our biggest customer?_\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8fc97d52-1c18-47ed-ba6f-4c7c9ce8b7d4\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 480,\n 240\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 572,\n \"height\": 219,\n \"content\": \"These tools all call the sub-workflow below\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"60cafb69-818f-49fe-b75e-e770304a6aa9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 260,\n 740\n ],\n \"parameters\": {\n \"width\": 179.99762227826224,\n \"height\": 226.64416053838073,\n \"content\": \"Change the URL of the Google Sheet here\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cd8d92fa-f7ef-47d8-a1a7-5b5aa6faaa96\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n 120,\n 40\n ],\n \"webhookId\": \"7668b567-b983-479f-a3e0-ad945707ae6b\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"72ac3bdb-56dc-4634-a0ab-0b1c82e2b23d\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n 160,\n 320\n ],\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"8gccIjcuf3gvaoEr\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"37e5bca6-4274-4714-a9e7-a8e4b7d732e5\",\n \"name\": \"Simple Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n 340,\n 320\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"81bf7de8-c4c6-49ce-a2cf-4afca5dce7e2\",\n \"name\": \"When Executed by Another Workflow\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n 80,\n 800\n ],\n \"parameters\": {\n \"workflowInputs\": {\n \"values\": [\n {\n \"name\": \"operation\"\n },\n {\n \"name\": \"query\"\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"24e5a49d-8f1f-4569-8072-c35f059ebd46\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n 480,\n 40\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.8\n },\n {\n \"id\": \"8cc35cb9-3371-4034-86b6-3d125d70d81b\",\n \"name\": \"List columns tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 540,\n 320\n ],\n \"parameters\": {\n \"name\": \"list_columns\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n },\n \"description\": \"List all column names in customer data\\n\\nCall this tool to find out what data is available for each customer. It should be called first at the beginning to understand which columns are available for querying.\",\n \"workflowInputs\": {\n \"value\": {\n \"query\": \"none\",\n \"operation\": \"column_names\"\n },\n \"schema\": [\n {\n \"id\": \"query\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"query\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"operation\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"operation\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"acf19978-dd84-4cfb-8034-eb9f14dd9c86\",\n \"name\": \"Get column values tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 720,\n 320\n ],\n \"parameters\": {\n \"name\": \"column_values\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Get the specified column value for all customers\\n\\nUse this tool to find out which customers have a certain value for a given column. Returns an array of JSON objects, one per customer. Each JSON object includes the column being requested plus the row_number column. Input should be a single string representing the name of the column to fetch.\\n\",\n \"workflowInputs\": {\n \"value\": {\n \"query\": \"none\",\n \"operation\": \"column_values\"\n },\n \"schema\": [\n {\n \"id\": \"operation\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"operation\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"query\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"query\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"operation\"\n ],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"acd8dad6-2ce5-4a53-9909-da7bc03cf0e2\",\n \"name\": \"Get customer tool\",\n \"type\": \"@n8n/n8n-nodes-langchain.toolWorkflow\",\n \"position\": [\n 900,\n 320\n ],\n \"parameters\": {\n \"name\": \"get_customer\",\n \"workflowId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $workflow.id }}\",\n \"cachedResultName\": \"={{ $workflow.id }}\"\n },\n \"description\": \"Get all columns for a given customer\\n\\nThe input should be a stringified row number of the customer to fetch; only single string inputs are allowed. Returns a JSON object with all the column names and their values.\",\n \"workflowInputs\": {\n \"value\": {\n \"query\": \"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}\",\n \"operation\": \"row\"\n },\n \"schema\": [\n {\n \"id\": \"operation\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"operation\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n },\n {\n \"id\": \"query\",\n \"type\": \"string\",\n \"display\": true,\n \"removed\": false,\n \"required\": false,\n \"displayName\": \"query\",\n \"defaultMatch\": false,\n \"canBeUsedToMatch\": true\n }\n ],\n \"mappingMode\": \"defineBelow\",\n \"matchingColumns\": [\n \"operation\"\n ],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"43988dff-2270-4d09-a091-8b719c281faf\",\n \"name\": \"Set Google Sheet URL\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 300,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"a96650f2-3a0c-45cb-afdd-ef7ca90b21cc\",\n \"name\": \"sheetUrl\",\n \"type\": \"string\",\n \"value\": \"https://docs.google.com/spreadsheets/d/1GjFBV8HpraNWG_JyuaQAgTb3zUGguh0S_25nO0CMd8A/edit#gid=736425281\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"536225e9-e33c-4819-a2dc-994d8f7c3f30\",\n \"name\": \"Get Google sheet contents\",\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"position\": [\n 520,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"sheetName\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"customer_data\"\n },\n \"documentId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"={{ $json.sheetUrl }}\"\n }\n },\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"XHvC7jIRR8A2TlUl\",\n \"name\": \"Google Sheets account\"\n }\n },\n \"typeVersion\": 4.5\n },\n {\n \"id\": \"a5668364-8824-44cc-8a0f-516906d8f821\",\n \"name\": \"Check operation\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 740,\n 800\n ],\n \"parameters\": {\n \"rules\": {\n \"values\": [\n {\n \"outputKey\": \"Column Names\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"db07e0a3-0a1d-44bd-84a7-59a9442e63a6\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $('When Executed by Another Workflow').item.json.operation }}\",\n \"rightValue\": \"column_names\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Column Values\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"96c82351-de4a-4299-903d-8b9b3a3bb931\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $('When Executed by Another Workflow').item.json.operation }}\",\n \"rightValue\": \"column_values\"\n }\n ]\n },\n \"renameOutput\": true\n },\n {\n \"outputKey\": \"Rows\",\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"fbc2afd0-361f-4181-94e3-4addc65a9086\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $('When Executed by Another Workflow').item.json.operation }}\",\n \"rightValue\": \"row\"\n }\n ]\n },\n \"renameOutput\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 3.2\n },\n {\n \"id\": \"46c3a8c4-ffaf-4373-b421-4d7ee65567b2\",\n \"name\": \"Get column names\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1040,\n 620\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"36a7be13-e792-4c0a-9997-f61fe2a7b225\",\n \"name\": \"response\",\n \"type\": \"array\",\n \"value\": \"={{ Object.keys($json) }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"190c48e8-4d4b-4e95-a694-49ab76b730da\",\n \"name\": \"Prepare column data\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 1040,\n 800\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"bcb75b32-3253-4a31-9771-4faaf12cc2ed\",\n \"name\": \"row_number\",\n \"type\": \"number\",\n \"value\": \"={{ $json.row_number }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"9c65e5e6-a3ac-4ed7-8546-b7f2b09b4f96\",\n \"name\": \"Filter\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1040,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"dbe89d36-e411-4765-8d4e-91a6425350ac\",\n \"operator\": {\n \"name\": \"filter.operator.equals\",\n \"type\": \"string\",\n \"operation\": \"equals\"\n },\n \"leftValue\": \"={{ $json.row_number.toString() }}\",\n \"rightValue\": \"={{ $('When Executed by Another Workflow').item.json.query }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"39265f3e-a2ea-4174-952a-3665747ff856\",\n \"name\": \"Prepare output\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1340,\n 800\n ],\n \"parameters\": {\n \"jsCode\": \"return {\\n 'response': JSON.stringify($input.all().map(x => x.json))\\n}\"\n },\n \"executeOnce\": true,\n \"typeVersion\": 2\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Filter\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Simple Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check operation\": {\n \"main\": [\n [\n {\n \"node\": \"Get column names\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Prepare column data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Filter\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get column names\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get customer tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"List columns tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prepare column data\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare output\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Google Sheet URL\": {\n \"main\": [\n [\n {\n \"node\": \"Get Google sheet contents\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get column values tool\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Google sheet contents\": {\n \"main\": [\n [\n {\n \"node\": \"Check operation\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Set Google Sheet URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
46
1
2
true
combined_workflows.json
{ "input": "This workflow builds an AI chatbot that can answer questions about data stored in a Google Sheet. It uses a language model and several tools to query the sheet and provide relevant information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11770, "processed_size": 11770, "processed_timestamp": "2025-04-09T03:08:39.056393", "timestamp": "2025-04-09T02:36:39.171763", "token_count": 2509, "tokens": 1131, "workflow_chunk_info": { "is_truncated": false, "original_size": 11770, "processed_size": 11770, "workflow_hash": "ca5b893b42034b709c6a0a3b60b97e6f" }, "workflow_hash": "ca5b893b42034b709c6a0a3b60b97e6f" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow implements an OpenID Connect (OIDC) client, handling user authentication and retrieving user information via a web application. Analyze this workflow: ```json { "id": "zeyTmqqmXaQIFWzV", "meta": { "instanceId": "11f0bca80fdd47e21bd156f4266eada6e64a6bc4c37f34dc8ae14ccf768e9285" }, "name": "OIDC client workflow", "tags": [], "nodes": [ { "id": "da0c6b83-9c8c-431b-beaa-66b5343b21c5", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 80, 680 ], "webhookId": "891ad1cd-6a50-4a88-8789-95680c78f14c", "parameters": { "path": "891ad1cd-6a50-4a88-8789-95680c78f14c", "options": {}, "responseMode": "responseNode" }, "typeVersion": 1 }, { "id": "5c9d4f59-7980-4bee-8df6-cf9ca3eccde1", "name": "Code", "type": "n8n-nodes-base.code", "position": [ 520, 680 ], "parameters": { "jsCode": "let myCookies = {};\nlet cookies = [];\n\ncookies = $input.item.json.headers.cookie.split(';')\nfor (item of cookies ) {\n myCookies[item.split('=')[0].trim()]=item.split('=')[1].trim();\n}\n\nreturn myCookies;" }, "typeVersion": 2, "continueOnFail": true }, { "id": "7867d061-c0e3-4359-90ac-a4536c948db2", "name": "user info", "type": "n8n-nodes-base.httpRequest", "position": [ 1220, 760 ], "parameters": { "url": "={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.userinfo_endpoint }}", "options": {}, "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Authorization", "value": "=Bearer {{ $json['access_token'] }}" } ] } }, "typeVersion": 4.1, "continueOnFail": true }, { "id": "df0e9896-0670-49cc-b7c6-140c234036b4", "name": "send back login page", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1900, 980 ], "parameters": { "options": {}, "respondWith": "text", "responseBody": "={{ $json.html }}" }, "typeVersion": 1 }, { "id": "81f03c86-91fe-4960-b4c4-295252c7e8fc", "name": "IF token is present", "type": "n8n-nodes-base.if", "position": [ 940, 820 ], "parameters": { "conditions": { "number": [ { "value1": "={{ $json['access_token'] }}", "operation": "isNotEmpty" } ] } }, "typeVersion": 1, "continueOnFail": true }, { "id": "5e2f87bd-9c1f-4e87-82df-1b3b3e98cbdb", "name": "Welcome page", "type": "n8n-nodes-base.html", "position": [ 1720, 660 ], "parameters": { "html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n <title>My HTML document</title>\n</head>\n<body>\n <div class=\"container\">\n <h1>Welcome {{$('user info').item.json.email }} </h1>\n </div>\n</body>\n</html>\n\n<style>\n.container {\n background-color: #ffffff;\n text-align: center;\n padding: 16px;\n border-radius: 8px;\n}\n\nh1 {\n color: #ff6d5a;\n font-size: 24px;\n font-weight: bold;\n padding: 8px;\n}\n\nh2 {\n color: #909399;\n font-size: 18px;\n font-weight: bold;\n padding: 8px;\n}\n</style>\n" }, "typeVersion": 1 }, { "id": "c1448e12-4292-402b-bf9d-0ab555bbc734", "name": "send back welcome page", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1920, 660 ], "parameters": { "options": {}, "respondWith": "text", "responseBody": "={{ $json.html }}" }, "typeVersion": 1 }, { "id": "8e64ab13-4f23-4c85-a625-c456910a9472", "name": "IF user info ok", "type": "n8n-nodes-base.if", "position": [ 1400, 760 ], "parameters": { "conditions": { "number": [ { "value1": "={{ $json.email }}", "operation": "isNotEmpty" } ] } }, "typeVersion": 1, "continueOnFail": true }, { "id": "a96b170f-fbd8-4061-9619-bf9877e85495", "name": "login form", "type": "n8n-nodes-base.html", "position": [ 1700, 980 ], "parameters": { "html": "<!-- Thanks to https://github.com/curityio/pkce-javascript-example/tree/master -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Login</title>\n </head>\n <style>\n.container {\n background-color: #ffffff;\n text-align: center;\n padding: 16px;\n border-radius: 8px;\n}\n\nh1 {\n color: #ff6d5a;\n font-size: 24px;\n font-weight: bold;\n padding: 8px;\n}\n\nh2 {\n color: #909399;\n font-size: 18px;\n font-weight: bold;\n padding: 8px;\n}\n</style>\n <body>\n <div id=\"result\"></div>\n <script>\n const authorizeEndpoint = \"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.auth_endpoint }}\";\n const tokenEndpoint = \"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.token_endpoint }}\";\n const clientId = \"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_id }}\";\n const scope = \"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.scope }}\";\n const usePKCE = {{ $('Set variables : auth, token, userinfo, client id, scope').item.json.PKCE }};\n if (window.location.search) {\n var args = new URLSearchParams(window.location.search);\n var code = args.get(\"code\");\n\n if (code) {\n var xhr = new XMLHttpRequest();\n\n xhr.onload = function() {\n var response = xhr.response;\n var message;\n\n if (xhr.status == 200) {\n message = \"Access Token: \" + response.access_token;\n document.cookie = \"access_token=\"+response.access_token;\n location.reload();\n }\n else {\n message = \"Error: \" + response.error_description + \" (\" + response.error + \")\";\n }\n\n document.getElementById(\"result\").innerHTML = message;\n };\n xhr.responseType = 'json';\n xhr.open(\"POST\", tokenEndpoint, true);\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n xhr.send(new URLSearchParams({\n client_id: clientId,\n code_verifier: window.sessionStorage.getItem(\"code_verifier\"),\n grant_type: \"authorization_code\",\n redirect_uri: location.href.replace(location.search, ''),\n code: code\n }));\n }\n }\n async function generateCodeChallenge(codeVerifier) {\n var digest = await crypto.subtle.digest(\"SHA-256\",\n new TextEncoder().encode(codeVerifier));\n\n return btoa(String.fromCharCode(...new Uint8Array(digest)))\n .replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_')\n }\n\n function generateRandomString(length) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n if (!crypto.subtle) {\n document.writeln('<p>' +\n '<b>WARNING:</b> The script will fall back to using plain code challenge as crypto is not available.</p>' +\n '<p>Javascript crypto services require that this site is served in a <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts\">secure context</a>; ' +\n 'either from <b>(*.)localhost</b> or via <b>https</b>. </p>' +\n '<p> You can add an entry to /etc/hosts like \"127.0.0.1 public-test-client.localhost\" and reload the site from there, enable SSL using something like <a href=\"https://letsencrypt.org/\">letsencypt</a>, or refer to this <a href=\"https://stackoverflow.com/questions/46468104/how-to-use-subtlecrypto-in-chrome-window-crypto-subtle-is-undefined\">stackoverflow article</a> for more alternatives.</p>' +\n '<p>If Javascript crypto is available this message will disappear.</p>')\n }\n\n var codeVerifier = generateRandomString(64);\n\n const challengeMethod = crypto.subtle ? \"S256\" : \"plain\"\n\n Promise.resolve()\n .then(() => {\n if (challengeMethod === 'S256') {\n return generateCodeChallenge(codeVerifier)\n } else {\n return codeVerifier\n }\n })\n .then(function(codeChallenge) {\n window.sessionStorage.setItem(\"code_verifier\", codeVerifier);\n\n var redirectUri = window.location.href.split('?')[0];\n var args = new URLSearchParams({\n response_type: \"code\",\n client_id: clientId,\n redirect_uri: redirectUri,\n scope: scope,\n state: generateRandomString(16)\n });\n if(usePKCE){\n args.append(\"code_challenge_method\", challengeMethod);\n args.append(\"code_challenge\", codeChallenge);\n }\n window.location = authorizeEndpoint + \"?\" + args;\n });\n </script>\n </body>\n</html>" }, "typeVersion": 1 }, { "id": "12395c64-1c9d-4801-8229-57d982e4243f", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 120, 460 ], "parameters": { "width": 510, "height": 207, "content": "In this set, you have to retrieve from your identity provider : \n- auth url\n- token url\n- userinfo url\n- the client id you created for this flow\n- scopes to use, at least \"openid\" scope\nif you do not want to use PKCE, you have to fill : \n- client_secret\n- redirect_uri (which is the webhook uri)" }, "typeVersion": 1 }, { "id": "25e934b5-fcd6-49e1-bb33-955b5f3f34ca", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1640, 480 ], "parameters": { "content": "At this point the user is authenticated, you have access to his profile from the user info result and you continue doing things" }, "typeVersion": 1 }, { "id": "9dab372a-3505-4be6-93bd-9e99fc71612c", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 460, 980 ], "parameters": { "width": 776, "height": 336, "content": "## Quick setup
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"zeyTmqqmXaQIFWzV\",\n \"meta\": {\n \"instanceId\": \"11f0bca80fdd47e21bd156f4266eada6e64a6bc4c37f34dc8ae14ccf768e9285\"\n },\n \"name\": \"OIDC client workflow\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"da0c6b83-9c8c-431b-beaa-66b5343b21c5\",\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 80,\n 680\n ],\n \"webhookId\": \"891ad1cd-6a50-4a88-8789-95680c78f14c\",\n \"parameters\": {\n \"path\": \"891ad1cd-6a50-4a88-8789-95680c78f14c\",\n \"options\": {},\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c9d4f59-7980-4bee-8df6-cf9ca3eccde1\",\n \"name\": \"Code\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 520,\n 680\n ],\n \"parameters\": {\n \"jsCode\": \"let myCookies = {};\\nlet cookies = [];\\n\\ncookies = $input.item.json.headers.cookie.split(';')\\nfor (item of cookies ) {\\n myCookies[item.split('=')[0].trim()]=item.split('=')[1].trim();\\n}\\n\\nreturn myCookies;\"\n },\n \"typeVersion\": 2,\n \"continueOnFail\": true\n },\n {\n \"id\": \"7867d061-c0e3-4359-90ac-a4536c948db2\",\n \"name\": \"user info\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1220,\n 760\n ],\n \"parameters\": {\n \"url\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.userinfo_endpoint }}\",\n \"options\": {},\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"=Bearer {{ $json['access_token'] }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"df0e9896-0670-49cc-b7c6-140c234036b4\",\n \"name\": \"send back login page\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1900,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"={{ $json.html }}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"81f03c86-91fe-4960-b4c4-295252c7e8fc\",\n \"name\": \"IF token is present\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 940,\n 820\n ],\n \"parameters\": {\n \"conditions\": {\n \"number\": [\n {\n \"value1\": \"={{ $json['access_token'] }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"5e2f87bd-9c1f-4e87-82df-1b3b3e98cbdb\",\n \"name\": \"Welcome page\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n 1720,\n 660\n ],\n \"parameters\": {\n \"html\": \"<!DOCTYPE html>\\n\\n<html>\\n<head>\\n <meta charset=\\\"UTF-8\\\" />\\n <title>My HTML document</title>\\n</head>\\n<body>\\n <div class=\\\"container\\\">\\n <h1>Welcome {{$('user info').item.json.email }} </h1>\\n </div>\\n</body>\\n</html>\\n\\n<style>\\n.container {\\n background-color: #ffffff;\\n text-align: center;\\n padding: 16px;\\n border-radius: 8px;\\n}\\n\\nh1 {\\n color: #ff6d5a;\\n font-size: 24px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n\\nh2 {\\n color: #909399;\\n font-size: 18px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n</style>\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1448e12-4292-402b-bf9d-0ab555bbc734\",\n \"name\": \"send back welcome page\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1920,\n 660\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"={{ $json.html }}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8e64ab13-4f23-4c85-a625-c456910a9472\",\n \"name\": \"IF user info ok\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1400,\n 760\n ],\n \"parameters\": {\n \"conditions\": {\n \"number\": [\n {\n \"value1\": \"={{ $json.email }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"a96b170f-fbd8-4061-9619-bf9877e85495\",\n \"name\": \"login form\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n 1700,\n 980\n ],\n \"parameters\": {\n \"html\": \"<!-- Thanks to https://github.com/curityio/pkce-javascript-example/tree/master -->\\n<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n <head>\\n <meta charset=\\\"utf-8\\\">\\n <title>Login</title>\\n </head>\\n <style>\\n.container {\\n background-color: #ffffff;\\n text-align: center;\\n padding: 16px;\\n border-radius: 8px;\\n}\\n\\nh1 {\\n color: #ff6d5a;\\n font-size: 24px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n\\nh2 {\\n color: #909399;\\n font-size: 18px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n</style>\\n <body>\\n <div id=\\\"result\\\"></div>\\n <script>\\n const authorizeEndpoint = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.auth_endpoint }}\\\";\\n const tokenEndpoint = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.token_endpoint }}\\\";\\n const clientId = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_id }}\\\";\\n const scope = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.scope }}\\\";\\n const usePKCE = {{ $('Set variables : auth, token, userinfo, client id, scope').item.json.PKCE }};\\n if (window.location.search) {\\n var args = new URLSearchParams(window.location.search);\\n var code = args.get(\\\"code\\\");\\n\\n if (code) {\\n var xhr = new XMLHttpRequest();\\n\\n xhr.onload = function() {\\n var response = xhr.response;\\n var message;\\n\\n if (xhr.status == 200) {\\n message = \\\"Access Token: \\\" + response.access_token;\\n document.cookie = \\\"access_token=\\\"+response.access_token;\\n location.reload();\\n }\\n else {\\n message = \\\"Error: \\\" + response.error_description + \\\" (\\\" + response.error + \\\")\\\";\\n }\\n\\n document.getElementById(\\\"result\\\").innerHTML = message;\\n };\\n xhr.responseType = 'json';\\n xhr.open(\\\"POST\\\", tokenEndpoint, true);\\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\\n xhr.send(new URLSearchParams({\\n client_id: clientId,\\n code_verifier: window.sessionStorage.getItem(\\\"code_verifier\\\"),\\n grant_type: \\\"authorization_code\\\",\\n redirect_uri: location.href.replace(location.search, ''),\\n code: code\\n }));\\n }\\n }\\n async function generateCodeChallenge(codeVerifier) {\\n var digest = await crypto.subtle.digest(\\\"SHA-256\\\",\\n new TextEncoder().encode(codeVerifier));\\n\\n return btoa(String.fromCharCode(...new Uint8Array(digest)))\\n .replace(/=/g, '').replace(/\\\\+/g, '-').replace(/\\\\//g, '_')\\n }\\n\\n function generateRandomString(length) {\\n var text = \\\"\\\";\\n var possible = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\";\\n\\n for (var i = 0; i < length; i++) {\\n text += possible.charAt(Math.floor(Math.random() * possible.length));\\n }\\n\\n return text;\\n }\\n\\n if (!crypto.subtle) {\\n document.writeln('<p>' +\\n '<b>WARNING:</b> The script will fall back to using plain code challenge as crypto is not available.</p>' +\\n '<p>Javascript crypto services require that this site is served in a <a href=\\\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts\\\">secure context</a>; ' +\\n 'either from <b>(*.)localhost</b> or via <b>https</b>. </p>' +\\n '<p> You can add an entry to /etc/hosts like \\\"127.0.0.1 public-test-client.localhost\\\" and reload the site from there, enable SSL using something like <a href=\\\"https://letsencrypt.org/\\\">letsencypt</a>, or refer to this <a href=\\\"https://stackoverflow.com/questions/46468104/how-to-use-subtlecrypto-in-chrome-window-crypto-subtle-is-undefined\\\">stackoverflow article</a> for more alternatives.</p>' +\\n '<p>If Javascript crypto is available this message will disappear.</p>')\\n }\\n\\n var codeVerifier = generateRandomString(64);\\n\\n const challengeMethod = crypto.subtle ? \\\"S256\\\" : \\\"plain\\\"\\n\\n Promise.resolve()\\n .then(() => {\\n if (challengeMethod === 'S256') {\\n return generateCodeChallenge(codeVerifier)\\n } else {\\n return codeVerifier\\n }\\n })\\n .then(function(codeChallenge) {\\n window.sessionStorage.setItem(\\\"code_verifier\\\", codeVerifier);\\n\\n var redirectUri = window.location.href.split('?')[0];\\n var args = new URLSearchParams({\\n response_type: \\\"code\\\",\\n client_id: clientId,\\n redirect_uri: redirectUri,\\n scope: scope,\\n state: generateRandomString(16)\\n });\\n if(usePKCE){\\n args.append(\\\"code_challenge_method\\\", challengeMethod);\\n args.append(\\\"code_challenge\\\", codeChallenge);\\n }\\n window.location = authorizeEndpoint + \\\"?\\\" + args;\\n });\\n </script>\\n </body>\\n</html>\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"12395c64-1c9d-4801-8229-57d982e4243f\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 460\n ],\n \"parameters\": {\n \"width\": 510,\n \"height\": 207,\n \"content\": \"In this set, you have to retrieve from your identity provider : \\n- auth url\\n- token url\\n- userinfo url\\n- the client id you created for this flow\\n- scopes to use, at least \\\"openid\\\" scope\\nif you do not want to use PKCE, you have to fill : \\n- client_secret\\n- redirect_uri (which is the webhook uri)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"25e934b5-fcd6-49e1-bb33-955b5f3f34ca\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1640,\n 480\n ],\n \"parameters\": {\n \"content\": \"At this point the user is authenticated, you have access to his profile from the user info result and you continue doing things\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9dab372a-3505-4be6-93bd-9e99fc71612c\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 980\n ],\n \"parameters\": {\n \"width\": 776,\n \"height\": 336,\n \"content\": \"## Quick setup with Keycloak\\n1. Open your Keycloak\\n2. Go to `Realm settings` and opn `OpenID Endpoint Configuration`\\n3. This will opene a new tab. Copy out the `authorization_endpoint`, `token_endpoint` and the `userinfo_endpoint` and add it to the `Set variables` node\\n4. Go go `Clients` and click `Create client`. In there pick a name of choice.\\n5. Go to the next step, `Capability config`, disable `Client authentication`. Only `Standard flow` should be checked.\\n6. Go to the next step `Login settings`. In there copy the Webhook URL of this workflow into the `Valid redirect URIs` field\\n7. Enter the clientID to the `Set variables` node\\n\\nNow you can activate the workflow and visit the webhook URL to test. You can find a more detailed setup guid in the description.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e3afc62-52a9-402a-bde9-e8798d0fd4f6\",\n \"name\": \"Set variables : auth, token, userinfo, client id, scope\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 320,\n 680\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"auth_endpoint\",\n \"value\": \"Your value here\"\n },\n {\n \"name\": \"token_endpoint\",\n \"value\": \"Your value here\"\n },\n {\n \"name\": \"userinfo_endpoint\",\n \"value\": \"Your value here\"\n },\n {\n \"name\": \"client_id\",\n \"value\": \"name of your client\"\n },\n {\n \"name\": \"scope\",\n \"value\": \"openid\"\n },\n {\n \"name\": \"redirect_uri\",\n \"value\": \"webhook uri\"\n },\n {\n \"name\": \"client_secret\",\n \"value\": \"secret of your client\"\n }\n ],\n \"boolean\": [\n {\n \"name\": \"PKCE\",\n \"value\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"2d54c64a-ae45-480f-923f-63d6cb3fcdfc\",\n \"name\": \"IF we have code in URI and not in PKCE mode\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 700,\n 680\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $('Webhook').item.json.query.code }}\",\n \"operation\": \"isNotEmpty\"\n }\n ],\n \"boolean\": [\n {\n \"value1\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.PKCE }}\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"99c8fa5d-3173-4371-9742-6014eca6e7fe\",\n \"name\": \"get access_token from /token endpoint with code\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 940,\n 640\n ],\n \"parameters\": {\n \"url\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.token_endpoint }}\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"contentType\": \"form-urlencoded\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"grant_type\",\n \"value\": \"authorization_code\"\n },\n {\n \"name\": \"client_id\",\n \"value\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_id }}\"\n },\n {\n \"name\": \"client_secret\",\n \"value\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_secret }}\"\n },\n {\n \"name\": \"code\",\n \"value\": \"={{ $('Webhook').item.json.query.code }}\"\n },\n {\n \"name\": \"redirect_uri\",\n \"value\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.redirect_uri }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"d91ac207-6f83-42cd-9c9f-326b8c53c160\",\n \"connections\": {\n \"Code\": {\n \"main\": [\n [\n {\n \"node\": \"IF we have code in URI and not in PKCE mode\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Set variables : auth, token, userinfo, client id, scope\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"user info\": {\n \"main\": [\n [\n {\n \"node\": \"IF user info ok\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"login form\": {\n \"main\": [\n [\n {\n \"node\": \"send back login page\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Welcome page\": {\n \"main\": [\n [\n {\n \"node\": \"send back welcome page\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF user info ok\": {\n \"main\": [\n [\n {\n \"node\": \"Welcome page\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"login form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF token is present\": {\n \"main\": [\n [\n {\n \"node\": \"user info\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"login form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF we have code in URI and not in PKCE mode\": {\n \"main\": [\n [\n {\n \"node\": \"get access_token from /token endpoint with code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"IF token is present\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get access_token from /token endpoint with code\": {\n \"main\": [\n [\n {\n \"node\": \"user info\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set variables : auth, token, userinfo, client id, scope\": {\n \"main\": [\n [\n {\n \"node\": \"Code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
47
0
2
true
combined_workflows.json
{ "input": "This workflow implements an OpenID Connect (OIDC) client, handling user authentication and retrieving user information via a web application.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 14140, "processed_size": 14140, "processed_timestamp": "2025-04-09T03:08:39.129356", "timestamp": "2025-04-09T02:37:41.530611", "token_count": 4095, "tokens": 1321, "workflow_chunk_info": { "is_truncated": false, "original_size": 14140, "processed_size": 14140, "workflow_hash": "eafb846aa5969f2872d6765351a1c89e" }, "workflow_hash": "eafb846aa5969f2872d6765351a1c89e" }
"position": [ 1640, 480 ], "parameters": { "content": "At this point the user is authenticated, you have access to his profile from the user info result and you continue doing things" }, "typeVersion": 1 }, { "id": "9dab372a-3505-4be6-93bd-9e99fc71612c", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 460, 980 ], "parameters": { "width": 776, "height": 336, "content": "## Quick setup with Keycloak\n1. Open your Keycloak\n2. Go to `Realm settings` and opn `OpenID Endpoint Configuration`\n3. This will opene a new tab. Copy out the `authorization_endpoint`, `token_endpoint` and the `userinfo_endpoint` and add it to the `Set variables` node\n4. Go go `Clients` and click `Create client`. In there pick a name of choice.\n5. Go to the next step, `Capability config`, disable `Client authentication`. Only `Standard flow` should be checked.\n6. Go to the next step `Login settings`. In there copy the Webhook URL of this workflow into the `Valid redirect URIs` field\n7. Enter the clientID to the `Set variables` node\n\nNow you can activate the workflow and visit the webhook URL to test. You can find a more detailed setup guid in the description.\n" }, "typeVersion": 1 }, { "id": "6e3afc62-52a9-402a-bde9-e8798d0fd4f6", "name": "Set variables : auth, token, userinfo, client id, scope", "type": "n8n-nodes-base.set", "position": [ 320, 680 ], "parameters": { "values": { "string": [ { "name": "auth_endpoint", "value": "Your value here" }, { "name": "token_endpoint", "value": "Your value here" }, { "name": "userinfo_endpoint", "value": "Your value here" }, { "name": "client_id", "value": "name of your client" }, { "name": "scope", "value": "openid" }, { "name": "redirect_uri", "value": "webhook uri" }, { "name": "client_secret", "value": "secret of your client" } ], "boolean": [ { "name": "PKCE", "value": true } ] }, "options": {} }, "typeVersion": 2 }, { "id": "2d54c64a-ae45-480f-923f-63d6cb3fcdfc", "name": "IF we have code in URI and not in PKCE mode", "type": "n8n-nodes-base.if", "position": [ 700, 680 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $('Webhook').item.json.query.code }}", "operation": "isNotEmpty" } ], "boolean": [ { "value1": "={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.PKCE }}" } ] } }, "typeVersion": 1 }, { "id": "99c8fa5d-3173-4371-9742-6014eca6e7fe", "name": "get access_token from /token endpoint with code", "type": "n8n-nodes-base.httpRequest", "position": [ 940, 640 ], "parameters": { "url": "={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.token_endpoint }}", "method": "POST", "options": {}, "sendBody": true, "contentType": "form-urlencoded", "bodyParameters": { "parameters": [ { "name": "grant_type", "value": "authorization_code" }, { "name": "client_id", "value": "={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_id }}" }, { "name": "client_secret", "value": "={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_secret }}" }, { "name": "code", "value": "={{ $('Webhook').item.json.query.code }}" }, { "name": "redirect_uri", "value": "={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.redirect_uri }}" } ] } }, "typeVersion": 4.1 } ], "active": true, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "d91ac207-6f83-42cd-9c9f-326b8c53c160", "connections": { "Code": { "main": [ [ { "node": "IF we have code in URI and not in PKCE mode", "type": "main", "index": 0 } ] ] }, "Webhook": { "main": [ [ { "node": "Set variables : auth, token, userinfo, client id, scope", "type": "main", "index": 0 } ] ] }, "user info": { "main": [ [ { "node": "IF user info ok", "type": "main", "index": 0 } ] ] }, "login form": { "main": [ [ { "node": "send back login page", "type": "main", "index": 0 } ] ] }, "Welcome page": { "main": [ [ { "node": "send back welcome page", "type": "main", "index": 0 } ] ] }, "IF user info ok": { "main": [ [ { "node": "Welcome page", "type": "main", "index": 0 } ], [ { "node": "login form", "type": "main", "index": 0 } ] ] }, "IF token is present": { "main": [ [ { "node": "user info", "type": "main", "index": 0 } ], [ { "node": "login form", "type": "main", "index": 0 } ] ] }, "IF we have code in URI and not in PKCE mode": { "main": [ [ { "node": "get access_token from /token endpoint with code", "type": "main", "index": 0 } ], [ { "node": "IF token is present", "type": "main", "index": 0 } ] ] }, "get access_token from /token endpoint with code": { "main": [ [ { "node": "user info", "type": "main", "index": 0 } ] ] }, "Set variables : auth, token, userinfo, client id, scope": { "main": [ [ { "node": "Code", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"zeyTmqqmXaQIFWzV\",\n \"meta\": {\n \"instanceId\": \"11f0bca80fdd47e21bd156f4266eada6e64a6bc4c37f34dc8ae14ccf768e9285\"\n },\n \"name\": \"OIDC client workflow\",\n \"tags\": [],\n \"nodes\": [\n {\n \"id\": \"da0c6b83-9c8c-431b-beaa-66b5343b21c5\",\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 80,\n 680\n ],\n \"webhookId\": \"891ad1cd-6a50-4a88-8789-95680c78f14c\",\n \"parameters\": {\n \"path\": \"891ad1cd-6a50-4a88-8789-95680c78f14c\",\n \"options\": {},\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5c9d4f59-7980-4bee-8df6-cf9ca3eccde1\",\n \"name\": \"Code\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 520,\n 680\n ],\n \"parameters\": {\n \"jsCode\": \"let myCookies = {};\\nlet cookies = [];\\n\\ncookies = $input.item.json.headers.cookie.split(';')\\nfor (item of cookies ) {\\n myCookies[item.split('=')[0].trim()]=item.split('=')[1].trim();\\n}\\n\\nreturn myCookies;\"\n },\n \"typeVersion\": 2,\n \"continueOnFail\": true\n },\n {\n \"id\": \"7867d061-c0e3-4359-90ac-a4536c948db2\",\n \"name\": \"user info\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1220,\n 760\n ],\n \"parameters\": {\n \"url\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.userinfo_endpoint }}\",\n \"options\": {},\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"=Bearer {{ $json['access_token'] }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"df0e9896-0670-49cc-b7c6-140c234036b4\",\n \"name\": \"send back login page\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1900,\n 980\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"={{ $json.html }}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"81f03c86-91fe-4960-b4c4-295252c7e8fc\",\n \"name\": \"IF token is present\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 940,\n 820\n ],\n \"parameters\": {\n \"conditions\": {\n \"number\": [\n {\n \"value1\": \"={{ $json['access_token'] }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"5e2f87bd-9c1f-4e87-82df-1b3b3e98cbdb\",\n \"name\": \"Welcome page\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n 1720,\n 660\n ],\n \"parameters\": {\n \"html\": \"<!DOCTYPE html>\\n\\n<html>\\n<head>\\n <meta charset=\\\"UTF-8\\\" />\\n <title>My HTML document</title>\\n</head>\\n<body>\\n <div class=\\\"container\\\">\\n <h1>Welcome {{$('user info').item.json.email }} </h1>\\n </div>\\n</body>\\n</html>\\n\\n<style>\\n.container {\\n background-color: #ffffff;\\n text-align: center;\\n padding: 16px;\\n border-radius: 8px;\\n}\\n\\nh1 {\\n color: #ff6d5a;\\n font-size: 24px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n\\nh2 {\\n color: #909399;\\n font-size: 18px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n</style>\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1448e12-4292-402b-bf9d-0ab555bbc734\",\n \"name\": \"send back welcome page\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1920,\n 660\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"text\",\n \"responseBody\": \"={{ $json.html }}\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8e64ab13-4f23-4c85-a625-c456910a9472\",\n \"name\": \"IF user info ok\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1400,\n 760\n ],\n \"parameters\": {\n \"conditions\": {\n \"number\": [\n {\n \"value1\": \"={{ $json.email }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"a96b170f-fbd8-4061-9619-bf9877e85495\",\n \"name\": \"login form\",\n \"type\": \"n8n-nodes-base.html\",\n \"position\": [\n 1700,\n 980\n ],\n \"parameters\": {\n \"html\": \"<!-- Thanks to https://github.com/curityio/pkce-javascript-example/tree/master -->\\n<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n <head>\\n <meta charset=\\\"utf-8\\\">\\n <title>Login</title>\\n </head>\\n <style>\\n.container {\\n background-color: #ffffff;\\n text-align: center;\\n padding: 16px;\\n border-radius: 8px;\\n}\\n\\nh1 {\\n color: #ff6d5a;\\n font-size: 24px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n\\nh2 {\\n color: #909399;\\n font-size: 18px;\\n font-weight: bold;\\n padding: 8px;\\n}\\n</style>\\n <body>\\n <div id=\\\"result\\\"></div>\\n <script>\\n const authorizeEndpoint = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.auth_endpoint }}\\\";\\n const tokenEndpoint = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.token_endpoint }}\\\";\\n const clientId = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_id }}\\\";\\n const scope = \\\"{{ $('Set variables : auth, token, userinfo, client id, scope').item.json.scope }}\\\";\\n const usePKCE = {{ $('Set variables : auth, token, userinfo, client id, scope').item.json.PKCE }};\\n if (window.location.search) {\\n var args = new URLSearchParams(window.location.search);\\n var code = args.get(\\\"code\\\");\\n\\n if (code) {\\n var xhr = new XMLHttpRequest();\\n\\n xhr.onload = function() {\\n var response = xhr.response;\\n var message;\\n\\n if (xhr.status == 200) {\\n message = \\\"Access Token: \\\" + response.access_token;\\n document.cookie = \\\"access_token=\\\"+response.access_token;\\n location.reload();\\n }\\n else {\\n message = \\\"Error: \\\" + response.error_description + \\\" (\\\" + response.error + \\\")\\\";\\n }\\n\\n document.getElementById(\\\"result\\\").innerHTML = message;\\n };\\n xhr.responseType = 'json';\\n xhr.open(\\\"POST\\\", tokenEndpoint, true);\\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\\n xhr.send(new URLSearchParams({\\n client_id: clientId,\\n code_verifier: window.sessionStorage.getItem(\\\"code_verifier\\\"),\\n grant_type: \\\"authorization_code\\\",\\n redirect_uri: location.href.replace(location.search, ''),\\n code: code\\n }));\\n }\\n }\\n async function generateCodeChallenge(codeVerifier) {\\n var digest = await crypto.subtle.digest(\\\"SHA-256\\\",\\n new TextEncoder().encode(codeVerifier));\\n\\n return btoa(String.fromCharCode(...new Uint8Array(digest)))\\n .replace(/=/g, '').replace(/\\\\+/g, '-').replace(/\\\\//g, '_')\\n }\\n\\n function generateRandomString(length) {\\n var text = \\\"\\\";\\n var possible = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\";\\n\\n for (var i = 0; i < length; i++) {\\n text += possible.charAt(Math.floor(Math.random() * possible.length));\\n }\\n\\n return text;\\n }\\n\\n if (!crypto.subtle) {\\n document.writeln('<p>' +\\n '<b>WARNING:</b> The script will fall back to using plain code challenge as crypto is not available.</p>' +\\n '<p>Javascript crypto services require that this site is served in a <a href=\\\"https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts\\\">secure context</a>; ' +\\n 'either from <b>(*.)localhost</b> or via <b>https</b>. </p>' +\\n '<p> You can add an entry to /etc/hosts like \\\"127.0.0.1 public-test-client.localhost\\\" and reload the site from there, enable SSL using something like <a href=\\\"https://letsencrypt.org/\\\">letsencypt</a>, or refer to this <a href=\\\"https://stackoverflow.com/questions/46468104/how-to-use-subtlecrypto-in-chrome-window-crypto-subtle-is-undefined\\\">stackoverflow article</a> for more alternatives.</p>' +\\n '<p>If Javascript crypto is available this message will disappear.</p>')\\n }\\n\\n var codeVerifier = generateRandomString(64);\\n\\n const challengeMethod = crypto.subtle ? \\\"S256\\\" : \\\"plain\\\"\\n\\n Promise.resolve()\\n .then(() => {\\n if (challengeMethod === 'S256') {\\n return generateCodeChallenge(codeVerifier)\\n } else {\\n return codeVerifier\\n }\\n })\\n .then(function(codeChallenge) {\\n window.sessionStorage.setItem(\\\"code_verifier\\\", codeVerifier);\\n\\n var redirectUri = window.location.href.split('?')[0];\\n var args = new URLSearchParams({\\n response_type: \\\"code\\\",\\n client_id: clientId,\\n redirect_uri: redirectUri,\\n scope: scope,\\n state: generateRandomString(16)\\n });\\n if(usePKCE){\\n args.append(\\\"code_challenge_method\\\", challengeMethod);\\n args.append(\\\"code_challenge\\\", codeChallenge);\\n }\\n window.location = authorizeEndpoint + \\\"?\\\" + args;\\n });\\n </script>\\n </body>\\n</html>\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"12395c64-1c9d-4801-8229-57d982e4243f\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 120,\n 460\n ],\n \"parameters\": {\n \"width\": 510,\n \"height\": 207,\n \"content\": \"In this set, you have to retrieve from your identity provider : \\n- auth url\\n- token url\\n- userinfo url\\n- the client id you created for this flow\\n- scopes to use, at least \\\"openid\\\" scope\\nif you do not want to use PKCE, you have to fill : \\n- client_secret\\n- redirect_uri (which is the webhook uri)\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"25e934b5-fcd6-49e1-bb33-955b5f3f34ca\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1640,\n 480\n ],\n \"parameters\": {\n \"content\": \"At this point the user is authenticated, you have access to his profile from the user info result and you continue doing things\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9dab372a-3505-4be6-93bd-9e99fc71612c\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 460,\n 980\n ],\n \"parameters\": {\n \"width\": 776,\n \"height\": 336,\n \"content\": \"## Quick setup with Keycloak\\n1. Open your Keycloak\\n2. Go to `Realm settings` and opn `OpenID Endpoint Configuration`\\n3. This will opene a new tab. Copy out the `authorization_endpoint`, `token_endpoint` and the `userinfo_endpoint` and add it to the `Set variables` node\\n4. Go go `Clients` and click `Create client`. In there pick a name of choice.\\n5. Go to the next step, `Capability config`, disable `Client authentication`. Only `Standard flow` should be checked.\\n6. Go to the next step `Login settings`. In there copy the Webhook URL of this workflow into the `Valid redirect URIs` field\\n7. Enter the clientID to the `Set variables` node\\n\\nNow you can activate the workflow and visit the webhook URL to test. You can find a more detailed setup guid in the description.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e3afc62-52a9-402a-bde9-e8798d0fd4f6\",\n \"name\": \"Set variables : auth, token, userinfo, client id, scope\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 320,\n 680\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"auth_endpoint\",\n \"value\": \"Your value here\"\n },\n {\n \"name\": \"token_endpoint\",\n \"value\": \"Your value here\"\n },\n {\n \"name\": \"userinfo_endpoint\",\n \"value\": \"Your value here\"\n },\n {\n \"name\": \"client_id\",\n \"value\": \"name of your client\"\n },\n {\n \"name\": \"scope\",\n \"value\": \"openid\"\n },\n {\n \"name\": \"redirect_uri\",\n \"value\": \"webhook uri\"\n },\n {\n \"name\": \"client_secret\",\n \"value\": \"secret of your client\"\n }\n ],\n \"boolean\": [\n {\n \"name\": \"PKCE\",\n \"value\": true\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"2d54c64a-ae45-480f-923f-63d6cb3fcdfc\",\n \"name\": \"IF we have code in URI and not in PKCE mode\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 700,\n 680\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $('Webhook').item.json.query.code }}\",\n \"operation\": \"isNotEmpty\"\n }\n ],\n \"boolean\": [\n {\n \"value1\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.PKCE }}\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"99c8fa5d-3173-4371-9742-6014eca6e7fe\",\n \"name\": \"get access_token from /token endpoint with code\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 940,\n 640\n ],\n \"parameters\": {\n \"url\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.token_endpoint }}\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"contentType\": \"form-urlencoded\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"grant_type\",\n \"value\": \"authorization_code\"\n },\n {\n \"name\": \"client_id\",\n \"value\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_id }}\"\n },\n {\n \"name\": \"client_secret\",\n \"value\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.client_secret }}\"\n },\n {\n \"name\": \"code\",\n \"value\": \"={{ $('Webhook').item.json.query.code }}\"\n },\n {\n \"name\": \"redirect_uri\",\n \"value\": \"={{ $('Set variables : auth, token, userinfo, client id, scope').item.json.redirect_uri }}\"\n }\n ]\n }\n },\n \"typeVersion\": 4.1\n }\n ],\n \"active\": true,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"d91ac207-6f83-42cd-9c9f-326b8c53c160\",\n \"connections\": {\n \"Code\": {\n \"main\": [\n [\n {\n \"node\": \"IF we have code in URI and not in PKCE mode\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Set variables : auth, token, userinfo, client id, scope\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"user info\": {\n \"main\": [\n [\n {\n \"node\": \"IF user info ok\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"login form\": {\n \"main\": [\n [\n {\n \"node\": \"send back login page\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Welcome page\": {\n \"main\": [\n [\n {\n \"node\": \"send back welcome page\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF user info ok\": {\n \"main\": [\n [\n {\n \"node\": \"Welcome page\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"login form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF token is present\": {\n \"main\": [\n [\n {\n \"node\": \"user info\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"login form\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF we have code in URI and not in PKCE mode\": {\n \"main\": [\n [\n {\n \"node\": \"get access_token from /token endpoint with code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"IF token is present\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"get access_token from /token endpoint with code\": {\n \"main\": [\n [\n {\n \"node\": \"user info\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set variables : auth, token, userinfo, client id, scope\": {\n \"main\": [\n [\n {\n \"node\": \"Code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
47
1
2
true
combined_workflows.json
{ "input": "This workflow implements an OpenID Connect (OIDC) client, handling user authentication and retrieving user information via a web application.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 14140, "processed_size": 14140, "processed_timestamp": "2025-04-09T03:08:39.136358", "timestamp": "2025-04-09T02:37:41.530611", "token_count": 2277, "tokens": 1321, "workflow_chunk_info": { "is_truncated": false, "original_size": 14140, "processed_size": 14140, "workflow_hash": "eafb846aa5969f2872d6765351a1c89e" }, "workflow_hash": "eafb846aa5969f2872d6765351a1c89e" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow aims to analyze email attachments for potential threats by extracting artifacts, creating a case in TheHive, running analysis using Cortex, and adding the results as observables in TheHive. Analyze this workflow: ```json { "id": 4, "name": "Email", "nodes": [ { "name": "IMAP Email", "type": "n8n-nodes-base.emailReadImap", "position": [ -300, 200 ], "parameters": { "format": "resolved", "options": {} }, "credentials": { "imap": { "id": "5", "name": "IMAP account" } }, "typeVersion": 1 }, { "name": "TheHive", "type": "n8n-nodes-base.theHive", "position": [ -20, 200 ], "parameters": { "tags": "Email", "type": "Email", "title": "={{$node[\"IMAP Email\"].binary.attachment_0.fileName}}", "source": "Outlook", "sourceRef": "={{$node[\"IMAP Email\"].json[\"messageId\"]}}", "artifactUi": { "artifactValues": [ { "dataType": "file", "binaryProperty": "attachment_0" } ] }, "description": "={{$node[\"IMAP Email\"].binary.attachment_0.fileName}}", "additionalFields": {} }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1, "alwaysOutputData": true }, { "name": "Create Case", "type": "n8n-nodes-base.theHive", "position": [ 280, 200 ], "parameters": { "id": "={{$node[\"TheHive\"].json[\"_id\"]}}", "operation": "promote", "additionalFields": {} }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1, "alwaysOutputData": true }, { "name": "Case", "type": "n8n-nodes-base.theHive", "position": [ 540, 200 ], "parameters": { "id": "={{$node[\"Create Case\"].json[\"_id\"]}}", "resource": "case", "operation": "get" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1, "alwaysOutputData": true }, { "name": "Observable", "type": "n8n-nodes-base.theHive", "position": [ 1060, 200 ], "parameters": { "caseId": "={{$node[\"Case\"].json[\"_id\"]}}", "options": {}, "resource": "observable", "returnAll": true }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1, "alwaysOutputData": true }, { "name": "Analyzer Email", "type": "n8n-nodes-base.theHive", "position": [ 1340, 200 ], "parameters": { "id": "={{$node[\"Observable\"].json[\"_id\"]}}", "dataType": "file", "resource": "observable", "analyzers": [ "24a64a086a410e1c7d7ace74003c4480::CORTEX" ], "operation": "executeAnalyzer" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "retryOnFail": true, "typeVersion": 1, "alwaysOutputData": true }, { "name": "Cortex", "type": "n8n-nodes-base.cortex", "position": [ 1560, 200 ], "parameters": { "jobId": "={{$node[\"Analyzer Email\"].json[\"cortexJobId\"]}}", "resource": "job", "operation": "report" }, "credentials": { "cortexApi": { "id": "2", "name": "Cortex account" } }, "typeVersion": 1 }, { "name": "IF", "type": "n8n-nodes-base.if", "position": [ -20, 600 ], "parameters": { "conditions": { "number": [ { "value1": "={{$node[\"Cortex\"].json[\"report\"][\"full\"][\"iocs\"][\"domain\"].length}}", "operation": "larger" }, { "value1": "={{$node[\"Cortex\"].json[\"report\"][\"full\"][\"iocs\"][\"email\"].length}}", "operation": "larger" }, { "value1": "={{$node[\"Cortex\"].json[\"report\"][\"full\"][\"iocs\"][\"ip\"].length}}", "operation": "larger" } ] }, "combineOperation": "any" }, "typeVersion": 1 }, { "name": "Update Case Domain", "type": "n8n-nodes-base.theHive", "position": [ 420, 480 ], "parameters": { "ioc": true, "data": "={{$node[\"Cortex\"].json[\"report\"][\"full\"][\"iocs\"][\"domain\"]}}", "caseId": "={{$node[\"Case\"].json[\"_id\"]}}", "status": "Ok", "message": "={{$node[\"Cortex\"].json[\"analyzerName\"]}}", "options": { "tags": "Domain" }, "dataType": "domain", "resource": "observable", "operation": "create" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1 }, { "name": "Update Case Email", "type": "n8n-nodes-base.theHive", "position": [ 420, 620 ], "parameters": { "ioc": true, "data": "={{$node[\"Cortex\"].json[\"report\"][\"full\"][\"iocs\"][\"email\"]}}", "caseId": "={{$node[\"Case\"].json[\"_id\"]}}", "status": "Ok", "message": "={{$node[\"Cortex\"].json[\"analyzerName\"]}}", "options": { "tags": "Domain" }, "dataType": "mail", "resource": "observable", "operation": "create" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1 }, { "name": "Update Case Ip", "type": "n8n-nodes-base.theHive", "position": [ 420, 760 ], "parameters": { "ioc": true, "data": "={{$node[\"Cortex\"].json[\"report\"][\"full\"][\"iocs\"][\"ip\"]}}", "caseId": "={{$node[\"Case\"].json[\"_id\"]}}", "status": "Ok", "message": "={{$node[\"Cortex\"].json[\"analyzerName\"]}}", "options": { "tags": "Domain" }, "dataType": "ip", "resource": "observable", "operation": "create" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1 }, { "name": "Wait", "type": "n8n-nodes-base.wait", "position": [ 800, 200 ], "webhookId": "ecada1d5-a671-44fc-906e-c64c6f05e760", "parameters": { "unit": "seconds", "amount": 5 }, "typeVersion": 1 }, { "name": "Email Reputation", "type": "n8n-nodes-base.theHive", "position": [ 640, 620 ], "parameters": { "id": "={{$node[\"Update Case Email\"].json[\"id\"]}}", "dataType": "mail", "resource": "observable", "analyzers": [ "9902b4e5c58015184b177de13f2151c7::CORTEX" ], "operation": "executeAnalyzer" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1 }, { "name": "OTX IP", "type": "n8n-nodes-base.theHive", "position": [ 640, 760 ], "parameters": { "id": "={{$node[\"Update Case Ip\"].json[\"id\"]}}", "dataType": "ip", "resource": "observable", "analyzers": [ "b084bf78d1aea92966b6ef6a4f6193a5::CORTEX" ], "operation": "executeAnalyzer" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1 }, { "name": "OTX DOMAIN", "type": "n8n-nodes-base.theHive", "position": [ 640, 480 ], "parameters": { "id": "={{$node[\"Update Case Domain\"].json[\"id\"]}}", "dataType": "domain", "resource": "observable", "analyzers": [ "b084bf78d1aea92966b6ef6a4f6193a5::CORTEX" ], "operation": "executeAnalyzer" }, "credentials": { "theHiveApi": { "id": "1", "name": "The Hive account" } }, "typeVersion": 1 } ], "active": true, "settings": {}, "connections": { "IF": { "main": [ [ { "node": "Update Case Domain", "type": "main", "index": 0 }, { "node": "Update Case Email", "type": "main", "index": 0 }, { "node": "Update Case Ip", "type": "main", "index": 0 } ] ] }, "Case": { "main": [ [ { "node": "Wait", "type": "main", "index": 0 } ] ] }, "Wait": { "main": [ [ { "node": "Observable", "type": "main", "index": 0 } ] ] }, "Cortex": { "main": [ [ { "node": "IF", "type": "main", "index": 0 } ] ] }, "TheHive": { "main": [ [ { "node": "Create Case", "type": "main", "index": 0 } ] ] }, "IMAP Email": { "main": [ [ { "node": "TheHive", "type": "main", "index": 0 } ] ] }, "Observable": { "main": [ [ { "node": "Analyzer Email", "type": "main", "index": 0 } ] ] }, "Create Case": { "main": [ [ { "node": "Case", "type": "main", "index": 0 } ] ] }, "Analyzer Email": { "main": [ [ { "node": "Cortex", "type": "main", "index": 0 } ] ] }, "Update Case Ip": { "main": [ [ { "node": "OTX IP", "type": "main", "index": 0 } ] ] }, "Update Case Email": { "main": [ [ { "node": "Email Reputation", "type": "main", "index": 0 } ] ] }, "Update Case Domain": { "main": [ [ { "node": "OTX DOMAIN", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": 4,\n \"name\": \"Email\",\n \"nodes\": [\n {\n \"name\": \"IMAP Email\",\n \"type\": \"n8n-nodes-base.emailReadImap\",\n \"position\": [\n -300,\n 200\n ],\n \"parameters\": {\n \"format\": \"resolved\",\n \"options\": {}\n },\n \"credentials\": {\n \"imap\": {\n \"id\": \"5\",\n \"name\": \"IMAP account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"TheHive\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n -20,\n 200\n ],\n \"parameters\": {\n \"tags\": \"Email\",\n \"type\": \"Email\",\n \"title\": \"={{$node[\\\"IMAP Email\\\"].binary.attachment_0.fileName}}\",\n \"source\": \"Outlook\",\n \"sourceRef\": \"={{$node[\\\"IMAP Email\\\"].json[\\\"messageId\\\"]}}\",\n \"artifactUi\": {\n \"artifactValues\": [\n {\n \"dataType\": \"file\",\n \"binaryProperty\": \"attachment_0\"\n }\n ]\n },\n \"description\": \"={{$node[\\\"IMAP Email\\\"].binary.attachment_0.fileName}}\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"name\": \"Create Case\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 280,\n 200\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"TheHive\\\"].json[\\\"_id\\\"]}}\",\n \"operation\": \"promote\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"name\": \"Case\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 540,\n 200\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"Create Case\\\"].json[\\\"_id\\\"]}}\",\n \"resource\": \"case\",\n \"operation\": \"get\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"name\": \"Observable\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 1060,\n 200\n ],\n \"parameters\": {\n \"caseId\": \"={{$node[\\\"Case\\\"].json[\\\"_id\\\"]}}\",\n \"options\": {},\n \"resource\": \"observable\",\n \"returnAll\": true\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"name\": \"Analyzer Email\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 1340,\n 200\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"Observable\\\"].json[\\\"_id\\\"]}}\",\n \"dataType\": \"file\",\n \"resource\": \"observable\",\n \"analyzers\": [\n \"24a64a086a410e1c7d7ace74003c4480::CORTEX\"\n ],\n \"operation\": \"executeAnalyzer\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"retryOnFail\": true,\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"name\": \"Cortex\",\n \"type\": \"n8n-nodes-base.cortex\",\n \"position\": [\n 1560,\n 200\n ],\n \"parameters\": {\n \"jobId\": \"={{$node[\\\"Analyzer Email\\\"].json[\\\"cortexJobId\\\"]}}\",\n \"resource\": \"job\",\n \"operation\": \"report\"\n },\n \"credentials\": {\n \"cortexApi\": {\n \"id\": \"2\",\n \"name\": \"Cortex account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"IF\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -20,\n 600\n ],\n \"parameters\": {\n \"conditions\": {\n \"number\": [\n {\n \"value1\": \"={{$node[\\\"Cortex\\\"].json[\\\"report\\\"][\\\"full\\\"][\\\"iocs\\\"][\\\"domain\\\"].length}}\",\n \"operation\": \"larger\"\n },\n {\n \"value1\": \"={{$node[\\\"Cortex\\\"].json[\\\"report\\\"][\\\"full\\\"][\\\"iocs\\\"][\\\"email\\\"].length}}\",\n \"operation\": \"larger\"\n },\n {\n \"value1\": \"={{$node[\\\"Cortex\\\"].json[\\\"report\\\"][\\\"full\\\"][\\\"iocs\\\"][\\\"ip\\\"].length}}\",\n \"operation\": \"larger\"\n }\n ]\n },\n \"combineOperation\": \"any\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Update Case Domain\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 420,\n 480\n ],\n \"parameters\": {\n \"ioc\": true,\n \"data\": \"={{$node[\\\"Cortex\\\"].json[\\\"report\\\"][\\\"full\\\"][\\\"iocs\\\"][\\\"domain\\\"]}}\",\n \"caseId\": \"={{$node[\\\"Case\\\"].json[\\\"_id\\\"]}}\",\n \"status\": \"Ok\",\n \"message\": \"={{$node[\\\"Cortex\\\"].json[\\\"analyzerName\\\"]}}\",\n \"options\": {\n \"tags\": \"Domain\"\n },\n \"dataType\": \"domain\",\n \"resource\": \"observable\",\n \"operation\": \"create\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Update Case Email\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 420,\n 620\n ],\n \"parameters\": {\n \"ioc\": true,\n \"data\": \"={{$node[\\\"Cortex\\\"].json[\\\"report\\\"][\\\"full\\\"][\\\"iocs\\\"][\\\"email\\\"]}}\",\n \"caseId\": \"={{$node[\\\"Case\\\"].json[\\\"_id\\\"]}}\",\n \"status\": \"Ok\",\n \"message\": \"={{$node[\\\"Cortex\\\"].json[\\\"analyzerName\\\"]}}\",\n \"options\": {\n \"tags\": \"Domain\"\n },\n \"dataType\": \"mail\",\n \"resource\": \"observable\",\n \"operation\": \"create\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Update Case Ip\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 420,\n 760\n ],\n \"parameters\": {\n \"ioc\": true,\n \"data\": \"={{$node[\\\"Cortex\\\"].json[\\\"report\\\"][\\\"full\\\"][\\\"iocs\\\"][\\\"ip\\\"]}}\",\n \"caseId\": \"={{$node[\\\"Case\\\"].json[\\\"_id\\\"]}}\",\n \"status\": \"Ok\",\n \"message\": \"={{$node[\\\"Cortex\\\"].json[\\\"analyzerName\\\"]}}\",\n \"options\": {\n \"tags\": \"Domain\"\n },\n \"dataType\": \"ip\",\n \"resource\": \"observable\",\n \"operation\": \"create\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Wait\",\n \"type\": \"n8n-nodes-base.wait\",\n \"position\": [\n 800,\n 200\n ],\n \"webhookId\": \"ecada1d5-a671-44fc-906e-c64c6f05e760\",\n \"parameters\": {\n \"unit\": \"seconds\",\n \"amount\": 5\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Email Reputation\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 640,\n 620\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"Update Case Email\\\"].json[\\\"id\\\"]}}\",\n \"dataType\": \"mail\",\n \"resource\": \"observable\",\n \"analyzers\": [\n \"9902b4e5c58015184b177de13f2151c7::CORTEX\"\n ],\n \"operation\": \"executeAnalyzer\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"OTX IP\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 640,\n 760\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"Update Case Ip\\\"].json[\\\"id\\\"]}}\",\n \"dataType\": \"ip\",\n \"resource\": \"observable\",\n \"analyzers\": [\n \"b084bf78d1aea92966b6ef6a4f6193a5::CORTEX\"\n ],\n \"operation\": \"executeAnalyzer\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"OTX DOMAIN\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 640,\n 480\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"Update Case Domain\\\"].json[\\\"id\\\"]}}\",\n \"dataType\": \"domain\",\n \"resource\": \"observable\",\n \"analyzers\": [\n \"b084bf78d1aea92966b6ef6a4f6193a5::CORTEX\"\n ],\n \"operation\": \"executeAnalyzer\"\n },\n \"credentials\": {\n \"theHiveApi\": {\n \"id\": \"1\",\n \"name\": \"The Hive account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": true,\n \"settings\": {},\n \"connections\": {\n \"IF\": {\n \"main\": [\n [\n {\n \"node\": \"Update Case Domain\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Update Case Email\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Update Case Ip\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Case\": {\n \"main\": [\n [\n {\n \"node\": \"Wait\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Wait\": {\n \"main\": [\n [\n {\n \"node\": \"Observable\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Cortex\": {\n \"main\": [\n [\n {\n \"node\": \"IF\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"TheHive\": {\n \"main\": [\n [\n {\n \"node\": \"Create Case\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IMAP Email\": {\n \"main\": [\n [\n {\n \"node\": \"TheHive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Observable\": {\n \"main\": [\n [\n {\n \"node\": \"Analyzer Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Case\": {\n \"main\": [\n [\n {\n \"node\": \"Case\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Analyzer Email\": {\n \"main\": [\n [\n {\n \"node\": \"Cortex\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Case Ip\": {\n \"main\": [\n [\n {\n \"node\": \"OTX IP\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Case Email\": {\n \"main\": [\n [\n {\n \"node\": \"Email Reputation\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Case Domain\": {\n \"main\": [\n [\n {\n \"node\": \"OTX DOMAIN\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
48
0
1
false
combined_workflows.json
{ "input": "The workflow aims to analyze email attachments for potential threats by extracting artifacts, creating a case in TheHive, running analysis using Cortex, and adding the results as observables in TheHive.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6979, "processed_size": 6979, "processed_timestamp": "2025-04-09T03:08:39.156363", "timestamp": "2025-04-09T02:37:41.671625", "token_count": 4030, "tokens": 594, "workflow_chunk_info": { "is_truncated": false, "original_size": 6979, "processed_size": 6979, "workflow_hash": "d92b58e7cc0185c2906f2fcf12c337b6" }, "workflow_hash": "d92b58e7cc0185c2906f2fcf12c337b6" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to analyze cybersecurity alerts, extract MITRE ATT&CK information, and provide actionable remediation steps, leveraging an AI agent and a knowledge base. It also enriches Zendesk tickets with this information. Analyze this workflow: ```json { "meta": { "instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "86ddd018-3d6b-46b9-aa93-dedd6c6b5076", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ -880, 360 ], "webhookId": "a9668bb8-bbe8-418a-b5c9-ff7dd431244f", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "a5ba5090-8e3b-4408-82df-92d2c524039e", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ -680, 360 ], "parameters": { "options": { "systemMessage": "You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\n1. Extract TTP information from SIEM data.\n2. Provide actionable remediation steps tailored to the alert.\n3. Cross-reference historical patterns and related alerts.\n4. Recommend external resources for deeper understanding.\n\nEnsure that:\n- TTPs are tagged with the tactic, technique name, and technique ID.\n- Remediation steps are specific and actionable.\n- Historical data includes related alerts and notable trends.\n- External links are relevant to the observed behavior.\n" } }, "typeVersion": 1.7 }, { "id": "67c52944-b616-4ea6-9507-e9fb6fcdbe2b", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ -740, 580 ], "parameters": { "model": "gpt-4o", "options": {} }, "credentials": { "openAiApi": { "id": "QpFZ2EiM3WGl6Zr3", "name": "Marketing OpenAI" } }, "typeVersion": 1 }, { "id": "55f6c16a-51ed-45e4-a1ab-aaaf1d7b5733", "name": "Split Out", "type": "n8n-nodes-base.splitOut", "position": [ -720, 1220 ], "parameters": { "options": {}, "fieldToSplitOut": "data" }, "typeVersion": 1 }, { "id": "46a5b8c6-3d34-4e9b-b812-23135f28c278", "name": "Embeddings OpenAI1", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ -580, 1420 ], "parameters": { "options": {} }, "credentials": { "openAiApi": { "id": "QpFZ2EiM3WGl6Zr3", "name": "Marketing OpenAI" } }, "typeVersion": 1.2 }, { "id": "561b0737-26d5-450d-bd9e-08e0a608d6f9", "name": "Default Data Loader", "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", "position": [ -460, 1440 ], "parameters": { "options": { "metadata": { "metadataValues": [ { "name": "id", "value": "={{ $json.id }}" }, { "name": "name", "value": "={{ $json.name }}" }, { "name": "killchain", "value": "={{ $json.kill_chain_phases }}" }, { "name": "external", "value": "={{ $json.external_references }}" } ] } }, "jsonData": "={{ $json.description }}", "jsonMode": "expressionData" }, "typeVersion": 1 }, { "id": "6e8a4aed-7e8c-492a-b816-6ab1a98c312a", "name": "Token Splitter1", "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter", "position": [ -460, 1620 ], "parameters": {}, "typeVersion": 1 }, { "id": "0c54049e-b5e8-448f-b864-39aeb274de3e", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ -580, 580 ], "parameters": {}, "typeVersion": 1.3 }, { "id": "96b776a0-10da-4f70-99d0-ad6b6ee8fcca", "name": "Embeddings OpenAI2", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ -460, 720 ], "parameters": { "model": "text-embedding-3-large", "options": { "dimensions": 1536 } }, "credentials": { "openAiApi": { "id": "QpFZ2EiM3WGl6Zr3", "name": "Marketing OpenAI" } }, "typeVersion": 1.2 }, { "id": "695fba89-8f42-47c3-9d86-73f4ea0e72df", "name": "Extract from File", "type": "n8n-nodes-base.extractFromFile", "position": [ -920, 1220 ], "parameters": { "options": {}, "operation": "fromJson" }, "typeVersion": 1 }, { "id": "0b9897b0-149b-43ce-b66c-e78552729aa5", "name": "When clicking β€˜Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ -1360, 1220 ], "parameters": {}, "typeVersion": 1 }, { "id": "d8c29a14-0389-4748-a9de-686bf9a682c5", "name": "AI Agent1", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ -540, -440 ], "parameters": { "text": "=Siem Alert Data:\nAlert: {{ $json.raw_subject }}\nDescription: {{ $json.description }}", "options": { "systemMessage": "You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\n1. Extract TTP information from SIEM data.\n2. Provide actionable remediation steps tailored to the alert.\n3. Cross-reference historical patterns and related alerts.\n4. Recommend external resources for deeper understanding.\n\nEnsure that:\n- TTPs are tagged with the tactic, technique name, and technique ID.\n- Remediation steps are specific and actionable.\n- Historical data includes related alerts and notable trends.\n- External links are relevant to the observed behavior.\n\nPlease output your response in html format, but do not include ```html at the beginning \n" }, "promptType": "define", "hasOutputParser": true }, "typeVersion": 1.7 }, { "id": "55d0b00a-5046-45fa-87cb-cb0257caae87", "name": "OpenAI Chat Model1", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "position": [ -600, -220 ], "parameters": { "model": "gpt-4o", "options": {} }, "credentials": { "openAiApi": { "id": "QpFZ2EiM3WGl6Zr3", "name": "Marketing OpenAI" } }, "typeVersion": 1 }, { "id": "9b53566b-e021-403d-9d78-28504c5c1dfa", "name": "Embeddings OpenAI", "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", "position": [ -320, -40 ], "parameters": { "model": "text-embedding-3-large", "options": { "dimensions": 1536 } }, "credentials": { "openAiApi": { "id": "QpFZ2EiM3WGl6Zr3", "name": "Marketing OpenAI" } }, "typeVersion": 1.2 }, { "id": "f3b44ef5-e928-4662-81ef-4dd044829607", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ -940, -440 ], "parameters": { "options": {} }, "typeVersion": 3 }, { "id": "cc572b71-65c9-460c-bdcd-1d20feb15b32", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1460, 940 ], "parameters": { "color": 7, "width": 1380, "height": 820, "content": "![n8n](https://uploads.n8n.io/templates/qdrantlogo.png)\n## Embed your Vector Store\nTo provide data for your Vector store, you need to pass it in as JSON, and ensure it's setup correctly. This flow pulls the JSON file from Google Drive and extracts the JSON data and then passes it into the qdrant collection. " }, "typeVersion": 1 }, { "id": "d5052d52-bec2-4b70-b460-6d5789c28d2c", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -1460, 220 ], "parameters": { "color": 7, "width": 1380, "height": 680, "content": "![n8n](https://uploads.n8n.io/templates/n8n.png)\n## Talk to your Vector Store\nNow that your vector store has been updated with the embedded data, \nyou can use the n8n chat interface to talk to your data using OpenAI, \nOllama, or any of our supported LLMs." }, "typeVersion": 1 }, { "id": "5cb478f6-17f3-4d7a-9b66-9e0654bd1dc9", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -1460, -700 ], "parameters": { "color": 7, "width": 2140, "height": 900, "content": "![Servicenow](https://uploads.n8n.io/templates/zendesk.png)\n## Deploy your Vector Store\nThis flow adds contextual information to your tickets using the Mitre Attack framework to help contextualize the ticket data." }, "typeVersion": 1 }, { "id": "71ee28f5-84a2-4c6c-855a-6c7c09b2d62a", "name": "Structured Output Parser", "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "position": [ 0, -160 ], "parameters": { "jsonSchemaExample": "{\n \"ttp_identification\": {\n \"alert_summary\": \"The alert indicates a check-in from the NetSupport RAT, a known Remote Access Trojan, suggesting command and control (C2) communication.\",\n \"mitre_attack_ttps\": [\n {\n \"tactic\": \"Command and Control\",\n \"technique\": \"Protocol or Service Impersonation\",\n \"technique_id\": \"T1001.003\",\n \"description\": \"The RAT's check-in over port 443 implies potential masquerading of its traffic as legitimate SSL/TLS traffic, a tactic often used to blend C2 communications with normal web traffic.\",\n \"reference\": \"https://attack.mitre.org/techniques/T1001/003/\"\n }\n ]\n },\n \"remediation_steps\": {\n \"network_segmentation\": {\n \"action\": \"Isolate the affected host\",\n \"target\": \"10.11.26.183\",\n \"reason\": \"Prevents
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"86ddd018-3d6b-46b9-aa93-dedd6c6b5076\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -880,\n 360\n ],\n \"webhookId\": \"a9668bb8-bbe8-418a-b5c9-ff7dd431244f\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"a5ba5090-8e3b-4408-82df-92d2c524039e\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -680,\n 360\n ],\n \"parameters\": {\n \"options\": {\n \"systemMessage\": \"You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\\n1. Extract TTP information from SIEM data.\\n2. Provide actionable remediation steps tailored to the alert.\\n3. Cross-reference historical patterns and related alerts.\\n4. Recommend external resources for deeper understanding.\\n\\nEnsure that:\\n- TTPs are tagged with the tactic, technique name, and technique ID.\\n- Remediation steps are specific and actionable.\\n- Historical data includes related alerts and notable trends.\\n- External links are relevant to the observed behavior.\\n\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"67c52944-b616-4ea6-9507-e9fb6fcdbe2b\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -740,\n 580\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"55f6c16a-51ed-45e4-a1ab-aaaf1d7b5733\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n -720,\n 1220\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"data\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"46a5b8c6-3d34-4e9b-b812-23135f28c278\",\n \"name\": \"Embeddings OpenAI1\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -580,\n 1420\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"561b0737-26d5-450d-bd9e-08e0a608d6f9\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n -460,\n 1440\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n {\n \"name\": \"name\",\n \"value\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"killchain\",\n \"value\": \"={{ $json.kill_chain_phases }}\"\n },\n {\n \"name\": \"external\",\n \"value\": \"={{ $json.external_references }}\"\n }\n ]\n }\n },\n \"jsonData\": \"={{ $json.description }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e8a4aed-7e8c-492a-b816-6ab1a98c312a\",\n \"name\": \"Token Splitter1\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterTokenSplitter\",\n \"position\": [\n -460,\n 1620\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0c54049e-b5e8-448f-b864-39aeb274de3e\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n -580,\n 580\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"96b776a0-10da-4f70-99d0-ad6b6ee8fcca\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -460,\n 720\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-large\",\n \"options\": {\n \"dimensions\": 1536\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"695fba89-8f42-47c3-9d86-73f4ea0e72df\",\n \"name\": \"Extract from File\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -920,\n 1220\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"fromJson\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0b9897b0-149b-43ce-b66c-e78552729aa5\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1360,\n 1220\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"d8c29a14-0389-4748-a9de-686bf9a682c5\",\n \"name\": \"AI Agent1\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -540,\n -440\n ],\n \"parameters\": {\n \"text\": \"=Siem Alert Data:\\nAlert: {{ $json.raw_subject }}\\nDescription: {{ $json.description }}\",\n \"options\": {\n \"systemMessage\": \"You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\\n1. Extract TTP information from SIEM data.\\n2. Provide actionable remediation steps tailored to the alert.\\n3. Cross-reference historical patterns and related alerts.\\n4. Recommend external resources for deeper understanding.\\n\\nEnsure that:\\n- TTPs are tagged with the tactic, technique name, and technique ID.\\n- Remediation steps are specific and actionable.\\n- Historical data includes related alerts and notable trends.\\n- External links are relevant to the observed behavior.\\n\\nPlease output your response in html format, but do not include ```html at the beginning \\n\"\n },\n \"promptType\": \"define\",\n \"hasOutputParser\": true\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"55d0b00a-5046-45fa-87cb-cb0257caae87\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -600,\n -220\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9b53566b-e021-403d-9d78-28504c5c1dfa\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -320,\n -40\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-large\",\n \"options\": {\n \"dimensions\": 1536\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"f3b44ef5-e928-4662-81ef-4dd044829607\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n -940,\n -440\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"cc572b71-65c9-460c-bdcd-1d20feb15b32\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 820,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/qdrantlogo.png)\\n## Embed your Vector Store\\nTo provide data for your Vector store, you need to pass it in as JSON, and ensure it's setup correctly. This flow pulls the JSON file from Google Drive and extracts the JSON data and then passes it into the qdrant collection. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d5052d52-bec2-4b70-b460-6d5789c28d2c\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n 220\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 680,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/n8n.png)\\n## Talk to your Vector Store\\nNow that your vector store has been updated with the embedded data, \\nyou can use the n8n chat interface to talk to your data using OpenAI, \\nOllama, or any of our supported LLMs.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5cb478f6-17f3-4d7a-9b66-9e0654bd1dc9\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n -700\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 2140,\n \"height\": 900,\n \"content\": \"![Servicenow](https://uploads.n8n.io/templates/zendesk.png)\\n## Deploy your Vector Store\\nThis flow adds contextual information to your tickets using the Mitre Attack framework to help contextualize the ticket data.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71ee28f5-84a2-4c6c-855a-6c7c09b2d62a\",\n \"name\": \"Structured Output Parser\",\n \"type\": \"@n8n/n8n-nodes-langchain.outputParserStructured\",\n \"position\": [\n 0,\n -160\n ],\n \"parameters\": {\n \"jsonSchemaExample\": \"{\\n \\\"ttp_identification\\\": {\\n \\\"alert_summary\\\": \\\"The alert indicates a check-in from the NetSupport RAT, a known Remote Access Trojan, suggesting command and control (C2) communication.\\\",\\n \\\"mitre_attack_ttps\\\": [\\n {\\n \\\"tactic\\\": \\\"Command and Control\\\",\\n \\\"technique\\\": \\\"Protocol or Service Impersonation\\\",\\n \\\"technique_id\\\": \\\"T1001.003\\\",\\n \\\"description\\\": \\\"The RAT's check-in over port 443 implies potential masquerading of its traffic as legitimate SSL/TLS traffic, a tactic often used to blend C2 communications with normal web traffic.\\\",\\n \\\"reference\\\": \\\"https://attack.mitre.org/techniques/T1001/003/\\\"\\n }\\n ]\\n },\\n \\\"remediation_steps\\\": {\\n \\\"network_segmentation\\\": {\\n \\\"action\\\": \\\"Isolate the affected host\\\",\\n \\\"target\\\": \\\"10.11.26.183\\\",\\n \\\"reason\\\": \\\"Prevents further C2 communication or lateral movement.\\\"\\n },\\n \\\"endpoint_inspection\\\": {\\n \\\"action\\\": \\\"Perform a thorough inspection\\\",\\n \\\"target\\\": \\\"Impacted endpoint\\\",\\n \\\"method\\\": \\\"Use endpoint detection and response (EDR) tools to check for additional persistence mechanisms.\\\"\\n },\\n \\\"network_traffic_analysis\\\": {\\n \\\"action\\\": \\\"Investigate and block unusual traffic\\\",\\n \\\"target\\\": \\\"IP 194.180.191.64\\\",\\n \\\"method\\\": \\\"Implement blocks for the IP across the firewall or IDS/IPS systems.\\\"\\n },\\n \\\"system_patching\\\": {\\n \\\"action\\\": \\\"Ensure all systems are updated\\\",\\n \\\"method\\\": \\\"Apply the latest security patches to mitigate vulnerabilities exploited by RAT malware.\\\"\\n },\\n \\\"ioc_hunting\\\": {\\n \\\"action\\\": \\\"Search for Indicators of Compromise (IoCs)\\\",\\n \\\"method\\\": \\\"Check for NetSupport RAT IoCs across other endpoints within the network.\\\"\\n }\\n },\\n \\\"historical_patterns\\\": {\\n \\\"network_anomalies\\\": \\\"Past alerts involving similar attempts to use standard web ports (e.g., 80, 443) for non-standard applications could suggest a broader attempt to blend malicious traffic into legitimate streams.\\\",\\n \\\"persistence_tactics\\\": \\\"Any detection of anomalies in task scheduling or shortcut modifications may indicate persistence methods similar to those used by RATs.\\\"\\n },\\n \\\"external_resources\\\": [\\n {\\n \\\"title\\\": \\\"ESET Report on Okrum and Ketrican\\\",\\n \\\"description\\\": \\\"Discusses similar tactics involving protocol impersonation and C2.\\\",\\n \\\"url\\\": \\\"https://www.eset.com/int/about/newsroom/research/okrum-ketrican/\\\"\\n },\\n {\\n \\\"title\\\": \\\"Malleable C2 Profiles\\\",\\n \\\"description\\\": \\\"Document on crafting custom C2 traffic profiles similar to the targeting methods used by NetSupport RAT.\\\",\\n \\\"url\\\": \\\"https://www.cobaltstrike.com/help-malleable-c2\\\"\\n },\\n {\\n \\\"title\\\": \\\"MITRE ATT&CK Technique Overview\\\",\\n \\\"description\\\": \\\"Overview of Protocol or Service Impersonation tactics.\\\",\\n \\\"url\\\": \\\"https://attack.mitre.org/techniques/T1001/003/\\\"\\n }\\n ]\\n}\\n\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"3aeb973d-22e5-4eaf-8fe8-fae3447909e1\",\n \"name\": \"Pull Mitre Data From Gdrive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -1140,\n 1220\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d\",\n \"cachedResultUrl\": \"https://drive.google.com/file/d/1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d/view?usp=drivesdk\",\n \"cachedResultName\": \"cleaned_mitre_attack_data.json\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"AVa7MXBLiB9NYjuO\",\n \"name\": \"Angel Gdrive\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"3b35633c-de80-4062-8497-cb65092d5708\",\n \"name\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -520,\n 1220\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5f7f2fd8-276f-4b3a-ae88-1f1765967883\",\n \"name\": \"Query Qdrant Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -480,\n 580\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"mitre_attack_vector_store\",\n \"toolDescription\": \"The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\\n\\nBy analyzing input text, the vector store can:\\n\\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\\nProvide structured context about potential adversary behaviors.\\nSuggest remediation actions or detection methods based on the input.\",\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"mitre\",\n \"cachedResultName\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"298ffc29-1d60-4c05-92c6-a61071629a3f\",\n \"name\": \"Qdrant Vector Store query\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -320,\n -200\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"mitre_attack_vector_store\",\n \"toolDescription\": \"The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\\n\\nBy analyzing input text, the vector store can:\\n\\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\\nProvide structured context about potential adversary behaviors.\\nSuggest remediation actions or detection methods based on the input.\",\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"mitre\",\n \"cachedResultName\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c47f0ae6-106d-46da-afc3-f7afb86923ff\",\n \"name\": \"Get all Zendesk Tickets\",\n \"type\": \"n8n-nodes-base.zendesk\",\n \"position\": [\n -1180,\n -440\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"zendeskApi\": {\n \"id\": \"ROx0ipJapRomRxEX\",\n \"name\": \"Zendesk Demo Access\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0ec2c505-5721-41af-91c8-1b0b55826d9e\",\n \"name\": \"Update Zendesk with Mitre Data\",\n \"type\": \"n8n-nodes-base.zendesk\",\n \"position\": [\n 0,\n -360\n ],\n \"parameters\": {\n \"id\": \"={{ $('Loop Over Items').item.json.id }}\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"internalNote\": \"=Summary: {{ $json.output.ttp_identification.alert_summary }}\\n\\n\",\n \"customFieldsUi\": {\n \"customFieldsValues\": [\n {\n \"id\": 34479547176212,\n \"value\": \"={{ $json.output.ttp_identification.mitre_attack_ttps[0].technique_id }}\"\n },\n {\n \"id\": 34479570659732,\n \"value\": \"={{ $json.output.ttp_identification.mitre_attack_ttps[0].tactic }}\"\n }\n ]\n }\n }\n },\n \"credentials\": {\n \"zendeskApi\": {\n \"id\": \"ROx0ipJapRomRxEX\",\n \"name\": \"Zendesk Demo Access\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6a74a6d4-610a-4a13-afe4-7bb03d83d4c8\",\n \"name\": \"Move on to next ticket\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 360,\n -80\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n []\n ]\n },\n \"AI Agent1\": {\n \"main\": [\n [\n {\n \"node\": \"Update Zendesk with Mitre Data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n [],\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Token Splitter1\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Qdrant Vector Store query\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract from File\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI1\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Query Qdrant Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Move on to next ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get all Zendesk Tickets\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Structured Output Parser\": {\n \"ai_outputParser\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_outputParser\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Qdrant Vector Store query\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Query Qdrant Vector Store\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pull Mitre Data From Gdrive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract from File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Zendesk with Mitre Data\": {\n \"main\": [\n [\n {\n \"node\": \"Move on to next ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Pull Mitre Data From Gdrive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
49
0
3
true
combined_workflows.json
{ "input": "The workflow's goal is to analyze cybersecurity alerts, extract MITRE ATT&CK information, and provide actionable remediation steps, leveraging an AI agent and a knowledge base. It also enriches Zendesk tickets with this information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17274, "processed_size": 17274, "processed_timestamp": "2025-04-09T03:08:39.261398", "timestamp": "2025-04-09T02:37:42.056561", "token_count": 4095, "tokens": 1704, "workflow_chunk_info": { "is_truncated": false, "original_size": 17274, "processed_size": 17274, "workflow_hash": "119a8594379e304b5520ea3d0e864c9a" }, "workflow_hash": "119a8594379e304b5520ea3d0e864c9a" }
\"tactic\": \"Command and Control\",\n \"technique\": \"Protocol or Service Impersonation\",\n \"technique_id\": \"T1001.003\",\n \"description\": \"The RAT's check-in over port 443 implies potential masquerading of its traffic as legitimate SSL/TLS traffic, a tactic often used to blend C2 communications with normal web traffic.\",\n \"reference\": \"https://attack.mitre.org/techniques/T1001/003/\"\n }\n ]\n },\n \"remediation_steps\": {\n \"network_segmentation\": {\n \"action\": \"Isolate the affected host\",\n \"target\": \"10.11.26.183\",\n \"reason\": \"Prevents further C2 communication or lateral movement.\"\n },\n \"endpoint_inspection\": {\n \"action\": \"Perform a thorough inspection\",\n \"target\": \"Impacted endpoint\",\n \"method\": \"Use endpoint detection and response (EDR) tools to check for additional persistence mechanisms.\"\n },\n \"network_traffic_analysis\": {\n \"action\": \"Investigate and block unusual traffic\",\n \"target\": \"IP 194.180.191.64\",\n \"method\": \"Implement blocks for the IP across the firewall or IDS/IPS systems.\"\n },\n \"system_patching\": {\n \"action\": \"Ensure all systems are updated\",\n \"method\": \"Apply the latest security patches to mitigate vulnerabilities exploited by RAT malware.\"\n },\n \"ioc_hunting\": {\n \"action\": \"Search for Indicators of Compromise (IoCs)\",\n \"method\": \"Check for NetSupport RAT IoCs across other endpoints within the network.\"\n }\n },\n \"historical_patterns\": {\n \"network_anomalies\": \"Past alerts involving similar attempts to use standard web ports (e.g., 80, 443) for non-standard applications could suggest a broader attempt to blend malicious traffic into legitimate streams.\",\n \"persistence_tactics\": \"Any detection of anomalies in task scheduling or shortcut modifications may indicate persistence methods similar to those used by RATs.\"\n },\n \"external_resources\": [\n {\n \"title\": \"ESET Report on Okrum and Ketrican\",\n \"description\": \"Discusses similar tactics involving protocol impersonation and C2.\",\n \"url\": \"https://www.eset.com/int/about/newsroom/research/okrum-ketrican/\"\n },\n {\n \"title\": \"Malleable C2 Profiles\",\n \"description\": \"Document on crafting custom C2 traffic profiles similar to the targeting methods used by NetSupport RAT.\",\n \"url\": \"https://www.cobaltstrike.com/help-malleable-c2\"\n },\n {\n \"title\": \"MITRE ATT&CK Technique Overview\",\n \"description\": \"Overview of Protocol or Service Impersonation tactics.\",\n \"url\": \"https://attack.mitre.org/techniques/T1001/003/\"\n }\n ]\n}\n" }, "typeVersion": 1.2 }, { "id": "3aeb973d-22e5-4eaf-8fe8-fae3447909e1", "name": "Pull Mitre Data From Gdrive", "type": "n8n-nodes-base.googleDrive", "position": [ -1140, 1220 ], "parameters": { "fileId": { "__rl": true, "mode": "list", "value": "1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d", "cachedResultUrl": "https://drive.google.com/file/d/1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d/view?usp=drivesdk", "cachedResultName": "cleaned_mitre_attack_data.json" }, "options": {}, "operation": "download" }, "credentials": { "googleDriveOAuth2Api": { "id": "AVa7MXBLiB9NYjuO", "name": "Angel Gdrive" } }, "typeVersion": 3 }, { "id": "3b35633c-de80-4062-8497-cb65092d5708", "name": "Embed JSON in Qdrant Collection", "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant", "position": [ -520, 1220 ], "parameters": { "mode": "insert", "options": {}, "qdrantCollection": { "__rl": true, "mode": "id", "value": "mitre" } }, "credentials": { "qdrantApi": { "id": "u0qre50aar6iqyxu", "name": "Angel MitreAttack Demo Cluster" } }, "typeVersion": 1 }, { "id": "5f7f2fd8-276f-4b3a-ae88-1f1765967883", "name": "Query Qdrant Vector Store", "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant", "position": [ -480, 580 ], "parameters": { "mode": "retrieve-as-tool", "options": {}, "toolName": "mitre_attack_vector_store", "toolDescription": "The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\n\nBy analyzing input text, the vector store can:\n\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\nProvide structured context about potential adversary behaviors.\nSuggest remediation actions or detection methods based on the input.", "qdrantCollection": { "__rl": true, "mode": "list", "value": "mitre", "cachedResultName": "mitre" } }, "credentials": { "qdrantApi": { "id": "u0qre50aar6iqyxu", "name": "Angel MitreAttack Demo Cluster" } }, "typeVersion": 1 }, { "id": "298ffc29-1d60-4c05-92c6-a61071629a3f", "name": "Qdrant Vector Store query", "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant", "position": [ -320, -200 ], "parameters": { "mode": "retrieve-as-tool", "options": {}, "toolName": "mitre_attack_vector_store", "toolDescription": "The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\n\nBy analyzing input text, the vector store can:\n\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\nProvide structured context about potential adversary behaviors.\nSuggest remediation actions or detection methods based on the input.", "qdrantCollection": { "__rl": true, "mode": "list", "value": "mitre", "cachedResultName": "mitre" } }, "credentials": { "qdrantApi": { "id": "u0qre50aar6iqyxu", "name": "Angel MitreAttack Demo Cluster" } }, "typeVersion": 1 }, { "id": "c47f0ae6-106d-46da-afc3-f7afb86923ff", "name": "Get all Zendesk Tickets", "type": "n8n-nodes-base.zendesk", "position": [ -1180, -440 ], "parameters": { "options": {}, "operation": "getAll" }, "credentials": { "zendeskApi": { "id": "ROx0ipJapRomRxEX", "name": "Zendesk Demo Access" } }, "typeVersion": 1 }, { "id": "0ec2c505-5721-41af-91c8-1b0b55826d9e", "name": "Update Zendesk with Mitre Data", "type": "n8n-nodes-base.zendesk", "position": [ 0, -360 ], "parameters": { "id": "={{ $('Loop Over Items').item.json.id }}", "operation": "update", "updateFields": { "internalNote": "=Summary: {{ $json.output.ttp_identification.alert_summary }}\n\n", "customFieldsUi": { "customFieldsValues": [ { "id": 34479547176212, "value": "={{ $json.output.ttp_identification.mitre_attack_ttps[0].technique_id }}" }, { "id": 34479570659732, "value": "={{ $json.output.ttp_identification.mitre_attack_ttps[0].tactic }}" } ] } } }, "credentials": { "zendeskApi": { "id": "ROx0ipJapRomRxEX", "name": "Zendesk Demo Access" } }, "typeVersion": 1 }, { "id": "6a74a6d4-610a-4a13-afe4-7bb03d83d4c8", "name": "Move on to next ticket", "type": "n8n-nodes-base.noOp", "position": [ 360, -80 ], "parameters": {}, "typeVersion": 1 } ], "pinData": {}, "connections": { "AI Agent": { "main": [ [] ] }, "AI Agent1": { "main": [ [ { "node": "Update Zendesk with Mitre Data", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "Embed JSON in Qdrant Collection", "type": "main", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "AI Agent1", "type": "main", "index": 0 } ] ] }, "Token Splitter1": { "ai_textSplitter": [ [ { "node": "Default Data Loader", "type": "ai_textSplitter", "index": 0 } ] ] }, "Embeddings OpenAI": { "ai_embedding": [ [ { "node": "Qdrant Vector Store query", "type": "ai_embedding", "index": 0 } ] ] }, "Extract from File": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Embeddings OpenAI1": { "ai_embedding": [ [ { "node": "Embed JSON in Qdrant Collection", "type": "ai_embedding", "index": 0 } ] ] }, "Embeddings OpenAI2": { "ai_embedding": [ [ { "node": "Query Qdrant Vector Store", "type": "ai_embedding", "index": 0 } ] ] }, "OpenAI Chat Model1": { "ai_languageModel": [ [ { "node": "AI Agent1", "type": "ai_languageModel", "index": 0 } ] ] }, "Default Data Loader": { "ai_document": [ [ { "node": "Embed JSON in Qdrant Collection", "type": "ai_document", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Move on to next ticket": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Get all Zendesk Tickets": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": "AI Agent1", "type": "ai_outputParser", "index": 0 } ] ] }, "Qdrant Vector Store query": { "ai_tool": [ [ { "node": "AI Agent1", "type": "ai_tool", "index": 0 } ] ] }, "Query Qdrant Vector Store": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"86ddd018-3d6b-46b9-aa93-dedd6c6b5076\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -880,\n 360\n ],\n \"webhookId\": \"a9668bb8-bbe8-418a-b5c9-ff7dd431244f\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"a5ba5090-8e3b-4408-82df-92d2c524039e\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -680,\n 360\n ],\n \"parameters\": {\n \"options\": {\n \"systemMessage\": \"You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\\n1. Extract TTP information from SIEM data.\\n2. Provide actionable remediation steps tailored to the alert.\\n3. Cross-reference historical patterns and related alerts.\\n4. Recommend external resources for deeper understanding.\\n\\nEnsure that:\\n- TTPs are tagged with the tactic, technique name, and technique ID.\\n- Remediation steps are specific and actionable.\\n- Historical data includes related alerts and notable trends.\\n- External links are relevant to the observed behavior.\\n\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"67c52944-b616-4ea6-9507-e9fb6fcdbe2b\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -740,\n 580\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"55f6c16a-51ed-45e4-a1ab-aaaf1d7b5733\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n -720,\n 1220\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"data\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"46a5b8c6-3d34-4e9b-b812-23135f28c278\",\n \"name\": \"Embeddings OpenAI1\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -580,\n 1420\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"561b0737-26d5-450d-bd9e-08e0a608d6f9\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n -460,\n 1440\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n {\n \"name\": \"name\",\n \"value\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"killchain\",\n \"value\": \"={{ $json.kill_chain_phases }}\"\n },\n {\n \"name\": \"external\",\n \"value\": \"={{ $json.external_references }}\"\n }\n ]\n }\n },\n \"jsonData\": \"={{ $json.description }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e8a4aed-7e8c-492a-b816-6ab1a98c312a\",\n \"name\": \"Token Splitter1\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterTokenSplitter\",\n \"position\": [\n -460,\n 1620\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0c54049e-b5e8-448f-b864-39aeb274de3e\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n -580,\n 580\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"96b776a0-10da-4f70-99d0-ad6b6ee8fcca\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -460,\n 720\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-large\",\n \"options\": {\n \"dimensions\": 1536\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"695fba89-8f42-47c3-9d86-73f4ea0e72df\",\n \"name\": \"Extract from File\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -920,\n 1220\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"fromJson\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0b9897b0-149b-43ce-b66c-e78552729aa5\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1360,\n 1220\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"d8c29a14-0389-4748-a9de-686bf9a682c5\",\n \"name\": \"AI Agent1\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -540,\n -440\n ],\n \"parameters\": {\n \"text\": \"=Siem Alert Data:\\nAlert: {{ $json.raw_subject }}\\nDescription: {{ $json.description }}\",\n \"options\": {\n \"systemMessage\": \"You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\\n1. Extract TTP information from SIEM data.\\n2. Provide actionable remediation steps tailored to the alert.\\n3. Cross-reference historical patterns and related alerts.\\n4. Recommend external resources for deeper understanding.\\n\\nEnsure that:\\n- TTPs are tagged with the tactic, technique name, and technique ID.\\n- Remediation steps are specific and actionable.\\n- Historical data includes related alerts and notable trends.\\n- External links are relevant to the observed behavior.\\n\\nPlease output your response in html format, but do not include ```html at the beginning \\n\"\n },\n \"promptType\": \"define\",\n \"hasOutputParser\": true\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"55d0b00a-5046-45fa-87cb-cb0257caae87\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -600,\n -220\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9b53566b-e021-403d-9d78-28504c5c1dfa\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -320,\n -40\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-large\",\n \"options\": {\n \"dimensions\": 1536\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"f3b44ef5-e928-4662-81ef-4dd044829607\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n -940,\n -440\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"cc572b71-65c9-460c-bdcd-1d20feb15b32\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 820,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/qdrantlogo.png)\\n## Embed your Vector Store\\nTo provide data for your Vector store, you need to pass it in as JSON, and ensure it's setup correctly. This flow pulls the JSON file from Google Drive and extracts the JSON data and then passes it into the qdrant collection. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d5052d52-bec2-4b70-b460-6d5789c28d2c\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n 220\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 680,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/n8n.png)\\n## Talk to your Vector Store\\nNow that your vector store has been updated with the embedded data, \\nyou can use the n8n chat interface to talk to your data using OpenAI, \\nOllama, or any of our supported LLMs.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5cb478f6-17f3-4d7a-9b66-9e0654bd1dc9\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n -700\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 2140,\n \"height\": 900,\n \"content\": \"![Servicenow](https://uploads.n8n.io/templates/zendesk.png)\\n## Deploy your Vector Store\\nThis flow adds contextual information to your tickets using the Mitre Attack framework to help contextualize the ticket data.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71ee28f5-84a2-4c6c-855a-6c7c09b2d62a\",\n \"name\": \"Structured Output Parser\",\n \"type\": \"@n8n/n8n-nodes-langchain.outputParserStructured\",\n \"position\": [\n 0,\n -160\n ],\n \"parameters\": {\n \"jsonSchemaExample\": \"{\\n \\\"ttp_identification\\\": {\\n \\\"alert_summary\\\": \\\"The alert indicates a check-in from the NetSupport RAT, a known Remote Access Trojan, suggesting command and control (C2) communication.\\\",\\n \\\"mitre_attack_ttps\\\": [\\n {\\n \\\"tactic\\\": \\\"Command and Control\\\",\\n \\\"technique\\\": \\\"Protocol or Service Impersonation\\\",\\n \\\"technique_id\\\": \\\"T1001.003\\\",\\n \\\"description\\\": \\\"The RAT's check-in over port 443 implies potential masquerading of its traffic as legitimate SSL/TLS traffic, a tactic often used to blend C2 communications with normal web traffic.\\\",\\n \\\"reference\\\": \\\"https://attack.mitre.org/techniques/T1001/003/\\\"\\n }\\n ]\\n },\\n \\\"remediation_steps\\\": {\\n \\\"network_segmentation\\\": {\\n \\\"action\\\": \\\"Isolate the affected host\\\",\\n \\\"target\\\": \\\"10.11.26.183\\\",\\n \\\"reason\\\": \\\"Prevents further C2 communication or lateral movement.\\\"\\n },\\n \\\"endpoint_inspection\\\": {\\n \\\"action\\\": \\\"Perform a thorough inspection\\\",\\n \\\"target\\\": \\\"Impacted endpoint\\\",\\n \\\"method\\\": \\\"Use endpoint detection and response (EDR) tools to check for additional persistence mechanisms.\\\"\\n },\\n \\\"network_traffic_analysis\\\": {\\n \\\"action\\\": \\\"Investigate and block unusual traffic\\\",\\n \\\"target\\\": \\\"IP 194.180.191.64\\\",\\n \\\"method\\\": \\\"Implement blocks for the IP across the firewall or IDS/IPS systems.\\\"\\n },\\n \\\"system_patching\\\": {\\n \\\"action\\\": \\\"Ensure all systems are updated\\\",\\n \\\"method\\\": \\\"Apply the latest security patches to mitigate vulnerabilities exploited by RAT malware.\\\"\\n },\\n \\\"ioc_hunting\\\": {\\n \\\"action\\\": \\\"Search for Indicators of Compromise (IoCs)\\\",\\n \\\"method\\\": \\\"Check for NetSupport RAT IoCs across other endpoints within the network.\\\"\\n }\\n },\\n \\\"historical_patterns\\\": {\\n \\\"network_anomalies\\\": \\\"Past alerts involving similar attempts to use standard web ports (e.g., 80, 443) for non-standard applications could suggest a broader attempt to blend malicious traffic into legitimate streams.\\\",\\n \\\"persistence_tactics\\\": \\\"Any detection of anomalies in task scheduling or shortcut modifications may indicate persistence methods similar to those used by RATs.\\\"\\n },\\n \\\"external_resources\\\": [\\n {\\n \\\"title\\\": \\\"ESET Report on Okrum and Ketrican\\\",\\n \\\"description\\\": \\\"Discusses similar tactics involving protocol impersonation and C2.\\\",\\n \\\"url\\\": \\\"https://www.eset.com/int/about/newsroom/research/okrum-ketrican/\\\"\\n },\\n {\\n \\\"title\\\": \\\"Malleable C2 Profiles\\\",\\n \\\"description\\\": \\\"Document on crafting custom C2 traffic profiles similar to the targeting methods used by NetSupport RAT.\\\",\\n \\\"url\\\": \\\"https://www.cobaltstrike.com/help-malleable-c2\\\"\\n },\\n {\\n \\\"title\\\": \\\"MITRE ATT&CK Technique Overview\\\",\\n \\\"description\\\": \\\"Overview of Protocol or Service Impersonation tactics.\\\",\\n \\\"url\\\": \\\"https://attack.mitre.org/techniques/T1001/003/\\\"\\n }\\n ]\\n}\\n\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"3aeb973d-22e5-4eaf-8fe8-fae3447909e1\",\n \"name\": \"Pull Mitre Data From Gdrive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -1140,\n 1220\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d\",\n \"cachedResultUrl\": \"https://drive.google.com/file/d/1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d/view?usp=drivesdk\",\n \"cachedResultName\": \"cleaned_mitre_attack_data.json\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"AVa7MXBLiB9NYjuO\",\n \"name\": \"Angel Gdrive\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"3b35633c-de80-4062-8497-cb65092d5708\",\n \"name\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -520,\n 1220\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5f7f2fd8-276f-4b3a-ae88-1f1765967883\",\n \"name\": \"Query Qdrant Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -480,\n 580\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"mitre_attack_vector_store\",\n \"toolDescription\": \"The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\\n\\nBy analyzing input text, the vector store can:\\n\\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\\nProvide structured context about potential adversary behaviors.\\nSuggest remediation actions or detection methods based on the input.\",\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"mitre\",\n \"cachedResultName\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"298ffc29-1d60-4c05-92c6-a61071629a3f\",\n \"name\": \"Qdrant Vector Store query\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -320,\n -200\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"mitre_attack_vector_store\",\n \"toolDescription\": \"The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\\n\\nBy analyzing input text, the vector store can:\\n\\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\\nProvide structured context about potential adversary behaviors.\\nSuggest remediation actions or detection methods based on the input.\",\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"mitre\",\n \"cachedResultName\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c47f0ae6-106d-46da-afc3-f7afb86923ff\",\n \"name\": \"Get all Zendesk Tickets\",\n \"type\": \"n8n-nodes-base.zendesk\",\n \"position\": [\n -1180,\n -440\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"zendeskApi\": {\n \"id\": \"ROx0ipJapRomRxEX\",\n \"name\": \"Zendesk Demo Access\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0ec2c505-5721-41af-91c8-1b0b55826d9e\",\n \"name\": \"Update Zendesk with Mitre Data\",\n \"type\": \"n8n-nodes-base.zendesk\",\n \"position\": [\n 0,\n -360\n ],\n \"parameters\": {\n \"id\": \"={{ $('Loop Over Items').item.json.id }}\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"internalNote\": \"=Summary: {{ $json.output.ttp_identification.alert_summary }}\\n\\n\",\n \"customFieldsUi\": {\n \"customFieldsValues\": [\n {\n \"id\": 34479547176212,\n \"value\": \"={{ $json.output.ttp_identification.mitre_attack_ttps[0].technique_id }}\"\n },\n {\n \"id\": 34479570659732,\n \"value\": \"={{ $json.output.ttp_identification.mitre_attack_ttps[0].tactic }}\"\n }\n ]\n }\n }\n },\n \"credentials\": {\n \"zendeskApi\": {\n \"id\": \"ROx0ipJapRomRxEX\",\n \"name\": \"Zendesk Demo Access\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6a74a6d4-610a-4a13-afe4-7bb03d83d4c8\",\n \"name\": \"Move on to next ticket\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 360,\n -80\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n []\n ]\n },\n \"AI Agent1\": {\n \"main\": [\n [\n {\n \"node\": \"Update Zendesk with Mitre Data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n [],\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Token Splitter1\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Qdrant Vector Store query\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract from File\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI1\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Query Qdrant Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Move on to next ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get all Zendesk Tickets\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Structured Output Parser\": {\n \"ai_outputParser\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_outputParser\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Qdrant Vector Store query\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Query Qdrant Vector Store\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pull Mitre Data From Gdrive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract from File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Zendesk with Mitre Data\": {\n \"main\": [\n [\n {\n \"node\": \"Move on to next ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Pull Mitre Data From Gdrive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
49
1
3
true
combined_workflows.json
{ "input": "The workflow's goal is to analyze cybersecurity alerts, extract MITRE ATT&CK information, and provide actionable remediation steps, leveraging an AI agent and a knowledge base. It also enriches Zendesk tickets with this information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17274, "processed_size": 17274, "processed_timestamp": "2025-04-09T03:08:39.271400", "timestamp": "2025-04-09T02:37:42.056561", "token_count": 4097, "tokens": 1704, "workflow_chunk_info": { "is_truncated": false, "original_size": 17274, "processed_size": 17274, "workflow_hash": "119a8594379e304b5520ea3d0e864c9a" }, "workflow_hash": "119a8594379e304b5520ea3d0e864c9a" }
Items", "type": "main", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": "AI Agent1", "type": "ai_outputParser", "index": 0 } ] ] }, "Qdrant Vector Store query": { "ai_tool": [ [ { "node": "AI Agent1", "type": "ai_tool", "index": 0 } ] ] }, "Query Qdrant Vector Store": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Pull Mitre Data From Gdrive": { "main": [ [ { "node": "Extract from File", "type": "main", "index": 0 } ] ] }, "Update Zendesk with Mitre Data": { "main": [ [ { "node": "Move on to next ticket", "type": "main", "index": 0 } ] ] }, "When clicking β€˜Test workflow’": { "main": [ [ { "node": "Pull Mitre Data From Gdrive", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"86ddd018-3d6b-46b9-aa93-dedd6c6b5076\",\n \"name\": \"When chat message received\",\n \"type\": \"@n8n/n8n-nodes-langchain.chatTrigger\",\n \"position\": [\n -880,\n 360\n ],\n \"webhookId\": \"a9668bb8-bbe8-418a-b5c9-ff7dd431244f\",\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"a5ba5090-8e3b-4408-82df-92d2c524039e\",\n \"name\": \"AI Agent\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -680,\n 360\n ],\n \"parameters\": {\n \"options\": {\n \"systemMessage\": \"You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\\n1. Extract TTP information from SIEM data.\\n2. Provide actionable remediation steps tailored to the alert.\\n3. Cross-reference historical patterns and related alerts.\\n4. Recommend external resources for deeper understanding.\\n\\nEnsure that:\\n- TTPs are tagged with the tactic, technique name, and technique ID.\\n- Remediation steps are specific and actionable.\\n- Historical data includes related alerts and notable trends.\\n- External links are relevant to the observed behavior.\\n\"\n }\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"67c52944-b616-4ea6-9507-e9fb6fcdbe2b\",\n \"name\": \"OpenAI Chat Model\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -740,\n 580\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"55f6c16a-51ed-45e4-a1ab-aaaf1d7b5733\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n -720,\n 1220\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"data\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"46a5b8c6-3d34-4e9b-b812-23135f28c278\",\n \"name\": \"Embeddings OpenAI1\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -580,\n 1420\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"561b0737-26d5-450d-bd9e-08e0a608d6f9\",\n \"name\": \"Default Data Loader\",\n \"type\": \"@n8n/n8n-nodes-langchain.documentDefaultDataLoader\",\n \"position\": [\n -460,\n 1440\n ],\n \"parameters\": {\n \"options\": {\n \"metadata\": {\n \"metadataValues\": [\n {\n \"name\": \"id\",\n \"value\": \"={{ $json.id }}\"\n },\n {\n \"name\": \"name\",\n \"value\": \"={{ $json.name }}\"\n },\n {\n \"name\": \"killchain\",\n \"value\": \"={{ $json.kill_chain_phases }}\"\n },\n {\n \"name\": \"external\",\n \"value\": \"={{ $json.external_references }}\"\n }\n ]\n }\n },\n \"jsonData\": \"={{ $json.description }}\",\n \"jsonMode\": \"expressionData\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6e8a4aed-7e8c-492a-b816-6ab1a98c312a\",\n \"name\": \"Token Splitter1\",\n \"type\": \"@n8n/n8n-nodes-langchain.textSplitterTokenSplitter\",\n \"position\": [\n -460,\n 1620\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"0c54049e-b5e8-448f-b864-39aeb274de3e\",\n \"name\": \"Window Buffer Memory\",\n \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\",\n \"position\": [\n -580,\n 580\n ],\n \"parameters\": {},\n \"typeVersion\": 1.3\n },\n {\n \"id\": \"96b776a0-10da-4f70-99d0-ad6b6ee8fcca\",\n \"name\": \"Embeddings OpenAI2\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -460,\n 720\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-large\",\n \"options\": {\n \"dimensions\": 1536\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"695fba89-8f42-47c3-9d86-73f4ea0e72df\",\n \"name\": \"Extract from File\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -920,\n 1220\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"fromJson\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0b9897b0-149b-43ce-b66c-e78552729aa5\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1360,\n 1220\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"d8c29a14-0389-4748-a9de-686bf9a682c5\",\n \"name\": \"AI Agent1\",\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"position\": [\n -540,\n -440\n ],\n \"parameters\": {\n \"text\": \"=Siem Alert Data:\\nAlert: {{ $json.raw_subject }}\\nDescription: {{ $json.description }}\",\n \"options\": {\n \"systemMessage\": \"You are a cybersecurity expert trained on MITRE ATT&CK and enterprise incident response. Your job is to:\\n1. Extract TTP information from SIEM data.\\n2. Provide actionable remediation steps tailored to the alert.\\n3. Cross-reference historical patterns and related alerts.\\n4. Recommend external resources for deeper understanding.\\n\\nEnsure that:\\n- TTPs are tagged with the tactic, technique name, and technique ID.\\n- Remediation steps are specific and actionable.\\n- Historical data includes related alerts and notable trends.\\n- External links are relevant to the observed behavior.\\n\\nPlease output your response in html format, but do not include ```html at the beginning \\n\"\n },\n \"promptType\": \"define\",\n \"hasOutputParser\": true\n },\n \"typeVersion\": 1.7\n },\n {\n \"id\": \"55d0b00a-5046-45fa-87cb-cb0257caae87\",\n \"name\": \"OpenAI Chat Model1\",\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"position\": [\n -600,\n -220\n ],\n \"parameters\": {\n \"model\": \"gpt-4o\",\n \"options\": {}\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9b53566b-e021-403d-9d78-28504c5c1dfa\",\n \"name\": \"Embeddings OpenAI\",\n \"type\": \"@n8n/n8n-nodes-langchain.embeddingsOpenAi\",\n \"position\": [\n -320,\n -40\n ],\n \"parameters\": {\n \"model\": \"text-embedding-3-large\",\n \"options\": {\n \"dimensions\": 1536\n }\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"QpFZ2EiM3WGl6Zr3\",\n \"name\": \"Marketing OpenAI\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"f3b44ef5-e928-4662-81ef-4dd044829607\",\n \"name\": \"Loop Over Items\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n -940,\n -440\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"cc572b71-65c9-460c-bdcd-1d20feb15b32\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n 940\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 820,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/qdrantlogo.png)\\n## Embed your Vector Store\\nTo provide data for your Vector store, you need to pass it in as JSON, and ensure it's setup correctly. This flow pulls the JSON file from Google Drive and extracts the JSON data and then passes it into the qdrant collection. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d5052d52-bec2-4b70-b460-6d5789c28d2c\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n 220\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1380,\n \"height\": 680,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/n8n.png)\\n## Talk to your Vector Store\\nNow that your vector store has been updated with the embedded data, \\nyou can use the n8n chat interface to talk to your data using OpenAI, \\nOllama, or any of our supported LLMs.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5cb478f6-17f3-4d7a-9b66-9e0654bd1dc9\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1460,\n -700\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 2140,\n \"height\": 900,\n \"content\": \"![Servicenow](https://uploads.n8n.io/templates/zendesk.png)\\n## Deploy your Vector Store\\nThis flow adds contextual information to your tickets using the Mitre Attack framework to help contextualize the ticket data.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"71ee28f5-84a2-4c6c-855a-6c7c09b2d62a\",\n \"name\": \"Structured Output Parser\",\n \"type\": \"@n8n/n8n-nodes-langchain.outputParserStructured\",\n \"position\": [\n 0,\n -160\n ],\n \"parameters\": {\n \"jsonSchemaExample\": \"{\\n \\\"ttp_identification\\\": {\\n \\\"alert_summary\\\": \\\"The alert indicates a check-in from the NetSupport RAT, a known Remote Access Trojan, suggesting command and control (C2) communication.\\\",\\n \\\"mitre_attack_ttps\\\": [\\n {\\n \\\"tactic\\\": \\\"Command and Control\\\",\\n \\\"technique\\\": \\\"Protocol or Service Impersonation\\\",\\n \\\"technique_id\\\": \\\"T1001.003\\\",\\n \\\"description\\\": \\\"The RAT's check-in over port 443 implies potential masquerading of its traffic as legitimate SSL/TLS traffic, a tactic often used to blend C2 communications with normal web traffic.\\\",\\n \\\"reference\\\": \\\"https://attack.mitre.org/techniques/T1001/003/\\\"\\n }\\n ]\\n },\\n \\\"remediation_steps\\\": {\\n \\\"network_segmentation\\\": {\\n \\\"action\\\": \\\"Isolate the affected host\\\",\\n \\\"target\\\": \\\"10.11.26.183\\\",\\n \\\"reason\\\": \\\"Prevents further C2 communication or lateral movement.\\\"\\n },\\n \\\"endpoint_inspection\\\": {\\n \\\"action\\\": \\\"Perform a thorough inspection\\\",\\n \\\"target\\\": \\\"Impacted endpoint\\\",\\n \\\"method\\\": \\\"Use endpoint detection and response (EDR) tools to check for additional persistence mechanisms.\\\"\\n },\\n \\\"network_traffic_analysis\\\": {\\n \\\"action\\\": \\\"Investigate and block unusual traffic\\\",\\n \\\"target\\\": \\\"IP 194.180.191.64\\\",\\n \\\"method\\\": \\\"Implement blocks for the IP across the firewall or IDS/IPS systems.\\\"\\n },\\n \\\"system_patching\\\": {\\n \\\"action\\\": \\\"Ensure all systems are updated\\\",\\n \\\"method\\\": \\\"Apply the latest security patches to mitigate vulnerabilities exploited by RAT malware.\\\"\\n },\\n \\\"ioc_hunting\\\": {\\n \\\"action\\\": \\\"Search for Indicators of Compromise (IoCs)\\\",\\n \\\"method\\\": \\\"Check for NetSupport RAT IoCs across other endpoints within the network.\\\"\\n }\\n },\\n \\\"historical_patterns\\\": {\\n \\\"network_anomalies\\\": \\\"Past alerts involving similar attempts to use standard web ports (e.g., 80, 443) for non-standard applications could suggest a broader attempt to blend malicious traffic into legitimate streams.\\\",\\n \\\"persistence_tactics\\\": \\\"Any detection of anomalies in task scheduling or shortcut modifications may indicate persistence methods similar to those used by RATs.\\\"\\n },\\n \\\"external_resources\\\": [\\n {\\n \\\"title\\\": \\\"ESET Report on Okrum and Ketrican\\\",\\n \\\"description\\\": \\\"Discusses similar tactics involving protocol impersonation and C2.\\\",\\n \\\"url\\\": \\\"https://www.eset.com/int/about/newsroom/research/okrum-ketrican/\\\"\\n },\\n {\\n \\\"title\\\": \\\"Malleable C2 Profiles\\\",\\n \\\"description\\\": \\\"Document on crafting custom C2 traffic profiles similar to the targeting methods used by NetSupport RAT.\\\",\\n \\\"url\\\": \\\"https://www.cobaltstrike.com/help-malleable-c2\\\"\\n },\\n {\\n \\\"title\\\": \\\"MITRE ATT&CK Technique Overview\\\",\\n \\\"description\\\": \\\"Overview of Protocol or Service Impersonation tactics.\\\",\\n \\\"url\\\": \\\"https://attack.mitre.org/techniques/T1001/003/\\\"\\n }\\n ]\\n}\\n\"\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"3aeb973d-22e5-4eaf-8fe8-fae3447909e1\",\n \"name\": \"Pull Mitre Data From Gdrive\",\n \"type\": \"n8n-nodes-base.googleDrive\",\n \"position\": [\n -1140,\n 1220\n ],\n \"parameters\": {\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d\",\n \"cachedResultUrl\": \"https://drive.google.com/file/d/1oWBLO5AlIqbgo9mKD1hNtx92HdC6O28d/view?usp=drivesdk\",\n \"cachedResultName\": \"cleaned_mitre_attack_data.json\"\n },\n \"options\": {},\n \"operation\": \"download\"\n },\n \"credentials\": {\n \"googleDriveOAuth2Api\": {\n \"id\": \"AVa7MXBLiB9NYjuO\",\n \"name\": \"Angel Gdrive\"\n }\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"3b35633c-de80-4062-8497-cb65092d5708\",\n \"name\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -520,\n 1220\n ],\n \"parameters\": {\n \"mode\": \"insert\",\n \"options\": {},\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5f7f2fd8-276f-4b3a-ae88-1f1765967883\",\n \"name\": \"Query Qdrant Vector Store\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -480,\n 580\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"mitre_attack_vector_store\",\n \"toolDescription\": \"The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\\n\\nBy analyzing input text, the vector store can:\\n\\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\\nProvide structured context about potential adversary behaviors.\\nSuggest remediation actions or detection methods based on the input.\",\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"mitre\",\n \"cachedResultName\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"298ffc29-1d60-4c05-92c6-a61071629a3f\",\n \"name\": \"Qdrant Vector Store query\",\n \"type\": \"@n8n/n8n-nodes-langchain.vectorStoreQdrant\",\n \"position\": [\n -320,\n -200\n ],\n \"parameters\": {\n \"mode\": \"retrieve-as-tool\",\n \"options\": {},\n \"toolName\": \"mitre_attack_vector_store\",\n \"toolDescription\": \"The mitre_attack_vector_store is a knowledge base trained on the MITRE ATT&CK framework. It is designed to help identify, correlate, and provide context for cybersecurity incidents based on textual descriptions of alerts, events, or behaviors. This tool leverages precomputed embeddings of attack techniques, tactics, and procedures (TTPs) to map user queries (such as SIEM-generated alerts or JIRA ticket titles) to relevant MITRE ATT&CK techniques.\\n\\nBy analyzing input text, the vector store can:\\n\\nRetrieve the most relevant MITRE ATT&CK entries (e.g., techniques, tactics, descriptions, external references).\\nProvide structured context about potential adversary behaviors.\\nSuggest remediation actions or detection methods based on the input.\",\n \"qdrantCollection\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"mitre\",\n \"cachedResultName\": \"mitre\"\n }\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"u0qre50aar6iqyxu\",\n \"name\": \"Angel MitreAttack Demo Cluster\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c47f0ae6-106d-46da-afc3-f7afb86923ff\",\n \"name\": \"Get all Zendesk Tickets\",\n \"type\": \"n8n-nodes-base.zendesk\",\n \"position\": [\n -1180,\n -440\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"zendeskApi\": {\n \"id\": \"ROx0ipJapRomRxEX\",\n \"name\": \"Zendesk Demo Access\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"0ec2c505-5721-41af-91c8-1b0b55826d9e\",\n \"name\": \"Update Zendesk with Mitre Data\",\n \"type\": \"n8n-nodes-base.zendesk\",\n \"position\": [\n 0,\n -360\n ],\n \"parameters\": {\n \"id\": \"={{ $('Loop Over Items').item.json.id }}\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"internalNote\": \"=Summary: {{ $json.output.ttp_identification.alert_summary }}\\n\\n\",\n \"customFieldsUi\": {\n \"customFieldsValues\": [\n {\n \"id\": 34479547176212,\n \"value\": \"={{ $json.output.ttp_identification.mitre_attack_ttps[0].technique_id }}\"\n },\n {\n \"id\": 34479570659732,\n \"value\": \"={{ $json.output.ttp_identification.mitre_attack_ttps[0].tactic }}\"\n }\n ]\n }\n }\n },\n \"credentials\": {\n \"zendeskApi\": {\n \"id\": \"ROx0ipJapRomRxEX\",\n \"name\": \"Zendesk Demo Access\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"6a74a6d4-610a-4a13-afe4-7bb03d83d4c8\",\n \"name\": \"Move on to next ticket\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 360,\n -80\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"AI Agent\": {\n \"main\": [\n []\n ]\n },\n \"AI Agent1\": {\n \"main\": [\n [\n {\n \"node\": \"Update Zendesk with Mitre Data\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Loop Over Items\": {\n \"main\": [\n [],\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Token Splitter1\": {\n \"ai_textSplitter\": [\n [\n {\n \"node\": \"Default Data Loader\",\n \"type\": \"ai_textSplitter\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Qdrant Vector Store query\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Extract from File\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI1\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Embeddings OpenAI2\": {\n \"ai_embedding\": [\n [\n {\n \"node\": \"Query Qdrant Vector Store\",\n \"type\": \"ai_embedding\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model1\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Default Data Loader\": {\n \"ai_document\": [\n [\n {\n \"node\": \"Embed JSON in Qdrant Collection\",\n \"type\": \"ai_document\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Window Buffer Memory\": {\n \"ai_memory\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_memory\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Move on to next ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get all Zendesk Tickets\": {\n \"main\": [\n [\n {\n \"node\": \"Loop Over Items\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Structured Output Parser\": {\n \"ai_outputParser\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_outputParser\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Qdrant Vector Store query\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent1\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Query Qdrant Vector Store\": {\n \"ai_tool\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"ai_tool\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When chat message received\": {\n \"main\": [\n [\n {\n \"node\": \"AI Agent\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Pull Mitre Data From Gdrive\": {\n \"main\": [\n [\n {\n \"node\": \"Extract from File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Update Zendesk with Mitre Data\": {\n \"main\": [\n [\n {\n \"node\": \"Move on to next ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Pull Mitre Data From Gdrive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
49
2
3
true
combined_workflows.json
{ "input": "The workflow's goal is to analyze cybersecurity alerts, extract MITRE ATT&CK information, and provide actionable remediation steps, leveraging an AI agent and a knowledge base. It also enriches Zendesk tickets with this information.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 17274, "processed_size": 17274, "processed_timestamp": "2025-04-09T03:08:39.273398", "timestamp": "2025-04-09T02:37:42.056561", "token_count": 512, "tokens": 1704, "workflow_chunk_info": { "is_truncated": false, "original_size": 17274, "processed_size": 17274, "workflow_hash": "119a8594379e304b5520ea3d0e864c9a" }, "workflow_hash": "119a8594379e304b5520ea3d0e864c9a" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow analyzes emails for potential phishing URLs, scans those URLs using URLScan.io and VirusTotal, and reports the findings via Slack. Analyze this workflow: ```json { "id": "8EmNhftXznAGV3dR", "meta": { "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8" }, "name": "Phishing_analysis__URLScan_io_and_Virustotal_", "tags": [ { "id": "GCHVocImoXoEVnzP", "name": "πŸ› οΈ In progress", "createdAt": "2023-10-31T02:17:21.618Z", "updatedAt": "2023-10-31T02:17:21.618Z" }, { "id": "QPJKatvLSxxtrE8U", "name": "Secops", "createdAt": "2023-10-31T02:15:11.396Z", "updatedAt": "2023-10-31T02:15:11.396Z" } ], "nodes": [ { "id": "f170068a-4540-4fbd-bd17-00a6367989d1", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ -1760, 560 ], "parameters": {}, "typeVersion": 1 }, { "id": "5a1e0490-6971-4490-a806-46da5e226365", "name": "sends slack message", "type": "n8n-nodes-base.slack", "position": [ -360, 1280 ], "parameters": { "text": "=*Email Analysis*\n\nSubject: {{ $('Microsoft Outlook').item.json[\"subject\"] }}\nFrom: {{ $('Microsoft Outlook').item.json[\"sender\"][\"emailAddress\"][\"address\"] }}\nDate: {{ $('Microsoft Outlook').item.json[\"sentDateTime\"] }}\n\nReport:\n\n*URLScan Report URL:* {{ $('urlscan.io').item.json.result ? $('urlscan.io').item.json.result : \"N/A\" }}\n*Virustotal report:* https://www.virustotal.com/gui/url/{{ $json[\"data\"][\"id\"].split(\"-\")[1] }}\n*Virustotal Verdict:* {{ $json.data.attributes.stats.malicious + $json.data.attributes.stats.suspicious }} / {{ Object.keys($json.data.attributes.results).length }}", "select": "channel", "channelId": { "__rl": true, "mode": "name", "value": "test-giulio-public" }, "otherOptions": {} }, "credentials": { "slackApi": { "id": "252", "name": "Slack Bot Token | Giulio [βœ… Share ok]" } }, "typeVersion": 2 }, { "id": "65e70f8a-7514-455e-97bf-b11514b4eec2", "name": "Split In Batches", "type": "n8n-nodes-base.splitInBatches", "position": [ -1020, 480 ], "parameters": { "options": {}, "batchSize": 1 }, "typeVersion": 2 }, { "id": "35084825-f3b2-4a01-b953-712c099a6451", "name": "Mark as read", "type": "n8n-nodes-base.microsoftOutlook", "position": [ -1300, 560 ], "parameters": { "messageId": "={{ $json.id }}", "operation": "update", "updateFields": { "isRead": true } }, "credentials": { "microsoftOutlookOAuth2Api": { "id": "Zeu3LbjDbkwiCUik", "name": "Microsoft Outlook | Giulio [βœ… Share ok]" } }, "typeVersion": 1 }, { "id": "62098c94-5735-4eed-a712-3f9887e0400f", "name": "VirusTotal: Scan URL", "type": "n8n-nodes-base.httpRequest", "position": [ -220, 700 ], "parameters": { "url": "https://www.virustotal.com/api/v3/urls", "method": "POST", "options": {}, "sendQuery": true, "authentication": "predefinedCredentialType", "queryParameters": { "parameters": [ { "name": "url", "value": "={{ $json.domain }}" } ] }, "nodeCredentialType": "virusTotalApi" }, "credentials": { "virusTotalApi": { "id": "hVTFFXxLV4oWPOb0", "name": "Virus Total | Giulio [βœ… Share ok]" } }, "typeVersion": 4.1 }, { "id": "55b7ce97-3609-4a16-b998-8bec77cffb59", "name": "VirusTotal: Get report", "type": "n8n-nodes-base.httpRequest", "position": [ 200, 700 ], "parameters": { "url": "=https://www.virustotal.com/api/v3/analyses/{{ $json.data.id }}", "options": {}, "sendQuery": true, "authentication": "predefinedCredentialType", "queryParameters": { "parameters": [ { "name": "resource", "value": "https://developers.virustotal.com/v2.0/reference/url-report" } ] }, "nodeCredentialType": "virusTotalApi" }, "credentials": { "virusTotalApi": { "id": "hVTFFXxLV4oWPOb0", "name": "Virus Total | Giulio [βœ… Share ok]" } }, "typeVersion": 4.1 }, { "id": "7bf3c7a0-94f9-410b-b0fe-e0d15d0ba895", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -1760, 380 ], "parameters": { "rule": { "interval": [ {} ] } }, "typeVersion": 1.1 }, { "id": "741f3221-bb73-4004-801e-e9c3030740f8", "name": "Find indicators of compromise", "type": "n8n-nodes-base.code", "position": [ -780, 440 ], "parameters": { "language": "python", "pythonCode": "try:\n from ioc_finder import find_iocs\nexcept ImportError:\n import micropip\n await micropip.install(\"ioc-finder\")\n from ioc_finder import find_iocs\n\ntext = _input.first().json['body']['content']\nprint(text)\n\niocs = find_iocs(text)\n\nreturn [{\"json\": { \"domain\": item }} for item in iocs[\"urls\"]]" }, "typeVersion": 2, "alwaysOutputData": true }, { "id": "bf8ba285-e824-4104-82e0-fa2dba80f301", "name": "URLScan: Get report", "type": "n8n-nodes-base.urlScanIo", "position": [ 640, 60 ], "parameters": { "scanId": "={{ $json.scanId }}", "operation": "get" }, "credentials": { "urlScanIoApi": { "id": "eva7ViJyyrpmJDe3", "name": "urlscan.io | Giulio [βœ… Share ok]" } }, "typeVersion": 1 }, { "id": "eb3b06e8-ffe3-4472-a70c-08fb2555e0fb", "name": "URLScan: Scan URL", "type": "n8n-nodes-base.urlScanIo", "position": [ -100, 120 ], "parameters": { "url": "={{ $json.domain }}", "additionalFields": {} }, "credentials": { "urlScanIoApi": { "id": "eva7ViJyyrpmJDe3", "name": "urlscan.io | Giulio [βœ… Share ok]" } }, "typeVersion": 1, "continueOnFail": true }, { "id": "34157694-635a-481b-b7d2-dcd4628b26fe", "name": "Has URL?", "type": "n8n-nodes-base.if", "position": [ -520, 440 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $json.domain }}", "operation": "isNotEmpty" } ] } }, "typeVersion": 1 }, { "id": "33cad369-0598-433e-90f8-0e7333ec5e92", "name": "No error?", "type": "n8n-nodes-base.if", "position": [ 240, 120 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $json.error }}", "operation": "isNotEmpty" } ] } }, "typeVersion": 1 }, { "id": "cba20d52-a56c-4ac0-99f2-d9b54adb342e", "name": "Not empty?", "type": "n8n-nodes-base.filter", "position": [ -640, 1280 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $json.data }}", "operation": "isNotEmpty" } ] } }, "typeVersion": 1 }, { "id": "449c31e3-e098-43ec-a31b-1e383c6add57", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -2051.228008430503, -251.94391274976795 ], "parameters": { "width": 474.5187061049208, "height": 1008.8561536646063, "content": "![Scheduled](https://i.imgur.com/PcOuvAL.png)\n## Workflow Overview\n\nThis n8n workflow is engineered to enhance cybersecurity measures by analyzing potential phishing URLs using URLScan.io and VirusTotal. \n\nIt is designed to automatically process and evaluate URLs from incoming messages for malicious content.\n\nThis workflow is tuned specifically for `Outlook`, but you can replace outlook with your mail provider of choice. \n\nThe workflow can be initiated manually or scheduled to run automatically, ensuring consistent checks against phishing threats. By integrating with leading cybersecurity tools, it provides a comprehensive analysis, strengthening your organization's defense against phishing attacks.\n\n## Execution Schedule\n\nIt can be triggered at will by clicking \"Execute Workflow\" or set to run on a schedule. To align with your operational needs, customize the `Schedule Trigger` to your preferred frequency, ensuring continuous monitoring for phishing attempts." }, "typeVersion": 1 }, { "id": "a8921212-aec4-422d-9f04-f402d7591475", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -1560, 107 ], "parameters": { "width": 397.3953488372091, "height": 647.1076277970203, "content": "![Outlook](https://i.imgur.com/R3Bhd8I.png)\n## Email Processing for Phishing Analysis\nThis segment of the workflow interfaces with Microsoft Outlook to retrieve and process `all messages marked as unread`. This section can be replaced with any mail provider.\n\nOnce an email is fetched, the `Get all unread messages` node captures the details, while the `Mark as read` node updates the message's status. \n\nThis ensures that each email is only processed once, maintaining a clean and organized inbox, and preventing reprocessing of the same messages." }, "typeVersion": 1 }, { "id": "fbad734e-4502-4d1b-8890-b05c486a1f70", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -1140, 15.062288067451163 ], "parameters": { "width": 859.9418604651164, "
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"8EmNhftXznAGV3dR\",\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"name\": \"Phishing_analysis__URLScan_io_and_Virustotal_\",\n \"tags\": [\n {\n \"id\": \"GCHVocImoXoEVnzP\",\n \"name\": \"πŸ› οΈ In progress\",\n \"createdAt\": \"2023-10-31T02:17:21.618Z\",\n \"updatedAt\": \"2023-10-31T02:17:21.618Z\"\n },\n {\n \"id\": \"QPJKatvLSxxtrE8U\",\n \"name\": \"Secops\",\n \"createdAt\": \"2023-10-31T02:15:11.396Z\",\n \"updatedAt\": \"2023-10-31T02:15:11.396Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"f170068a-4540-4fbd-bd17-00a6367989d1\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1760,\n 560\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a1e0490-6971-4490-a806-46da5e226365\",\n \"name\": \"sends slack message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n -360,\n 1280\n ],\n \"parameters\": {\n \"text\": \"=*Email Analysis*\\n\\nSubject: {{ $('Microsoft Outlook').item.json[\\\"subject\\\"] }}\\nFrom: {{ $('Microsoft Outlook').item.json[\\\"sender\\\"][\\\"emailAddress\\\"][\\\"address\\\"] }}\\nDate: {{ $('Microsoft Outlook').item.json[\\\"sentDateTime\\\"] }}\\n\\nReport:\\n\\n*URLScan Report URL:* {{ $('urlscan.io').item.json.result ? $('urlscan.io').item.json.result : \\\"N/A\\\" }}\\n*Virustotal report:* https://www.virustotal.com/gui/url/{{ $json[\\\"data\\\"][\\\"id\\\"].split(\\\"-\\\")[1] }}\\n*Virustotal Verdict:* {{ $json.data.attributes.stats.malicious + $json.data.attributes.stats.suspicious }} / {{ Object.keys($json.data.attributes.results).length }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"test-giulio-public\"\n },\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"252\",\n \"name\": \"Slack Bot Token | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"65e70f8a-7514-455e-97bf-b11514b4eec2\",\n \"name\": \"Split In Batches\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n -1020,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": 1\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"35084825-f3b2-4a01-b953-712c099a6451\",\n \"name\": \"Mark as read\",\n \"type\": \"n8n-nodes-base.microsoftOutlook\",\n \"position\": [\n -1300,\n 560\n ],\n \"parameters\": {\n \"messageId\": \"={{ $json.id }}\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"isRead\": true\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"Zeu3LbjDbkwiCUik\",\n \"name\": \"Microsoft Outlook | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"62098c94-5735-4eed-a712-3f9887e0400f\",\n \"name\": \"VirusTotal: Scan URL\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n -220,\n 700\n ],\n \"parameters\": {\n \"url\": \"https://www.virustotal.com/api/v3/urls\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"url\",\n \"value\": \"={{ $json.domain }}\"\n }\n ]\n },\n \"nodeCredentialType\": \"virusTotalApi\"\n },\n \"credentials\": {\n \"virusTotalApi\": {\n \"id\": \"hVTFFXxLV4oWPOb0\",\n \"name\": \"Virus Total | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"55b7ce97-3609-4a16-b998-8bec77cffb59\",\n \"name\": \"VirusTotal: Get report\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 200,\n 700\n ],\n \"parameters\": {\n \"url\": \"=https://www.virustotal.com/api/v3/analyses/{{ $json.data.id }}\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"resource\",\n \"value\": \"https://developers.virustotal.com/v2.0/reference/url-report\"\n }\n ]\n },\n \"nodeCredentialType\": \"virusTotalApi\"\n },\n \"credentials\": {\n \"virusTotalApi\": {\n \"id\": \"hVTFFXxLV4oWPOb0\",\n \"name\": \"Virus Total | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"7bf3c7a0-94f9-410b-b0fe-e0d15d0ba895\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n -1760,\n 380\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {}\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"741f3221-bb73-4004-801e-e9c3030740f8\",\n \"name\": \"Find indicators of compromise\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n -780,\n 440\n ],\n \"parameters\": {\n \"language\": \"python\",\n \"pythonCode\": \"try:\\n from ioc_finder import find_iocs\\nexcept ImportError:\\n import micropip\\n await micropip.install(\\\"ioc-finder\\\")\\n from ioc_finder import find_iocs\\n\\ntext = _input.first().json['body']['content']\\nprint(text)\\n\\niocs = find_iocs(text)\\n\\nreturn [{\\\"json\\\": { \\\"domain\\\": item }} for item in iocs[\\\"urls\\\"]]\"\n },\n \"typeVersion\": 2,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"bf8ba285-e824-4104-82e0-fa2dba80f301\",\n \"name\": \"URLScan: Get report\",\n \"type\": \"n8n-nodes-base.urlScanIo\",\n \"position\": [\n 640,\n 60\n ],\n \"parameters\": {\n \"scanId\": \"={{ $json.scanId }}\",\n \"operation\": \"get\"\n },\n \"credentials\": {\n \"urlScanIoApi\": {\n \"id\": \"eva7ViJyyrpmJDe3\",\n \"name\": \"urlscan.io | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eb3b06e8-ffe3-4472-a70c-08fb2555e0fb\",\n \"name\": \"URLScan: Scan URL\",\n \"type\": \"n8n-nodes-base.urlScanIo\",\n \"position\": [\n -100,\n 120\n ],\n \"parameters\": {\n \"url\": \"={{ $json.domain }}\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"urlScanIoApi\": {\n \"id\": \"eva7ViJyyrpmJDe3\",\n \"name\": \"urlscan.io | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"34157694-635a-481b-b7d2-dcd4628b26fe\",\n \"name\": \"Has URL?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -520,\n 440\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.domain }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"33cad369-0598-433e-90f8-0e7333ec5e92\",\n \"name\": \"No error?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 240,\n 120\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.error }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cba20d52-a56c-4ac0-99f2-d9b54adb342e\",\n \"name\": \"Not empty?\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n -640,\n 1280\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.data }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"449c31e3-e098-43ec-a31b-1e383c6add57\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -2051.228008430503,\n -251.94391274976795\n ],\n \"parameters\": {\n \"width\": 474.5187061049208,\n \"height\": 1008.8561536646063,\n \"content\": \"![Scheduled](https://i.imgur.com/PcOuvAL.png)\\n## Workflow Overview\\n\\nThis n8n workflow is engineered to enhance cybersecurity measures by analyzing potential phishing URLs using URLScan.io and VirusTotal. \\n\\nIt is designed to automatically process and evaluate URLs from incoming messages for malicious content.\\n\\nThis workflow is tuned specifically for `Outlook`, but you can replace outlook with your mail provider of choice. \\n\\nThe workflow can be initiated manually or scheduled to run automatically, ensuring consistent checks against phishing threats. By integrating with leading cybersecurity tools, it provides a comprehensive analysis, strengthening your organization's defense against phishing attacks.\\n\\n## Execution Schedule\\n\\nIt can be triggered at will by clicking \\\"Execute Workflow\\\" or set to run on a schedule. To align with your operational needs, customize the `Schedule Trigger` to your preferred frequency, ensuring continuous monitoring for phishing attempts.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a8921212-aec4-422d-9f04-f402d7591475\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1560,\n 107\n ],\n \"parameters\": {\n \"width\": 397.3953488372091,\n \"height\": 647.1076277970203,\n \"content\": \"![Outlook](https://i.imgur.com/R3Bhd8I.png)\\n## Email Processing for Phishing Analysis\\nThis segment of the workflow interfaces with Microsoft Outlook to retrieve and process `all messages marked as unread`. This section can be replaced with any mail provider.\\n\\nOnce an email is fetched, the `Get all unread messages` node captures the details, while the `Mark as read` node updates the message's status. \\n\\nThis ensures that each email is only processed once, maintaining a clean and organized inbox, and preventing reprocessing of the same messages.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fbad734e-4502-4d1b-8890-b05c486a1f70\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1140,\n 15.062288067451163\n ],\n \"parameters\": {\n \"width\": 859.9418604651164,\n \"height\": 836.8098049558043,\n \"content\": \"![python](https://i.imgur.com/S2TZ3u6.png)\\n## Indicator of Compromise Detection Loop\\nThis workflow section leverages n8n's `Split In Batches` node, a powerful feature for iterative processing. It is set to dissect the batch of emails one by one, allowing for individual examination of each message's content for potential threats.\\n\\nWith the `Find indicators of compromise` node, the workflow employs Python code to parse the email content and extract URLs, which are common indicators of compromise (IoCs) in phishing attempts. By utilizing the ioc-finder library, it systematically scans for and isolates these IoCs from the email body.\\n\\nThe `Has URL?` node then checks if the email contains any urls. If no URLs are found, then the loop moves on to the next email, as there is nothing to scan. If it does find one, it allows the email to flow to the next sections. \\n\\nThe splitting of batches is key to the workflow's efficiency, enabling the loop to handle vast quantities of emails methodically. This step is crucial in pinpointing and extracting suspicious elements from each email, highlighting the workflow's meticulous approach to security analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8603fe5b-ad6b-4980-a28b-01531c6629f3\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n -313.5039999999999\n ],\n \"parameters\": {\n \"width\": 1099.116279069767,\n \"height\": 618.8295813953489,\n \"content\": \"![urlscan](https://i.imgur.com/RjaMt6c.png)\\n## URL Scanning and Verification\\nThis portion of the workflow engages with URLScan.io, a tool for scanning and analyzing websites for potential security threats.\\n\\nThe `URLScan: Scan URL` node begins the process by submitting the URL extracted from the email content. It's configured to continue even if an error occurs, which allows us to then do an error check in the `No error?` node instead. \\n\\nThis is because if the `URLScan: Scan URL` node fails, the whole workflow will grind to a stop. This is not good because in theory, we maybe processing another email after this one, and we need to ensure the workflow moves on to the next email. \\n\\nFollowing the submission, the `Wait 1 Minute` node pauses the workflow, giving URLScan.io adequate time to perform the scan and generate a report. This wait ensures that the subsequent retrieval of the report reflects the most recent and comprehensive analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"33299274-9f02-4ea0-af60-5dee53db2c34\",\n \"name\": \"Wait 1 Minute\",\n \"type\": \"n8n-nodes-base.wait\",\n \"position\": [\n 480,\n 60\n ],\n \"webhookId\": \"469a8b5e-8b5a-4360-bc9d-3b253cc0ae24\",\n \"parameters\": {\n \"unit\": \"seconds\",\n \"amount\": 60\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"757ad81d-ae24-4b26-98ba-a571670be2a3\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n 318.64011851851865\n ],\n \"parameters\": {\n \"width\": 1435.7278194659766,\n \"height\": 540.6919228251508,\n \"content\": \"\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8e2cbf69-6c9e-4a98-ba5e-29b93eb2742f\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -680,\n 880\n ],\n \"parameters\": {\n \"width\": 1213.8313506082789,\n \"height\": 575.5779026440933,\n \"content\": \"![Slack](https://i.imgur.com/iKyMV0N.png)\\n## Final Reporting on Phishing Analysis\\nIn the concluding phase of the workflow, we consolidate the analysis into actionable intelligence and report through Slack.\\n\\nThe `Not empty?` node filters the data, ensuring that only URLs with a completed analysis proceed to the reporting stage. This step is crucial to avoid alerting on incomplete data, which could lead to misinformed decisions.\\n\\nThe `sends slack message` node is the final touchpoint of the workflow, where it compiles a detailed report and posts it on Slack. The message includes the `subject, sender, and date` of the analyzed email, along with the URLScan and VirusTotal reports. It provides a concise verdict by tallying the number of malicious and suspicious flags against the total checks performed, offering a clear indication of the potential threat level.\\n\\nThis Slack notification serves as a prompt for the cybersecurity team to take appropriate action, completing the workflow's aim of providing streamlined, accurate, and timely phishing threat analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a2a0dc81-b1f0-4d7b-b818-71bae58512a9\",\n \"name\": \"Get all unread messages\",\n \"type\": \"n8n-nodes-base.microsoftOutlook\",\n \"position\": [\n -1520,\n 560\n ],\n \"parameters\": {\n \"operation\": \"getAll\",\n \"additionalFields\": {\n \"filter\": \"isRead eq false\"\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"Zeu3LbjDbkwiCUik\",\n \"name\": \"Microsoft Outlook | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5793014-9575-4e05-b467-f295a09f0945\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n 320\n ],\n \"parameters\": {\n \"width\": 615.527819465977,\n \"height\": 540.6919228251508,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/VirusTotal_logo.svg/320px-VirusTotal_logo.svg.png)\\n## Phishing URL Analysis with VirusTotal\\nThis segment of the workflow deploys VirusTotal's capabilities to scrutinize URLs for signs of phishing.\\n\\nThe `VirusTotal: Scan URL` node initiates the process by sending the URL to VirusTotal for analysis. Once the scan is triggered, the workflow moves on to the `VirusTotal: Get report` node, which retrieves the detailed analysis report after a certain interval, ensuring that the data received includes all findings from the scan.\\n\\nFinally, the `Merge Reports` node combines the results from both URLScan.io and VirusTotal, aligning the data side by side for a comprehensive view. This merging by position is vital as it correlates the analysis from different sources, providing a layered security assessment of the URL in question.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c8d5c248-77ba-4a7f-ab21-19ff8d60ed55\",\n \"name\": \"Merge Reports\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1040,\n 680\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combinationMode\": \"mergeByPosition\"\n },\n \"typeVersion\": 2.1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"02ba918c-5fee-4d3e-824f-1160881716b6\",\n \"connections\": {\n \"Has URL?\": {\n \"main\": [\n [\n {\n \"node\": \"URLScan: Scan URL\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"VirusTotal: Scan URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"No error?\": {\n \"main\": [\n [\n {\n \"node\": \"Merge Reports\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Wait 1 Minute\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Not empty?\": {\n \"main\": [\n [\n {\n \"node\": \"sends slack message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Mark as read\": {\n \"main\": [\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge Reports\": {\n \"main\": [\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Wait 1 Minute\": {\n \"main\": [\n [\n {\n \"node\": \"URLScan: Get report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get all unread messages\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split In Batches\": {\n \"main\": [\n [\n {\n \"node\": \"Find indicators of compromise\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Not empty?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"URLScan: Scan URL\": {\n \"main\": [\n [\n {\n \"node\": \"No error?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"URLScan: Get report\": {\n \"main\": [\n [\n {\n \"node\": \"Merge Reports\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"VirusTotal: Scan URL\": {\n \"main\": [\n [\n {\n \"node\": \"VirusTotal: Get report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"VirusTotal: Get report\": {\n \"main\": [\n [\n {\n \"node\": \"Merge Reports\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Get all unread messages\": {\n \"main\": [\n [\n {\n \"node\": \"Mark as read\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Find indicators of compromise\": {\n \"main\": [\n [\n {\n \"node\": \"Has URL?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get all unread messages\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
50
0
2
true
combined_workflows.json
{ "input": "The workflow analyzes emails for potential phishing URLs, scans those URLs using URLScan.io and VirusTotal, and reports the findings via Slack.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 15748, "processed_size": 15748, "processed_timestamp": "2025-04-09T03:08:39.371398", "timestamp": "2025-04-09T02:37:42.353759", "token_count": 4095, "tokens": 1667, "workflow_chunk_info": { "is_truncated": false, "original_size": 15748, "processed_size": 15748, "workflow_hash": "465711cb7effbaf0b1aa95148e4fac7d" }, "workflow_hash": "465711cb7effbaf0b1aa95148e4fac7d" }
Mark as read` node updates the message's status. \n\nThis ensures that each email is only processed once, maintaining a clean and organized inbox, and preventing reprocessing of the same messages." }, "typeVersion": 1 }, { "id": "fbad734e-4502-4d1b-8890-b05c486a1f70", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -1140, 15.062288067451163 ], "parameters": { "width": 859.9418604651164, "height": 836.8098049558043, "content": "![python](https://i.imgur.com/S2TZ3u6.png)\n## Indicator of Compromise Detection Loop\nThis workflow section leverages n8n's `Split In Batches` node, a powerful feature for iterative processing. It is set to dissect the batch of emails one by one, allowing for individual examination of each message's content for potential threats.\n\nWith the `Find indicators of compromise` node, the workflow employs Python code to parse the email content and extract URLs, which are common indicators of compromise (IoCs) in phishing attempts. By utilizing the ioc-finder library, it systematically scans for and isolates these IoCs from the email body.\n\nThe `Has URL?` node then checks if the email contains any urls. If no URLs are found, then the loop moves on to the next email, as there is nothing to scan. If it does find one, it allows the email to flow to the next sections. \n\nThe splitting of batches is key to the workflow's efficiency, enabling the loop to handle vast quantities of emails methodically. This step is crucial in pinpointing and extracting suspicious elements from each email, highlighting the workflow's meticulous approach to security analysis." }, "typeVersion": 1 }, { "id": "8603fe5b-ad6b-4980-a28b-01531c6629f3", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -260, -313.5039999999999 ], "parameters": { "width": 1099.116279069767, "height": 618.8295813953489, "content": "![urlscan](https://i.imgur.com/RjaMt6c.png)\n## URL Scanning and Verification\nThis portion of the workflow engages with URLScan.io, a tool for scanning and analyzing websites for potential security threats.\n\nThe `URLScan: Scan URL` node begins the process by submitting the URL extracted from the email content. It's configured to continue even if an error occurs, which allows us to then do an error check in the `No error?` node instead. \n\nThis is because if the `URLScan: Scan URL` node fails, the whole workflow will grind to a stop. This is not good because in theory, we maybe processing another email after this one, and we need to ensure the workflow moves on to the next email. \n\nFollowing the submission, the `Wait 1 Minute` node pauses the workflow, giving URLScan.io adequate time to perform the scan and generate a report. This wait ensures that the subsequent retrieval of the report reflects the most recent and comprehensive analysis." }, "typeVersion": 1 }, { "id": "33299274-9f02-4ea0-af60-5dee53db2c34", "name": "Wait 1 Minute", "type": "n8n-nodes-base.wait", "position": [ 480, 60 ], "webhookId": "469a8b5e-8b5a-4360-bc9d-3b253cc0ae24", "parameters": { "unit": "seconds", "amount": 60 }, "typeVersion": 1 }, { "id": "757ad81d-ae24-4b26-98ba-a571670be2a3", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -260, 318.64011851851865 ], "parameters": { "width": 1435.7278194659766, "height": 540.6919228251508, "content": "" }, "typeVersion": 1 }, { "id": "8e2cbf69-6c9e-4a98-ba5e-29b93eb2742f", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ -680, 880 ], "parameters": { "width": 1213.8313506082789, "height": 575.5779026440933, "content": "![Slack](https://i.imgur.com/iKyMV0N.png)\n## Final Reporting on Phishing Analysis\nIn the concluding phase of the workflow, we consolidate the analysis into actionable intelligence and report through Slack.\n\nThe `Not empty?` node filters the data, ensuring that only URLs with a completed analysis proceed to the reporting stage. This step is crucial to avoid alerting on incomplete data, which could lead to misinformed decisions.\n\nThe `sends slack message` node is the final touchpoint of the workflow, where it compiles a detailed report and posts it on Slack. The message includes the `subject, sender, and date` of the analyzed email, along with the URLScan and VirusTotal reports. It provides a concise verdict by tallying the number of malicious and suspicious flags against the total checks performed, offering a clear indication of the potential threat level.\n\nThis Slack notification serves as a prompt for the cybersecurity team to take appropriate action, completing the workflow's aim of providing streamlined, accurate, and timely phishing threat analysis." }, "typeVersion": 1 }, { "id": "a2a0dc81-b1f0-4d7b-b818-71bae58512a9", "name": "Get all unread messages", "type": "n8n-nodes-base.microsoftOutlook", "position": [ -1520, 560 ], "parameters": { "operation": "getAll", "additionalFields": { "filter": "isRead eq false" } }, "credentials": { "microsoftOutlookOAuth2Api": { "id": "Zeu3LbjDbkwiCUik", "name": "Microsoft Outlook | Giulio [βœ… Share ok]" } }, "typeVersion": 1 }, { "id": "a5793014-9575-4e05-b467-f295a09f0945", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -260, 320 ], "parameters": { "width": 615.527819465977, "height": 540.6919228251508, "content": "![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/VirusTotal_logo.svg/320px-VirusTotal_logo.svg.png)\n## Phishing URL Analysis with VirusTotal\nThis segment of the workflow deploys VirusTotal's capabilities to scrutinize URLs for signs of phishing.\n\nThe `VirusTotal: Scan URL` node initiates the process by sending the URL to VirusTotal for analysis. Once the scan is triggered, the workflow moves on to the `VirusTotal: Get report` node, which retrieves the detailed analysis report after a certain interval, ensuring that the data received includes all findings from the scan.\n\nFinally, the `Merge Reports` node combines the results from both URLScan.io and VirusTotal, aligning the data side by side for a comprehensive view. This merging by position is vital as it correlates the analysis from different sources, providing a layered security assessment of the URL in question." }, "typeVersion": 1 }, { "id": "c8d5c248-77ba-4a7f-ab21-19ff8d60ed55", "name": "Merge Reports", "type": "n8n-nodes-base.merge", "position": [ 1040, 680 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "mergeByPosition" }, "typeVersion": 2.1 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "02ba918c-5fee-4d3e-824f-1160881716b6", "connections": { "Has URL?": { "main": [ [ { "node": "URLScan: Scan URL", "type": "main", "index": 0 }, { "node": "VirusTotal: Scan URL", "type": "main", "index": 0 } ], [ { "node": "Split In Batches", "type": "main", "index": 0 } ] ] }, "No error?": { "main": [ [ { "node": "Merge Reports", "type": "main", "index": 0 } ], [ { "node": "Wait 1 Minute", "type": "main", "index": 0 } ] ] }, "Not empty?": { "main": [ [ { "node": "sends slack message", "type": "main", "index": 0 } ] ] }, "Mark as read": { "main": [ [ { "node": "Split In Batches", "type": "main", "index": 0 } ] ] }, "Merge Reports": { "main": [ [ { "node": "Split In Batches", "type": "main", "index": 0 } ] ] }, "Wait 1 Minute": { "main": [ [ { "node": "URLScan: Get report", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Get all unread messages", "type": "main", "index": 0 } ] ] }, "Split In Batches": { "main": [ [ { "node": "Find indicators of compromise", "type": "main", "index": 0 } ], [ { "node": "Not empty?", "type": "main", "index": 0 } ] ] }, "URLScan: Scan URL": { "main": [ [ { "node": "No error?", "type": "main", "index": 0 } ] ] }, "URLScan: Get report": { "main": [ [ { "node": "Merge Reports", "type": "main", "index": 0 } ] ] }, "VirusTotal: Scan URL": { "main": [ [ { "node": "VirusTotal: Get report", "type": "main", "index": 0 } ] ] }, "VirusTotal: Get report": { "main": [ [ { "node": "Merge Reports", "type": "main", "index": 1 } ] ] }, "Get all unread messages": { "main": [ [ { "node": "Mark as read", "type": "main", "index": 0 } ] ] }, "Find indicators of compromise": { "main": [ [ { "node": "Has URL?", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Get all unread messages", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"8EmNhftXznAGV3dR\",\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"name\": \"Phishing_analysis__URLScan_io_and_Virustotal_\",\n \"tags\": [\n {\n \"id\": \"GCHVocImoXoEVnzP\",\n \"name\": \"πŸ› οΈ In progress\",\n \"createdAt\": \"2023-10-31T02:17:21.618Z\",\n \"updatedAt\": \"2023-10-31T02:17:21.618Z\"\n },\n {\n \"id\": \"QPJKatvLSxxtrE8U\",\n \"name\": \"Secops\",\n \"createdAt\": \"2023-10-31T02:15:11.396Z\",\n \"updatedAt\": \"2023-10-31T02:15:11.396Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"f170068a-4540-4fbd-bd17-00a6367989d1\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1760,\n 560\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a1e0490-6971-4490-a806-46da5e226365\",\n \"name\": \"sends slack message\",\n \"type\": \"n8n-nodes-base.slack\",\n \"position\": [\n -360,\n 1280\n ],\n \"parameters\": {\n \"text\": \"=*Email Analysis*\\n\\nSubject: {{ $('Microsoft Outlook').item.json[\\\"subject\\\"] }}\\nFrom: {{ $('Microsoft Outlook').item.json[\\\"sender\\\"][\\\"emailAddress\\\"][\\\"address\\\"] }}\\nDate: {{ $('Microsoft Outlook').item.json[\\\"sentDateTime\\\"] }}\\n\\nReport:\\n\\n*URLScan Report URL:* {{ $('urlscan.io').item.json.result ? $('urlscan.io').item.json.result : \\\"N/A\\\" }}\\n*Virustotal report:* https://www.virustotal.com/gui/url/{{ $json[\\\"data\\\"][\\\"id\\\"].split(\\\"-\\\")[1] }}\\n*Virustotal Verdict:* {{ $json.data.attributes.stats.malicious + $json.data.attributes.stats.suspicious }} / {{ Object.keys($json.data.attributes.results).length }}\",\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"test-giulio-public\"\n },\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"slackApi\": {\n \"id\": \"252\",\n \"name\": \"Slack Bot Token | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"65e70f8a-7514-455e-97bf-b11514b4eec2\",\n \"name\": \"Split In Batches\",\n \"type\": \"n8n-nodes-base.splitInBatches\",\n \"position\": [\n -1020,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"batchSize\": 1\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"35084825-f3b2-4a01-b953-712c099a6451\",\n \"name\": \"Mark as read\",\n \"type\": \"n8n-nodes-base.microsoftOutlook\",\n \"position\": [\n -1300,\n 560\n ],\n \"parameters\": {\n \"messageId\": \"={{ $json.id }}\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"isRead\": true\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"Zeu3LbjDbkwiCUik\",\n \"name\": \"Microsoft Outlook | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"62098c94-5735-4eed-a712-3f9887e0400f\",\n \"name\": \"VirusTotal: Scan URL\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n -220,\n 700\n ],\n \"parameters\": {\n \"url\": \"https://www.virustotal.com/api/v3/urls\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"url\",\n \"value\": \"={{ $json.domain }}\"\n }\n ]\n },\n \"nodeCredentialType\": \"virusTotalApi\"\n },\n \"credentials\": {\n \"virusTotalApi\": {\n \"id\": \"hVTFFXxLV4oWPOb0\",\n \"name\": \"Virus Total | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"55b7ce97-3609-4a16-b998-8bec77cffb59\",\n \"name\": \"VirusTotal: Get report\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 200,\n 700\n ],\n \"parameters\": {\n \"url\": \"=https://www.virustotal.com/api/v3/analyses/{{ $json.data.id }}\",\n \"options\": {},\n \"sendQuery\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"resource\",\n \"value\": \"https://developers.virustotal.com/v2.0/reference/url-report\"\n }\n ]\n },\n \"nodeCredentialType\": \"virusTotalApi\"\n },\n \"credentials\": {\n \"virusTotalApi\": {\n \"id\": \"hVTFFXxLV4oWPOb0\",\n \"name\": \"Virus Total | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 4.1\n },\n {\n \"id\": \"7bf3c7a0-94f9-410b-b0fe-e0d15d0ba895\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n -1760,\n 380\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {}\n ]\n }\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"741f3221-bb73-4004-801e-e9c3030740f8\",\n \"name\": \"Find indicators of compromise\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n -780,\n 440\n ],\n \"parameters\": {\n \"language\": \"python\",\n \"pythonCode\": \"try:\\n from ioc_finder import find_iocs\\nexcept ImportError:\\n import micropip\\n await micropip.install(\\\"ioc-finder\\\")\\n from ioc_finder import find_iocs\\n\\ntext = _input.first().json['body']['content']\\nprint(text)\\n\\niocs = find_iocs(text)\\n\\nreturn [{\\\"json\\\": { \\\"domain\\\": item }} for item in iocs[\\\"urls\\\"]]\"\n },\n \"typeVersion\": 2,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"bf8ba285-e824-4104-82e0-fa2dba80f301\",\n \"name\": \"URLScan: Get report\",\n \"type\": \"n8n-nodes-base.urlScanIo\",\n \"position\": [\n 640,\n 60\n ],\n \"parameters\": {\n \"scanId\": \"={{ $json.scanId }}\",\n \"operation\": \"get\"\n },\n \"credentials\": {\n \"urlScanIoApi\": {\n \"id\": \"eva7ViJyyrpmJDe3\",\n \"name\": \"urlscan.io | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eb3b06e8-ffe3-4472-a70c-08fb2555e0fb\",\n \"name\": \"URLScan: Scan URL\",\n \"type\": \"n8n-nodes-base.urlScanIo\",\n \"position\": [\n -100,\n 120\n ],\n \"parameters\": {\n \"url\": \"={{ $json.domain }}\",\n \"additionalFields\": {}\n },\n \"credentials\": {\n \"urlScanIoApi\": {\n \"id\": \"eva7ViJyyrpmJDe3\",\n \"name\": \"urlscan.io | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1,\n \"continueOnFail\": true\n },\n {\n \"id\": \"34157694-635a-481b-b7d2-dcd4628b26fe\",\n \"name\": \"Has URL?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -520,\n 440\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.domain }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"33cad369-0598-433e-90f8-0e7333ec5e92\",\n \"name\": \"No error?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 240,\n 120\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.error }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cba20d52-a56c-4ac0-99f2-d9b54adb342e\",\n \"name\": \"Not empty?\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n -640,\n 1280\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.data }}\",\n \"operation\": \"isNotEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"449c31e3-e098-43ec-a31b-1e383c6add57\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -2051.228008430503,\n -251.94391274976795\n ],\n \"parameters\": {\n \"width\": 474.5187061049208,\n \"height\": 1008.8561536646063,\n \"content\": \"![Scheduled](https://i.imgur.com/PcOuvAL.png)\\n## Workflow Overview\\n\\nThis n8n workflow is engineered to enhance cybersecurity measures by analyzing potential phishing URLs using URLScan.io and VirusTotal. \\n\\nIt is designed to automatically process and evaluate URLs from incoming messages for malicious content.\\n\\nThis workflow is tuned specifically for `Outlook`, but you can replace outlook with your mail provider of choice. \\n\\nThe workflow can be initiated manually or scheduled to run automatically, ensuring consistent checks against phishing threats. By integrating with leading cybersecurity tools, it provides a comprehensive analysis, strengthening your organization's defense against phishing attacks.\\n\\n## Execution Schedule\\n\\nIt can be triggered at will by clicking \\\"Execute Workflow\\\" or set to run on a schedule. To align with your operational needs, customize the `Schedule Trigger` to your preferred frequency, ensuring continuous monitoring for phishing attempts.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a8921212-aec4-422d-9f04-f402d7591475\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1560,\n 107\n ],\n \"parameters\": {\n \"width\": 397.3953488372091,\n \"height\": 647.1076277970203,\n \"content\": \"![Outlook](https://i.imgur.com/R3Bhd8I.png)\\n## Email Processing for Phishing Analysis\\nThis segment of the workflow interfaces with Microsoft Outlook to retrieve and process `all messages marked as unread`. This section can be replaced with any mail provider.\\n\\nOnce an email is fetched, the `Get all unread messages` node captures the details, while the `Mark as read` node updates the message's status. \\n\\nThis ensures that each email is only processed once, maintaining a clean and organized inbox, and preventing reprocessing of the same messages.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"fbad734e-4502-4d1b-8890-b05c486a1f70\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1140,\n 15.062288067451163\n ],\n \"parameters\": {\n \"width\": 859.9418604651164,\n \"height\": 836.8098049558043,\n \"content\": \"![python](https://i.imgur.com/S2TZ3u6.png)\\n## Indicator of Compromise Detection Loop\\nThis workflow section leverages n8n's `Split In Batches` node, a powerful feature for iterative processing. It is set to dissect the batch of emails one by one, allowing for individual examination of each message's content for potential threats.\\n\\nWith the `Find indicators of compromise` node, the workflow employs Python code to parse the email content and extract URLs, which are common indicators of compromise (IoCs) in phishing attempts. By utilizing the ioc-finder library, it systematically scans for and isolates these IoCs from the email body.\\n\\nThe `Has URL?` node then checks if the email contains any urls. If no URLs are found, then the loop moves on to the next email, as there is nothing to scan. If it does find one, it allows the email to flow to the next sections. \\n\\nThe splitting of batches is key to the workflow's efficiency, enabling the loop to handle vast quantities of emails methodically. This step is crucial in pinpointing and extracting suspicious elements from each email, highlighting the workflow's meticulous approach to security analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8603fe5b-ad6b-4980-a28b-01531c6629f3\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n -313.5039999999999\n ],\n \"parameters\": {\n \"width\": 1099.116279069767,\n \"height\": 618.8295813953489,\n \"content\": \"![urlscan](https://i.imgur.com/RjaMt6c.png)\\n## URL Scanning and Verification\\nThis portion of the workflow engages with URLScan.io, a tool for scanning and analyzing websites for potential security threats.\\n\\nThe `URLScan: Scan URL` node begins the process by submitting the URL extracted from the email content. It's configured to continue even if an error occurs, which allows us to then do an error check in the `No error?` node instead. \\n\\nThis is because if the `URLScan: Scan URL` node fails, the whole workflow will grind to a stop. This is not good because in theory, we maybe processing another email after this one, and we need to ensure the workflow moves on to the next email. \\n\\nFollowing the submission, the `Wait 1 Minute` node pauses the workflow, giving URLScan.io adequate time to perform the scan and generate a report. This wait ensures that the subsequent retrieval of the report reflects the most recent and comprehensive analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"33299274-9f02-4ea0-af60-5dee53db2c34\",\n \"name\": \"Wait 1 Minute\",\n \"type\": \"n8n-nodes-base.wait\",\n \"position\": [\n 480,\n 60\n ],\n \"webhookId\": \"469a8b5e-8b5a-4360-bc9d-3b253cc0ae24\",\n \"parameters\": {\n \"unit\": \"seconds\",\n \"amount\": 60\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"757ad81d-ae24-4b26-98ba-a571670be2a3\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n 318.64011851851865\n ],\n \"parameters\": {\n \"width\": 1435.7278194659766,\n \"height\": 540.6919228251508,\n \"content\": \"\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"8e2cbf69-6c9e-4a98-ba5e-29b93eb2742f\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -680,\n 880\n ],\n \"parameters\": {\n \"width\": 1213.8313506082789,\n \"height\": 575.5779026440933,\n \"content\": \"![Slack](https://i.imgur.com/iKyMV0N.png)\\n## Final Reporting on Phishing Analysis\\nIn the concluding phase of the workflow, we consolidate the analysis into actionable intelligence and report through Slack.\\n\\nThe `Not empty?` node filters the data, ensuring that only URLs with a completed analysis proceed to the reporting stage. This step is crucial to avoid alerting on incomplete data, which could lead to misinformed decisions.\\n\\nThe `sends slack message` node is the final touchpoint of the workflow, where it compiles a detailed report and posts it on Slack. The message includes the `subject, sender, and date` of the analyzed email, along with the URLScan and VirusTotal reports. It provides a concise verdict by tallying the number of malicious and suspicious flags against the total checks performed, offering a clear indication of the potential threat level.\\n\\nThis Slack notification serves as a prompt for the cybersecurity team to take appropriate action, completing the workflow's aim of providing streamlined, accurate, and timely phishing threat analysis.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a2a0dc81-b1f0-4d7b-b818-71bae58512a9\",\n \"name\": \"Get all unread messages\",\n \"type\": \"n8n-nodes-base.microsoftOutlook\",\n \"position\": [\n -1520,\n 560\n ],\n \"parameters\": {\n \"operation\": \"getAll\",\n \"additionalFields\": {\n \"filter\": \"isRead eq false\"\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"Zeu3LbjDbkwiCUik\",\n \"name\": \"Microsoft Outlook | Giulio [βœ… Share ok]\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5793014-9575-4e05-b467-f295a09f0945\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -260,\n 320\n ],\n \"parameters\": {\n \"width\": 615.527819465977,\n \"height\": 540.6919228251508,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/VirusTotal_logo.svg/320px-VirusTotal_logo.svg.png)\\n## Phishing URL Analysis with VirusTotal\\nThis segment of the workflow deploys VirusTotal's capabilities to scrutinize URLs for signs of phishing.\\n\\nThe `VirusTotal: Scan URL` node initiates the process by sending the URL to VirusTotal for analysis. Once the scan is triggered, the workflow moves on to the `VirusTotal: Get report` node, which retrieves the detailed analysis report after a certain interval, ensuring that the data received includes all findings from the scan.\\n\\nFinally, the `Merge Reports` node combines the results from both URLScan.io and VirusTotal, aligning the data side by side for a comprehensive view. This merging by position is vital as it correlates the analysis from different sources, providing a layered security assessment of the URL in question.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c8d5c248-77ba-4a7f-ab21-19ff8d60ed55\",\n \"name\": \"Merge Reports\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n 1040,\n 680\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combinationMode\": \"mergeByPosition\"\n },\n \"typeVersion\": 2.1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"02ba918c-5fee-4d3e-824f-1160881716b6\",\n \"connections\": {\n \"Has URL?\": {\n \"main\": [\n [\n {\n \"node\": \"URLScan: Scan URL\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"VirusTotal: Scan URL\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"No error?\": {\n \"main\": [\n [\n {\n \"node\": \"Merge Reports\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Wait 1 Minute\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Not empty?\": {\n \"main\": [\n [\n {\n \"node\": \"sends slack message\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Mark as read\": {\n \"main\": [\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Merge Reports\": {\n \"main\": [\n [\n {\n \"node\": \"Split In Batches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Wait 1 Minute\": {\n \"main\": [\n [\n {\n \"node\": \"URLScan: Get report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Get all unread messages\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Split In Batches\": {\n \"main\": [\n [\n {\n \"node\": \"Find indicators of compromise\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Not empty?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"URLScan: Scan URL\": {\n \"main\": [\n [\n {\n \"node\": \"No error?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"URLScan: Get report\": {\n \"main\": [\n [\n {\n \"node\": \"Merge Reports\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"VirusTotal: Scan URL\": {\n \"main\": [\n [\n {\n \"node\": \"VirusTotal: Get report\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"VirusTotal: Get report\": {\n \"main\": [\n [\n {\n \"node\": \"Merge Reports\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Get all unread messages\": {\n \"main\": [\n [\n {\n \"node\": \"Mark as read\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Find indicators of compromise\": {\n \"main\": [\n [\n {\n \"node\": \"Has URL?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get all unread messages\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
50
1
2
true
combined_workflows.json
{ "input": "The workflow analyzes emails for potential phishing URLs, scans those URLs using URLScan.io and VirusTotal, and reports the findings via Slack.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 15748, "processed_size": 15748, "processed_timestamp": "2025-04-09T03:08:39.380397", "timestamp": "2025-04-09T02:37:42.353759", "token_count": 3641, "tokens": 1667, "workflow_chunk_info": { "is_truncated": false, "original_size": 15748, "processed_size": 15748, "workflow_hash": "465711cb7effbaf0b1aa95148e4fac7d" }, "workflow_hash": "465711cb7effbaf0b1aa95148e4fac7d" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow monitors the haveibeenpwned.com API for new data breaches and triggers an alert when a new breach is detected. It also caches the last breach name to avoid duplicate alerts. Analyze this workflow: ```json { "meta": { "instanceId": "568298fde06d3db80a2eea77fe5bf45f0c7bb898dea20b769944e9ac7c6c5a80", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "eb8bbb43-d6ca-48f9-9522-12ac7100961d", "name": "When clicking β€˜Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ -1360, 380 ], "parameters": {}, "typeVersion": 1 }, { "id": "77bf0c40-b045-40f9-9401-d1b206938180", "name": "Convert to File", "type": "n8n-nodes-base.convertToFile", "position": [ -360, -420 ], "parameters": { "options": {}, "operation": "toJson", "binaryPropertyName": "=data" }, "typeVersion": 1.1 }, { "id": "c2e870c2-52e8-4808-9091-e3dcf286eaa5", "name": "Split Out", "type": "n8n-nodes-base.splitOut", "position": [ -660, 20 ], "parameters": { "options": {}, "fieldToSplitOut": "data" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "2bcafdc1-94e0-4a3d-9ad5-a189973be980", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -1500, -340 ], "parameters": { "rule": { "interval": [ { "field": "minutes", "minutesInterval": 15 } ] } }, "typeVersion": 1.2 }, { "id": "a602fdf3-82d8-4bc1-806b-576b6fc904b7", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1520, -520 ], "parameters": { "width": 760, "content": "### Receive an alert when new breaches are added to haveibeenpwned.com\nThis workflow demonstrates how we can receive alerts when new breaches are added to haveibeenpwned.com.\nIt also demonstrates a simple method for caching data between executions." }, "typeVersion": 1 }, { "id": "a53e7c76-0823-415f-91fd-920b354568d3", "name": "Request breaches", "type": "n8n-nodes-base.httpRequest", "position": [ -1240, -340 ], "parameters": { "url": "https://haveibeenpwned.com/api/v3/latestbreach", "options": {} }, "typeVersion": 4.2 }, { "id": "777c65aa-1bce-40eb-9de1-dd8fef4afd05", "name": "Read last breach", "type": "n8n-nodes-base.readWriteFile", "notes": "we alerted about.", "position": [ -1020, -160 ], "parameters": { "options": {}, "fileSelector": "./cache.json" }, "notesInFlow": true, "typeVersion": 1, "alwaysOutputData": true }, { "id": "d6638b7b-6209-497a-a176-91751a10bab1", "name": "Get JSON from file", "type": "n8n-nodes-base.extractFromFile", "position": [ -840, -80 ], "parameters": { "options": {}, "operation": "fromJson" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "42103453-54db-4d18-8d2b-9b56f5d3a3dd", "name": "Check for content", "type": "n8n-nodes-base.if", "position": [ -480, 20 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "6bf6a0bd-e9b3-4fde-a9cc-08f4d0e94fd6", "operator": { "type": "string", "operation": "exists", "singleValue": true }, "leftValue": "={{ $json.lastItem }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "2dfa332e-9892-4385-a693-2ff2fc51f067", "name": "Set to none", "type": "n8n-nodes-base.set", "notes": "File was empty.", "position": [ -300, 80 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "47736e3f-0961-4b73-b4d5-207792640e87", "name": "lastItem", "type": "string", "value": "none" } ] } }, "notesInFlow": true, "typeVersion": 3.4 }, { "id": "6653599a-db6a-4a01-af5c-d79a2d58202f", "name": "If - check for new", "type": "n8n-nodes-base.if", "position": [ -840, -340 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "badd0a56-081f-49e2-92f4-7711f1cd9289", "operator": { "type": "string", "operation": "notEquals" }, "leftValue": "={{ $json.lastItem }}", "rightValue": "={{ $json.Name }}" } ] } }, "typeVersion": 2.2 }, { "id": "1f2cbeda-0c84-4b54-84ec-03a7b22f4471", "name": "Set breach name", "type": "n8n-nodes-base.set", "position": [ -560, -420 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "d0714936-9956-4af8-93f9-3c44ef7beb09", "name": "lastItem", "type": "string", "value": "={{ $json.Name }}" } ] } }, "typeVersion": 3.4 }, { "id": "85314f2d-98d7-461a-a565-5202006ddd39", "name": "Write breach name to file", "type": "n8n-nodes-base.readWriteFile", "position": [ -180, -420 ], "parameters": { "options": {}, "fileName": "./cache.json", "operation": "write" }, "typeVersion": 1 }, { "id": "e4cc122c-172f-4154-b534-c2c9268cf10d", "name": "New breach", "type": "n8n-nodes-base.noOp", "notes": "Send alert", "position": [ -560, -680 ], "parameters": {}, "notesInFlow": true, "typeVersion": 1 }, { "id": "80b7507f-d5f2-4a3d-9090-784f80770478", "name": "Old breach", "type": "n8n-nodes-base.noOp", "notes": "already alerted.", "position": [ -560, -160 ], "parameters": {}, "notesInFlow": true, "typeVersion": 1 }, { "id": "63f65fa4-fba1-4ab4-93ff-cd4df9068b19", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -600, -500 ], "parameters": { "color": 7, "width": 640, "height": 240, "content": "### Save the name of the breach\nWe will check it the next time the workflow runs to see if we have a new breach." }, "typeVersion": 1 }, { "id": "5a8dd017-e3e4-445e-be0f-24a8033d7dac", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -600, -240 ], "parameters": { "color": 7, "width": 640, "height": 240, "content": "### This breach has been seen before\nIf we end up here it means that the latest breach has been seen before." }, "typeVersion": 1 }, { "id": "eb563c4a-54f5-4583-8fb1-e5ee5a14ca43", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -600, -760 ], "parameters": { "color": 3, "width": 640, "height": 240, "content": "### This is a new breach - send alert\nIf we end up here it means that the latest breach is new. Time to send some alerts to Slack, or Discord or something." }, "typeVersion": 1 }, { "id": "45b58d9b-7172-447d-91ab-e91e3516c8d9", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -1220, 300 ], "parameters": { "color": 7, "width": 600, "height": 260, "content": "### Clean up the cache\nDelete the `./cache.json` file. This will make sure the alert is triggered on the next run." }, "typeVersion": 1 }, { "id": "bb2401d2-716c-47eb-9797-5b69583058ee", "name": "Set empty json", "type": "n8n-nodes-base.set", "position": [ -1180, 380 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "69f35659-fd32-4fa7-969e-6cf266519f5b", "name": "data", "type": "string", "value": "{}" } ] } }, "typeVersion": 3.4 }, { "id": "c3abbf86-50f2-4772-bc7c-9a57ac39d4a3", "name": "Write cache.json", "type": "n8n-nodes-base.readWriteFile", "position": [ -840, 380 ], "parameters": { "options": {}, "fileName": "./cache.json", "operation": "write" }, "typeVersion": 1 }, { "id": "69f03dd6-11f0-41e6-8871-9b17c44ef2fe", "name": "Convert json to file", "type": "n8n-nodes-base.convertToFile", "position": [ -1000, 380 ], "parameters": { "options": {}, "operation": "toJson" }, "typeVersion": 1.1 }, { "id": "2cf6adf9-59e4-4450-b7f8-96907155da84", "name": "Add information about the last breach we alerted", "type": "n8n-nodes-
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"568298fde06d3db80a2eea77fe5bf45f0c7bb898dea20b769944e9ac7c6c5a80\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"eb8bbb43-d6ca-48f9-9522-12ac7100961d\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1360,\n 380\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"77bf0c40-b045-40f9-9401-d1b206938180\",\n \"name\": \"Convert to File\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n -360,\n -420\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"toJson\",\n \"binaryPropertyName\": \"=data\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"c2e870c2-52e8-4808-9091-e3dcf286eaa5\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n -660,\n 20\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"data\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"2bcafdc1-94e0-4a3d-9ad5-a189973be980\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n -1500,\n -340\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"minutes\",\n \"minutesInterval\": 15\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"a602fdf3-82d8-4bc1-806b-576b6fc904b7\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1520,\n -520\n ],\n \"parameters\": {\n \"width\": 760,\n \"content\": \"### Receive an alert when new breaches are added to haveibeenpwned.com\\nThis workflow demonstrates how we can receive alerts when new breaches are added to haveibeenpwned.com.\\nIt also demonstrates a simple method for caching data between executions.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a53e7c76-0823-415f-91fd-920b354568d3\",\n \"name\": \"Request breaches\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n -1240,\n -340\n ],\n \"parameters\": {\n \"url\": \"https://haveibeenpwned.com/api/v3/latestbreach\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"777c65aa-1bce-40eb-9de1-dd8fef4afd05\",\n \"name\": \"Read last breach\",\n \"type\": \"n8n-nodes-base.readWriteFile\",\n \"notes\": \"we alerted about.\",\n \"position\": [\n -1020,\n -160\n ],\n \"parameters\": {\n \"options\": {},\n \"fileSelector\": \"./cache.json\"\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"d6638b7b-6209-497a-a176-91751a10bab1\",\n \"name\": \"Get JSON from file\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -840,\n -80\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"fromJson\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"42103453-54db-4d18-8d2b-9b56f5d3a3dd\",\n \"name\": \"Check for content\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -480,\n 20\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"6bf6a0bd-e9b3-4fde-a9cc-08f4d0e94fd6\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"exists\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.lastItem }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"2dfa332e-9892-4385-a693-2ff2fc51f067\",\n \"name\": \"Set to none\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"File was empty.\",\n \"position\": [\n -300,\n 80\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"47736e3f-0961-4b73-b4d5-207792640e87\",\n \"name\": \"lastItem\",\n \"type\": \"string\",\n \"value\": \"none\"\n }\n ]\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"6653599a-db6a-4a01-af5c-d79a2d58202f\",\n \"name\": \"If - check for new\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -840,\n -340\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"badd0a56-081f-49e2-92f4-7711f1cd9289\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.lastItem }}\",\n \"rightValue\": \"={{ $json.Name }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"1f2cbeda-0c84-4b54-84ec-03a7b22f4471\",\n \"name\": \"Set breach name\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -560,\n -420\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"d0714936-9956-4af8-93f9-3c44ef7beb09\",\n \"name\": \"lastItem\",\n \"type\": \"string\",\n \"value\": \"={{ $json.Name }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"85314f2d-98d7-461a-a565-5202006ddd39\",\n \"name\": \"Write breach name to file\",\n \"type\": \"n8n-nodes-base.readWriteFile\",\n \"position\": [\n -180,\n -420\n ],\n \"parameters\": {\n \"options\": {},\n \"fileName\": \"./cache.json\",\n \"operation\": \"write\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e4cc122c-172f-4154-b534-c2c9268cf10d\",\n \"name\": \"New breach\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"notes\": \"Send alert\",\n \"position\": [\n -560,\n -680\n ],\n \"parameters\": {},\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"80b7507f-d5f2-4a3d-9090-784f80770478\",\n \"name\": \"Old breach\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"notes\": \"already alerted.\",\n \"position\": [\n -560,\n -160\n ],\n \"parameters\": {},\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"63f65fa4-fba1-4ab4-93ff-cd4df9068b19\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n -500\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 640,\n \"height\": 240,\n \"content\": \"### Save the name of the breach\\nWe will check it the next time the workflow runs to see if we have a new breach.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a8dd017-e3e4-445e-be0f-24a8033d7dac\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n -240\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 640,\n \"height\": 240,\n \"content\": \"### This breach has been seen before\\nIf we end up here it means that the latest breach has been seen before.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eb563c4a-54f5-4583-8fb1-e5ee5a14ca43\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n -760\n ],\n \"parameters\": {\n \"color\": 3,\n \"width\": 640,\n \"height\": 240,\n \"content\": \"### This is a new breach - send alert\\nIf we end up here it means that the latest breach is new. Time to send some alerts to Slack, or Discord or something.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"45b58d9b-7172-447d-91ab-e91e3516c8d9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1220,\n 300\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 600,\n \"height\": 260,\n \"content\": \"### Clean up the cache\\nDelete the `./cache.json` file. This will make sure the alert is triggered on the next run.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"bb2401d2-716c-47eb-9797-5b69583058ee\",\n \"name\": \"Set empty json\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -1180,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"69f35659-fd32-4fa7-969e-6cf266519f5b\",\n \"name\": \"data\",\n \"type\": \"string\",\n \"value\": \"{}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"c3abbf86-50f2-4772-bc7c-9a57ac39d4a3\",\n \"name\": \"Write cache.json\",\n \"type\": \"n8n-nodes-base.readWriteFile\",\n \"position\": [\n -840,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"fileName\": \"./cache.json\",\n \"operation\": \"write\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"69f03dd6-11f0-41e6-8871-9b17c44ef2fe\",\n \"name\": \"Convert json to file\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n -1000,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"toJson\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2cf6adf9-59e4-4450-b7f8-96907155da84\",\n \"name\": \"Add information about the last breach we alerted\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n -1020,\n -340\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combineBy\": \"combineAll\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"80e38061-140a-4c78-b49c-dcf796da1427\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1480,\n -100\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 380,\n \"height\": 240,\n \"content\": \"## Support My Work! ❀️\\n**If you find this workflow helpful**, consider downloading or purchasing it on [Gumroad](https://xqus.gumroad.com/l/hasgi).\\n\\nYour support helps me create more useful n8n workflows and resources for the community. \\n-Thanks a lot! πŸ™Œ\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Check for content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set to none\": {\n \"main\": [\n [\n {\n \"node\": \"Add information about the last breach we alerted\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Set empty json\": {\n \"main\": [\n [\n {\n \"node\": \"Convert json to file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert to File\": {\n \"main\": [\n [\n {\n \"node\": \"Write breach name to file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set breach name\": {\n \"main\": [\n [\n {\n \"node\": \"Convert to File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read last breach\": {\n \"main\": [\n [\n {\n \"node\": \"Get JSON from file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Request breaches\": {\n \"main\": [\n [\n {\n \"node\": \"Read last breach\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Add information about the last breach we alerted\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Request breaches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check for content\": {\n \"main\": [\n [\n {\n \"node\": \"Add information about the last breach we alerted\",\n \"type\": \"main\",\n \"index\": 1\n }\n ],\n [\n {\n \"node\": \"Set to none\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get JSON from file\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"If - check for new\": {\n \"main\": [\n [\n {\n \"node\": \"Set breach name\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"New breach\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Old breach\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert json to file\": {\n \"main\": [\n [\n {\n \"node\": \"Write cache.json\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Write breach name to file\": {\n \"main\": [\n []\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Set empty json\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Add information about the last breach we alerted\": {\n \"main\": [\n [\n {\n \"node\": \"If - check for new\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
51
0
2
true
combined_workflows.json
{ "input": "This workflow monitors the haveibeenpwned.com API for new data breaches and triggers an alert when a new breach is detected. It also caches the last breach name to avoid duplicate alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9361, "processed_size": 9361, "processed_timestamp": "2025-04-09T03:08:39.447408", "timestamp": "2025-04-09T02:37:42.728052", "token_count": 4095, "tokens": 958, "workflow_chunk_info": { "is_truncated": false, "original_size": 9361, "processed_size": 9361, "workflow_hash": "1bcc1e13b21e784f13f3907e667612d8" }, "workflow_hash": "1bcc1e13b21e784f13f3907e667612d8" }
"id": "69f03dd6-11f0-41e6-8871-9b17c44ef2fe", "name": "Convert json to file", "type": "n8n-nodes-base.convertToFile", "position": [ -1000, 380 ], "parameters": { "options": {}, "operation": "toJson" }, "typeVersion": 1.1 }, { "id": "2cf6adf9-59e4-4450-b7f8-96907155da84", "name": "Add information about the last breach we alerted", "type": "n8n-nodes-base.merge", "position": [ -1020, -340 ], "parameters": { "mode": "combine", "options": {}, "combineBy": "combineAll" }, "typeVersion": 3 }, { "id": "80e38061-140a-4c78-b49c-dcf796da1427", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -1480, -100 ], "parameters": { "color": 6, "width": 380, "height": 240, "content": "## Support My Work! ❀️\n**If you find this workflow helpful**, consider downloading or purchasing it on [Gumroad](https://xqus.gumroad.com/l/hasgi).\n\nYour support helps me create more useful n8n workflows and resources for the community. \n-Thanks a lot! πŸ™Œ" }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Split Out": { "main": [ [ { "node": "Check for content", "type": "main", "index": 0 } ] ] }, "Set to none": { "main": [ [ { "node": "Add information about the last breach we alerted", "type": "main", "index": 1 } ] ] }, "Set empty json": { "main": [ [ { "node": "Convert json to file", "type": "main", "index": 0 } ] ] }, "Convert to File": { "main": [ [ { "node": "Write breach name to file", "type": "main", "index": 0 } ] ] }, "Set breach name": { "main": [ [ { "node": "Convert to File", "type": "main", "index": 0 } ] ] }, "Read last breach": { "main": [ [ { "node": "Get JSON from file", "type": "main", "index": 0 } ] ] }, "Request breaches": { "main": [ [ { "node": "Read last breach", "type": "main", "index": 0 }, { "node": "Add information about the last breach we alerted", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Request breaches", "type": "main", "index": 0 } ] ] }, "Check for content": { "main": [ [ { "node": "Add information about the last breach we alerted", "type": "main", "index": 1 } ], [ { "node": "Set to none", "type": "main", "index": 0 } ] ] }, "Get JSON from file": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "If - check for new": { "main": [ [ { "node": "Set breach name", "type": "main", "index": 0 }, { "node": "New breach", "type": "main", "index": 0 } ], [ { "node": "Old breach", "type": "main", "index": 0 } ] ] }, "Convert json to file": { "main": [ [ { "node": "Write cache.json", "type": "main", "index": 0 } ] ] }, "Write breach name to file": { "main": [ [] ] }, "When clicking β€˜Test workflow’": { "main": [ [ { "node": "Set empty json", "type": "main", "index": 0 } ] ] }, "Add information about the last breach we alerted": { "main": [ [ { "node": "If - check for new", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"568298fde06d3db80a2eea77fe5bf45f0c7bb898dea20b769944e9ac7c6c5a80\",\n \"templateCredsSetupCompleted\": true\n },\n \"nodes\": [\n {\n \"id\": \"eb8bbb43-d6ca-48f9-9522-12ac7100961d\",\n \"name\": \"When clicking β€˜Test workflow’\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n -1360,\n 380\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"77bf0c40-b045-40f9-9401-d1b206938180\",\n \"name\": \"Convert to File\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n -360,\n -420\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"toJson\",\n \"binaryPropertyName\": \"=data\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"c2e870c2-52e8-4808-9091-e3dcf286eaa5\",\n \"name\": \"Split Out\",\n \"type\": \"n8n-nodes-base.splitOut\",\n \"position\": [\n -660,\n 20\n ],\n \"parameters\": {\n \"options\": {},\n \"fieldToSplitOut\": \"data\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"2bcafdc1-94e0-4a3d-9ad5-a189973be980\",\n \"name\": \"Schedule Trigger\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n -1500,\n -340\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"field\": \"minutes\",\n \"minutesInterval\": 15\n }\n ]\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"a602fdf3-82d8-4bc1-806b-576b6fc904b7\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1520,\n -520\n ],\n \"parameters\": {\n \"width\": 760,\n \"content\": \"### Receive an alert when new breaches are added to haveibeenpwned.com\\nThis workflow demonstrates how we can receive alerts when new breaches are added to haveibeenpwned.com.\\nIt also demonstrates a simple method for caching data between executions.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a53e7c76-0823-415f-91fd-920b354568d3\",\n \"name\": \"Request breaches\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n -1240,\n -340\n ],\n \"parameters\": {\n \"url\": \"https://haveibeenpwned.com/api/v3/latestbreach\",\n \"options\": {}\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"777c65aa-1bce-40eb-9de1-dd8fef4afd05\",\n \"name\": \"Read last breach\",\n \"type\": \"n8n-nodes-base.readWriteFile\",\n \"notes\": \"we alerted about.\",\n \"position\": [\n -1020,\n -160\n ],\n \"parameters\": {\n \"options\": {},\n \"fileSelector\": \"./cache.json\"\n },\n \"notesInFlow\": true,\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"d6638b7b-6209-497a-a176-91751a10bab1\",\n \"name\": \"Get JSON from file\",\n \"type\": \"n8n-nodes-base.extractFromFile\",\n \"position\": [\n -840,\n -80\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"fromJson\"\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"42103453-54db-4d18-8d2b-9b56f5d3a3dd\",\n \"name\": \"Check for content\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -480,\n 20\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"6bf6a0bd-e9b3-4fde-a9cc-08f4d0e94fd6\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"exists\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.lastItem }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"2dfa332e-9892-4385-a693-2ff2fc51f067\",\n \"name\": \"Set to none\",\n \"type\": \"n8n-nodes-base.set\",\n \"notes\": \"File was empty.\",\n \"position\": [\n -300,\n 80\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"47736e3f-0961-4b73-b4d5-207792640e87\",\n \"name\": \"lastItem\",\n \"type\": \"string\",\n \"value\": \"none\"\n }\n ]\n }\n },\n \"notesInFlow\": true,\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"6653599a-db6a-4a01-af5c-d79a2d58202f\",\n \"name\": \"If - check for new\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n -840,\n -340\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"badd0a56-081f-49e2-92f4-7711f1cd9289\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEquals\"\n },\n \"leftValue\": \"={{ $json.lastItem }}\",\n \"rightValue\": \"={{ $json.Name }}\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"1f2cbeda-0c84-4b54-84ec-03a7b22f4471\",\n \"name\": \"Set breach name\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -560,\n -420\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"d0714936-9956-4af8-93f9-3c44ef7beb09\",\n \"name\": \"lastItem\",\n \"type\": \"string\",\n \"value\": \"={{ $json.Name }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"85314f2d-98d7-461a-a565-5202006ddd39\",\n \"name\": \"Write breach name to file\",\n \"type\": \"n8n-nodes-base.readWriteFile\",\n \"position\": [\n -180,\n -420\n ],\n \"parameters\": {\n \"options\": {},\n \"fileName\": \"./cache.json\",\n \"operation\": \"write\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e4cc122c-172f-4154-b534-c2c9268cf10d\",\n \"name\": \"New breach\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"notes\": \"Send alert\",\n \"position\": [\n -560,\n -680\n ],\n \"parameters\": {},\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"80b7507f-d5f2-4a3d-9090-784f80770478\",\n \"name\": \"Old breach\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"notes\": \"already alerted.\",\n \"position\": [\n -560,\n -160\n ],\n \"parameters\": {},\n \"notesInFlow\": true,\n \"typeVersion\": 1\n },\n {\n \"id\": \"63f65fa4-fba1-4ab4-93ff-cd4df9068b19\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n -500\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 640,\n \"height\": 240,\n \"content\": \"### Save the name of the breach\\nWe will check it the next time the workflow runs to see if we have a new breach.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5a8dd017-e3e4-445e-be0f-24a8033d7dac\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n -240\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 640,\n \"height\": 240,\n \"content\": \"### This breach has been seen before\\nIf we end up here it means that the latest breach has been seen before.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"eb563c4a-54f5-4583-8fb1-e5ee5a14ca43\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -600,\n -760\n ],\n \"parameters\": {\n \"color\": 3,\n \"width\": 640,\n \"height\": 240,\n \"content\": \"### This is a new breach - send alert\\nIf we end up here it means that the latest breach is new. Time to send some alerts to Slack, or Discord or something.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"45b58d9b-7172-447d-91ab-e91e3516c8d9\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1220,\n 300\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 600,\n \"height\": 260,\n \"content\": \"### Clean up the cache\\nDelete the `./cache.json` file. This will make sure the alert is triggered on the next run.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"bb2401d2-716c-47eb-9797-5b69583058ee\",\n \"name\": \"Set empty json\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -1180,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"69f35659-fd32-4fa7-969e-6cf266519f5b\",\n \"name\": \"data\",\n \"type\": \"string\",\n \"value\": \"{}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"c3abbf86-50f2-4772-bc7c-9a57ac39d4a3\",\n \"name\": \"Write cache.json\",\n \"type\": \"n8n-nodes-base.readWriteFile\",\n \"position\": [\n -840,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"fileName\": \"./cache.json\",\n \"operation\": \"write\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"69f03dd6-11f0-41e6-8871-9b17c44ef2fe\",\n \"name\": \"Convert json to file\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n -1000,\n 380\n ],\n \"parameters\": {\n \"options\": {},\n \"operation\": \"toJson\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"2cf6adf9-59e4-4450-b7f8-96907155da84\",\n \"name\": \"Add information about the last breach we alerted\",\n \"type\": \"n8n-nodes-base.merge\",\n \"position\": [\n -1020,\n -340\n ],\n \"parameters\": {\n \"mode\": \"combine\",\n \"options\": {},\n \"combineBy\": \"combineAll\"\n },\n \"typeVersion\": 3\n },\n {\n \"id\": \"80e38061-140a-4c78-b49c-dcf796da1427\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1480,\n -100\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 380,\n \"height\": 240,\n \"content\": \"## Support My Work! ❀️\\n**If you find this workflow helpful**, consider downloading or purchasing it on [Gumroad](https://xqus.gumroad.com/l/hasgi).\\n\\nYour support helps me create more useful n8n workflows and resources for the community. \\n-Thanks a lot! πŸ™Œ\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Split Out\": {\n \"main\": [\n [\n {\n \"node\": \"Check for content\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set to none\": {\n \"main\": [\n [\n {\n \"node\": \"Add information about the last breach we alerted\",\n \"type\": \"main\",\n \"index\": 1\n }\n ]\n ]\n },\n \"Set empty json\": {\n \"main\": [\n [\n {\n \"node\": \"Convert json to file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert to File\": {\n \"main\": [\n [\n {\n \"node\": \"Write breach name to file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set breach name\": {\n \"main\": [\n [\n {\n \"node\": \"Convert to File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read last breach\": {\n \"main\": [\n [\n {\n \"node\": \"Get JSON from file\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Request breaches\": {\n \"main\": [\n [\n {\n \"node\": \"Read last breach\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Add information about the last breach we alerted\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Schedule Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Request breaches\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check for content\": {\n \"main\": [\n [\n {\n \"node\": \"Add information about the last breach we alerted\",\n \"type\": \"main\",\n \"index\": 1\n }\n ],\n [\n {\n \"node\": \"Set to none\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get JSON from file\": {\n \"main\": [\n [\n {\n \"node\": \"Split Out\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"If - check for new\": {\n \"main\": [\n [\n {\n \"node\": \"Set breach name\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"New breach\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Old breach\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert json to file\": {\n \"main\": [\n [\n {\n \"node\": \"Write cache.json\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Write breach name to file\": {\n \"main\": [\n []\n ]\n },\n \"When clicking β€˜Test workflow’\": {\n \"main\": [\n [\n {\n \"node\": \"Set empty json\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Add information about the last breach we alerted\": {\n \"main\": [\n [\n {\n \"node\": \"If - check for new\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
51
1
2
true
combined_workflows.json
{ "input": "This workflow monitors the haveibeenpwned.com API for new data breaches and triggers an alert when a new breach is detected. It also caches the last breach name to avoid duplicate alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 9361, "processed_size": 9361, "processed_timestamp": "2025-04-09T03:08:39.451399", "timestamp": "2025-04-09T02:37:42.728052", "token_count": 1570, "tokens": 958, "workflow_chunk_info": { "is_truncated": false, "original_size": 9361, "processed_size": 9361, "workflow_hash": "1bcc1e13b21e784f13f3907e667612d8" }, "workflow_hash": "1bcc1e13b21e784f13f3907e667612d8" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow monitors for alerts and resolves them in SIGNL4 based on a schedule, storing and updating alert data. Analyze this workflow: ```json { "id": "2", "name": "SIGNL4 Alert", "nodes": [ { "name": "Cron", "type": "n8n-nodes-base.cron", "position": [ 350, 500 ], "parameters": { "triggerTimes": { "item": [ { "mode": "everyHour" } ] } }, "typeVersion": 1 }, { "name": "Write Binary File", "type": "n8n-nodes-base.writeBinaryFile", "position": [ 880, 500 ], "parameters": { "fileName": "alert-data.json" }, "typeVersion": 1 }, { "name": "Read Binary File", "type": "n8n-nodes-base.readBinaryFile", "position": [ 450, 270 ], "parameters": { "filePath": "alert-data.json" }, "typeVersion": 1 }, { "name": "Binary to JSON", "type": "n8n-nodes-base.moveBinaryData", "position": [ 630, 270 ], "parameters": { "options": {} }, "typeVersion": 1 }, { "name": "JSON to Binary", "type": "n8n-nodes-base.moveBinaryData", "position": [ 720, 500 ], "parameters": { "mode": "jsonToBinary", "options": {} }, "typeVersion": 1 }, { "name": "Mark as Done", "type": "n8n-nodes-base.function", "position": [ 560, 500 ], "parameters": { "functionCode": "items[0].json.Body = $node[\"Binary to JSON\"].json.Body;\nitems[0].json.Done = true;\nitems[0].json.eventId = $node[\"SIGNL4 Alert\"].json.eventId;\nitems[0].json.lastId = $node[\"Binary to JSON\"].json.eventId;\n\nreturn items;" }, "typeVersion": 1 }, { "name": "IF", "type": "n8n-nodes-base.if", "position": [ 810, 270 ], "parameters": { "conditions": { "boolean": [ { "value1": "={{$node[\"Binary to JSON\"].json[\"Done\"]}}" } ] }, "combineOperation": "=all" }, "typeVersion": 1 }, { "name": "SIGNL4 Resolve", "type": "n8n-nodes-base.signl4", "position": [ 1040, 500 ], "parameters": { "operation": "resolve", "externalId": "={{$node[\"Binary to JSON\"].json[\"lastId\"]}}" }, "credentials": { "signl4Api": "Team" }, "typeVersion": 1 }, { "name": "SIGNL4 Alert", "type": "n8n-nodes-base.signl4", "position": [ 990, 270 ], "parameters": { "message": "={{$node[\"Binary to JSON\"].json[\"Body\"]}}", "additionalFields": { "externalId": "={{$node[\"Binary to JSON\"].json[\"eventId\"]}}", "locationFieldsUi": { "locationFieldsValues": { "latitude": "52.3984235", "longitude": "13.0544149" } } } }, "credentials": { "signl4Api": "Team" }, "typeVersion": 1 } ], "active": true, "settings": { "timezone": "Europe/Berlin" }, "connections": { "IF": { "main": [ [ { "node": "SIGNL4 Alert", "type": "main", "index": 0 } ], [ { "node": "SIGNL4 Resolve", "type": "main", "index": 0 } ] ] }, "Cron": { "main": [ [ { "node": "Read Binary File", "type": "main", "index": 0 } ] ] }, "Mark as Done": { "main": [ [ { "node": "JSON to Binary", "type": "main", "index": 0 } ] ] }, "SIGNL4 Alert": { "main": [ [ { "node": "Mark as Done", "type": "main", "index": 0 } ] ] }, "Binary to JSON": { "main": [ [ { "node": "IF", "type": "main", "index": 0 } ] ] }, "JSON to Binary": { "main": [ [ { "node": "Write Binary File", "type": "main", "index": 0 } ] ] }, "Read Binary File": { "main": [ [ { "node": "Binary to JSON", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"2\",\n \"name\": \"SIGNL4 Alert\",\n \"nodes\": [\n {\n \"name\": \"Cron\",\n \"type\": \"n8n-nodes-base.cron\",\n \"position\": [\n 350,\n 500\n ],\n \"parameters\": {\n \"triggerTimes\": {\n \"item\": [\n {\n \"mode\": \"everyHour\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Write Binary File\",\n \"type\": \"n8n-nodes-base.writeBinaryFile\",\n \"position\": [\n 880,\n 500\n ],\n \"parameters\": {\n \"fileName\": \"alert-data.json\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Binary File\",\n \"type\": \"n8n-nodes-base.readBinaryFile\",\n \"position\": [\n 450,\n 270\n ],\n \"parameters\": {\n \"filePath\": \"alert-data.json\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Binary to JSON\",\n \"type\": \"n8n-nodes-base.moveBinaryData\",\n \"position\": [\n 630,\n 270\n ],\n \"parameters\": {\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"JSON to Binary\",\n \"type\": \"n8n-nodes-base.moveBinaryData\",\n \"position\": [\n 720,\n 500\n ],\n \"parameters\": {\n \"mode\": \"jsonToBinary\",\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mark as Done\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 560,\n 500\n ],\n \"parameters\": {\n \"functionCode\": \"items[0].json.Body = $node[\\\"Binary to JSON\\\"].json.Body;\\nitems[0].json.Done = true;\\nitems[0].json.eventId = $node[\\\"SIGNL4 Alert\\\"].json.eventId;\\nitems[0].json.lastId = $node[\\\"Binary to JSON\\\"].json.eventId;\\n\\nreturn items;\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"IF\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 810,\n 270\n ],\n \"parameters\": {\n \"conditions\": {\n \"boolean\": [\n {\n \"value1\": \"={{$node[\\\"Binary to JSON\\\"].json[\\\"Done\\\"]}}\"\n }\n ]\n },\n \"combineOperation\": \"=all\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"SIGNL4 Resolve\",\n \"type\": \"n8n-nodes-base.signl4\",\n \"position\": [\n 1040,\n 500\n ],\n \"parameters\": {\n \"operation\": \"resolve\",\n \"externalId\": \"={{$node[\\\"Binary to JSON\\\"].json[\\\"lastId\\\"]}}\"\n },\n \"credentials\": {\n \"signl4Api\": \"Team\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"SIGNL4 Alert\",\n \"type\": \"n8n-nodes-base.signl4\",\n \"position\": [\n 990,\n 270\n ],\n \"parameters\": {\n \"message\": \"={{$node[\\\"Binary to JSON\\\"].json[\\\"Body\\\"]}}\",\n \"additionalFields\": {\n \"externalId\": \"={{$node[\\\"Binary to JSON\\\"].json[\\\"eventId\\\"]}}\",\n \"locationFieldsUi\": {\n \"locationFieldsValues\": {\n \"latitude\": \"52.3984235\",\n \"longitude\": \"13.0544149\"\n }\n }\n }\n },\n \"credentials\": {\n \"signl4Api\": \"Team\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": true,\n \"settings\": {\n \"timezone\": \"Europe/Berlin\"\n },\n \"connections\": {\n \"IF\": {\n \"main\": [\n [\n {\n \"node\": \"SIGNL4 Alert\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"SIGNL4 Resolve\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Cron\": {\n \"main\": [\n [\n {\n \"node\": \"Read Binary File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Mark as Done\": {\n \"main\": [\n [\n {\n \"node\": \"JSON to Binary\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"SIGNL4 Alert\": {\n \"main\": [\n [\n {\n \"node\": \"Mark as Done\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Binary to JSON\": {\n \"main\": [\n [\n {\n \"node\": \"IF\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"JSON to Binary\": {\n \"main\": [\n [\n {\n \"node\": \"Write Binary File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Binary File\": {\n \"main\": [\n [\n {\n \"node\": \"Binary to JSON\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
52
0
1
false
combined_workflows.json
{ "input": "The workflow monitors for alerts and resolves them in SIGNL4 based on a schedule, storing and updating alert data.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 2789, "processed_size": 2789, "processed_timestamp": "2025-04-09T03:08:39.460396", "timestamp": "2025-04-09T02:37:42.729054", "token_count": 1720, "tokens": 262, "workflow_chunk_info": { "is_truncated": false, "original_size": 2789, "processed_size": 2789, "workflow_hash": "1f875271191e5214bd1a086a8268a4d5" }, "workflow_hash": "1f875271191e5214bd1a086a8268a4d5" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to detect potential phishing emails by analyzing email content and headers, generating screenshots, and automatically creating Jira tickets with the analysis and screenshots. Analyze this workflow: ```json { "meta": { "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8" }, "nodes": [ { "id": "1bad6bfc-9ec9-48a5-b8f7-73c4de3d08cf", "name": "Gmail Trigger", "type": "n8n-nodes-base.gmailTrigger", "position": [ 1480, 160 ], "parameters": { "simple": false, "filters": {}, "options": {}, "pollTimes": { "item": [ { "mode": "everyMinute" } ] } }, "credentials": { "gmailOAuth2": { "id": "kkhNhqKpZt6IUZd0", "name": " Gmail" } }, "typeVersion": 1.2 }, { "id": "9ac747a1-4fd8-46ba-b4c1-75fd17aab2ed", "name": "Microsoft Outlook Trigger", "type": "n8n-nodes-base.microsoftOutlookTrigger", "disabled": true, "position": [ 1480, 720 ], "parameters": { "fields": [ "body", "toRecipients", "subject", "bodyPreview" ], "output": "fields", "filters": {}, "options": {}, "pollTimes": { "item": [ { "mode": "everyMinute" } ] } }, "credentials": { "microsoftOutlookOAuth2Api": { "id": "vTCK0oVQ0WjFrI5H", "name": " Outlook Credential" } }, "typeVersion": 1 }, { "id": "5bf9b0e8-b84e-44a2-aad2-45dde3e4ab1b", "name": "Screenshot HTML", "type": "n8n-nodes-base.httpRequest", "position": [ 2520, 480 ], "parameters": { "url": "https://hcti.io/v1/image", "method": "POST", "options": {}, "sendBody": true, "sendQuery": true, "authentication": "genericCredentialType", "bodyParameters": { "parameters": [ { "name": "html", "value": "={{ $json.htmlBody }}" } ] }, "genericAuthType": "httpBasicAuth", "queryParameters": { "parameters": [ {} ] } }, "credentials": { "httpBasicAuth": { "id": "8tm8mUWmPvtmPFPk", "name": "hcti.io" } }, "typeVersion": 4.2 }, { "id": "fc770d1d-6c18-4d14-8344-1dc042464df6", "name": "Retrieve Screenshot", "type": "n8n-nodes-base.httpRequest", "position": [ 2700, 480 ], "parameters": { "url": "={{ $json.url }}", "options": {}, "authentication": "genericCredentialType", "genericAuthType": "httpBasicAuth" }, "credentials": { "httpBasicAuth": { "id": "8tm8mUWmPvtmPFPk", "name": "hcti.io" } }, "typeVersion": 4.2 }, { "id": "2f3e5cc0-24e8-450a-898b-71e2d6f7bb58", "name": "Set Outlook Variables", "type": "n8n-nodes-base.set", "position": [ 2020, 720 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "38bd3db2-1a8d-4c40-a2dd-336e0cc84224", "name": "htmlBody", "type": "string", "value": "={{ $('Microsoft Outlook Trigger').item.json.body.content }}" }, { "id": "13bdd95b-ef02-486e-b38b-d14bd05a4a8a", "name": "headers", "type": "string", "value": "={{ $json}}" }, { "id": "20566ad4-7eb7-42b1-8a0d-f8b759610f10", "name": "subject", "type": "string", "value": "={{ $('Microsoft Outlook Trigger').item.json.subject }}" }, { "id": "7171998f-a5a2-4e23-946a-9c1ad75710e7", "name": "recipient", "type": "string", "value": "={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}" }, { "id": "cc262634-2470-4524-8319-abe2518a6335", "name": "textBody", "type": "string", "value": "={{ $('Retrieve Headers of Email').item.json.body.content }}" } ] } }, "typeVersion": 3.4 }, { "id": "374e5b16-a666-4706-9fd2-762b2927012d", "name": "Set Gmail Variables", "type": "n8n-nodes-base.set", "position": [ 2040, 160 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "38bd3db2-1a8d-4c40-a2dd-336e0cc84224", "name": "htmlBody", "type": "string", "value": "={{ $json.html }}" }, { "id": "18fbcf78-6d3c-4036-b3a2-fb5adf22176a", "name": "headers", "type": "string", "value": "={{ $json.headers }}" }, { "id": "1d690098-be2a-4604-baf8-62f314930929", "name": "subject", "type": "string", "value": "={{ $json.subject }}" }, { "id": "8009f00a-547f-4eb1-b52d-2e7305248885", "name": "recipient", "type": "string", "value": "={{ $json.to.text }}" }, { "id": "1932e97d-b03b-4964-b8bc-8262aaaa1f7a", "name": "textBody", "type": "string", "value": "={{ $json.text }}" } ] } }, "typeVersion": 3.4 }, { "id": "3166738e-d0a3-475b-8b19-51afd519ee3a", "name": "Retrieve Headers of Email", "type": "n8n-nodes-base.httpRequest", "position": [ 1680, 720 ], "parameters": { "url": "=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body", "options": {}, "sendHeaders": true, "authentication": "predefinedCredentialType", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/json" }, { "name": "Prefer", "value": "outlook.body-content-type=\"text\"" } ] }, "nodeCredentialType": "microsoftOutlookOAuth2Api" }, "credentials": { "microsoftOutlookOAuth2Api": { "id": "vTCK0oVQ0WjFrI5H", "name": " Outlook Credential" } }, "typeVersion": 4.2 }, { "id": "25ae222c-088f-4565-98d6-803c8c1b0826", "name": "Format Headers", "type": "n8n-nodes-base.code", "position": [ 1860, 720 ], "parameters": { "jsCode": "const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\n\nconst result = input.reduce((acc, { name, value }) => {\n if (!acc[name]) acc[name] = [];\n acc[name].push(value);\n return acc;\n}, {});\n\nreturn result;" }, "typeVersion": 2 }, { "id": "8f14f267-1074-43ea-968d-26a6ab36fd7b", "name": "Set Email Variables", "type": "n8n-nodes-base.set", "position": [ 2360, 480 ], "parameters": { "options": {}, "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "45d156aa-91f4-483c-91d4-c9de4a4f595d", "name": "ChatGPT Analysis", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 3100, 480 ], "parameters": { "text": "=Describe this image. Determine if the email could be a phishing email. The message headers are as follows:\n{{ $('Set Email Variables').item.json.headers }}\n\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response.", "modelId": { "__rl": true, "mode": "list", "value": "chatgpt-4o-latest", "cachedResultName": "CHATGPT-4O-LATEST" }, "options": { "maxTokens": 1500 }, "resource": "image", "inputType": "base64", "operation": "analyze" }, "credentials": { "openAiApi": { "id": "76", "name": "OpenAi account" } }, "typeVersion": 1.6 }, { "id": "62ca591b-6627-496c-96a7-95cb0081480d", "name": "Create Jira Ticket", "type": "n8n-nodes-base.jira", "position": [ 3500, 480 ], "parameters": { "project": { "__rl": true, "mode": "list", "value": "10001", "cachedResultName": "Support" }, "summary": "=Phishing Email Reported: \"{{ $('Set Email Variables').item.json.subject }}\"", "issueType": { "__rl": true, "mode": "list", "value": "10008", "cachedResultName": "Task" }, "additionalFields": { "description": "=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \"{{ $('Set Email Variables').item.json.subject }}\" and body:\n{{ $('Set Email Variables').item.json.textBody }}\n\\\\\n\\\\\n\\\\\nh2. Here is ChatGPT's analysis of the email:\n{{ $json.content }}" } }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "071380c8-8070-4f8f-86c6-87c4ee3bc261", "name": "Rename Screenshot", "type": "n8n-nodes-base.code", "position": [ 3680, 480 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\n\nreturn $('Retrieve Screenshot').item;" }, "typeVersion": 2 }, { "id": "05c57490-c1ee-48f0-9e38-244c9a995e22", "name": "Upload Screenshot of Email to Jira", "type": "n8n-nodes-base.jira", "position": [ 3860, 480 ], "parameters": { "issueKey": "={{ $('Create Jira Ticket').item.json.key }}", "resource": "issueAttachment" }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "be
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"nodes\": [\n {\n \"id\": \"1bad6bfc-9ec9-48a5-b8f7-73c4de3d08cf\",\n \"name\": \"Gmail Trigger\",\n \"type\": \"n8n-nodes-base.gmailTrigger\",\n \"position\": [\n 1480,\n 160\n ],\n \"parameters\": {\n \"simple\": false,\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"kkhNhqKpZt6IUZd0\",\n \"name\": \" Gmail\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"9ac747a1-4fd8-46ba-b4c1-75fd17aab2ed\",\n \"name\": \"Microsoft Outlook Trigger\",\n \"type\": \"n8n-nodes-base.microsoftOutlookTrigger\",\n \"disabled\": true,\n \"position\": [\n 1480,\n 720\n ],\n \"parameters\": {\n \"fields\": [\n \"body\",\n \"toRecipients\",\n \"subject\",\n \"bodyPreview\"\n ],\n \"output\": \"fields\",\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5bf9b0e8-b84e-44a2-aad2-45dde3e4ab1b\",\n \"name\": \"Screenshot HTML\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2520,\n 480\n ],\n \"parameters\": {\n \"url\": \"https://hcti.io/v1/image\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendQuery\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"html\",\n \"value\": \"={{ $json.htmlBody }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpBasicAuth\",\n \"queryParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"fc770d1d-6c18-4d14-8344-1dc042464df6\",\n \"name\": \"Retrieve Screenshot\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2700,\n 480\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpBasicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"2f3e5cc0-24e8-450a-898b-71e2d6f7bb58\",\n \"name\": \"Set Outlook Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2020,\n 720\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.body.content }}\"\n },\n {\n \"id\": \"13bdd95b-ef02-486e-b38b-d14bd05a4a8a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json}}\"\n },\n {\n \"id\": \"20566ad4-7eb7-42b1-8a0d-f8b759610f10\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.subject }}\"\n },\n {\n \"id\": \"7171998f-a5a2-4e23-946a-9c1ad75710e7\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}\"\n },\n {\n \"id\": \"cc262634-2470-4524-8319-abe2518a6335\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Retrieve Headers of Email').item.json.body.content }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"374e5b16-a666-4706-9fd2-762b2927012d\",\n \"name\": \"Set Gmail Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2040,\n 160\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.html }}\"\n },\n {\n \"id\": \"18fbcf78-6d3c-4036-b3a2-fb5adf22176a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers }}\"\n },\n {\n \"id\": \"1d690098-be2a-4604-baf8-62f314930929\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $json.subject }}\"\n },\n {\n \"id\": \"8009f00a-547f-4eb1-b52d-2e7305248885\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $json.to.text }}\"\n },\n {\n \"id\": \"1932e97d-b03b-4964-b8bc-8262aaaa1f7a\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.text }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3166738e-d0a3-475b-8b19-51afd519ee3a\",\n \"name\": \"Retrieve Headers of Email\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1680,\n 720\n ],\n \"parameters\": {\n \"url\": \"=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n },\n {\n \"name\": \"Prefer\",\n \"value\": \"outlook.body-content-type=\\\"text\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"microsoftOutlookOAuth2Api\"\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"25ae222c-088f-4565-98d6-803c8c1b0826\",\n \"name\": \"Format Headers\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1860,\n 720\n ],\n \"parameters\": {\n \"jsCode\": \"const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\\n\\nconst result = input.reduce((acc, { name, value }) => {\\n if (!acc[name]) acc[name] = [];\\n acc[name].push(value);\\n return acc;\\n}, {});\\n\\nreturn result;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"8f14f267-1074-43ea-968d-26a6ab36fd7b\",\n \"name\": \"Set Email Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2360,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"45d156aa-91f4-483c-91d4-c9de4a4f595d\",\n \"name\": \"ChatGPT Analysis\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 3100,\n 480\n ],\n \"parameters\": {\n \"text\": \"=Describe this image. Determine if the email could be a phishing email. The message headers are as follows:\\n{{ $('Set Email Variables').item.json.headers }}\\n\\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response.\",\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"chatgpt-4o-latest\",\n \"cachedResultName\": \"CHATGPT-4O-LATEST\"\n },\n \"options\": {\n \"maxTokens\": 1500\n },\n \"resource\": \"image\",\n \"inputType\": \"base64\",\n \"operation\": \"analyze\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"76\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"62ca591b-6627-496c-96a7-95cb0081480d\",\n \"name\": \"Create Jira Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3500,\n 480\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\" and body:\\n{{ $('Set Email Variables').item.json.textBody }}\\n\\\\\\\\\\n\\\\\\\\\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.content }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"071380c8-8070-4f8f-86c6-87c4ee3bc261\",\n \"name\": \"Rename Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 3680,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\\n\\nreturn $('Retrieve Screenshot').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"05c57490-c1ee-48f0-9e38-244c9a995e22\",\n \"name\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3860,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Create Jira Ticket').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"be02770d-a943-41f5-98a9-5c433a6a3dbf\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1420,\n -107.36679523834897\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 792.3026315789474,\n \"height\": 426.314163659402,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/gmail.png)\\n## Gmail Integration and Data Extraction\\n\\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1d2f691-669a-46de-9ef8-59ce4e6980c5\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1420,\n 380.6918768014301\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 792.3026315789474,\n \"height\": 532.3344389880435,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/outlook.png)\\n## Microsoft Outlook Integration and Email Header Processing\\n\\nThis section connects to a Microsoft Outlook account to monitor incoming emails using the **Microsoft Outlook Trigger** node, which checks for new messages every minute. Emails are then processed to retrieve detailed headers and body content via the **Retrieve Headers of Email** node. The headers are structured into a user-friendly format using the **Format Headers** code node, ensuring clarity for further analysis. Key details, including the email's subject, recipient, and body content, are assigned to variables with the **Set Outlook Variables** node for streamlined integration into subsequent workflow steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c189e2e0-9f51-4bc0-a483-8b7f0528be70\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2287.3684210526317,\n 46.18421052631584\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 580.4605263157906,\n \"height\": 615.460526315789,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/hctiapi.png)\\n## HTML Screenshot Generation and Email Visualization\\n\\nThis section processes an email’s HTML content to create a visual representation, useful for documentation or phishing detection workflows. The **Set Email Variables** node organizes the email's HTML body into a format ready for processing. The **Screenshot HTML** node sends this HTML content to the **hcti.io** API, which generates a screenshot of the email's layout. The **Retrieve Screenshot** node then fetches the image URL for further use in the workflow. This setup ensures that the email's appearance is preserved in a visually accessible format, simplifying review and reporting. Keep in mind however that this exposes the email content to a third party. If you self host n8n, you can deploy a cli tool to rasterize locally instead.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9076f9e9-f4fb-409a-9580-1ae459094c31\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2880,\n 123.72476075009968\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 507.82894736842223,\n \"height\": 537.9199760920052,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/openai.png)\\n## AI-Powered Email Analysis with ChatGPT\\n\\nThis section leverages AI to analyze email content and headers for phishing indicators. The **ChatGPT Analysis** node utilizes the ChatGPT-4 model to review the email screenshot and associated metadata, including message headers. It generates a detailed report indicating whether the email might be a phishing attempt. The output is formatted specifically for Jira’s wiki-style renderer, making it ready for seamless integration into ticketing workflows. This ensures thorough and automated email threat assessments.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ca2488af-e787-4675-802a-8b4f2d845376\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 3400,\n 122.88662032580646\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 692.434210526317,\n \"height\": 529.5475902005091,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/jira.png)\\n## Automated Jira Ticket Creation for Phishing Reports\\n\\nThis section streamlines the process of reporting phishing emails by automatically creating detailed Jira tickets. The **Create Jira Ticket** node compiles email information, including the subject, recipient, body text, and ChatGPT's phishing analysis, into a structured ticket. The **Rename Screenshot** node ensures that the email screenshot file is appropriately labeled for attachment. Finally, the **Upload Screenshot of Email to Jira** node attaches the email’s visual representation to the ticket, providing additional context for the security team. This integration ensures that phishing reports are logged with all necessary details, enabling efficient tracking and resolution.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Gmail Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Set Gmail Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Format Headers\": {\n \"main\": [\n [\n {\n \"node\": \"Set Outlook Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Screenshot HTML\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"ChatGPT Analysis\": {\n \"main\": [\n [\n {\n \"node\": \"Create Jira Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Jira Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"ChatGPT Analysis\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Email Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Screenshot HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Gmail Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Outlook Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Microsoft Outlook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Headers of Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Headers of Email\": {\n \"main\": [\n [\n {\n \"node\": \"Format Headers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
53
0
2
true
combined_workflows.json
{ "input": "The workflow's goal is to detect potential phishing emails by analyzing email content and headers, generating screenshots, and automatically creating Jira tickets with the analysis and screenshots.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 13421, "processed_size": 13421, "processed_timestamp": "2025-04-09T03:08:39.558357", "timestamp": "2025-04-09T02:37:47.555808", "token_count": 4095, "tokens": 1316, "workflow_chunk_info": { "is_truncated": false, "original_size": 13421, "processed_size": 13421, "workflow_hash": "ead134a96f20237a655b4ffcd5e6d96c" }, "workflow_hash": "ead134a96f20237a655b4ffcd5e6d96c" }
-c1ee-48f0-9e38-244c9a995e22", "name": "Upload Screenshot of Email to Jira", "type": "n8n-nodes-base.jira", "position": [ 3860, 480 ], "parameters": { "issueKey": "={{ $('Create Jira Ticket').item.json.key }}", "resource": "issueAttachment" }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "be02770d-a943-41f5-98a9-5c433a6a3dbf", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1420, -107.36679523834897 ], "parameters": { "color": 7, "width": 792.3026315789474, "height": 426.314163659402, "content": "![Gmail](https://uploads.n8n.io/templates/gmail.png)\n## Gmail Integration and Data Extraction\n\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps." }, "typeVersion": 1 }, { "id": "c1d2f691-669a-46de-9ef8-59ce4e6980c5", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1420, 380.6918768014301 ], "parameters": { "color": 7, "width": 792.3026315789474, "height": 532.3344389880435, "content": "![Gmail](https://uploads.n8n.io/templates/outlook.png)\n## Microsoft Outlook Integration and Email Header Processing\n\nThis section connects to a Microsoft Outlook account to monitor incoming emails using the **Microsoft Outlook Trigger** node, which checks for new messages every minute. Emails are then processed to retrieve detailed headers and body content via the **Retrieve Headers of Email** node. The headers are structured into a user-friendly format using the **Format Headers** code node, ensuring clarity for further analysis. Key details, including the email's subject, recipient, and body content, are assigned to variables with the **Set Outlook Variables** node for streamlined integration into subsequent workflow steps." }, "typeVersion": 1 }, { "id": "c189e2e0-9f51-4bc0-a483-8b7f0528be70", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 2287.3684210526317, 46.18421052631584 ], "parameters": { "color": 7, "width": 580.4605263157906, "height": 615.460526315789, "content": "![hctiapi](https://uploads.n8n.io/templates/hctiapi.png)\n## HTML Screenshot Generation and Email Visualization\n\nThis section processes an email’s HTML content to create a visual representation, useful for documentation or phishing detection workflows. The **Set Email Variables** node organizes the email's HTML body into a format ready for processing. The **Screenshot HTML** node sends this HTML content to the **hcti.io** API, which generates a screenshot of the email's layout. The **Retrieve Screenshot** node then fetches the image URL for further use in the workflow. This setup ensures that the email's appearance is preserved in a visually accessible format, simplifying review and reporting. Keep in mind however that this exposes the email content to a third party. If you self host n8n, you can deploy a cli tool to rasterize locally instead." }, "typeVersion": 1 }, { "id": "9076f9e9-f4fb-409a-9580-1ae459094c31", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 2880, 123.72476075009968 ], "parameters": { "color": 7, "width": 507.82894736842223, "height": 537.9199760920052, "content": "![hctiapi](https://uploads.n8n.io/templates/openai.png)\n## AI-Powered Email Analysis with ChatGPT\n\nThis section leverages AI to analyze email content and headers for phishing indicators. The **ChatGPT Analysis** node utilizes the ChatGPT-4 model to review the email screenshot and associated metadata, including message headers. It generates a detailed report indicating whether the email might be a phishing attempt. The output is formatted specifically for Jira’s wiki-style renderer, making it ready for seamless integration into ticketing workflows. This ensures thorough and automated email threat assessments." }, "typeVersion": 1 }, { "id": "ca2488af-e787-4675-802a-8b4f2d845376", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 3400, 122.88662032580646 ], "parameters": { "color": 7, "width": 692.434210526317, "height": 529.5475902005091, "content": "![hctiapi](https://uploads.n8n.io/templates/jira.png)\n## Automated Jira Ticket Creation for Phishing Reports\n\nThis section streamlines the process of reporting phishing emails by automatically creating detailed Jira tickets. The **Create Jira Ticket** node compiles email information, including the subject, recipient, body text, and ChatGPT's phishing analysis, into a structured ticket. The **Rename Screenshot** node ensures that the email screenshot file is appropriately labeled for attachment. Finally, the **Upload Screenshot of Email to Jira** node attaches the email’s visual representation to the ticket, providing additional context for the security team. This integration ensures that phishing reports are logged with all necessary details, enabling efficient tracking and resolution." }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Gmail Trigger": { "main": [ [ { "node": "Set Gmail Variables", "type": "main", "index": 0 } ] ] }, "Format Headers": { "main": [ [ { "node": "Set Outlook Variables", "type": "main", "index": 0 } ] ] }, "Screenshot HTML": { "main": [ [ { "node": "Retrieve Screenshot", "type": "main", "index": 0 } ] ] }, "ChatGPT Analysis": { "main": [ [ { "node": "Create Jira Ticket", "type": "main", "index": 0 } ] ] }, "Rename Screenshot": { "main": [ [ { "node": "Upload Screenshot of Email to Jira", "type": "main", "index": 0 } ] ] }, "Create Jira Ticket": { "main": [ [ { "node": "Rename Screenshot", "type": "main", "index": 0 } ] ] }, "Retrieve Screenshot": { "main": [ [ { "node": "ChatGPT Analysis", "type": "main", "index": 0 } ] ] }, "Set Email Variables": { "main": [ [ { "node": "Screenshot HTML", "type": "main", "index": 0 } ] ] }, "Set Gmail Variables": { "main": [ [ { "node": "Set Email Variables", "type": "main", "index": 0 } ] ] }, "Set Outlook Variables": { "main": [ [ { "node": "Set Email Variables", "type": "main", "index": 0 } ] ] }, "Microsoft Outlook Trigger": { "main": [ [ { "node": "Retrieve Headers of Email", "type": "main", "index": 0 } ] ] }, "Retrieve Headers of Email": { "main": [ [ { "node": "Format Headers", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"nodes\": [\n {\n \"id\": \"1bad6bfc-9ec9-48a5-b8f7-73c4de3d08cf\",\n \"name\": \"Gmail Trigger\",\n \"type\": \"n8n-nodes-base.gmailTrigger\",\n \"position\": [\n 1480,\n 160\n ],\n \"parameters\": {\n \"simple\": false,\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"kkhNhqKpZt6IUZd0\",\n \"name\": \" Gmail\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"9ac747a1-4fd8-46ba-b4c1-75fd17aab2ed\",\n \"name\": \"Microsoft Outlook Trigger\",\n \"type\": \"n8n-nodes-base.microsoftOutlookTrigger\",\n \"disabled\": true,\n \"position\": [\n 1480,\n 720\n ],\n \"parameters\": {\n \"fields\": [\n \"body\",\n \"toRecipients\",\n \"subject\",\n \"bodyPreview\"\n ],\n \"output\": \"fields\",\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5bf9b0e8-b84e-44a2-aad2-45dde3e4ab1b\",\n \"name\": \"Screenshot HTML\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2520,\n 480\n ],\n \"parameters\": {\n \"url\": \"https://hcti.io/v1/image\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendQuery\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"html\",\n \"value\": \"={{ $json.htmlBody }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpBasicAuth\",\n \"queryParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"fc770d1d-6c18-4d14-8344-1dc042464df6\",\n \"name\": \"Retrieve Screenshot\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2700,\n 480\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpBasicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"2f3e5cc0-24e8-450a-898b-71e2d6f7bb58\",\n \"name\": \"Set Outlook Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2020,\n 720\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.body.content }}\"\n },\n {\n \"id\": \"13bdd95b-ef02-486e-b38b-d14bd05a4a8a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json}}\"\n },\n {\n \"id\": \"20566ad4-7eb7-42b1-8a0d-f8b759610f10\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.subject }}\"\n },\n {\n \"id\": \"7171998f-a5a2-4e23-946a-9c1ad75710e7\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}\"\n },\n {\n \"id\": \"cc262634-2470-4524-8319-abe2518a6335\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Retrieve Headers of Email').item.json.body.content }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"374e5b16-a666-4706-9fd2-762b2927012d\",\n \"name\": \"Set Gmail Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2040,\n 160\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.html }}\"\n },\n {\n \"id\": \"18fbcf78-6d3c-4036-b3a2-fb5adf22176a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers }}\"\n },\n {\n \"id\": \"1d690098-be2a-4604-baf8-62f314930929\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $json.subject }}\"\n },\n {\n \"id\": \"8009f00a-547f-4eb1-b52d-2e7305248885\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $json.to.text }}\"\n },\n {\n \"id\": \"1932e97d-b03b-4964-b8bc-8262aaaa1f7a\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.text }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"3166738e-d0a3-475b-8b19-51afd519ee3a\",\n \"name\": \"Retrieve Headers of Email\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1680,\n 720\n ],\n \"parameters\": {\n \"url\": \"=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n },\n {\n \"name\": \"Prefer\",\n \"value\": \"outlook.body-content-type=\\\"text\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"microsoftOutlookOAuth2Api\"\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"25ae222c-088f-4565-98d6-803c8c1b0826\",\n \"name\": \"Format Headers\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1860,\n 720\n ],\n \"parameters\": {\n \"jsCode\": \"const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\\n\\nconst result = input.reduce((acc, { name, value }) => {\\n if (!acc[name]) acc[name] = [];\\n acc[name].push(value);\\n return acc;\\n}, {});\\n\\nreturn result;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"8f14f267-1074-43ea-968d-26a6ab36fd7b\",\n \"name\": \"Set Email Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2360,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"45d156aa-91f4-483c-91d4-c9de4a4f595d\",\n \"name\": \"ChatGPT Analysis\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 3100,\n 480\n ],\n \"parameters\": {\n \"text\": \"=Describe this image. Determine if the email could be a phishing email. The message headers are as follows:\\n{{ $('Set Email Variables').item.json.headers }}\\n\\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response.\",\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"chatgpt-4o-latest\",\n \"cachedResultName\": \"CHATGPT-4O-LATEST\"\n },\n \"options\": {\n \"maxTokens\": 1500\n },\n \"resource\": \"image\",\n \"inputType\": \"base64\",\n \"operation\": \"analyze\"\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"76\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"62ca591b-6627-496c-96a7-95cb0081480d\",\n \"name\": \"Create Jira Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3500,\n 480\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\" and body:\\n{{ $('Set Email Variables').item.json.textBody }}\\n\\\\\\\\\\n\\\\\\\\\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.content }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"071380c8-8070-4f8f-86c6-87c4ee3bc261\",\n \"name\": \"Rename Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 3680,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\\n\\nreturn $('Retrieve Screenshot').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"05c57490-c1ee-48f0-9e38-244c9a995e22\",\n \"name\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3860,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Create Jira Ticket').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"be02770d-a943-41f5-98a9-5c433a6a3dbf\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1420,\n -107.36679523834897\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 792.3026315789474,\n \"height\": 426.314163659402,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/gmail.png)\\n## Gmail Integration and Data Extraction\\n\\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c1d2f691-669a-46de-9ef8-59ce4e6980c5\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1420,\n 380.6918768014301\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 792.3026315789474,\n \"height\": 532.3344389880435,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/outlook.png)\\n## Microsoft Outlook Integration and Email Header Processing\\n\\nThis section connects to a Microsoft Outlook account to monitor incoming emails using the **Microsoft Outlook Trigger** node, which checks for new messages every minute. Emails are then processed to retrieve detailed headers and body content via the **Retrieve Headers of Email** node. The headers are structured into a user-friendly format using the **Format Headers** code node, ensuring clarity for further analysis. Key details, including the email's subject, recipient, and body content, are assigned to variables with the **Set Outlook Variables** node for streamlined integration into subsequent workflow steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c189e2e0-9f51-4bc0-a483-8b7f0528be70\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2287.3684210526317,\n 46.18421052631584\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 580.4605263157906,\n \"height\": 615.460526315789,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/hctiapi.png)\\n## HTML Screenshot Generation and Email Visualization\\n\\nThis section processes an email’s HTML content to create a visual representation, useful for documentation or phishing detection workflows. The **Set Email Variables** node organizes the email's HTML body into a format ready for processing. The **Screenshot HTML** node sends this HTML content to the **hcti.io** API, which generates a screenshot of the email's layout. The **Retrieve Screenshot** node then fetches the image URL for further use in the workflow. This setup ensures that the email's appearance is preserved in a visually accessible format, simplifying review and reporting. Keep in mind however that this exposes the email content to a third party. If you self host n8n, you can deploy a cli tool to rasterize locally instead.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"9076f9e9-f4fb-409a-9580-1ae459094c31\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2880,\n 123.72476075009968\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 507.82894736842223,\n \"height\": 537.9199760920052,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/openai.png)\\n## AI-Powered Email Analysis with ChatGPT\\n\\nThis section leverages AI to analyze email content and headers for phishing indicators. The **ChatGPT Analysis** node utilizes the ChatGPT-4 model to review the email screenshot and associated metadata, including message headers. It generates a detailed report indicating whether the email might be a phishing attempt. The output is formatted specifically for Jira’s wiki-style renderer, making it ready for seamless integration into ticketing workflows. This ensures thorough and automated email threat assessments.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"ca2488af-e787-4675-802a-8b4f2d845376\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 3400,\n 122.88662032580646\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 692.434210526317,\n \"height\": 529.5475902005091,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/jira.png)\\n## Automated Jira Ticket Creation for Phishing Reports\\n\\nThis section streamlines the process of reporting phishing emails by automatically creating detailed Jira tickets. The **Create Jira Ticket** node compiles email information, including the subject, recipient, body text, and ChatGPT's phishing analysis, into a structured ticket. The **Rename Screenshot** node ensures that the email screenshot file is appropriately labeled for attachment. Finally, the **Upload Screenshot of Email to Jira** node attaches the email’s visual representation to the ticket, providing additional context for the security team. This integration ensures that phishing reports are logged with all necessary details, enabling efficient tracking and resolution.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Gmail Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Set Gmail Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Format Headers\": {\n \"main\": [\n [\n {\n \"node\": \"Set Outlook Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Screenshot HTML\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"ChatGPT Analysis\": {\n \"main\": [\n [\n {\n \"node\": \"Create Jira Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Jira Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"ChatGPT Analysis\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Email Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Screenshot HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Gmail Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Outlook Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Microsoft Outlook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Headers of Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Headers of Email\": {\n \"main\": [\n [\n {\n \"node\": \"Format Headers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
53
1
2
true
combined_workflows.json
{ "input": "The workflow's goal is to detect potential phishing emails by analyzing email content and headers, generating screenshots, and automatically creating Jira tickets with the analysis and screenshots.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 13421, "processed_size": 13421, "processed_timestamp": "2025-04-09T03:08:39.565362", "timestamp": "2025-04-09T02:37:47.555808", "token_count": 2762, "tokens": 1316, "workflow_chunk_info": { "is_truncated": false, "original_size": 13421, "processed_size": 13421, "workflow_hash": "ead134a96f20237a655b4ffcd5e6d96c" }, "workflow_hash": "ead134a96f20237a655b4ffcd5e6d96c" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow monitors Palo Alto security advisories, filters them based on keywords (GlobalProtect, Traps), and then either creates a Jira issue or emails relevant customers about the advisory. Analyze this workflow: ```json { "id": "YSjQ7TVCNY9v1F2A", "meta": { "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8" }, "name": "Monitor_security_advisories", "tags": [ { "id": "DlIeVDZxzko5ifNi", "name": "createdBy:David", "createdAt": "2023-10-31T02:21:50.700Z", "updatedAt": "2023-10-31T02:21:50.700Z" }, { "id": "QPJKatvLSxxtrE8U", "name": "Secops", "createdAt": "2023-10-31T02:15:11.396Z", "updatedAt": "2023-10-31T02:15:11.396Z" }, { "id": "oyHT7KfD0rdIizVw", "name": "Pending", "createdAt": "2023-11-10T23:19:06.319Z", "updatedAt": "2023-11-10T23:19:06.319Z" } ], "nodes": [ { "id": "62ef1311-a623-4a7d-b59a-6c0a0d7751d7", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ 100, 200 ], "parameters": {}, "typeVersion": 1 }, { "id": "808c1b88-69e9-4e96-bcfd-b93810740fda", "name": "Get Palo Alto security advisories", "type": "n8n-nodes-base.rssFeedRead", "position": [ 400, 360 ], "parameters": { "url": "https://security.paloaltonetworks.com/rss.xml", "options": {} }, "typeVersion": 1 }, { "id": "97f16fe1-c720-40e0-85ff-61fdbfb9a2c2", "name": "GlobalProtect advisory?", "type": "n8n-nodes-base.filter", "position": [ 1240, 240 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $json.title }}", "value2": "GlobalProtect", "operation": "contains" } ] } }, "typeVersion": 1 }, { "id": "3602f7bb-87d3-49a2-9916-b9ab7d86f58b", "name": "Traps advisory?", "type": "n8n-nodes-base.filter", "position": [ 1240, 380 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $json.title }}", "value2": "Traps", "operation": "contains" } ] } }, "typeVersion": 1 }, { "id": "97c108f0-bdf1-4ed9-a545-d52acb7c9cec", "name": "Create Jira issue", "type": "n8n-nodes-base.jira", "position": [ 1520, 240 ], "parameters": { "project": { "__rl": true, "mode": "list", "value": "" }, "summary": "={{ $json.title.substring(14) }}", "issueType": { "__rl": true, "mode": "list", "value": "" }, "additionalFields": { "priority": { "mode": "list", "value": "" }, "description": "=Severity: {{ $json.title.split('(Severity:')[1].replace(')', '').trim() }}\nLink: {{ $json.link }}\nPublished: {{ $json.pubDate }} " } }, "credentials": { "jiraSoftwareCloudApi": { "id": "4", "name": "Jira Ricardo" } }, "typeVersion": 1 }, { "id": "acb89eb0-c9e5-4fbb-a750-3607ae280670", "name": "Get customers", "type": "n8n-nodes-base.n8nTrainingCustomerDatastore", "position": [ 1960, 380 ], "parameters": { "operation": "getAllPeople", "returnAll": true }, "typeVersion": 1 }, { "id": "babf1ce4-6ed4-4bd9-a1df-429a15fa6849", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -13.168003380834136, -396.06737036843754 ], "parameters": { "width": 332.0284684971131, "height": 926.523360092614, "content": "![Shodan](https://i.imgur.com/PcOuvAL.png)\n## Workflow Overview\nThis n8n workflow is designed to streamline security oversight by fetching advisories from Palo Alto's feed and filtering out alerts not pertinent to your products. \n\nBy utilizing a dynamic filter system, it excludes unrelated advisories, ensuring that your team receives only relevant security updates. \n\nCoupled with a sample database of emails, this workflow offers a customizable solution to align with any corporate email directory, providing a strong foundation for your security information management strategy. \n\n## Execution Schedule\n\nScheduled to run every 24 hours at 1 am. If you change this timer, ensure to update the `Deduplicate Advisories` section to match. \n" }, "typeVersion": 1 }, { "id": "820112fc-e635-4d51-b152-8a2ee4de8f56", "name": "Email customers", "type": "n8n-nodes-base.gmail", "position": [ 2360, 380 ], "parameters": { "sendTo": "={{ $json.email }}", "message": "=Dear {{ $json.name.split(' ')[0] }},\n\nWe wanted to let you know of a new security advisory:\n\n{{ $('GlobalProtect advisory?').item.json.title }}\n{{ $('GlobalProtect advisory?').item.json.link }}\n\nRegards,\n\nNathan", "options": {}, "subject": "=New {{ $('Extract info').item.json.type }} security advisory " }, "credentials": { "gmailOAuth2": { "id": "198", "name": "Gmail account (David)" } }, "typeVersion": 2 }, { "id": "06497e48-37ea-4c2a-a633-6b0f02d1da5f", "name": "Extract info", "type": "n8n-nodes-base.set", "position": [ 600, 360 ], "parameters": { "values": { "string": [ { "name": "type", "value": "={{ $json.title.match(/[^ ]* ([^:]*):/)[1].trim() }}" }, { "name": "subject", "value": "={{ $json.title.match(/[^ ]* [^:]*: (.*)(?=\\(Severity:)/)[1].trim() }}" }, { "name": "severity", "value": "={{ $json.title.split('Severity:')[1].replaceAll(')', '').trim().toLowerCase().toTitleCase() }}" } ] }, "options": {} }, "typeVersion": 2 }, { "id": "79a85d6e-2550-4351-9356-6f2f8c330693", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 340, -54.852630774649356 ], "parameters": { "width": 419.37209302325573, "height": 577.9223982165106, "content": "![Shodan](https://i.imgur.com/weKPN2E.png)\n## Get Palo Alto security advisories\nAdaptable and efficient, this segment of the workflow retrieves Palo Alto security advisories directly through their RSS feed. \n\nYou can tailor the feed URL in the RSS node below to meet your needs and ensure the `Extract Info` node captures the correct information. \n\nThis flexibility allows the workflow to stay current with the latest advisories, making it a vital component in maintaining up-to-date security measures across your network infrastructure.\n" }, "typeVersion": 1 }, { "id": "f2c5155d-28ab-4ae4-a402-5244ccac94e3", "name": "Check if posted in last 24 hours", "type": "n8n-nodes-base.if", "position": [ 920, 360 ], "parameters": { "conditions": { "dateTime": [ { "value1": "={{ $json.pubDate }}", "value2": "={{$today.minus({days: 1})}}" } ] } }, "typeVersion": 1 }, { "id": "a3553ba4-3581-4844-abaf-e872cb6dc7ea", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1751, -366.68188678732713 ], "parameters": { "width": 461.89918009735027, "height": 893.2712326436663, "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n## Query Company Email Directory\nThe workflow includes a sample node setup that queries a company email directory, allowing for dynamic distribution of advisories to relevant personnel. \n\nReplace the sample node with a connection to your corporate directory or a Google Sheet for an integrated approach. If you choose to go the google sheets route, create a column for `name` and a column for `email` and use the Google Sheets node to get the rows. \n\nThis ensures that every advisory reaches the appropriate individual, promoting a proactive security posture organization-wide.\n\nEnsure that the node you use outputs the json in this format:\n\n```\n[\n {\n \"name\": \"Jay Gatsby\",\n \"email\": \"gatsby@west-egg.com\"\n },\n {\n \"name\": \"JosΓ© Arcadio BuendΓ­a\",\n \"email\": \"jab@macondo.co\"\n },\n {\n \"name\": \"Max Sendak\",\n \"email\": \"info@in-and-out-of-weeks.org\"\n }\n]\n```" }, "typeVersion": 1 }, { "id": "4c6a7aac-8aa3-480e-9691-bfa5472d3d91", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 2240, -113.74332300803701 ], "parameters": { "width": 324.2540832882642, "height": 639.8357317519218, "content": "![gmail](https://i.imgur.com/f6f6my0.png)\n## Email advisory information to your team\nOnce advisories are filtered and prepared, this final node uses Gmail to disseminate the information to your team, ensuring that those who need to be aware of security updates are informed in a timely manner. \n\nThis step is pivotal in the communication chain, turning advisories into actionable insights for your team, thereby promoting a culture of responsiveness and awareness regarding network security.\n\nYou can replace this with your preferred email provider by substituting the node and expressions in the Gmail node. " }, "typeVersion": 1 }, { "id": "75aae5d6-bcaf-4d69-9adf-f71075b16318", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 1180, -320 ], "parameters": { "width": 552.9069767441861, "height": 844.9721583936011, "content": "![Jira](https://i.imgur.com/Ko72Qxa.png)\n## Filter advisories based on Palo Alto Products used in your organization \nThis node enhances specificity by filtering advisories based on the Palo Alto products utilized within your organization. \n\nBy customizing the filter nodes to match your environment, you create a streamlined process that directs pertinent advisories to a Jira issue (or any incident management system
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"YSjQ7TVCNY9v1F2A\",\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"name\": \"Monitor_security_advisories\",\n \"tags\": [\n {\n \"id\": \"DlIeVDZxzko5ifNi\",\n \"name\": \"createdBy:David\",\n \"createdAt\": \"2023-10-31T02:21:50.700Z\",\n \"updatedAt\": \"2023-10-31T02:21:50.700Z\"\n },\n {\n \"id\": \"QPJKatvLSxxtrE8U\",\n \"name\": \"Secops\",\n \"createdAt\": \"2023-10-31T02:15:11.396Z\",\n \"updatedAt\": \"2023-10-31T02:15:11.396Z\"\n },\n {\n \"id\": \"oyHT7KfD0rdIizVw\",\n \"name\": \"Pending\",\n \"createdAt\": \"2023-11-10T23:19:06.319Z\",\n \"updatedAt\": \"2023-11-10T23:19:06.319Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"62ef1311-a623-4a7d-b59a-6c0a0d7751d7\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 100,\n 200\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"808c1b88-69e9-4e96-bcfd-b93810740fda\",\n \"name\": \"Get Palo Alto security advisories\",\n \"type\": \"n8n-nodes-base.rssFeedRead\",\n \"position\": [\n 400,\n 360\n ],\n \"parameters\": {\n \"url\": \"https://security.paloaltonetworks.com/rss.xml\",\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"97f16fe1-c720-40e0-85ff-61fdbfb9a2c2\",\n \"name\": \"GlobalProtect advisory?\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1240,\n 240\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.title }}\",\n \"value2\": \"GlobalProtect\",\n \"operation\": \"contains\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3602f7bb-87d3-49a2-9916-b9ab7d86f58b\",\n \"name\": \"Traps advisory?\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1240,\n 380\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.title }}\",\n \"value2\": \"Traps\",\n \"operation\": \"contains\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"97c108f0-bdf1-4ed9-a545-d52acb7c9cec\",\n \"name\": \"Create Jira issue\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 1520,\n 240\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"\"\n },\n \"summary\": \"={{ $json.title.substring(14) }}\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"\"\n },\n \"additionalFields\": {\n \"priority\": {\n \"mode\": \"list\",\n \"value\": \"\"\n },\n \"description\": \"=Severity: {{ $json.title.split('(Severity:')[1].replace(')', '').trim() }}\\nLink: {{ $json.link }}\\nPublished: {{ $json.pubDate }} \"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"4\",\n \"name\": \"Jira Ricardo\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"acb89eb0-c9e5-4fbb-a750-3607ae280670\",\n \"name\": \"Get customers\",\n \"type\": \"n8n-nodes-base.n8nTrainingCustomerDatastore\",\n \"position\": [\n 1960,\n 380\n ],\n \"parameters\": {\n \"operation\": \"getAllPeople\",\n \"returnAll\": true\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"babf1ce4-6ed4-4bd9-a1df-429a15fa6849\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -13.168003380834136,\n -396.06737036843754\n ],\n \"parameters\": {\n \"width\": 332.0284684971131,\n \"height\": 926.523360092614,\n \"content\": \"![Shodan](https://i.imgur.com/PcOuvAL.png)\\n## Workflow Overview\\nThis n8n workflow is designed to streamline security oversight by fetching advisories from Palo Alto's feed and filtering out alerts not pertinent to your products. \\n\\nBy utilizing a dynamic filter system, it excludes unrelated advisories, ensuring that your team receives only relevant security updates. \\n\\nCoupled with a sample database of emails, this workflow offers a customizable solution to align with any corporate email directory, providing a strong foundation for your security information management strategy. \\n\\n## Execution Schedule\\n\\nScheduled to run every 24 hours at 1 am. If you change this timer, ensure to update the `Deduplicate Advisories` section to match. \\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"820112fc-e635-4d51-b152-8a2ee4de8f56\",\n \"name\": \"Email customers\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 2360,\n 380\n ],\n \"parameters\": {\n \"sendTo\": \"={{ $json.email }}\",\n \"message\": \"=Dear {{ $json.name.split(' ')[0] }},\\n\\nWe wanted to let you know of a new security advisory:\\n\\n{{ $('GlobalProtect advisory?').item.json.title }}\\n{{ $('GlobalProtect advisory?').item.json.link }}\\n\\nRegards,\\n\\nNathan\",\n \"options\": {},\n \"subject\": \"=New {{ $('Extract info').item.json.type }} security advisory \"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"198\",\n \"name\": \"Gmail account (David)\"\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"06497e48-37ea-4c2a-a633-6b0f02d1da5f\",\n \"name\": \"Extract info\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 600,\n 360\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"type\",\n \"value\": \"={{ $json.title.match(/[^ ]* ([^:]*):/)[1].trim() }}\"\n },\n {\n \"name\": \"subject\",\n \"value\": \"={{ $json.title.match(/[^ ]* [^:]*: (.*)(?=\\\\(Severity:)/)[1].trim() }}\"\n },\n {\n \"name\": \"severity\",\n \"value\": \"={{ $json.title.split('Severity:')[1].replaceAll(')', '').trim().toLowerCase().toTitleCase() }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"79a85d6e-2550-4351-9356-6f2f8c330693\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n -54.852630774649356\n ],\n \"parameters\": {\n \"width\": 419.37209302325573,\n \"height\": 577.9223982165106,\n \"content\": \"![Shodan](https://i.imgur.com/weKPN2E.png)\\n## Get Palo Alto security advisories\\nAdaptable and efficient, this segment of the workflow retrieves Palo Alto security advisories directly through their RSS feed. \\n\\nYou can tailor the feed URL in the RSS node below to meet your needs and ensure the `Extract Info` node captures the correct information. \\n\\nThis flexibility allows the workflow to stay current with the latest advisories, making it a vital component in maintaining up-to-date security measures across your network infrastructure.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f2c5155d-28ab-4ae4-a402-5244ccac94e3\",\n \"name\": \"Check if posted in last 24 hours\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 920,\n 360\n ],\n \"parameters\": {\n \"conditions\": {\n \"dateTime\": [\n {\n \"value1\": \"={{ $json.pubDate }}\",\n \"value2\": \"={{$today.minus({days: 1})}}\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a3553ba4-3581-4844-abaf-e872cb6dc7ea\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1751,\n -366.68188678732713\n ],\n \"parameters\": {\n \"width\": 461.89918009735027,\n \"height\": 893.2712326436663,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n## Query Company Email Directory\\nThe workflow includes a sample node setup that queries a company email directory, allowing for dynamic distribution of advisories to relevant personnel. \\n\\nReplace the sample node with a connection to your corporate directory or a Google Sheet for an integrated approach. If you choose to go the google sheets route, create a column for `name` and a column for `email` and use the Google Sheets node to get the rows. \\n\\nThis ensures that every advisory reaches the appropriate individual, promoting a proactive security posture organization-wide.\\n\\nEnsure that the node you use outputs the json in this format:\\n\\n```\\n[\\n {\\n \\\"name\\\": \\\"Jay Gatsby\\\",\\n \\\"email\\\": \\\"gatsby@west-egg.com\\\"\\n },\\n {\\n \\\"name\\\": \\\"JosΓ© Arcadio BuendΓ­a\\\",\\n \\\"email\\\": \\\"jab@macondo.co\\\"\\n },\\n {\\n \\\"name\\\": \\\"Max Sendak\\\",\\n \\\"email\\\": \\\"info@in-and-out-of-weeks.org\\\"\\n }\\n]\\n```\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c6a7aac-8aa3-480e-9691-bfa5472d3d91\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2240,\n -113.74332300803701\n ],\n \"parameters\": {\n \"width\": 324.2540832882642,\n \"height\": 639.8357317519218,\n \"content\": \"![gmail](https://i.imgur.com/f6f6my0.png)\\n## Email advisory information to your team\\nOnce advisories are filtered and prepared, this final node uses Gmail to disseminate the information to your team, ensuring that those who need to be aware of security updates are informed in a timely manner. \\n\\nThis step is pivotal in the communication chain, turning advisories into actionable insights for your team, thereby promoting a culture of responsiveness and awareness regarding network security.\\n\\nYou can replace this with your preferred email provider by substituting the node and expressions in the Gmail node. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"75aae5d6-bcaf-4d69-9adf-f71075b16318\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1180,\n -320\n ],\n \"parameters\": {\n \"width\": 552.9069767441861,\n \"height\": 844.9721583936011,\n \"content\": \"![Jira](https://i.imgur.com/Ko72Qxa.png)\\n## Filter advisories based on Palo Alto Products used in your organization \\nThis node enhances specificity by filtering advisories based on the Palo Alto products utilized within your organization. \\n\\nBy customizing the filter nodes to match your environment, you create a streamlined process that directs pertinent advisories to a Jira issue (or any incident management system that uses an API) for further investigation, ensuring your incident management process is both efficient and tailored to your specific security landscape.\\n\\n**Want to add a new filter?** Duplicate one of the `filter nodes` below and connect it to the `true output` of the date filter node, decide whether you wish to add an incident management node, and then connect to your email directory node.\\n \\n**Want to create a ticket for your team to investigate if an advisory is found for your filtered product/keyword?** Simply add the node for your favorite incident management platform if it exists, and an http request if it doesn't to integrate with any REST api.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c34c8aa-3876-4248-9c5e-cd362ffb6833\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 780,\n -176.24786257310654\n ],\n \"parameters\": {\n \"width\": 382.81395348837174,\n \"height\": 700.2899123297333,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n## Deduplicate Advisories\\n### Filter advisories based on date \\nTo maintain accuracy and avoid redundancy, this n8n node deduplicates advisories by date, ensuring that each security notice is unique and relevant. \\n\\nIt's programmed to sync with the scheduled trigger, preventing any overlap in data analysis. \\n\\nAdjustments can be made to alter the frequency and timing of the trigger, allowing for weekly or custom schedules, demonstrating n8n's versatile capability to adapt to your operational requirements.\\n\\nFor example if you preferred to change it to weekly, set the `Trigger Node` to run weekly, and adjust the expression in the `If` node below from `{{$today.minus({days: 1})}}` to `{{$today.minus({days: 7})}}`.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"518de294-2961-419b-b936-3519fc4bdcf8\",\n \"name\": \"Ignore, stale advisory\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1220,\n 600\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"699ba4b3-ef02-4e7c-8894-c302566ac5e7\",\n \"name\": \"Run workflow every 24 hours at 1am\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 100,\n 360\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"triggerAtHour\": 1\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"e64a6ec2-b231-4cb7-9d36-8933c844d482\",\n \"connections\": {\n \"Extract info\": {\n \"main\": [\n [\n {\n \"node\": \"Check if posted in last 24 hours\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get customers\": {\n \"main\": [\n [\n {\n \"node\": \"Email customers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Traps advisory?\": {\n \"main\": [\n [\n {\n \"node\": \"Get customers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Jira issue\": {\n \"main\": [\n [\n {\n \"node\": \"Get customers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GlobalProtect advisory?\": {\n \"main\": [\n [\n {\n \"node\": \"Create Jira issue\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if posted in last 24 hours\": {\n \"main\": [\n [\n {\n \"node\": \"GlobalProtect advisory?\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Traps advisory?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Ignore, stale advisory\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get Palo Alto security advisories\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Palo Alto security advisories\": {\n \"main\": [\n [\n {\n \"node\": \"Extract info\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Run workflow every 24 hours at 1am\": {\n \"main\": [\n [\n {\n \"node\": \"Get Palo Alto security advisories\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
54
0
2
true
combined_workflows.json
{ "input": "This workflow monitors Palo Alto security advisories, filters them based on keywords (GlobalProtect, Traps), and then either creates a Jira issue or emails relevant customers about the advisory.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11753, "processed_size": 11753, "processed_timestamp": "2025-04-09T03:08:39.640498", "timestamp": "2025-04-09T02:37:51.007075", "token_count": 4095, "tokens": 1258, "workflow_chunk_info": { "is_truncated": false, "original_size": 11753, "processed_size": 11753, "workflow_hash": "70170944aec3d89d450ca838063d3679" }, "workflow_hash": "70170944aec3d89d450ca838063d3679" }
"type": "n8n-nodes-base.stickyNote", "position": [ 1180, -320 ], "parameters": { "width": 552.9069767441861, "height": 844.9721583936011, "content": "![Jira](https://i.imgur.com/Ko72Qxa.png)\n## Filter advisories based on Palo Alto Products used in your organization \nThis node enhances specificity by filtering advisories based on the Palo Alto products utilized within your organization. \n\nBy customizing the filter nodes to match your environment, you create a streamlined process that directs pertinent advisories to a Jira issue (or any incident management system that uses an API) for further investigation, ensuring your incident management process is both efficient and tailored to your specific security landscape.\n\n**Want to add a new filter?** Duplicate one of the `filter nodes` below and connect it to the `true output` of the date filter node, decide whether you wish to add an incident management node, and then connect to your email directory node.\n \n**Want to create a ticket for your team to investigate if an advisory is found for your filtered product/keyword?** Simply add the node for your favorite incident management platform if it exists, and an http request if it doesn't to integrate with any REST api.\n" }, "typeVersion": 1 }, { "id": "4c34c8aa-3876-4248-9c5e-cd362ffb6833", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 780, -176.24786257310654 ], "parameters": { "width": 382.81395348837174, "height": 700.2899123297333, "content": "![n8n](https://i.imgur.com/lKnBNnH.png)\n## Deduplicate Advisories\n### Filter advisories based on date \nTo maintain accuracy and avoid redundancy, this n8n node deduplicates advisories by date, ensuring that each security notice is unique and relevant. \n\nIt's programmed to sync with the scheduled trigger, preventing any overlap in data analysis. \n\nAdjustments can be made to alter the frequency and timing of the trigger, allowing for weekly or custom schedules, demonstrating n8n's versatile capability to adapt to your operational requirements.\n\nFor example if you preferred to change it to weekly, set the `Trigger Node` to run weekly, and adjust the expression in the `If` node below from `{{$today.minus({days: 1})}}` to `{{$today.minus({days: 7})}}`." }, "typeVersion": 1 }, { "id": "518de294-2961-419b-b936-3519fc4bdcf8", "name": "Ignore, stale advisory", "type": "n8n-nodes-base.noOp", "position": [ 1220, 600 ], "parameters": {}, "typeVersion": 1 }, { "id": "699ba4b3-ef02-4e7c-8894-c302566ac5e7", "name": "Run workflow every 24 hours at 1am", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 100, 360 ], "parameters": { "rule": { "interval": [ { "triggerAtHour": 1 } ] } }, "typeVersion": 1.1 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "e64a6ec2-b231-4cb7-9d36-8933c844d482", "connections": { "Extract info": { "main": [ [ { "node": "Check if posted in last 24 hours", "type": "main", "index": 0 } ] ] }, "Get customers": { "main": [ [ { "node": "Email customers", "type": "main", "index": 0 } ] ] }, "Traps advisory?": { "main": [ [ { "node": "Get customers", "type": "main", "index": 0 } ] ] }, "Create Jira issue": { "main": [ [ { "node": "Get customers", "type": "main", "index": 0 } ] ] }, "GlobalProtect advisory?": { "main": [ [ { "node": "Create Jira issue", "type": "main", "index": 0 } ] ] }, "Check if posted in last 24 hours": { "main": [ [ { "node": "GlobalProtect advisory?", "type": "main", "index": 0 }, { "node": "Traps advisory?", "type": "main", "index": 0 } ], [ { "node": "Ignore, stale advisory", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Get Palo Alto security advisories", "type": "main", "index": 0 } ] ] }, "Get Palo Alto security advisories": { "main": [ [ { "node": "Extract info", "type": "main", "index": 0 } ] ] }, "Run workflow every 24 hours at 1am": { "main": [ [ { "node": "Get Palo Alto security advisories", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"YSjQ7TVCNY9v1F2A\",\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"name\": \"Monitor_security_advisories\",\n \"tags\": [\n {\n \"id\": \"DlIeVDZxzko5ifNi\",\n \"name\": \"createdBy:David\",\n \"createdAt\": \"2023-10-31T02:21:50.700Z\",\n \"updatedAt\": \"2023-10-31T02:21:50.700Z\"\n },\n {\n \"id\": \"QPJKatvLSxxtrE8U\",\n \"name\": \"Secops\",\n \"createdAt\": \"2023-10-31T02:15:11.396Z\",\n \"updatedAt\": \"2023-10-31T02:15:11.396Z\"\n },\n {\n \"id\": \"oyHT7KfD0rdIizVw\",\n \"name\": \"Pending\",\n \"createdAt\": \"2023-11-10T23:19:06.319Z\",\n \"updatedAt\": \"2023-11-10T23:19:06.319Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"62ef1311-a623-4a7d-b59a-6c0a0d7751d7\",\n \"name\": \"When clicking \\\"Execute Workflow\\\"\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 100,\n 200\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"808c1b88-69e9-4e96-bcfd-b93810740fda\",\n \"name\": \"Get Palo Alto security advisories\",\n \"type\": \"n8n-nodes-base.rssFeedRead\",\n \"position\": [\n 400,\n 360\n ],\n \"parameters\": {\n \"url\": \"https://security.paloaltonetworks.com/rss.xml\",\n \"options\": {}\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"97f16fe1-c720-40e0-85ff-61fdbfb9a2c2\",\n \"name\": \"GlobalProtect advisory?\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1240,\n 240\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.title }}\",\n \"value2\": \"GlobalProtect\",\n \"operation\": \"contains\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3602f7bb-87d3-49a2-9916-b9ab7d86f58b\",\n \"name\": \"Traps advisory?\",\n \"type\": \"n8n-nodes-base.filter\",\n \"position\": [\n 1240,\n 380\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.title }}\",\n \"value2\": \"Traps\",\n \"operation\": \"contains\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"97c108f0-bdf1-4ed9-a545-d52acb7c9cec\",\n \"name\": \"Create Jira issue\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 1520,\n 240\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"\"\n },\n \"summary\": \"={{ $json.title.substring(14) }}\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"\"\n },\n \"additionalFields\": {\n \"priority\": {\n \"mode\": \"list\",\n \"value\": \"\"\n },\n \"description\": \"=Severity: {{ $json.title.split('(Severity:')[1].replace(')', '').trim() }}\\nLink: {{ $json.link }}\\nPublished: {{ $json.pubDate }} \"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"4\",\n \"name\": \"Jira Ricardo\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"acb89eb0-c9e5-4fbb-a750-3607ae280670\",\n \"name\": \"Get customers\",\n \"type\": \"n8n-nodes-base.n8nTrainingCustomerDatastore\",\n \"position\": [\n 1960,\n 380\n ],\n \"parameters\": {\n \"operation\": \"getAllPeople\",\n \"returnAll\": true\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"babf1ce4-6ed4-4bd9-a1df-429a15fa6849\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -13.168003380834136,\n -396.06737036843754\n ],\n \"parameters\": {\n \"width\": 332.0284684971131,\n \"height\": 926.523360092614,\n \"content\": \"![Shodan](https://i.imgur.com/PcOuvAL.png)\\n## Workflow Overview\\nThis n8n workflow is designed to streamline security oversight by fetching advisories from Palo Alto's feed and filtering out alerts not pertinent to your products. \\n\\nBy utilizing a dynamic filter system, it excludes unrelated advisories, ensuring that your team receives only relevant security updates. \\n\\nCoupled with a sample database of emails, this workflow offers a customizable solution to align with any corporate email directory, providing a strong foundation for your security information management strategy. \\n\\n## Execution Schedule\\n\\nScheduled to run every 24 hours at 1 am. If you change this timer, ensure to update the `Deduplicate Advisories` section to match. \\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"820112fc-e635-4d51-b152-8a2ee4de8f56\",\n \"name\": \"Email customers\",\n \"type\": \"n8n-nodes-base.gmail\",\n \"position\": [\n 2360,\n 380\n ],\n \"parameters\": {\n \"sendTo\": \"={{ $json.email }}\",\n \"message\": \"=Dear {{ $json.name.split(' ')[0] }},\\n\\nWe wanted to let you know of a new security advisory:\\n\\n{{ $('GlobalProtect advisory?').item.json.title }}\\n{{ $('GlobalProtect advisory?').item.json.link }}\\n\\nRegards,\\n\\nNathan\",\n \"options\": {},\n \"subject\": \"=New {{ $('Extract info').item.json.type }} security advisory \"\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"198\",\n \"name\": \"Gmail account (David)\"\n }\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"06497e48-37ea-4c2a-a633-6b0f02d1da5f\",\n \"name\": \"Extract info\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 600,\n 360\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"type\",\n \"value\": \"={{ $json.title.match(/[^ ]* ([^:]*):/)[1].trim() }}\"\n },\n {\n \"name\": \"subject\",\n \"value\": \"={{ $json.title.match(/[^ ]* [^:]*: (.*)(?=\\\\(Severity:)/)[1].trim() }}\"\n },\n {\n \"name\": \"severity\",\n \"value\": \"={{ $json.title.split('Severity:')[1].replaceAll(')', '').trim().toLowerCase().toTitleCase() }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"79a85d6e-2550-4351-9356-6f2f8c330693\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 340,\n -54.852630774649356\n ],\n \"parameters\": {\n \"width\": 419.37209302325573,\n \"height\": 577.9223982165106,\n \"content\": \"![Shodan](https://i.imgur.com/weKPN2E.png)\\n## Get Palo Alto security advisories\\nAdaptable and efficient, this segment of the workflow retrieves Palo Alto security advisories directly through their RSS feed. \\n\\nYou can tailor the feed URL in the RSS node below to meet your needs and ensure the `Extract Info` node captures the correct information. \\n\\nThis flexibility allows the workflow to stay current with the latest advisories, making it a vital component in maintaining up-to-date security measures across your network infrastructure.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"f2c5155d-28ab-4ae4-a402-5244ccac94e3\",\n \"name\": \"Check if posted in last 24 hours\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 920,\n 360\n ],\n \"parameters\": {\n \"conditions\": {\n \"dateTime\": [\n {\n \"value1\": \"={{ $json.pubDate }}\",\n \"value2\": \"={{$today.minus({days: 1})}}\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a3553ba4-3581-4844-abaf-e872cb6dc7ea\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1751,\n -366.68188678732713\n ],\n \"parameters\": {\n \"width\": 461.89918009735027,\n \"height\": 893.2712326436663,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n## Query Company Email Directory\\nThe workflow includes a sample node setup that queries a company email directory, allowing for dynamic distribution of advisories to relevant personnel. \\n\\nReplace the sample node with a connection to your corporate directory or a Google Sheet for an integrated approach. If you choose to go the google sheets route, create a column for `name` and a column for `email` and use the Google Sheets node to get the rows. \\n\\nThis ensures that every advisory reaches the appropriate individual, promoting a proactive security posture organization-wide.\\n\\nEnsure that the node you use outputs the json in this format:\\n\\n```\\n[\\n {\\n \\\"name\\\": \\\"Jay Gatsby\\\",\\n \\\"email\\\": \\\"gatsby@west-egg.com\\\"\\n },\\n {\\n \\\"name\\\": \\\"JosΓ© Arcadio BuendΓ­a\\\",\\n \\\"email\\\": \\\"jab@macondo.co\\\"\\n },\\n {\\n \\\"name\\\": \\\"Max Sendak\\\",\\n \\\"email\\\": \\\"info@in-and-out-of-weeks.org\\\"\\n }\\n]\\n```\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c6a7aac-8aa3-480e-9691-bfa5472d3d91\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2240,\n -113.74332300803701\n ],\n \"parameters\": {\n \"width\": 324.2540832882642,\n \"height\": 639.8357317519218,\n \"content\": \"![gmail](https://i.imgur.com/f6f6my0.png)\\n## Email advisory information to your team\\nOnce advisories are filtered and prepared, this final node uses Gmail to disseminate the information to your team, ensuring that those who need to be aware of security updates are informed in a timely manner. \\n\\nThis step is pivotal in the communication chain, turning advisories into actionable insights for your team, thereby promoting a culture of responsiveness and awareness regarding network security.\\n\\nYou can replace this with your preferred email provider by substituting the node and expressions in the Gmail node. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"75aae5d6-bcaf-4d69-9adf-f71075b16318\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1180,\n -320\n ],\n \"parameters\": {\n \"width\": 552.9069767441861,\n \"height\": 844.9721583936011,\n \"content\": \"![Jira](https://i.imgur.com/Ko72Qxa.png)\\n## Filter advisories based on Palo Alto Products used in your organization \\nThis node enhances specificity by filtering advisories based on the Palo Alto products utilized within your organization. \\n\\nBy customizing the filter nodes to match your environment, you create a streamlined process that directs pertinent advisories to a Jira issue (or any incident management system that uses an API) for further investigation, ensuring your incident management process is both efficient and tailored to your specific security landscape.\\n\\n**Want to add a new filter?** Duplicate one of the `filter nodes` below and connect it to the `true output` of the date filter node, decide whether you wish to add an incident management node, and then connect to your email directory node.\\n \\n**Want to create a ticket for your team to investigate if an advisory is found for your filtered product/keyword?** Simply add the node for your favorite incident management platform if it exists, and an http request if it doesn't to integrate with any REST api.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"4c34c8aa-3876-4248-9c5e-cd362ffb6833\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 780,\n -176.24786257310654\n ],\n \"parameters\": {\n \"width\": 382.81395348837174,\n \"height\": 700.2899123297333,\n \"content\": \"![n8n](https://i.imgur.com/lKnBNnH.png)\\n## Deduplicate Advisories\\n### Filter advisories based on date \\nTo maintain accuracy and avoid redundancy, this n8n node deduplicates advisories by date, ensuring that each security notice is unique and relevant. \\n\\nIt's programmed to sync with the scheduled trigger, preventing any overlap in data analysis. \\n\\nAdjustments can be made to alter the frequency and timing of the trigger, allowing for weekly or custom schedules, demonstrating n8n's versatile capability to adapt to your operational requirements.\\n\\nFor example if you preferred to change it to weekly, set the `Trigger Node` to run weekly, and adjust the expression in the `If` node below from `{{$today.minus({days: 1})}}` to `{{$today.minus({days: 7})}}`.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"518de294-2961-419b-b936-3519fc4bdcf8\",\n \"name\": \"Ignore, stale advisory\",\n \"type\": \"n8n-nodes-base.noOp\",\n \"position\": [\n 1220,\n 600\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"699ba4b3-ef02-4e7c-8894-c302566ac5e7\",\n \"name\": \"Run workflow every 24 hours at 1am\",\n \"type\": \"n8n-nodes-base.scheduleTrigger\",\n \"position\": [\n 100,\n 360\n ],\n \"parameters\": {\n \"rule\": {\n \"interval\": [\n {\n \"triggerAtHour\": 1\n }\n ]\n }\n },\n \"typeVersion\": 1.1\n }\n ],\n \"active\": false,\n \"pinData\": {},\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"e64a6ec2-b231-4cb7-9d36-8933c844d482\",\n \"connections\": {\n \"Extract info\": {\n \"main\": [\n [\n {\n \"node\": \"Check if posted in last 24 hours\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get customers\": {\n \"main\": [\n [\n {\n \"node\": \"Email customers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Traps advisory?\": {\n \"main\": [\n [\n {\n \"node\": \"Get customers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Jira issue\": {\n \"main\": [\n [\n {\n \"node\": \"Get customers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"GlobalProtect advisory?\": {\n \"main\": [\n [\n {\n \"node\": \"Create Jira issue\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if posted in last 24 hours\": {\n \"main\": [\n [\n {\n \"node\": \"GlobalProtect advisory?\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Traps advisory?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Ignore, stale advisory\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"When clicking \\\"Execute Workflow\\\"\": {\n \"main\": [\n [\n {\n \"node\": \"Get Palo Alto security advisories\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get Palo Alto security advisories\": {\n \"main\": [\n [\n {\n \"node\": \"Extract info\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Run workflow every 24 hours at 1am\": {\n \"main\": [\n [\n {\n \"node\": \"Get Palo Alto security advisories\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
54
1
2
true
combined_workflows.json
{ "input": "This workflow monitors Palo Alto security advisories, filters them based on keywords (GlobalProtect, Traps), and then either creates a Jira issue or emails relevant customers about the advisory.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11753, "processed_size": 11753, "processed_timestamp": "2025-04-09T03:08:39.645499", "timestamp": "2025-04-09T02:37:51.007075", "token_count": 1775, "tokens": 1258, "workflow_chunk_info": { "is_truncated": false, "original_size": 11753, "processed_size": 11753, "workflow_hash": "70170944aec3d89d450ca838063d3679" }, "workflow_hash": "70170944aec3d89d450ca838063d3679" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to analyze incoming emails from Gmail and Microsoft Outlook, detect potential phishing attempts using ChatGPT, and automatically create Jira tickets with analysis and attachments based on the email's threat level. Analyze this workflow: ```json { "meta": { "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8" }, "nodes": [ { "id": "94dd7f48-0013-4fb5-89c4-826ecd7f2d66", "name": "Gmail Trigger", "type": "n8n-nodes-base.gmailTrigger", "position": [ 1460, 120 ], "parameters": { "simple": false, "filters": {}, "options": {}, "pollTimes": { "item": [ { "mode": "everyMinute" } ] } }, "credentials": { "gmailOAuth2": { "id": "kkhNhqKpZt6IUZd0", "name": "Gmail" } }, "typeVersion": 1.2 }, { "id": "ca2023fa-ceca-4923-80e4-a3843803536c", "name": "Microsoft Outlook Trigger", "type": "n8n-nodes-base.microsoftOutlookTrigger", "disabled": true, "position": [ 1480, 680 ], "parameters": { "fields": [ "body", "toRecipients", "subject", "bodyPreview" ], "output": "fields", "filters": {}, "options": {}, "pollTimes": { "item": [ { "mode": "everyMinute" } ] } }, "credentials": { "microsoftOutlookOAuth2Api": { "id": "vTCK0oVQ0WjFrI5H", "name": " Outlook Credential" } }, "typeVersion": 1 }, { "id": "1f011214-91a0-4cfa-9d9e-29864937c0a3", "name": "Screenshot HTML", "type": "n8n-nodes-base.httpRequest", "position": [ 2620, 420 ], "parameters": { "url": "https://hcti.io/v1/image", "method": "POST", "options": {}, "sendBody": true, "sendQuery": true, "authentication": "genericCredentialType", "bodyParameters": { "parameters": [ { "name": "html", "value": "={{ $('Set Email Variables').item.json.htmlBody }}" } ] }, "genericAuthType": "httpBasicAuth", "queryParameters": { "parameters": [ {} ] } }, "credentials": { "httpBasicAuth": { "id": "8tm8mUWmPvtmPFPk", "name": "hcti.io" } }, "typeVersion": 4.2 }, { "id": "64f4789f-9de8-414f-af62-ddc339f0d0ac", "name": "Retrieve Screenshot", "type": "n8n-nodes-base.httpRequest", "position": [ 2800, 420 ], "parameters": { "url": "={{ $json.url }}", "options": {}, "authentication": "genericCredentialType", "genericAuthType": "httpBasicAuth" }, "credentials": { "httpBasicAuth": { "id": "8tm8mUWmPvtmPFPk", "name": "hcti.io" } }, "typeVersion": 4.2 }, { "id": "db707bd9-6abc-4ab7-8ffa-ad25c5e8adc4", "name": "Set Outlook Variables", "type": "n8n-nodes-base.set", "position": [ 2040, 680 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "38bd3db2-1a8d-4c40-a2dd-336e0cc84224", "name": "htmlBody", "type": "string", "value": "={{ $('Microsoft Outlook Trigger').item.json.body.content }}" }, { "id": "13bdd95b-ef02-486e-b38b-d14bd05a4a8a", "name": "headers", "type": "string", "value": "={{ $json}}" }, { "id": "20566ad4-7eb7-42b1-8a0d-f8b759610f10", "name": "subject", "type": "string", "value": "={{ $('Microsoft Outlook Trigger').item.json.subject }}" }, { "id": "7171998f-a5a2-4e23-946a-9c1ad75710e7", "name": "recipient", "type": "string", "value": "={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}" }, { "id": "cc262634-2470-4524-8319-abe2518a6335", "name": "textBody", "type": "string", "value": "={{ $('Retrieve Headers of Email').item.json.body.content }}" } ] } }, "typeVersion": 3.4 }, { "id": "7a3622c0-6949-4ea3-ae13-46a1ee26de7b", "name": "Set Gmail Variables", "type": "n8n-nodes-base.set", "position": [ 2020, 120 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "38bd3db2-1a8d-4c40-a2dd-336e0cc84224", "name": "htmlBody", "type": "string", "value": "={{ $json.html }}" }, { "id": "18fbcf78-6d3c-4036-b3a2-fb5adf22176a", "name": "headers", "type": "string", "value": "={{ $json.headers }}" }, { "id": "1d690098-be2a-4604-baf8-62f314930929", "name": "subject", "type": "string", "value": "={{ $json.subject }}" }, { "id": "8009f00a-547f-4eb1-b52d-2e7305248885", "name": "recipient", "type": "string", "value": "={{ $json.to.text }}" }, { "id": "1932e97d-b03b-4964-b8bc-8262aaaa1f7a", "name": "textBody", "type": "string", "value": "={{ $json.text }}" } ] } }, "typeVersion": 3.4 }, { "id": "4b4c6b34-f74c-4402-91a1-4d002e02a3bd", "name": "Retrieve Headers of Email", "type": "n8n-nodes-base.httpRequest", "position": [ 1700, 680 ], "parameters": { "url": "=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body", "options": {}, "sendHeaders": true, "authentication": "predefinedCredentialType", "headerParameters": { "parameters": [ { "name": "Accept", "value": "application/json" }, { "name": "Prefer", "value": "outlook.body-content-type=\"text\"" } ] }, "nodeCredentialType": "microsoftOutlookOAuth2Api" }, "credentials": { "microsoftOutlookOAuth2Api": { "id": "vTCK0oVQ0WjFrI5H", "name": " Outlook Credential" } }, "typeVersion": 4.2 }, { "id": "0c9883b5-3eb7-45db-9803-d1b30166a3b5", "name": "Format Headers", "type": "n8n-nodes-base.code", "position": [ 1880, 680 ], "parameters": { "jsCode": "const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\n\nconst result = input.reduce((acc, { name, value }) => {\n if (!acc[name]) acc[name] = [];\n acc[name].push(value);\n return acc;\n}, {});\n\nreturn result;" }, "typeVersion": 2 }, { "id": "c21a976c-00e5-4823-bd94-4c95a7d60438", "name": "Analyze Email with ChatGPT", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 3000, 420 ], "parameters": { "modelId": { "__rl": true, "mode": "list", "value": "gpt-4o", "cachedResultName": "GPT-4O" }, "options": {}, "messages": { "values": [ { "content": "=Describe the following email using the HTML body and headers. Determine if the email could be a phishing email. \n\nHere is the HTML body:\n{{ $('Set Email Variables').item.json.htmlBody }}\n\nThe message headers are as follows:\n{{ $('Set Email Variables').item.json.headers }}\n\n" }, { "role": "system", "content": "Please make sure to output all responses using the following structured JSON output:\n{\n \"malicious\": false,\n \"summary\": \"The email appears to be a legitimate communication from a known sender. It contains no suspicious links, attachments, or language that indicates phishing or malicious intent.\"\n}\n\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response. Make the summary as verbose as possible including a full breakdown of why the email is benign or malicious." } ] }, "jsonOutput": true }, "credentials": { "openAiApi": { "id": "76", "name": "OpenAi account" } }, "typeVersion": 1.6 }, { "id": "a91f4095-9245-4276-b21f-f415de22df62", "name": "Create Potentially Malicious Ticket", "type": "n8n-nodes-base.jira", "position": [ 3640, 400 ], "parameters": { "project": { "__rl": true, "mode": "list", "value": "10001", "cachedResultName": "Support" }, "summary": "=Potentially Malicious - Phishing Email Reported: \"{{ $('Set Email Variables').item.json.subject }}\"", "issueType": { "__rl": true, "mode": "list", "value": "10008", "cachedResultName": "Task" }, "additionalFields": { "description": "=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \"{{ $('Set Email Variables').item.json.subject }}\"\n\\\\\nh2. Here is ChatGPT's analysis of the email:\n{{ $json.message.content.summary }}" } }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "a5a66a0e-9d8a-45a9-b1ae-aec78ddfec27", "name": "Create Potentially Benign Ticket", "type": "n8n-nodes-base.jira", "position": [ 3640, 580 ], "parameters": { "project": { "__rl": true, "mode": "list", "value": "10001", "cachedResultName": "Support" }, "summary": "=Potentially Benign - Phishing Email Reported: \"{{ $('Set Email Variables').item.json.subject }}\"", "issueType": { "__rl": true, "mode": "list", "value": "10008", "cachedResultName": "Task" }, "additionalFields": { "description": "=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \"{{ $('Set Email Variables').item.json.subject }}\"\n\\\\\nh2. Here is ChatGPT's analysis of the email:\n{{ $json.message.content.summary }}" } }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" }
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"nodes\": [\n {\n \"id\": \"94dd7f48-0013-4fb5-89c4-826ecd7f2d66\",\n \"name\": \"Gmail Trigger\",\n \"type\": \"n8n-nodes-base.gmailTrigger\",\n \"position\": [\n 1460,\n 120\n ],\n \"parameters\": {\n \"simple\": false,\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"kkhNhqKpZt6IUZd0\",\n \"name\": \"Gmail\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"ca2023fa-ceca-4923-80e4-a3843803536c\",\n \"name\": \"Microsoft Outlook Trigger\",\n \"type\": \"n8n-nodes-base.microsoftOutlookTrigger\",\n \"disabled\": true,\n \"position\": [\n 1480,\n 680\n ],\n \"parameters\": {\n \"fields\": [\n \"body\",\n \"toRecipients\",\n \"subject\",\n \"bodyPreview\"\n ],\n \"output\": \"fields\",\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1f011214-91a0-4cfa-9d9e-29864937c0a3\",\n \"name\": \"Screenshot HTML\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2620,\n 420\n ],\n \"parameters\": {\n \"url\": \"https://hcti.io/v1/image\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendQuery\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"html\",\n \"value\": \"={{ $('Set Email Variables').item.json.htmlBody }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpBasicAuth\",\n \"queryParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"64f4789f-9de8-414f-af62-ddc339f0d0ac\",\n \"name\": \"Retrieve Screenshot\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2800,\n 420\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpBasicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"db707bd9-6abc-4ab7-8ffa-ad25c5e8adc4\",\n \"name\": \"Set Outlook Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2040,\n 680\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.body.content }}\"\n },\n {\n \"id\": \"13bdd95b-ef02-486e-b38b-d14bd05a4a8a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json}}\"\n },\n {\n \"id\": \"20566ad4-7eb7-42b1-8a0d-f8b759610f10\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.subject }}\"\n },\n {\n \"id\": \"7171998f-a5a2-4e23-946a-9c1ad75710e7\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}\"\n },\n {\n \"id\": \"cc262634-2470-4524-8319-abe2518a6335\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Retrieve Headers of Email').item.json.body.content }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7a3622c0-6949-4ea3-ae13-46a1ee26de7b\",\n \"name\": \"Set Gmail Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2020,\n 120\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.html }}\"\n },\n {\n \"id\": \"18fbcf78-6d3c-4036-b3a2-fb5adf22176a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers }}\"\n },\n {\n \"id\": \"1d690098-be2a-4604-baf8-62f314930929\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $json.subject }}\"\n },\n {\n \"id\": \"8009f00a-547f-4eb1-b52d-2e7305248885\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $json.to.text }}\"\n },\n {\n \"id\": \"1932e97d-b03b-4964-b8bc-8262aaaa1f7a\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.text }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4b4c6b34-f74c-4402-91a1-4d002e02a3bd\",\n \"name\": \"Retrieve Headers of Email\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1700,\n 680\n ],\n \"parameters\": {\n \"url\": \"=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n },\n {\n \"name\": \"Prefer\",\n \"value\": \"outlook.body-content-type=\\\"text\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"microsoftOutlookOAuth2Api\"\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"0c9883b5-3eb7-45db-9803-d1b30166a3b5\",\n \"name\": \"Format Headers\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1880,\n 680\n ],\n \"parameters\": {\n \"jsCode\": \"const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\\n\\nconst result = input.reduce((acc, { name, value }) => {\\n if (!acc[name]) acc[name] = [];\\n acc[name].push(value);\\n return acc;\\n}, {});\\n\\nreturn result;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"c21a976c-00e5-4823-bd94-4c95a7d60438\",\n \"name\": \"Analyze Email with ChatGPT\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 3000,\n 420\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o\",\n \"cachedResultName\": \"GPT-4O\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Describe the following email using the HTML body and headers. Determine if the email could be a phishing email. \\n\\nHere is the HTML body:\\n{{ $('Set Email Variables').item.json.htmlBody }}\\n\\nThe message headers are as follows:\\n{{ $('Set Email Variables').item.json.headers }}\\n\\n\"\n },\n {\n \"role\": \"system\",\n \"content\": \"Please make sure to output all responses using the following structured JSON output:\\n{\\n \\\"malicious\\\": false,\\n \\\"summary\\\": \\\"The email appears to be a legitimate communication from a known sender. It contains no suspicious links, attachments, or language that indicates phishing or malicious intent.\\\"\\n}\\n\\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response. Make the summary as verbose as possible including a full breakdown of why the email is benign or malicious.\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"76\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"a91f4095-9245-4276-b21f-f415de22df62\",\n \"name\": \"Create Potentially Malicious Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3640,\n 400\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Potentially Malicious - Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.message.content.summary }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5a66a0e-9d8a-45a9-b1ae-aec78ddfec27\",\n \"name\": \"Create Potentially Benign Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3640,\n 580\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Potentially Benign - Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.message.content.summary }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5af0d60b-d021-4dd9-98f7-b2842800764a\",\n \"name\": \"Rename Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 4020,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\\n\\nreturn $('Retrieve Screenshot').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"441c4cbb-bd93-4213-bd34-e18f2a49389f\",\n \"name\": \"Set Jira ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 3860,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4c71188c-011d-4f8e-a36c-87900bfab59a\",\n \"name\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 4220,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Set Jira ID').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3c031c34-8306-44e1-8e0e-a584c5323112\",\n \"name\": \"Upload Email Body to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 4620,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Set Jira ID').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d033dcbd-7ccb-451f-ab81-cc6d32d2e01f\",\n \"name\": \"Convert Email Body to File\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n 2420,\n 420\n ],\n \"parameters\": {\n \"options\": {\n \"fileName\": \"emailBody.txt\"\n },\n \"operation\": \"toText\",\n \"sourceProperty\": \"textBody\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"bda5e2fe-d8c0-456b-975a-35e82ff02816\",\n \"name\": \"Set Email Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2240,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"54ecd8ab-ac4a-4b6b-bd1b-bf8c70082a33\",\n \"name\": \"Rename Email Body Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 4420,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Convert Email Body to File').item.binary.data.fileName = 'emailBody.txt'\\n\\nreturn $('Convert Email Body to File').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"fe5b82cc-b4bb-4c97-9477-075d5a280e9f\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2574.536755825029,\n 0\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 376.8280004374956,\n \"height\": 595.590013880477,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/hctiapi2.png)\\n## Email Body Screenshot Creation\\n\\nThe **Screenshot HTML** node sends the email's HTML body to the **hcti.io** API, generating a screenshot that visually represents the email's layout. The **Retrieve Screenshot** node then fetches this image, making it available for attachment or review in subsequent steps. This dual-format processing ensures both clarity and flexibility in email analysis workflows.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"86b21049-f65e-4c6a-a854-c4376f870da9\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1380,\n -149.99110983560342\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 814.4556539379754,\n \"height\": 444.5525554815556,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/gmail.png)\\n## Gmail Integration and Data Extraction\\n\\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b1a786cf-7a8d-49e1-90ed-31f3d0e65b13\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1380,\n 308\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 809.7918597571277,\n \"height\": 602.9002284617277,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/outlook.png)\\n## Microsoft Outlook Integration and Email Header Processing\\n\\nThis section enables the integration of Microsoft Outlook to monitor and capture incoming emails. The Microsoft Outlook Trigger node checks for new messages every minute. Once an email is detected, the Retrieve Headers of Email node fetches detailed header and body content via the Microsoft Graph API. The Format Headers node organizes the email headers into a structured format using a JavaScript function, ensuring clarity and readiness for further processing. Finally, the Set Outlook Variables node extracts and assigns key detailsβ€”such as the email subject, recipient, body, and formatted headersβ€”to variables for use in subsequent workflow steps. This section is essential for processing Outlook emails and preparing them for analysis and reporting.\\n\\n\\n\\n\\n\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e7ace035-b5f5-4ef3-a117-22c7c938868d\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2958.4325220284563,\n 24.744924120002338\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 593.0990401534098,\n \"height\": 573.1750519720028,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/openai.png)\\n## AI-Powered Email Analysis and Threat Detection\\n\\nThis section leverages ChatGPT for advanced email content and header analysis to determine potential phishing threats. The **Analyze Email with ChatGPT** node processes the email's HTML body and headers, generating a detailed JSON response that categorizes the email as malicious or benign. The response includes a verbose explanation, formatted for Jira, outlining the reasons for the classification. The **Check if Malicious** node evaluates the AI output to determine the next steps based on the email's threat status. If flagged as malicious, subsequent actions like reporting and ticket creation are triggered. This section ensures precise, AI-driven analysis to enhance email security workflows.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"02c1ad8e-f952-42d2-ae9f-cf3a77e49e52\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 3562.4948140707697,\n -125.79607719303533\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1251.7025543502837,\n \"height\": 891.579206098173,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/jira.png)\\n## Automated Jira Ticket Creation and Email Attachment\\n\\nThis section streamlines the process of logging phishing email reports in Jira, complete with detailed analysis and attachments. The workflow creates two distinct Jira tickets depending on the AI classification of the email:\\n\\n1. **Potentially Malicious**: The **Create Potentially Malicious Ticket** node generates a ticket if the email is flagged as a phishing attempt, including a summary of ChatGPT's analysis and the email’s details.\\n2. **Potentially Benign**: If the email is classified as safe, the **Create Potentially Benign Ticket** node logs a ticket with similar details but under a non-malicious category.\\n\\n\\nThe **Set Jira ID** node ensures the generated ticket's ID is tracked for subsequent operations. Attachments are handled efficiently:\\n\\n- **Rename Screenshot** prepares the email screenshot for upload.\\n- **Upload Screenshot of Email to Jira** adds the screenshot to the Jira ticket for visual context.\\n- **Rename Email Body Screenshot** and **Upload Email Body to Jira** manage the attachment of the email's text body as a `.txt` file.\\n\\n\\nThis section enhances reporting by automating ticket creation, ensuring all relevant email data is readily available for review by security teams.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"597ef23e-c61c-4e27-8c14-74ec20079c96\",\n \"name\": \"Check if Malicious\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 3400,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"493f412c-5f11-4173-8940-90f5bc7f5fab\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.malicious }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"af512af9-924b-4019-bdf9-62aac9cd0dac\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2200,\n 39.041733604283195\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 365.6458805720866,\n \"height\": 559.8072303111675,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/n8n.png)\\n## Email Body Conversion\\n\\nThis section processes the email body into both text and visual formats for detailed analysis and reporting. The **Set Email Variables** node organizes the email's data, including its HTML body and text content, to prepare it for further steps. The **Convert Email Body to File** node creates a `.txt` file containing the plain text version of the email body, useful for documentation or further analysis.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Set Jira ID\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Gmail Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Set Gmail Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Format Headers\": {\n \"main\": [\n [\n {\n \"node\": \"Set Outlook Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Screenshot HTML\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Malicious\": {\n \"main\": [\n [\n {\n \"node\": \"Create Potentially Malicious Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Create Potentially Benign Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Analyze Email with ChatGPT\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Email Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Convert Email Body to File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Gmail Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Outlook Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Microsoft Outlook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Headers of Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Headers of Email\": {\n \"main\": [\n [\n {\n \"node\": \"Format Headers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Analyze Email with ChatGPT\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Malicious\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert Email Body to File\": {\n \"main\": [\n [\n {\n \"node\": \"Screenshot HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Email Body Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Email Body to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Potentially Benign Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Set Jira ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload Screenshot of Email to Jira\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Email Body Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Potentially Malicious Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Set Jira ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
55
0
3
true
combined_workflows.json
{ "input": "The workflow's goal is to analyze incoming emails from Gmail and Microsoft Outlook, detect potential phishing attempts using ChatGPT, and automatically create Jira tickets with analysis and attachments based on the email's threat level.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 18526, "processed_size": 18526, "processed_timestamp": "2025-04-09T03:08:39.756497", "timestamp": "2025-04-09T02:37:51.357324", "token_count": 4095, "tokens": 1877, "workflow_chunk_info": { "is_truncated": false, "original_size": 18526, "processed_size": 18526, "workflow_hash": "abacc16c443d28123cff89cfa71a90f9" }, "workflow_hash": "abacc16c443d28123cff89cfa71a90f9" }
}}\"", "issueType": { "__rl": true, "mode": "list", "value": "10008", "cachedResultName": "Task" }, "additionalFields": { "description": "=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \"{{ $('Set Email Variables').item.json.subject }}\"\n\\\\\nh2. Here is ChatGPT's analysis of the email:\n{{ $json.message.content.summary }}" } }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "5af0d60b-d021-4dd9-98f7-b2842800764a", "name": "Rename Screenshot", "type": "n8n-nodes-base.code", "position": [ 4020, 480 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\n\nreturn $('Retrieve Screenshot').item;" }, "typeVersion": 2 }, { "id": "441c4cbb-bd93-4213-bd34-e18f2a49389f", "name": "Set Jira ID", "type": "n8n-nodes-base.set", "position": [ 3860, 480 ], "parameters": { "options": {}, "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "4c71188c-011d-4f8e-a36c-87900bfab59a", "name": "Upload Screenshot of Email to Jira", "type": "n8n-nodes-base.jira", "position": [ 4220, 480 ], "parameters": { "issueKey": "={{ $('Set Jira ID').item.json.key }}", "resource": "issueAttachment" }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "3c031c34-8306-44e1-8e0e-a584c5323112", "name": "Upload Email Body to Jira", "type": "n8n-nodes-base.jira", "position": [ 4620, 480 ], "parameters": { "issueKey": "={{ $('Set Jira ID').item.json.key }}", "resource": "issueAttachment" }, "credentials": { "jiraSoftwareCloudApi": { "id": "BZmmGUrNIsgM9fDj", "name": "New Jira Cloud" } }, "typeVersion": 1 }, { "id": "d033dcbd-7ccb-451f-ab81-cc6d32d2e01f", "name": "Convert Email Body to File", "type": "n8n-nodes-base.convertToFile", "position": [ 2420, 420 ], "parameters": { "options": { "fileName": "emailBody.txt" }, "operation": "toText", "sourceProperty": "textBody" }, "typeVersion": 1.1 }, { "id": "bda5e2fe-d8c0-456b-975a-35e82ff02816", "name": "Set Email Variables", "type": "n8n-nodes-base.set", "position": [ 2240, 420 ], "parameters": { "options": {}, "includeOtherFields": true }, "typeVersion": 3.4 }, { "id": "54ecd8ab-ac4a-4b6b-bd1b-bf8c70082a33", "name": "Rename Email Body Screenshot", "type": "n8n-nodes-base.code", "position": [ 4420, 480 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "$('Convert Email Body to File').item.binary.data.fileName = 'emailBody.txt'\n\nreturn $('Convert Email Body to File').item;" }, "typeVersion": 2 }, { "id": "fe5b82cc-b4bb-4c97-9477-075d5a280e9f", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 2574.536755825029, 0 ], "parameters": { "color": 7, "width": 376.8280004374956, "height": 595.590013880477, "content": "![hctiapi](https://uploads.n8n.io/templates/hctiapi2.png)\n## Email Body Screenshot Creation\n\nThe **Screenshot HTML** node sends the email's HTML body to the **hcti.io** API, generating a screenshot that visually represents the email's layout. The **Retrieve Screenshot** node then fetches this image, making it available for attachment or review in subsequent steps. This dual-format processing ensures both clarity and flexibility in email analysis workflows." }, "typeVersion": 1 }, { "id": "86b21049-f65e-4c6a-a854-c4376f870da9", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 1380, -149.99110983560342 ], "parameters": { "color": 7, "width": 814.4556539379754, "height": 444.5525554815556, "content": "![Gmail](https://uploads.n8n.io/templates/gmail.png)\n## Gmail Integration and Data Extraction\n\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps." }, "typeVersion": 1 }, { "id": "b1a786cf-7a8d-49e1-90ed-31f3d0e65b13", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1380, 308 ], "parameters": { "color": 7, "width": 809.7918597571277, "height": 602.9002284617277, "content": "![Gmail](https://uploads.n8n.io/templates/outlook.png)\n## Microsoft Outlook Integration and Email Header Processing\n\nThis section enables the integration of Microsoft Outlook to monitor and capture incoming emails. The Microsoft Outlook Trigger node checks for new messages every minute. Once an email is detected, the Retrieve Headers of Email node fetches detailed header and body content via the Microsoft Graph API. The Format Headers node organizes the email headers into a structured format using a JavaScript function, ensuring clarity and readiness for further processing. Finally, the Set Outlook Variables node extracts and assigns key detailsβ€”such as the email subject, recipient, body, and formatted headersβ€”to variables for use in subsequent workflow steps. This section is essential for processing Outlook emails and preparing them for analysis and reporting.\n\n\n\n\n\n\n" }, "typeVersion": 1 }, { "id": "e7ace035-b5f5-4ef3-a117-22c7c938868d", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 2958.4325220284563, 24.744924120002338 ], "parameters": { "color": 7, "width": 593.0990401534098, "height": 573.1750519720028, "content": "![hctiapi](https://uploads.n8n.io/templates/openai.png)\n## AI-Powered Email Analysis and Threat Detection\n\nThis section leverages ChatGPT for advanced email content and header analysis to determine potential phishing threats. The **Analyze Email with ChatGPT** node processes the email's HTML body and headers, generating a detailed JSON response that categorizes the email as malicious or benign. The response includes a verbose explanation, formatted for Jira, outlining the reasons for the classification. The **Check if Malicious** node evaluates the AI output to determine the next steps based on the email's threat status. If flagged as malicious, subsequent actions like reporting and ticket creation are triggered. This section ensures precise, AI-driven analysis to enhance email security workflows." }, "typeVersion": 1 }, { "id": "02c1ad8e-f952-42d2-ae9f-cf3a77e49e52", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 3562.4948140707697, -125.79607719303533 ], "parameters": { "color": 7, "width": 1251.7025543502837, "height": 891.579206098173, "content": "![hctiapi](https://uploads.n8n.io/templates/jira.png)\n## Automated Jira Ticket Creation and Email Attachment\n\nThis section streamlines the process of logging phishing email reports in Jira, complete with detailed analysis and attachments. The workflow creates two distinct Jira tickets depending on the AI classification of the email:\n\n1. **Potentially Malicious**: The **Create Potentially Malicious Ticket** node generates a ticket if the email is flagged as a phishing attempt, including a summary of ChatGPT's analysis and the email’s details.\n2. **Potentially Benign**: If the email is classified as safe, the **Create Potentially Benign Ticket** node logs a ticket with similar details but under a non-malicious category.\n\n\nThe **Set Jira ID** node ensures the generated ticket's ID is tracked for subsequent operations. Attachments are handled efficiently:\n\n- **Rename Screenshot** prepares the email screenshot for upload.\n- **Upload Screenshot of Email to Jira** adds the screenshot to the Jira ticket for visual context.\n- **Rename Email Body Screenshot** and **Upload Email Body to Jira** manage the attachment of the email's text body as a `.txt` file.\n\n\nThis section enhances reporting by automating ticket creation, ensuring all relevant email data is readily available for review by security teams." }, "typeVersion": 1 }, { "id": "597ef23e-c61c-4e27-8c14-74ec20079c96", "name": "Check if Malicious", "type": "n8n-nodes-base.if", "position": [ 3400, 420 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "493f412c-5f11-4173-8940-90f5bc7f5fab", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.message.content.malicious }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "af512af9-924b-4019-bdf9-62aac9cd0dac", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 2200, 39.041733604283195 ], "parameters": { "color": 7, "width": 365.6458805720866, "height": 559.8072303111675, "content": "![n8n](https://uploads.n8n.io/templates/n8n.png)\n## Email Body Conversion\n\nThis section processes the email body into both text and visual formats for detailed analysis and reporting. The **Set Email Variables** node organizes the email's data, including its HTML body and text content, to prepare it for further steps. The **Convert Email Body to File** node creates a `.txt` file containing the plain text version of the email body, useful for documentation or further analysis." }, "typeVersion": 1 } ], "pinData": {}, "connections": { "Set Jira ID": { "main": [ [ { "node": "Rename Screenshot", "type": "main", "index": 0 } ] ] }, "Gmail Trigger": { "main": [ [ { "node": "Set Gmail Variables", "type": "main", "index": 0 } ] ] }, "Format Headers": { "main": [ [ { "node": "Set Outlook Variables", "type": "main", "index": 0 } ] ] }, "Screenshot HTML":
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"nodes\": [\n {\n \"id\": \"94dd7f48-0013-4fb5-89c4-826ecd7f2d66\",\n \"name\": \"Gmail Trigger\",\n \"type\": \"n8n-nodes-base.gmailTrigger\",\n \"position\": [\n 1460,\n 120\n ],\n \"parameters\": {\n \"simple\": false,\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"kkhNhqKpZt6IUZd0\",\n \"name\": \"Gmail\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"ca2023fa-ceca-4923-80e4-a3843803536c\",\n \"name\": \"Microsoft Outlook Trigger\",\n \"type\": \"n8n-nodes-base.microsoftOutlookTrigger\",\n \"disabled\": true,\n \"position\": [\n 1480,\n 680\n ],\n \"parameters\": {\n \"fields\": [\n \"body\",\n \"toRecipients\",\n \"subject\",\n \"bodyPreview\"\n ],\n \"output\": \"fields\",\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1f011214-91a0-4cfa-9d9e-29864937c0a3\",\n \"name\": \"Screenshot HTML\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2620,\n 420\n ],\n \"parameters\": {\n \"url\": \"https://hcti.io/v1/image\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendQuery\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"html\",\n \"value\": \"={{ $('Set Email Variables').item.json.htmlBody }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpBasicAuth\",\n \"queryParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"64f4789f-9de8-414f-af62-ddc339f0d0ac\",\n \"name\": \"Retrieve Screenshot\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2800,\n 420\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpBasicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"db707bd9-6abc-4ab7-8ffa-ad25c5e8adc4\",\n \"name\": \"Set Outlook Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2040,\n 680\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.body.content }}\"\n },\n {\n \"id\": \"13bdd95b-ef02-486e-b38b-d14bd05a4a8a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json}}\"\n },\n {\n \"id\": \"20566ad4-7eb7-42b1-8a0d-f8b759610f10\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.subject }}\"\n },\n {\n \"id\": \"7171998f-a5a2-4e23-946a-9c1ad75710e7\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}\"\n },\n {\n \"id\": \"cc262634-2470-4524-8319-abe2518a6335\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Retrieve Headers of Email').item.json.body.content }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7a3622c0-6949-4ea3-ae13-46a1ee26de7b\",\n \"name\": \"Set Gmail Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2020,\n 120\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.html }}\"\n },\n {\n \"id\": \"18fbcf78-6d3c-4036-b3a2-fb5adf22176a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers }}\"\n },\n {\n \"id\": \"1d690098-be2a-4604-baf8-62f314930929\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $json.subject }}\"\n },\n {\n \"id\": \"8009f00a-547f-4eb1-b52d-2e7305248885\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $json.to.text }}\"\n },\n {\n \"id\": \"1932e97d-b03b-4964-b8bc-8262aaaa1f7a\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.text }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4b4c6b34-f74c-4402-91a1-4d002e02a3bd\",\n \"name\": \"Retrieve Headers of Email\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1700,\n 680\n ],\n \"parameters\": {\n \"url\": \"=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n },\n {\n \"name\": \"Prefer\",\n \"value\": \"outlook.body-content-type=\\\"text\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"microsoftOutlookOAuth2Api\"\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"0c9883b5-3eb7-45db-9803-d1b30166a3b5\",\n \"name\": \"Format Headers\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1880,\n 680\n ],\n \"parameters\": {\n \"jsCode\": \"const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\\n\\nconst result = input.reduce((acc, { name, value }) => {\\n if (!acc[name]) acc[name] = [];\\n acc[name].push(value);\\n return acc;\\n}, {});\\n\\nreturn result;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"c21a976c-00e5-4823-bd94-4c95a7d60438\",\n \"name\": \"Analyze Email with ChatGPT\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 3000,\n 420\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o\",\n \"cachedResultName\": \"GPT-4O\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Describe the following email using the HTML body and headers. Determine if the email could be a phishing email. \\n\\nHere is the HTML body:\\n{{ $('Set Email Variables').item.json.htmlBody }}\\n\\nThe message headers are as follows:\\n{{ $('Set Email Variables').item.json.headers }}\\n\\n\"\n },\n {\n \"role\": \"system\",\n \"content\": \"Please make sure to output all responses using the following structured JSON output:\\n{\\n \\\"malicious\\\": false,\\n \\\"summary\\\": \\\"The email appears to be a legitimate communication from a known sender. It contains no suspicious links, attachments, or language that indicates phishing or malicious intent.\\\"\\n}\\n\\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response. Make the summary as verbose as possible including a full breakdown of why the email is benign or malicious.\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"76\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"a91f4095-9245-4276-b21f-f415de22df62\",\n \"name\": \"Create Potentially Malicious Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3640,\n 400\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Potentially Malicious - Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.message.content.summary }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5a66a0e-9d8a-45a9-b1ae-aec78ddfec27\",\n \"name\": \"Create Potentially Benign Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3640,\n 580\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Potentially Benign - Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.message.content.summary }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5af0d60b-d021-4dd9-98f7-b2842800764a\",\n \"name\": \"Rename Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 4020,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\\n\\nreturn $('Retrieve Screenshot').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"441c4cbb-bd93-4213-bd34-e18f2a49389f\",\n \"name\": \"Set Jira ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 3860,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4c71188c-011d-4f8e-a36c-87900bfab59a\",\n \"name\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 4220,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Set Jira ID').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3c031c34-8306-44e1-8e0e-a584c5323112\",\n \"name\": \"Upload Email Body to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 4620,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Set Jira ID').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d033dcbd-7ccb-451f-ab81-cc6d32d2e01f\",\n \"name\": \"Convert Email Body to File\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n 2420,\n 420\n ],\n \"parameters\": {\n \"options\": {\n \"fileName\": \"emailBody.txt\"\n },\n \"operation\": \"toText\",\n \"sourceProperty\": \"textBody\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"bda5e2fe-d8c0-456b-975a-35e82ff02816\",\n \"name\": \"Set Email Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2240,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"54ecd8ab-ac4a-4b6b-bd1b-bf8c70082a33\",\n \"name\": \"Rename Email Body Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 4420,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Convert Email Body to File').item.binary.data.fileName = 'emailBody.txt'\\n\\nreturn $('Convert Email Body to File').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"fe5b82cc-b4bb-4c97-9477-075d5a280e9f\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2574.536755825029,\n 0\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 376.8280004374956,\n \"height\": 595.590013880477,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/hctiapi2.png)\\n## Email Body Screenshot Creation\\n\\nThe **Screenshot HTML** node sends the email's HTML body to the **hcti.io** API, generating a screenshot that visually represents the email's layout. The **Retrieve Screenshot** node then fetches this image, making it available for attachment or review in subsequent steps. This dual-format processing ensures both clarity and flexibility in email analysis workflows.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"86b21049-f65e-4c6a-a854-c4376f870da9\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1380,\n -149.99110983560342\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 814.4556539379754,\n \"height\": 444.5525554815556,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/gmail.png)\\n## Gmail Integration and Data Extraction\\n\\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b1a786cf-7a8d-49e1-90ed-31f3d0e65b13\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1380,\n 308\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 809.7918597571277,\n \"height\": 602.9002284617277,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/outlook.png)\\n## Microsoft Outlook Integration and Email Header Processing\\n\\nThis section enables the integration of Microsoft Outlook to monitor and capture incoming emails. The Microsoft Outlook Trigger node checks for new messages every minute. Once an email is detected, the Retrieve Headers of Email node fetches detailed header and body content via the Microsoft Graph API. The Format Headers node organizes the email headers into a structured format using a JavaScript function, ensuring clarity and readiness for further processing. Finally, the Set Outlook Variables node extracts and assigns key detailsβ€”such as the email subject, recipient, body, and formatted headersβ€”to variables for use in subsequent workflow steps. This section is essential for processing Outlook emails and preparing them for analysis and reporting.\\n\\n\\n\\n\\n\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e7ace035-b5f5-4ef3-a117-22c7c938868d\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2958.4325220284563,\n 24.744924120002338\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 593.0990401534098,\n \"height\": 573.1750519720028,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/openai.png)\\n## AI-Powered Email Analysis and Threat Detection\\n\\nThis section leverages ChatGPT for advanced email content and header analysis to determine potential phishing threats. The **Analyze Email with ChatGPT** node processes the email's HTML body and headers, generating a detailed JSON response that categorizes the email as malicious or benign. The response includes a verbose explanation, formatted for Jira, outlining the reasons for the classification. The **Check if Malicious** node evaluates the AI output to determine the next steps based on the email's threat status. If flagged as malicious, subsequent actions like reporting and ticket creation are triggered. This section ensures precise, AI-driven analysis to enhance email security workflows.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"02c1ad8e-f952-42d2-ae9f-cf3a77e49e52\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 3562.4948140707697,\n -125.79607719303533\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1251.7025543502837,\n \"height\": 891.579206098173,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/jira.png)\\n## Automated Jira Ticket Creation and Email Attachment\\n\\nThis section streamlines the process of logging phishing email reports in Jira, complete with detailed analysis and attachments. The workflow creates two distinct Jira tickets depending on the AI classification of the email:\\n\\n1. **Potentially Malicious**: The **Create Potentially Malicious Ticket** node generates a ticket if the email is flagged as a phishing attempt, including a summary of ChatGPT's analysis and the email’s details.\\n2. **Potentially Benign**: If the email is classified as safe, the **Create Potentially Benign Ticket** node logs a ticket with similar details but under a non-malicious category.\\n\\n\\nThe **Set Jira ID** node ensures the generated ticket's ID is tracked for subsequent operations. Attachments are handled efficiently:\\n\\n- **Rename Screenshot** prepares the email screenshot for upload.\\n- **Upload Screenshot of Email to Jira** adds the screenshot to the Jira ticket for visual context.\\n- **Rename Email Body Screenshot** and **Upload Email Body to Jira** manage the attachment of the email's text body as a `.txt` file.\\n\\n\\nThis section enhances reporting by automating ticket creation, ensuring all relevant email data is readily available for review by security teams.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"597ef23e-c61c-4e27-8c14-74ec20079c96\",\n \"name\": \"Check if Malicious\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 3400,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"493f412c-5f11-4173-8940-90f5bc7f5fab\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.malicious }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"af512af9-924b-4019-bdf9-62aac9cd0dac\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2200,\n 39.041733604283195\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 365.6458805720866,\n \"height\": 559.8072303111675,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/n8n.png)\\n## Email Body Conversion\\n\\nThis section processes the email body into both text and visual formats for detailed analysis and reporting. The **Set Email Variables** node organizes the email's data, including its HTML body and text content, to prepare it for further steps. The **Convert Email Body to File** node creates a `.txt` file containing the plain text version of the email body, useful for documentation or further analysis.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Set Jira ID\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Gmail Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Set Gmail Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Format Headers\": {\n \"main\": [\n [\n {\n \"node\": \"Set Outlook Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Screenshot HTML\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Malicious\": {\n \"main\": [\n [\n {\n \"node\": \"Create Potentially Malicious Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Create Potentially Benign Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Analyze Email with ChatGPT\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Email Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Convert Email Body to File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Gmail Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Outlook Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Microsoft Outlook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Headers of Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Headers of Email\": {\n \"main\": [\n [\n {\n \"node\": \"Format Headers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Analyze Email with ChatGPT\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Malicious\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert Email Body to File\": {\n \"main\": [\n [\n {\n \"node\": \"Screenshot HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Email Body Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Email Body to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Potentially Benign Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Set Jira ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload Screenshot of Email to Jira\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Email Body Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Potentially Malicious Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Set Jira ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
55
1
3
true
combined_workflows.json
{ "input": "The workflow's goal is to analyze incoming emails from Gmail and Microsoft Outlook, detect potential phishing attempts using ChatGPT, and automatically create Jira tickets with analysis and attachments based on the email's threat level.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 18526, "processed_size": 18526, "processed_timestamp": "2025-04-09T03:08:39.766498", "timestamp": "2025-04-09T02:37:51.357324", "token_count": 4097, "tokens": 1877, "workflow_chunk_info": { "is_truncated": false, "original_size": 18526, "processed_size": 18526, "workflow_hash": "abacc16c443d28123cff89cfa71a90f9" }, "workflow_hash": "abacc16c443d28123cff89cfa71a90f9" }
"pinData": {}, "connections": { "Set Jira ID": { "main": [ [ { "node": "Rename Screenshot", "type": "main", "index": 0 } ] ] }, "Gmail Trigger": { "main": [ [ { "node": "Set Gmail Variables", "type": "main", "index": 0 } ] ] }, "Format Headers": { "main": [ [ { "node": "Set Outlook Variables", "type": "main", "index": 0 } ] ] }, "Screenshot HTML": { "main": [ [ { "node": "Retrieve Screenshot", "type": "main", "index": 0 } ] ] }, "Rename Screenshot": { "main": [ [ { "node": "Upload Screenshot of Email to Jira", "type": "main", "index": 0 } ] ] }, "Check if Malicious": { "main": [ [ { "node": "Create Potentially Malicious Ticket", "type": "main", "index": 0 } ], [ { "node": "Create Potentially Benign Ticket", "type": "main", "index": 0 } ] ] }, "Retrieve Screenshot": { "main": [ [ { "node": "Analyze Email with ChatGPT", "type": "main", "index": 0 } ] ] }, "Set Email Variables": { "main": [ [ { "node": "Convert Email Body to File", "type": "main", "index": 0 } ] ] }, "Set Gmail Variables": { "main": [ [ { "node": "Set Email Variables", "type": "main", "index": 0 } ] ] }, "Set Outlook Variables": { "main": [ [ { "node": "Set Email Variables", "type": "main", "index": 0 } ] ] }, "Microsoft Outlook Trigger": { "main": [ [ { "node": "Retrieve Headers of Email", "type": "main", "index": 0 } ] ] }, "Retrieve Headers of Email": { "main": [ [ { "node": "Format Headers", "type": "main", "index": 0 } ] ] }, "Analyze Email with ChatGPT": { "main": [ [ { "node": "Check if Malicious", "type": "main", "index": 0 } ] ] }, "Convert Email Body to File": { "main": [ [ { "node": "Screenshot HTML", "type": "main", "index": 0 } ] ] }, "Rename Email Body Screenshot": { "main": [ [ { "node": "Upload Email Body to Jira", "type": "main", "index": 0 } ] ] }, "Create Potentially Benign Ticket": { "main": [ [ { "node": "Set Jira ID", "type": "main", "index": 0 } ] ] }, "Upload Screenshot of Email to Jira": { "main": [ [ { "node": "Rename Email Body Screenshot", "type": "main", "index": 0 } ] ] }, "Create Potentially Malicious Ticket": { "main": [ [ { "node": "Set Jira ID", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"nodes\": [\n {\n \"id\": \"94dd7f48-0013-4fb5-89c4-826ecd7f2d66\",\n \"name\": \"Gmail Trigger\",\n \"type\": \"n8n-nodes-base.gmailTrigger\",\n \"position\": [\n 1460,\n 120\n ],\n \"parameters\": {\n \"simple\": false,\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"gmailOAuth2\": {\n \"id\": \"kkhNhqKpZt6IUZd0\",\n \"name\": \"Gmail\"\n }\n },\n \"typeVersion\": 1.2\n },\n {\n \"id\": \"ca2023fa-ceca-4923-80e4-a3843803536c\",\n \"name\": \"Microsoft Outlook Trigger\",\n \"type\": \"n8n-nodes-base.microsoftOutlookTrigger\",\n \"disabled\": true,\n \"position\": [\n 1480,\n 680\n ],\n \"parameters\": {\n \"fields\": [\n \"body\",\n \"toRecipients\",\n \"subject\",\n \"bodyPreview\"\n ],\n \"output\": \"fields\",\n \"filters\": {},\n \"options\": {},\n \"pollTimes\": {\n \"item\": [\n {\n \"mode\": \"everyMinute\"\n }\n ]\n }\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1f011214-91a0-4cfa-9d9e-29864937c0a3\",\n \"name\": \"Screenshot HTML\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2620,\n 420\n ],\n \"parameters\": {\n \"url\": \"https://hcti.io/v1/image\",\n \"method\": \"POST\",\n \"options\": {},\n \"sendBody\": true,\n \"sendQuery\": true,\n \"authentication\": \"genericCredentialType\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"html\",\n \"value\": \"={{ $('Set Email Variables').item.json.htmlBody }}\"\n }\n ]\n },\n \"genericAuthType\": \"httpBasicAuth\",\n \"queryParameters\": {\n \"parameters\": [\n {}\n ]\n }\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"64f4789f-9de8-414f-af62-ddc339f0d0ac\",\n \"name\": \"Retrieve Screenshot\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2800,\n 420\n ],\n \"parameters\": {\n \"url\": \"={{ $json.url }}\",\n \"options\": {},\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpBasicAuth\"\n },\n \"credentials\": {\n \"httpBasicAuth\": {\n \"id\": \"8tm8mUWmPvtmPFPk\",\n \"name\": \"hcti.io\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"db707bd9-6abc-4ab7-8ffa-ad25c5e8adc4\",\n \"name\": \"Set Outlook Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2040,\n 680\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.body.content }}\"\n },\n {\n \"id\": \"13bdd95b-ef02-486e-b38b-d14bd05a4a8a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json}}\"\n },\n {\n \"id\": \"20566ad4-7eb7-42b1-8a0d-f8b759610f10\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.subject }}\"\n },\n {\n \"id\": \"7171998f-a5a2-4e23-946a-9c1ad75710e7\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $('Microsoft Outlook Trigger').item.json.toRecipients[0].emailAddress.address }}\"\n },\n {\n \"id\": \"cc262634-2470-4524-8319-abe2518a6335\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $('Retrieve Headers of Email').item.json.body.content }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"7a3622c0-6949-4ea3-ae13-46a1ee26de7b\",\n \"name\": \"Set Gmail Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2020,\n 120\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"38bd3db2-1a8d-4c40-a2dd-336e0cc84224\",\n \"name\": \"htmlBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.html }}\"\n },\n {\n \"id\": \"18fbcf78-6d3c-4036-b3a2-fb5adf22176a\",\n \"name\": \"headers\",\n \"type\": \"string\",\n \"value\": \"={{ $json.headers }}\"\n },\n {\n \"id\": \"1d690098-be2a-4604-baf8-62f314930929\",\n \"name\": \"subject\",\n \"type\": \"string\",\n \"value\": \"={{ $json.subject }}\"\n },\n {\n \"id\": \"8009f00a-547f-4eb1-b52d-2e7305248885\",\n \"name\": \"recipient\",\n \"type\": \"string\",\n \"value\": \"={{ $json.to.text }}\"\n },\n {\n \"id\": \"1932e97d-b03b-4964-b8bc-8262aaaa1f7a\",\n \"name\": \"textBody\",\n \"type\": \"string\",\n \"value\": \"={{ $json.text }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4b4c6b34-f74c-4402-91a1-4d002e02a3bd\",\n \"name\": \"Retrieve Headers of Email\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 1700,\n 680\n ],\n \"parameters\": {\n \"url\": \"=https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}?$select=internetMessageHeaders,body\",\n \"options\": {},\n \"sendHeaders\": true,\n \"authentication\": \"predefinedCredentialType\",\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Accept\",\n \"value\": \"application/json\"\n },\n {\n \"name\": \"Prefer\",\n \"value\": \"outlook.body-content-type=\\\"text\\\"\"\n }\n ]\n },\n \"nodeCredentialType\": \"microsoftOutlookOAuth2Api\"\n },\n \"credentials\": {\n \"microsoftOutlookOAuth2Api\": {\n \"id\": \"vTCK0oVQ0WjFrI5H\",\n \"name\": \" Outlook Credential\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"0c9883b5-3eb7-45db-9803-d1b30166a3b5\",\n \"name\": \"Format Headers\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1880,\n 680\n ],\n \"parameters\": {\n \"jsCode\": \"const input = $('Retrieve Headers of Email').item.json.internetMessageHeaders;\\n\\nconst result = input.reduce((acc, { name, value }) => {\\n if (!acc[name]) acc[name] = [];\\n acc[name].push(value);\\n return acc;\\n}, {});\\n\\nreturn result;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"c21a976c-00e5-4823-bd94-4c95a7d60438\",\n \"name\": \"Analyze Email with ChatGPT\",\n \"type\": \"@n8n/n8n-nodes-langchain.openAi\",\n \"position\": [\n 3000,\n 420\n ],\n \"parameters\": {\n \"modelId\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"gpt-4o\",\n \"cachedResultName\": \"GPT-4O\"\n },\n \"options\": {},\n \"messages\": {\n \"values\": [\n {\n \"content\": \"=Describe the following email using the HTML body and headers. Determine if the email could be a phishing email. \\n\\nHere is the HTML body:\\n{{ $('Set Email Variables').item.json.htmlBody }}\\n\\nThe message headers are as follows:\\n{{ $('Set Email Variables').item.json.headers }}\\n\\n\"\n },\n {\n \"role\": \"system\",\n \"content\": \"Please make sure to output all responses using the following structured JSON output:\\n{\\n \\\"malicious\\\": false,\\n \\\"summary\\\": \\\"The email appears to be a legitimate communication from a known sender. It contains no suspicious links, attachments, or language that indicates phishing or malicious intent.\\\"\\n}\\n\\nFormat the response for Jira who uses a wiki-style renderer. Do not include ``` around your response. Make the summary as verbose as possible including a full breakdown of why the email is benign or malicious.\"\n }\n ]\n },\n \"jsonOutput\": true\n },\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"76\",\n \"name\": \"OpenAi account\"\n }\n },\n \"typeVersion\": 1.6\n },\n {\n \"id\": \"a91f4095-9245-4276-b21f-f415de22df62\",\n \"name\": \"Create Potentially Malicious Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3640,\n 400\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Potentially Malicious - Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.message.content.summary }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5a66a0e-9d8a-45a9-b1ae-aec78ddfec27\",\n \"name\": \"Create Potentially Benign Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 3640,\n 580\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Support\"\n },\n \"summary\": \"=Potentially Benign - Phishing Email Reported: \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10008\",\n \"cachedResultName\": \"Task\"\n },\n \"additionalFields\": {\n \"description\": \"=A phishing email was reported by {{ $('Set Email Variables').item.json.recipient }} with the subject line \\\"{{ $('Set Email Variables').item.json.subject }}\\\"\\n\\\\\\\\\\nh2. Here is ChatGPT's analysis of the email:\\n{{ $json.message.content.summary }}\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"5af0d60b-d021-4dd9-98f7-b2842800764a\",\n \"name\": \"Rename Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 4020,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Retrieve Screenshot').item.binary.data.fileName = 'emailScreenshot.png'\\n\\nreturn $('Retrieve Screenshot').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"441c4cbb-bd93-4213-bd34-e18f2a49389f\",\n \"name\": \"Set Jira ID\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 3860,\n 480\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"4c71188c-011d-4f8e-a36c-87900bfab59a\",\n \"name\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 4220,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Set Jira ID').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3c031c34-8306-44e1-8e0e-a584c5323112\",\n \"name\": \"Upload Email Body to Jira\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 4620,\n 480\n ],\n \"parameters\": {\n \"issueKey\": \"={{ $('Set Jira ID').item.json.key }}\",\n \"resource\": \"issueAttachment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"BZmmGUrNIsgM9fDj\",\n \"name\": \"New Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"d033dcbd-7ccb-451f-ab81-cc6d32d2e01f\",\n \"name\": \"Convert Email Body to File\",\n \"type\": \"n8n-nodes-base.convertToFile\",\n \"position\": [\n 2420,\n 420\n ],\n \"parameters\": {\n \"options\": {\n \"fileName\": \"emailBody.txt\"\n },\n \"operation\": \"toText\",\n \"sourceProperty\": \"textBody\"\n },\n \"typeVersion\": 1.1\n },\n {\n \"id\": \"bda5e2fe-d8c0-456b-975a-35e82ff02816\",\n \"name\": \"Set Email Variables\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 2240,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"includeOtherFields\": true\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"54ecd8ab-ac4a-4b6b-bd1b-bf8c70082a33\",\n \"name\": \"Rename Email Body Screenshot\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 4420,\n 480\n ],\n \"parameters\": {\n \"mode\": \"runOnceForEachItem\",\n \"jsCode\": \"$('Convert Email Body to File').item.binary.data.fileName = 'emailBody.txt'\\n\\nreturn $('Convert Email Body to File').item;\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"fe5b82cc-b4bb-4c97-9477-075d5a280e9f\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2574.536755825029,\n 0\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 376.8280004374956,\n \"height\": 595.590013880477,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/hctiapi2.png)\\n## Email Body Screenshot Creation\\n\\nThe **Screenshot HTML** node sends the email's HTML body to the **hcti.io** API, generating a screenshot that visually represents the email's layout. The **Retrieve Screenshot** node then fetches this image, making it available for attachment or review in subsequent steps. This dual-format processing ensures both clarity and flexibility in email analysis workflows.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"86b21049-f65e-4c6a-a854-c4376f870da9\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1380,\n -149.99110983560342\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 814.4556539379754,\n \"height\": 444.5525554815556,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/gmail.png)\\n## Gmail Integration and Data Extraction\\n\\nThis section of the workflow connects to a Gmail account using the **Gmail Trigger** node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key componentsβ€”such as the subject, recipient, body, and headersβ€”are extracted and assigned to variables using the **Set Gmail Variables** node. These variables are structured for subsequent analysis and processing in later steps.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b1a786cf-7a8d-49e1-90ed-31f3d0e65b13\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 1380,\n 308\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 809.7918597571277,\n \"height\": 602.9002284617277,\n \"content\": \"![Gmail](https://uploads.n8n.io/templates/outlook.png)\\n## Microsoft Outlook Integration and Email Header Processing\\n\\nThis section enables the integration of Microsoft Outlook to monitor and capture incoming emails. The Microsoft Outlook Trigger node checks for new messages every minute. Once an email is detected, the Retrieve Headers of Email node fetches detailed header and body content via the Microsoft Graph API. The Format Headers node organizes the email headers into a structured format using a JavaScript function, ensuring clarity and readiness for further processing. Finally, the Set Outlook Variables node extracts and assigns key detailsβ€”such as the email subject, recipient, body, and formatted headersβ€”to variables for use in subsequent workflow steps. This section is essential for processing Outlook emails and preparing them for analysis and reporting.\\n\\n\\n\\n\\n\\n\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e7ace035-b5f5-4ef3-a117-22c7c938868d\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2958.4325220284563,\n 24.744924120002338\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 593.0990401534098,\n \"height\": 573.1750519720028,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/openai.png)\\n## AI-Powered Email Analysis and Threat Detection\\n\\nThis section leverages ChatGPT for advanced email content and header analysis to determine potential phishing threats. The **Analyze Email with ChatGPT** node processes the email's HTML body and headers, generating a detailed JSON response that categorizes the email as malicious or benign. The response includes a verbose explanation, formatted for Jira, outlining the reasons for the classification. The **Check if Malicious** node evaluates the AI output to determine the next steps based on the email's threat status. If flagged as malicious, subsequent actions like reporting and ticket creation are triggered. This section ensures precise, AI-driven analysis to enhance email security workflows.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"02c1ad8e-f952-42d2-ae9f-cf3a77e49e52\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 3562.4948140707697,\n -125.79607719303533\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 1251.7025543502837,\n \"height\": 891.579206098173,\n \"content\": \"![hctiapi](https://uploads.n8n.io/templates/jira.png)\\n## Automated Jira Ticket Creation and Email Attachment\\n\\nThis section streamlines the process of logging phishing email reports in Jira, complete with detailed analysis and attachments. The workflow creates two distinct Jira tickets depending on the AI classification of the email:\\n\\n1. **Potentially Malicious**: The **Create Potentially Malicious Ticket** node generates a ticket if the email is flagged as a phishing attempt, including a summary of ChatGPT's analysis and the email’s details.\\n2. **Potentially Benign**: If the email is classified as safe, the **Create Potentially Benign Ticket** node logs a ticket with similar details but under a non-malicious category.\\n\\n\\nThe **Set Jira ID** node ensures the generated ticket's ID is tracked for subsequent operations. Attachments are handled efficiently:\\n\\n- **Rename Screenshot** prepares the email screenshot for upload.\\n- **Upload Screenshot of Email to Jira** adds the screenshot to the Jira ticket for visual context.\\n- **Rename Email Body Screenshot** and **Upload Email Body to Jira** manage the attachment of the email's text body as a `.txt` file.\\n\\n\\nThis section enhances reporting by automating ticket creation, ensuring all relevant email data is readily available for review by security teams.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"597ef23e-c61c-4e27-8c14-74ec20079c96\",\n \"name\": \"Check if Malicious\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 3400,\n 420\n ],\n \"parameters\": {\n \"options\": {},\n \"conditions\": {\n \"options\": {\n \"version\": 2,\n \"leftValue\": \"\",\n \"caseSensitive\": true,\n \"typeValidation\": \"strict\"\n },\n \"combinator\": \"and\",\n \"conditions\": [\n {\n \"id\": \"493f412c-5f11-4173-8940-90f5bc7f5fab\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\",\n \"singleValue\": true\n },\n \"leftValue\": \"={{ $json.message.content.malicious }}\",\n \"rightValue\": \"\"\n }\n ]\n }\n },\n \"typeVersion\": 2.2\n },\n {\n \"id\": \"af512af9-924b-4019-bdf9-62aac9cd0dac\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 2200,\n 39.041733604283195\n ],\n \"parameters\": {\n \"color\": 7,\n \"width\": 365.6458805720866,\n \"height\": 559.8072303111675,\n \"content\": \"![n8n](https://uploads.n8n.io/templates/n8n.png)\\n## Email Body Conversion\\n\\nThis section processes the email body into both text and visual formats for detailed analysis and reporting. The **Set Email Variables** node organizes the email's data, including its HTML body and text content, to prepare it for further steps. The **Convert Email Body to File** node creates a `.txt` file containing the plain text version of the email body, useful for documentation or further analysis.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"pinData\": {},\n \"connections\": {\n \"Set Jira ID\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Gmail Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Set Gmail Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Format Headers\": {\n \"main\": [\n [\n {\n \"node\": \"Set Outlook Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Screenshot HTML\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Screenshot of Email to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Check if Malicious\": {\n \"main\": [\n [\n {\n \"node\": \"Create Potentially Malicious Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Create Potentially Benign Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Analyze Email with ChatGPT\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Email Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Convert Email Body to File\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Gmail Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Outlook Variables\": {\n \"main\": [\n [\n {\n \"node\": \"Set Email Variables\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Microsoft Outlook Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Retrieve Headers of Email\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Retrieve Headers of Email\": {\n \"main\": [\n [\n {\n \"node\": \"Format Headers\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Analyze Email with ChatGPT\": {\n \"main\": [\n [\n {\n \"node\": \"Check if Malicious\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert Email Body to File\": {\n \"main\": [\n [\n {\n \"node\": \"Screenshot HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Rename Email Body Screenshot\": {\n \"main\": [\n [\n {\n \"node\": \"Upload Email Body to Jira\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Potentially Benign Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Set Jira ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Upload Screenshot of Email to Jira\": {\n \"main\": [\n [\n {\n \"node\": \"Rename Email Body Screenshot\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Create Potentially Malicious Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"Set Jira ID\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
55
2
3
true
combined_workflows.json
{ "input": "The workflow's goal is to analyze incoming emails from Gmail and Microsoft Outlook, detect potential phishing attempts using ChatGPT, and automatically create Jira tickets with analysis and attachments based on the email's threat level.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 18526, "processed_size": 18526, "processed_timestamp": "2025-04-09T03:08:39.770496", "timestamp": "2025-04-09T02:37:51.357324", "token_count": 1204, "tokens": 1877, "workflow_chunk_info": { "is_truncated": false, "original_size": 18526, "processed_size": 18526, "workflow_hash": "abacc16c443d28123cff89cfa71a90f9" }, "workflow_hash": "abacc16c443d28123cff89cfa71a90f9" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow creates, updates, and retrieves a case in TheHive. Analyze this workflow: ```json { "id": "159", "name": "Create, update and get a case in TheHive", "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 270, 340 ], "parameters": {}, "typeVersion": 1 }, { "name": "TheHive", "type": "n8n-nodes-base.theHive", "position": [ 470, 340 ], "parameters": { "tags": "n8n, theHive", "owner": "Harshil", "title": "n8n", "options": {}, "resource": "case", "severity": 1, "operation": "create", "startDate": "2020-12-03T10:08:14.000Z", "description": "Creating a case from n8n" }, "credentials": { "theHiveApi": "hive" }, "typeVersion": 1 }, { "name": "TheHive1", "type": "n8n-nodes-base.theHive", "position": [ 670, 340 ], "parameters": { "id": "={{$node[\"TheHive\"].json[\"id\"]}}", "resource": "case", "operation": "update", "updateFields": { "severity": 3 } }, "credentials": { "theHiveApi": "hive" }, "typeVersion": 1 }, { "name": "TheHive2", "type": "n8n-nodes-base.theHive", "position": [ 870, 340 ], "parameters": { "id": "={{$node[\"TheHive\"].json[\"id\"]}}", "resource": "case", "operation": "get" }, "credentials": { "theHiveApi": "hive" }, "typeVersion": 1 } ], "active": false, "settings": {}, "connections": { "TheHive": { "main": [ [ { "node": "TheHive1", "type": "main", "index": 0 } ] ] }, "TheHive1": { "main": [ [ { "node": "TheHive2", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "TheHive", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"159\",\n \"name\": \"Create, update and get a case in TheHive\",\n \"nodes\": [\n {\n \"name\": \"On clicking 'execute'\",\n \"type\": \"n8n-nodes-base.manualTrigger\",\n \"position\": [\n 270,\n 340\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"name\": \"TheHive\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 470,\n 340\n ],\n \"parameters\": {\n \"tags\": \"n8n, theHive\",\n \"owner\": \"Harshil\",\n \"title\": \"n8n\",\n \"options\": {},\n \"resource\": \"case\",\n \"severity\": 1,\n \"operation\": \"create\",\n \"startDate\": \"2020-12-03T10:08:14.000Z\",\n \"description\": \"Creating a case from n8n\"\n },\n \"credentials\": {\n \"theHiveApi\": \"hive\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"TheHive1\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 670,\n 340\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"TheHive\\\"].json[\\\"id\\\"]}}\",\n \"resource\": \"case\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"severity\": 3\n }\n },\n \"credentials\": {\n \"theHiveApi\": \"hive\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"TheHive2\",\n \"type\": \"n8n-nodes-base.theHive\",\n \"position\": [\n 870,\n 340\n ],\n \"parameters\": {\n \"id\": \"={{$node[\\\"TheHive\\\"].json[\\\"id\\\"]}}\",\n \"resource\": \"case\",\n \"operation\": \"get\"\n },\n \"credentials\": {\n \"theHiveApi\": \"hive\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"settings\": {},\n \"connections\": {\n \"TheHive\": {\n \"main\": [\n [\n {\n \"node\": \"TheHive1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"TheHive1\": {\n \"main\": [\n [\n {\n \"node\": \"TheHive2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"On clicking 'execute'\": {\n \"main\": [\n [\n {\n \"node\": \"TheHive\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
56
0
1
false
combined_workflows.json
{ "input": "The workflow creates, updates, and retrieves a case in TheHive.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 1383, "processed_size": 1383, "processed_timestamp": "2025-04-09T03:08:39.775501", "timestamp": "2025-04-09T02:37:54.425438", "token_count": 923, "tokens": 133, "workflow_chunk_info": { "is_truncated": false, "original_size": 1383, "processed_size": 1383, "workflow_hash": "a56fe10bdecc62529cc06d8dc56caa79" }, "workflow_hash": "a56fe10bdecc62529cc06d8dc56caa79" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow automates the process of deleting user data in response to a Slack command, verifying the request, and logging the outcome. Analyze this workflow: ```json { "nodes": [ { "name": "Receive Slash Command", "type": "n8n-nodes-base.webhook", "position": [ 240, 100 ], "webhookId": "3c0d3820-5896-41c5-83bf-1cd5e956c32c", "parameters": { "path": "3c0d3820-5896-41c5-83bf-1cd5e956c32c", "options": {}, "httpMethod": "POST", "responseMode": "responseNode" }, "typeVersion": 1 }, { "name": "Reject", "type": "n8n-nodes-base.respondToWebhook", "position": [ 680, 200 ], "parameters": { "options": { "responseCode": 403 }, "respondWith": "noData" }, "typeVersion": 1 }, { "name": "Set", "type": "n8n-nodes-base.set", "position": [ 680, 0 ], "parameters": { "values": { "string": [ { "name": "operation", "value": "={{$json[\"body\"][\"text\"].split(\" \")[0].toLowerCase()}}" }, { "name": "email", "value": "={{$json[\"body\"][\"text\"].split(\" \")[1].toLowerCase()}}" } ] }, "options": {}, "keepOnlySet": true }, "typeVersion": 1 }, { "name": "Read Command", "type": "n8n-nodes-base.switch", "position": [ 900, 0 ], "parameters": { "rules": { "rules": [ { "value2": "delete" } ] }, "value1": "={{$json[\"operation\"]}}", "dataType": "string", "fallbackOutput": 3 }, "typeVersion": 1 }, { "name": "Wrong Command Error", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1120, 100 ], "parameters": { "options": {}, "respondWith": "json", "responseBody": "{\n \"text\": \"Sorry, I didn't understand your command. You can request data deletion like so: `/gdpr delete <email>`.\"\n}" }, "typeVersion": 1 }, { "name": "Acknowledge", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1340, 0 ], "parameters": { "options": {}, "respondWith": "json", "responseBody": "{\n \"text\": \"On it!\"\n}" }, "typeVersion": 1 }, { "name": "Empty Email?", "type": "n8n-nodes-base.if", "position": [ 1120, -100 ], "parameters": { "conditions": { "string": [ { "value1": "={{$json[\"email\"]}}", "operation": "isEmpty" } ] } }, "typeVersion": 1 }, { "name": "Missing Email Error", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1340, -200 ], "parameters": { "options": {}, "respondWith": "json", "responseBody": "{\n \"text\": \"It looks like the user email address is missing. You can request data deletion like so: `/gdpr delete <email>`.\"\n}" }, "typeVersion": 1 }, { "name": "Valid Token?", "type": "n8n-nodes-base.if", "position": [ 460, 100 ], "parameters": { "conditions": { "string": [ { "value1": "={{$json[\"body\"][\"token\"]}}", "value2": "foo" } ] } }, "typeVersion": 1 }, { "name": "Paddle Data Deletion", "type": "n8n-nodes-base.executeWorkflow", "position": [ 1560, 0 ], "parameters": { "workflowId": "1231" }, "typeVersion": 1 }, { "name": "Customer.io Data Deletion", "type": "n8n-nodes-base.executeWorkflow", "position": [ 1780, 0 ], "parameters": { "workflowId": "1237" }, "typeVersion": 1 }, { "name": "Zendesk Data Deletion", "type": "n8n-nodes-base.executeWorkflow", "position": [ 2000, 0 ], "parameters": { "workflowId": "1240" }, "typeVersion": 1 }, { "name": "Airtable", "type": "n8n-nodes-base.airtable", "position": [ 1780, 200 ], "parameters": { "table": "Log", "options": {}, "operation": "append", "application": "app3wAXUUwalhapFV" }, "credentials": { "airtableApi": { "id": "12", "name": "mutedjam@n8n.io" } }, "typeVersion": 1 }, { "name": "Prepare Log Entry", "type": "n8n-nodes-base.function", "position": [ 1340, 200 ], "parameters": { "functionCode": "let deletion_nodes = [\n 'Paddle Data Deletion',\n 'Customer.io Data Deletion',\n 'Zendesk Data Deletion'\n]\n\nconst deletion_results = deletion_nodes.map(node_name => $items(node_name)[0].json);\nconst deletion_success = deletion_results.filter(json => json.success == true).length == deletion_nodes.length;\n\nreturn [{\n json: {\n Result: deletion_success ? 'Done' : 'Error',\n Notes: deletion_results.map(json => json.service + ': ' + json.message).join('\\n'),\n Processed: new Date().toISOString()\n }\n}];" }, "typeVersion": 1 }, { "name": "Crypto", "type": "n8n-nodes-base.crypto", "position": [ 1560, 200 ], "parameters": { "type": "SHA256", "value": "={{$node[\"Set\"].json[\"email\"]}}", "dataPropertyName": "Email Hash" }, "typeVersion": 1 }, { "name": "Respond to Slack", "type": "n8n-nodes-base.httpRequest", "position": [ 2000, 200 ], "parameters": { "url": "={{$node[\"Receive Slash Command\"].json[\"body\"][\"response_url\"]}}", "options": {}, "requestMethod": "POST", "responseFormat": "string", "bodyParametersUi": { "parameter": [ { "name": "text", "value": "=GDPR data deletion process finished.\nStatus: {{$node[\"Prepare Log Entry\"].json[\"Result\"] == \"Done\" ? \":white_check_mark: OK\" : \":x: Error\"}}\nLog: <https://airtable.com/app3wAXUUwalhapFV/tbljkxW55l2Gq7Fzq/viwOJdJM1taITEaPr/{{$node[\"Airtable\"].json[\"id\"]}}?blocks=hide|View in Airtable>" }, { "name": "delete_original", "value": "true" } ] } }, "typeVersion": 1 } ], "connections": { "Set": { "main": [ [ { "node": "Read Command", "type": "main", "index": 0 } ] ] }, "Crypto": { "main": [ [ { "node": "Airtable", "type": "main", "index": 0 } ] ] }, "Airtable": { "main": [ [ { "node": "Respond to Slack", "type": "main", "index": 0 } ] ] }, "Acknowledge": { "main": [ [ { "node": "Paddle Data Deletion", "type": "main", "index": 0 } ] ] }, "Empty Email?": { "main": [ [ { "node": "Missing Email Error", "type": "main", "index": 0 } ], [ { "node": "Acknowledge", "type": "main", "index": 0 } ] ] }, "Read Command": { "main": [ [ { "node": "Empty Email?", "type": "main", "index": 0 } ], null, null, [ { "node": "Wrong Command Error", "type": "main", "index": 0 } ] ] }, "Valid Token?": { "main": [ [ { "node": "Set", "type": "main", "index": 0 } ], [ { "node": "Reject", "type": "main", "index": 0 } ] ] }, "Prepare Log Entry": { "main": [ [ { "node": "Crypto", "type": "main", "index": 0 } ] ] }, "Paddle Data Deletion": { "main": [ [ { "node": "Customer.io Data Deletion", "type": "main", "index": 0 } ] ] }, "Receive Slash Command": { "main": [ [ { "node": "Valid Token?", "type": "main", "index": 0 } ] ] }, "Zendesk Data Deletion": { "main": [ [ { "node": "Prepare Log Entry", "type": "main", "index": 0 } ] ] }, "Customer.io Data Deletion": { "main": [ [ { "node": "Zendesk Data Deletion", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"Receive Slash Command\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 240,\n 100\n ],\n \"webhookId\": \"3c0d3820-5896-41c5-83bf-1cd5e956c32c\",\n \"parameters\": {\n \"path\": \"3c0d3820-5896-41c5-83bf-1cd5e956c32c\",\n \"options\": {},\n \"httpMethod\": \"POST\",\n \"responseMode\": \"responseNode\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Reject\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 680,\n 200\n ],\n \"parameters\": {\n \"options\": {\n \"responseCode\": 403\n },\n \"respondWith\": \"noData\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Set\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 680,\n 0\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"operation\",\n \"value\": \"={{$json[\\\"body\\\"][\\\"text\\\"].split(\\\" \\\")[0].toLowerCase()}}\"\n },\n {\n \"name\": \"email\",\n \"value\": \"={{$json[\\\"body\\\"][\\\"text\\\"].split(\\\" \\\")[1].toLowerCase()}}\"\n }\n ]\n },\n \"options\": {},\n \"keepOnlySet\": true\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Read Command\",\n \"type\": \"n8n-nodes-base.switch\",\n \"position\": [\n 900,\n 0\n ],\n \"parameters\": {\n \"rules\": {\n \"rules\": [\n {\n \"value2\": \"delete\"\n }\n ]\n },\n \"value1\": \"={{$json[\\\"operation\\\"]}}\",\n \"dataType\": \"string\",\n \"fallbackOutput\": 3\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Wrong Command Error\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1120,\n 100\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"json\",\n \"responseBody\": \"{\\n \\\"text\\\": \\\"Sorry, I didn't understand your command. You can request data deletion like so: `/gdpr delete <email>`.\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Acknowledge\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1340,\n 0\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"json\",\n \"responseBody\": \"{\\n \\\"text\\\": \\\"On it!\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Empty Email?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 1120,\n -100\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$json[\\\"email\\\"]}}\",\n \"operation\": \"isEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Missing Email Error\",\n \"type\": \"n8n-nodes-base.respondToWebhook\",\n \"position\": [\n 1340,\n -200\n ],\n \"parameters\": {\n \"options\": {},\n \"respondWith\": \"json\",\n \"responseBody\": \"{\\n \\\"text\\\": \\\"It looks like the user email address is missing. You can request data deletion like so: `/gdpr delete <email>`.\\\"\\n}\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Valid Token?\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 460,\n 100\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{$json[\\\"body\\\"][\\\"token\\\"]}}\",\n \"value2\": \"foo\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Paddle Data Deletion\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 1560,\n 0\n ],\n \"parameters\": {\n \"workflowId\": \"1231\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Customer.io Data Deletion\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 1780,\n 0\n ],\n \"parameters\": {\n \"workflowId\": \"1237\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Zendesk Data Deletion\",\n \"type\": \"n8n-nodes-base.executeWorkflow\",\n \"position\": [\n 2000,\n 0\n ],\n \"parameters\": {\n \"workflowId\": \"1240\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Airtable\",\n \"type\": \"n8n-nodes-base.airtable\",\n \"position\": [\n 1780,\n 200\n ],\n \"parameters\": {\n \"table\": \"Log\",\n \"options\": {},\n \"operation\": \"append\",\n \"application\": \"app3wAXUUwalhapFV\"\n },\n \"credentials\": {\n \"airtableApi\": {\n \"id\": \"12\",\n \"name\": \"mutedjam@n8n.io\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Prepare Log Entry\",\n \"type\": \"n8n-nodes-base.function\",\n \"position\": [\n 1340,\n 200\n ],\n \"parameters\": {\n \"functionCode\": \"let deletion_nodes = [\\n 'Paddle Data Deletion',\\n 'Customer.io Data Deletion',\\n 'Zendesk Data Deletion'\\n]\\n\\nconst deletion_results = deletion_nodes.map(node_name => $items(node_name)[0].json);\\nconst deletion_success = deletion_results.filter(json => json.success == true).length == deletion_nodes.length;\\n\\nreturn [{\\n json: {\\n Result: deletion_success ? 'Done' : 'Error',\\n Notes: deletion_results.map(json => json.service + ': ' + json.message).join('\\\\n'),\\n Processed: new Date().toISOString()\\n }\\n}];\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Crypto\",\n \"type\": \"n8n-nodes-base.crypto\",\n \"position\": [\n 1560,\n 200\n ],\n \"parameters\": {\n \"type\": \"SHA256\",\n \"value\": \"={{$node[\\\"Set\\\"].json[\\\"email\\\"]}}\",\n \"dataPropertyName\": \"Email Hash\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Respond to Slack\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 2000,\n 200\n ],\n \"parameters\": {\n \"url\": \"={{$node[\\\"Receive Slash Command\\\"].json[\\\"body\\\"][\\\"response_url\\\"]}}\",\n \"options\": {},\n \"requestMethod\": \"POST\",\n \"responseFormat\": \"string\",\n \"bodyParametersUi\": {\n \"parameter\": [\n {\n \"name\": \"text\",\n \"value\": \"=GDPR data deletion process finished.\\nStatus: {{$node[\\\"Prepare Log Entry\\\"].json[\\\"Result\\\"] == \\\"Done\\\" ? \\\":white_check_mark: OK\\\" : \\\":x: Error\\\"}}\\nLog: <https://airtable.com/app3wAXUUwalhapFV/tbljkxW55l2Gq7Fzq/viwOJdJM1taITEaPr/{{$node[\\\"Airtable\\\"].json[\\\"id\\\"]}}?blocks=hide|View in Airtable>\"\n },\n {\n \"name\": \"delete_original\",\n \"value\": \"true\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Set\": {\n \"main\": [\n [\n {\n \"node\": \"Read Command\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Crypto\": {\n \"main\": [\n [\n {\n \"node\": \"Airtable\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Airtable\": {\n \"main\": [\n [\n {\n \"node\": \"Respond to Slack\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Acknowledge\": {\n \"main\": [\n [\n {\n \"node\": \"Paddle Data Deletion\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Empty Email?\": {\n \"main\": [\n [\n {\n \"node\": \"Missing Email Error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Acknowledge\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Read Command\": {\n \"main\": [\n [\n {\n \"node\": \"Empty Email?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n null,\n null,\n [\n {\n \"node\": \"Wrong Command Error\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Valid Token?\": {\n \"main\": [\n [\n {\n \"node\": \"Set\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Reject\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Prepare Log Entry\": {\n \"main\": [\n [\n {\n \"node\": \"Crypto\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Paddle Data Deletion\": {\n \"main\": [\n [\n {\n \"node\": \"Customer.io Data Deletion\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Receive Slash Command\": {\n \"main\": [\n [\n {\n \"node\": \"Valid Token?\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Zendesk Data Deletion\": {\n \"main\": [\n [\n {\n \"node\": \"Prepare Log Entry\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Customer.io Data Deletion\": {\n \"main\": [\n [\n {\n \"node\": \"Zendesk Data Deletion\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
57
0
1
false
combined_workflows.json
{ "input": "This workflow automates the process of deleting user data in response to a Slack command, verifying the request, and logging the outcome.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 5926, "processed_size": 5926, "processed_timestamp": "2025-04-09T03:08:39.795499", "timestamp": "2025-04-09T02:37:55.192105", "token_count": 3322, "tokens": 553, "workflow_chunk_info": { "is_truncated": false, "original_size": 5926, "processed_size": 5926, "workflow_hash": "5b80d2af24dea540011d2ebb6b118610" }, "workflow_hash": "5b80d2af24dea540011d2ebb6b118610" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: The workflow's goal is to automatically create or update Jira tickets from Splunk alerts. Analyze this workflow: ```json { "id": "uD31xU0VYjogxWoY", "meta": { "instanceId": "03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8" }, "name": "Create_Unique_Jira_tickets_from_Splunk_alerts", "tags": [ { "id": "GCHVocImoXoEVnzP", "name": "πŸ› οΈ In progress", "createdAt": "2023-10-31T02:17:21.618Z", "updatedAt": "2023-10-31T02:17:21.618Z" }, { "id": "QPJKatvLSxxtrE8U", "name": "Secops", "createdAt": "2023-10-31T02:15:11.396Z", "updatedAt": "2023-10-31T02:15:11.396Z" } ], "nodes": [ { "id": "3f9fa220-1966-4478-b7db-c39056564c9d", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ -640, 320 ], "webhookId": "f2a52578-2fef-40a6-a7ff-e03f6b751a02", "parameters": { "path": "f2a52578-2fef-40a6-a7ff-e03f6b751a02", "options": {}, "httpMethod": "POST" }, "typeVersion": 1 }, { "id": "375ac47e-7975-45cb-b7c1-cef1c7fca701", "name": "Add Ticket Comment", "type": "n8n-nodes-base.jira", "position": [ 240, 520 ], "parameters": { "comment": "=Timestamp: {{ $('Set Host Name').item.json.body.timestamp }}\nDescription: {{ $('Set Host Name').item.json.body.description }}", "options": {}, "issueKey": "={{ $json.key }}", "resource": "issueComment" }, "credentials": { "jiraSoftwareCloudApi": { "id": "OYvpDV2Q42eY6iyA", "name": "Alex Jira Cloud" } }, "typeVersion": 1 }, { "id": "a5dea875-6adf-4d18-aeb9-5fe31a0ebfae", "name": "Search Ticket", "type": "n8n-nodes-base.jira", "position": [ -200, 320 ], "parameters": { "options": { "jql": "=splunkhostname ~ \"{{ $json['splunk-host-name'] }}\" " }, "operation": "getAll" }, "credentials": { "jiraSoftwareCloudApi": { "id": "OYvpDV2Q42eY6iyA", "name": "Alex Jira Cloud" } }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "3dac410e-1e37-463d-9aba-bc6abf3889f7", "name": "Set Host Name", "type": "n8n-nodes-base.set", "position": [ -420, 320 ], "parameters": { "values": { "string": [ { "name": "splunk-host-name", "value": "={{ $json.body.inputs.A.key['host.name'].replace(/[^a-zA-Z0-9 ]/g, '') }}" } ] }, "options": {} }, "typeVersion": 2 }, { "id": "465ec3b0-dd16-482e-b4b6-f8ed91fbb11b", "name": "IF Ticket Not Exists", "type": "n8n-nodes-base.if", "position": [ 20, 320 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $json.key }}", "operation": "isEmpty" } ] } }, "typeVersion": 1 }, { "id": "1315b76b-39fc-4fd3-9a45-a91e5e873874", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1120, -26.960531840248223 ], "parameters": { "width": 643.8620281403546, "height": 537.944771288002, "content": "![VirusTotal](https://i.imgur.com/spMd6AQ.png)\n## Webhook Node \nTo setup your webhook integration for Splunk, first ensure that splunk is setup to send alerts to a webhook by visiting the [Setup Guide here](https://docs.splunk.com/observability/en/admin/notif-services/webhook.html). You will copy the n8n webhook url opening the webhook node below. \n- **Form Access URLs**:\n - **Execute Mode**: `https://n8n.domain.com/webhook/test/webhookpath` - Use this to execute the workflow interactively within the n8n canvas. Hit the 'Execute Workflow' button to see real-time execution results. We have pinned data in the webhook node to make testing easier. \n - **Silent Mode**: `https://n8n.domain.com/webhook/webhookpath` - Use this for background execution without canvas updates. Results will be logged silently and can be reviewed in the 'Executions' tab." }, "typeVersion": 1 }, { "id": "636425b9-a11f-4891-aa00-2f3c42956c01", "name": "Create Ticket", "type": "n8n-nodes-base.jira", "position": [ 240, 160 ], "parameters": { "project": { "__rl": true, "mode": "list", "value": "10001", "cachedResultName": "Service Desk" }, "summary": "=Splunk Alert for host {{ $('Set Host Name').item.json.body.inputs.A.key[\"host.name\"] }}: {{ $('Set Host Name').item.json.body.description }}", "issueType": { "__rl": true, "mode": "list", "value": "10004", "cachedResultName": "[System] Incident" }, "additionalFields": { "description": "={{ $('Set Host Name').item.json.body.description }}\n\n{{ $('Set Host Name').item.json.body.messageBody }}", "customFieldsUi": { "customFieldsValues": [ { "fieldId": { "__rl": true, "mode": "id", "value": "customfield_10063" }, "fieldValue": "={{ $('Webhook').item.json[\"body\"][\"inputs\"][\"A\"][\"key\"][\"host.name\"].replace(/[^a-zA-Z0-9 ]/g, '') }}" } ] } } }, "credentials": { "jiraSoftwareCloudApi": { "id": "OYvpDV2Q42eY6iyA", "name": "Alex Jira Cloud" } }, "typeVersion": 1 }, { "id": "47af8bdb-e0da-4923-8f0a-05deb86ac1b3", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -460, 98.72468966845895 ], "parameters": { "width": 401.99970102055784, "height": 413.43480804607805, "content": "![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\n## Normalize Hostname \nTo ensure no special characters are passed into jira and create issues, this set node removes special characters from the `splunk-host-name` and uses that to search and create tickets. This host name is saved as a custom field. " }, "typeVersion": 1 }, { "id": "c0bf09e6-ca08-4db6-aff0-a6528a8fb03b", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 180, -21.934709587377256 ], "parameters": { "width": 401.99970102055784, "height": 348.38243930996134, "content": "![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\n## Create a new ticket\nThis creates a new ticket in your Prjoect and issue type. Ensure to update these values to ensure it works correctly. " }, "typeVersion": 1 }, { "id": "a175e343-83ed-4442-94df-7e7027b8c687", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 180, 340 ], "parameters": { "width": 401.99970102055784, "height": 341.08777742613927, "content": "![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\n## Add Ticket Comment\nThis adds the alert as a comment in the existing ticket, to ensure the data is not duplicated. " }, "typeVersion": 1 }, { "id": "09143b8c-a4ce-4791-8937-3333d24b6e01", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -40, 100.50445897107033 ], "parameters": { "width": 193.6032856277124, "height": 415.27445353029793, "content": "## Check if ticket found\nThis checks `$json.key` to see if the value was found, and route accordingly." }, "typeVersion": 1 } ], "active": false, "pinData": { "Webhook": [ { "json": { "body": { "tip": null, "rule": "n8n-test", "inputs": { "A": { "key": { "os.type": "linux", "host.name": "n8n-enterprise-demo", "sf_metric": "cpu.utilization" }, "value": "0.1670342357065173", "fragment": "data('cpu.utilization').publish(label='A')" }, "_S2": { "value": "0.2", "fragment": "threshold(0.2)" } }, "status": "ok", "detector": "n8n-test", "imageUrl": "https://static.eu0.signalfx.com/signed/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjb20uc2lnbmFsZnguYXBwIiwiZXhwIjoxNjk0NjE0NjI2LCJpSWQiOiJGNVZBcTEwQUVBQSIsIm9JZCI6IkY1V0JKZ2lBSUFBIiwiYlQiOiJlbmQifQ.udzyF5-HqKyV_EMRmT51EtgECK9g-wanl8nx_MH0i9Q/async", "severity": "Critical", "eventType": "F5Vx1EuAAKc__F5V-TcTAEJ8__n8n-test", "sf_schema": 2, "timestamp": "2023-09-06T14:17:00Z", "detectorId": "F5V-TcTAEJ8", "incidentId": "F5VAq10AEAA", "runbookUrl": null, "description": "The value of cpu.utilization is above 0.2.", "detectorUrl": "https://app.eu0.signalfx.com/#/detector/F5V-TcTAEJ8/edit?incidentId=F5VAq10AEAA&is=ok", "messageBody": "Rule \"n8n-test\" in detector \"n8n-
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"uD31xU0VYjogxWoY\",\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"name\": \"Create_Unique_Jira_tickets_from_Splunk_alerts\",\n \"tags\": [\n {\n \"id\": \"GCHVocImoXoEVnzP\",\n \"name\": \"πŸ› οΈ In progress\",\n \"createdAt\": \"2023-10-31T02:17:21.618Z\",\n \"updatedAt\": \"2023-10-31T02:17:21.618Z\"\n },\n {\n \"id\": \"QPJKatvLSxxtrE8U\",\n \"name\": \"Secops\",\n \"createdAt\": \"2023-10-31T02:15:11.396Z\",\n \"updatedAt\": \"2023-10-31T02:15:11.396Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"3f9fa220-1966-4478-b7db-c39056564c9d\",\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n -640,\n 320\n ],\n \"webhookId\": \"f2a52578-2fef-40a6-a7ff-e03f6b751a02\",\n \"parameters\": {\n \"path\": \"f2a52578-2fef-40a6-a7ff-e03f6b751a02\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"375ac47e-7975-45cb-b7c1-cef1c7fca701\",\n \"name\": \"Add Ticket Comment\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 240,\n 520\n ],\n \"parameters\": {\n \"comment\": \"=Timestamp: {{ $('Set Host Name').item.json.body.timestamp }}\\nDescription: {{ $('Set Host Name').item.json.body.description }}\",\n \"options\": {},\n \"issueKey\": \"={{ $json.key }}\",\n \"resource\": \"issueComment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"OYvpDV2Q42eY6iyA\",\n \"name\": \"Alex Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5dea875-6adf-4d18-aeb9-5fe31a0ebfae\",\n \"name\": \"Search Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n -200,\n 320\n ],\n \"parameters\": {\n \"options\": {\n \"jql\": \"=splunkhostname ~ \\\"{{ $json['splunk-host-name'] }}\\\" \"\n },\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"OYvpDV2Q42eY6iyA\",\n \"name\": \"Alex Jira Cloud\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"3dac410e-1e37-463d-9aba-bc6abf3889f7\",\n \"name\": \"Set Host Name\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -420,\n 320\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"splunk-host-name\",\n \"value\": \"={{ $json.body.inputs.A.key['host.name'].replace(/[^a-zA-Z0-9 ]/g, '') }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"465ec3b0-dd16-482e-b4b6-f8ed91fbb11b\",\n \"name\": \"IF Ticket Not Exists\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 20,\n 320\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.key }}\",\n \"operation\": \"isEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1315b76b-39fc-4fd3-9a45-a91e5e873874\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1120,\n -26.960531840248223\n ],\n \"parameters\": {\n \"width\": 643.8620281403546,\n \"height\": 537.944771288002,\n \"content\": \"![VirusTotal](https://i.imgur.com/spMd6AQ.png)\\n## Webhook Node \\nTo setup your webhook integration for Splunk, first ensure that splunk is setup to send alerts to a webhook by visiting the [Setup Guide here](https://docs.splunk.com/observability/en/admin/notif-services/webhook.html). You will copy the n8n webhook url opening the webhook node below. \\n- **Form Access URLs**:\\n - **Execute Mode**: `https://n8n.domain.com/webhook/test/webhookpath` - Use this to execute the workflow interactively within the n8n canvas. Hit the 'Execute Workflow' button to see real-time execution results. We have pinned data in the webhook node to make testing easier. \\n - **Silent Mode**: `https://n8n.domain.com/webhook/webhookpath` - Use this for background execution without canvas updates. Results will be logged silently and can be reviewed in the 'Executions' tab.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"636425b9-a11f-4891-aa00-2f3c42956c01\",\n \"name\": \"Create Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 240,\n 160\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Service Desk\"\n },\n \"summary\": \"=Splunk Alert for host {{ $('Set Host Name').item.json.body.inputs.A.key[\\\"host.name\\\"] }}: {{ $('Set Host Name').item.json.body.description }}\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10004\",\n \"cachedResultName\": \"[System] Incident\"\n },\n \"additionalFields\": {\n \"description\": \"={{ $('Set Host Name').item.json.body.description }}\\n\\n{{ $('Set Host Name').item.json.body.messageBody }}\",\n \"customFieldsUi\": {\n \"customFieldsValues\": [\n {\n \"fieldId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"customfield_10063\"\n },\n \"fieldValue\": \"={{ $('Webhook').item.json[\\\"body\\\"][\\\"inputs\\\"][\\\"A\\\"][\\\"key\\\"][\\\"host.name\\\"].replace(/[^a-zA-Z0-9 ]/g, '') }}\"\n }\n ]\n }\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"OYvpDV2Q42eY6iyA\",\n \"name\": \"Alex Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"47af8bdb-e0da-4923-8f0a-05deb86ac1b3\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -460,\n 98.72468966845895\n ],\n \"parameters\": {\n \"width\": 401.99970102055784,\n \"height\": 413.43480804607805,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\\n## Normalize Hostname \\nTo ensure no special characters are passed into jira and create issues, this set node removes special characters from the `splunk-host-name` and uses that to search and create tickets. This host name is saved as a custom field. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c0bf09e6-ca08-4db6-aff0-a6528a8fb03b\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 180,\n -21.934709587377256\n ],\n \"parameters\": {\n \"width\": 401.99970102055784,\n \"height\": 348.38243930996134,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\\n## Create a new ticket\\nThis creates a new ticket in your Prjoect and issue type. Ensure to update these values to ensure it works correctly. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a175e343-83ed-4442-94df-7e7027b8c687\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 180,\n 340\n ],\n \"parameters\": {\n \"width\": 401.99970102055784,\n \"height\": 341.08777742613927,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\\n## Add Ticket Comment\\nThis adds the alert as a comment in the existing ticket, to ensure the data is not duplicated. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"09143b8c-a4ce-4791-8937-3333d24b6e01\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -40,\n 100.50445897107033\n ],\n \"parameters\": {\n \"width\": 193.6032856277124,\n \"height\": 415.27445353029793,\n \"content\": \"## Check if ticket found\\nThis checks `$json.key` to see if the value was found, and route accordingly.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {\n \"Webhook\": [\n {\n \"json\": {\n \"body\": {\n \"tip\": null,\n \"rule\": \"n8n-test\",\n \"inputs\": {\n \"A\": {\n \"key\": {\n \"os.type\": \"linux\",\n \"host.name\": \"n8n-enterprise-demo\",\n \"sf_metric\": \"cpu.utilization\"\n },\n \"value\": \"0.1670342357065173\",\n \"fragment\": \"data('cpu.utilization').publish(label='A')\"\n },\n \"_S2\": {\n \"value\": \"0.2\",\n \"fragment\": \"threshold(0.2)\"\n }\n },\n \"status\": \"ok\",\n \"detector\": \"n8n-test\",\n \"imageUrl\": \"https://static.eu0.signalfx.com/signed/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjb20uc2lnbmFsZnguYXBwIiwiZXhwIjoxNjk0NjE0NjI2LCJpSWQiOiJGNVZBcTEwQUVBQSIsIm9JZCI6IkY1V0JKZ2lBSUFBIiwiYlQiOiJlbmQifQ.udzyF5-HqKyV_EMRmT51EtgECK9g-wanl8nx_MH0i9Q/async\",\n \"severity\": \"Critical\",\n \"eventType\": \"F5Vx1EuAAKc__F5V-TcTAEJ8__n8n-test\",\n \"sf_schema\": 2,\n \"timestamp\": \"2023-09-06T14:17:00Z\",\n \"detectorId\": \"F5V-TcTAEJ8\",\n \"incidentId\": \"F5VAq10AEAA\",\n \"runbookUrl\": null,\n \"description\": \"The value of cpu.utilization is above 0.2.\",\n \"detectorUrl\": \"https://app.eu0.signalfx.com/#/detector/F5V-TcTAEJ8/edit?incidentId=F5VAq10AEAA&is=ok\",\n \"messageBody\": \"Rule \\\"n8n-test\\\" in detector \\\"n8n-test\\\" cleared at Wed, 6 Sep 2023 14:17:00 GMT.\\n\\nCurrent signal value for n8n.test: 0.1670342357065173\\n\\nSignal details:\\n{sf_metric=cpu.utilization, host.name=n8n-enterprise-demo, os.type=linux}\",\n \"messageTitle\": \"Back to normal: n8n-test (n8n-test)\",\n \"statusExtended\": \"ok\",\n \"detectOnCondition\": \"when(A > threshold(0.2))\",\n \"originatingMetric\": \"cpu.utilization\",\n \"triggeredWhileMuted\": false\n },\n \"query\": {},\n \"params\": {},\n \"headers\": {\n \"host\": \"internal.users.n8n.cloud\",\n \"x-real-ip\": \"10.255.0.2\",\n \"user-agent\": \"Apache-HttpClient/4.5.14 (Java/1.8.0_372)\",\n \"content-type\": \"application/json; charset=utf-8\",\n \"content-length\": \"1366\",\n \"accept-encoding\": \"gzip,deflate\",\n \"x-forwarded-for\": \"10.255.0.2\",\n \"x-forwarded-host\": \"internal.users.n8n.cloud\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\",\n \"x-forwarded-server\": \"e591fa1c2d01\"\n }\n }\n }\n ]\n },\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"3985cac2-7f23-4d27-b826-0edfb0544b58\",\n \"connections\": {\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Set Host Name\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"IF Ticket Not Exists\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Host Name\": {\n \"main\": [\n [\n {\n \"node\": \"Search Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF Ticket Not Exists\": {\n \"main\": [\n [\n {\n \"node\": \"Create Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Add Ticket Comment\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
58
0
2
true
combined_workflows.json
{ "input": "The workflow's goal is to automatically create or update Jira tickets from Splunk alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8846, "processed_size": 8846, "processed_timestamp": "2025-04-09T03:08:39.856499", "timestamp": "2025-04-09T02:37:55.193104", "token_count": 4095, "tokens": 743, "workflow_chunk_info": { "is_truncated": false, "original_size": 8846, "processed_size": 8846, "workflow_hash": "7c8f21526d94eae9b06a74c86a9451b3" }, "workflow_hash": "7c8f21526d94eae9b06a74c86a9451b3" }
AAKc__F5V-TcTAEJ8__n8n-test", "sf_schema": 2, "timestamp": "2023-09-06T14:17:00Z", "detectorId": "F5V-TcTAEJ8", "incidentId": "F5VAq10AEAA", "runbookUrl": null, "description": "The value of cpu.utilization is above 0.2.", "detectorUrl": "https://app.eu0.signalfx.com/#/detector/F5V-TcTAEJ8/edit?incidentId=F5VAq10AEAA&is=ok", "messageBody": "Rule \"n8n-test\" in detector \"n8n-test\" cleared at Wed, 6 Sep 2023 14:17:00 GMT.\n\nCurrent signal value for n8n.test: 0.1670342357065173\n\nSignal details:\n{sf_metric=cpu.utilization, host.name=n8n-enterprise-demo, os.type=linux}", "messageTitle": "Back to normal: n8n-test (n8n-test)", "statusExtended": "ok", "detectOnCondition": "when(A > threshold(0.2))", "originatingMetric": "cpu.utilization", "triggeredWhileMuted": false }, "query": {}, "params": {}, "headers": { "host": "internal.users.n8n.cloud", "x-real-ip": "10.255.0.2", "user-agent": "Apache-HttpClient/4.5.14 (Java/1.8.0_372)", "content-type": "application/json; charset=utf-8", "content-length": "1366", "accept-encoding": "gzip,deflate", "x-forwarded-for": "10.255.0.2", "x-forwarded-host": "internal.users.n8n.cloud", "x-forwarded-port": "443", "x-forwarded-proto": "https", "x-forwarded-server": "e591fa1c2d01" } } } ] }, "settings": { "executionOrder": "v1" }, "versionId": "3985cac2-7f23-4d27-b826-0edfb0544b58", "connections": { "Webhook": { "main": [ [ { "node": "Set Host Name", "type": "main", "index": 0 } ] ] }, "Search Ticket": { "main": [ [ { "node": "IF Ticket Not Exists", "type": "main", "index": 0 } ] ] }, "Set Host Name": { "main": [ [ { "node": "Search Ticket", "type": "main", "index": 0 } ] ] }, "IF Ticket Not Exists": { "main": [ [ { "node": "Create Ticket", "type": "main", "index": 0 } ], [ { "node": "Add Ticket Comment", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"uD31xU0VYjogxWoY\",\n \"meta\": {\n \"instanceId\": \"03e9d14e9196363fe7191ce21dc0bb17387a6e755dcc9acc4f5904752919dca8\"\n },\n \"name\": \"Create_Unique_Jira_tickets_from_Splunk_alerts\",\n \"tags\": [\n {\n \"id\": \"GCHVocImoXoEVnzP\",\n \"name\": \"πŸ› οΈ In progress\",\n \"createdAt\": \"2023-10-31T02:17:21.618Z\",\n \"updatedAt\": \"2023-10-31T02:17:21.618Z\"\n },\n {\n \"id\": \"QPJKatvLSxxtrE8U\",\n \"name\": \"Secops\",\n \"createdAt\": \"2023-10-31T02:15:11.396Z\",\n \"updatedAt\": \"2023-10-31T02:15:11.396Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"3f9fa220-1966-4478-b7db-c39056564c9d\",\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n -640,\n 320\n ],\n \"webhookId\": \"f2a52578-2fef-40a6-a7ff-e03f6b751a02\",\n \"parameters\": {\n \"path\": \"f2a52578-2fef-40a6-a7ff-e03f6b751a02\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"375ac47e-7975-45cb-b7c1-cef1c7fca701\",\n \"name\": \"Add Ticket Comment\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 240,\n 520\n ],\n \"parameters\": {\n \"comment\": \"=Timestamp: {{ $('Set Host Name').item.json.body.timestamp }}\\nDescription: {{ $('Set Host Name').item.json.body.description }}\",\n \"options\": {},\n \"issueKey\": \"={{ $json.key }}\",\n \"resource\": \"issueComment\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"OYvpDV2Q42eY6iyA\",\n \"name\": \"Alex Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a5dea875-6adf-4d18-aeb9-5fe31a0ebfae\",\n \"name\": \"Search Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n -200,\n 320\n ],\n \"parameters\": {\n \"options\": {\n \"jql\": \"=splunkhostname ~ \\\"{{ $json['splunk-host-name'] }}\\\" \"\n },\n \"operation\": \"getAll\"\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"OYvpDV2Q42eY6iyA\",\n \"name\": \"Alex Jira Cloud\"\n }\n },\n \"typeVersion\": 1,\n \"alwaysOutputData\": true\n },\n {\n \"id\": \"3dac410e-1e37-463d-9aba-bc6abf3889f7\",\n \"name\": \"Set Host Name\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -420,\n 320\n ],\n \"parameters\": {\n \"values\": {\n \"string\": [\n {\n \"name\": \"splunk-host-name\",\n \"value\": \"={{ $json.body.inputs.A.key['host.name'].replace(/[^a-zA-Z0-9 ]/g, '') }}\"\n }\n ]\n },\n \"options\": {}\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"465ec3b0-dd16-482e-b4b6-f8ed91fbb11b\",\n \"name\": \"IF Ticket Not Exists\",\n \"type\": \"n8n-nodes-base.if\",\n \"position\": [\n 20,\n 320\n ],\n \"parameters\": {\n \"conditions\": {\n \"string\": [\n {\n \"value1\": \"={{ $json.key }}\",\n \"operation\": \"isEmpty\"\n }\n ]\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"1315b76b-39fc-4fd3-9a45-a91e5e873874\",\n \"name\": \"Sticky Note\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1120,\n -26.960531840248223\n ],\n \"parameters\": {\n \"width\": 643.8620281403546,\n \"height\": 537.944771288002,\n \"content\": \"![VirusTotal](https://i.imgur.com/spMd6AQ.png)\\n## Webhook Node \\nTo setup your webhook integration for Splunk, first ensure that splunk is setup to send alerts to a webhook by visiting the [Setup Guide here](https://docs.splunk.com/observability/en/admin/notif-services/webhook.html). You will copy the n8n webhook url opening the webhook node below. \\n- **Form Access URLs**:\\n - **Execute Mode**: `https://n8n.domain.com/webhook/test/webhookpath` - Use this to execute the workflow interactively within the n8n canvas. Hit the 'Execute Workflow' button to see real-time execution results. We have pinned data in the webhook node to make testing easier. \\n - **Silent Mode**: `https://n8n.domain.com/webhook/webhookpath` - Use this for background execution without canvas updates. Results will be logged silently and can be reviewed in the 'Executions' tab.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"636425b9-a11f-4891-aa00-2f3c42956c01\",\n \"name\": \"Create Ticket\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 240,\n 160\n ],\n \"parameters\": {\n \"project\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10001\",\n \"cachedResultName\": \"Service Desk\"\n },\n \"summary\": \"=Splunk Alert for host {{ $('Set Host Name').item.json.body.inputs.A.key[\\\"host.name\\\"] }}: {{ $('Set Host Name').item.json.body.description }}\",\n \"issueType\": {\n \"__rl\": true,\n \"mode\": \"list\",\n \"value\": \"10004\",\n \"cachedResultName\": \"[System] Incident\"\n },\n \"additionalFields\": {\n \"description\": \"={{ $('Set Host Name').item.json.body.description }}\\n\\n{{ $('Set Host Name').item.json.body.messageBody }}\",\n \"customFieldsUi\": {\n \"customFieldsValues\": [\n {\n \"fieldId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"customfield_10063\"\n },\n \"fieldValue\": \"={{ $('Webhook').item.json[\\\"body\\\"][\\\"inputs\\\"][\\\"A\\\"][\\\"key\\\"][\\\"host.name\\\"].replace(/[^a-zA-Z0-9 ]/g, '') }}\"\n }\n ]\n }\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"OYvpDV2Q42eY6iyA\",\n \"name\": \"Alex Jira Cloud\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"47af8bdb-e0da-4923-8f0a-05deb86ac1b3\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -460,\n 98.72468966845895\n ],\n \"parameters\": {\n \"width\": 401.99970102055784,\n \"height\": 413.43480804607805,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\\n## Normalize Hostname \\nTo ensure no special characters are passed into jira and create issues, this set node removes special characters from the `splunk-host-name` and uses that to search and create tickets. This host name is saved as a custom field. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"c0bf09e6-ca08-4db6-aff0-a6528a8fb03b\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 180,\n -21.934709587377256\n ],\n \"parameters\": {\n \"width\": 401.99970102055784,\n \"height\": 348.38243930996134,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\\n## Create a new ticket\\nThis creates a new ticket in your Prjoect and issue type. Ensure to update these values to ensure it works correctly. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"a175e343-83ed-4442-94df-7e7027b8c687\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 180,\n 340\n ],\n \"parameters\": {\n \"width\": 401.99970102055784,\n \"height\": 341.08777742613927,\n \"content\": \"![VirusTotal](https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Jira_%28Software%29_logo.svg/320px-Jira_%28Software%29_logo.svg.png)\\n## Add Ticket Comment\\nThis adds the alert as a comment in the existing ticket, to ensure the data is not duplicated. \"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"09143b8c-a4ce-4791-8937-3333d24b6e01\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -40,\n 100.50445897107033\n ],\n \"parameters\": {\n \"width\": 193.6032856277124,\n \"height\": 415.27445353029793,\n \"content\": \"## Check if ticket found\\nThis checks `$json.key` to see if the value was found, and route accordingly.\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {\n \"Webhook\": [\n {\n \"json\": {\n \"body\": {\n \"tip\": null,\n \"rule\": \"n8n-test\",\n \"inputs\": {\n \"A\": {\n \"key\": {\n \"os.type\": \"linux\",\n \"host.name\": \"n8n-enterprise-demo\",\n \"sf_metric\": \"cpu.utilization\"\n },\n \"value\": \"0.1670342357065173\",\n \"fragment\": \"data('cpu.utilization').publish(label='A')\"\n },\n \"_S2\": {\n \"value\": \"0.2\",\n \"fragment\": \"threshold(0.2)\"\n }\n },\n \"status\": \"ok\",\n \"detector\": \"n8n-test\",\n \"imageUrl\": \"https://static.eu0.signalfx.com/signed/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjb20uc2lnbmFsZnguYXBwIiwiZXhwIjoxNjk0NjE0NjI2LCJpSWQiOiJGNVZBcTEwQUVBQSIsIm9JZCI6IkY1V0JKZ2lBSUFBIiwiYlQiOiJlbmQifQ.udzyF5-HqKyV_EMRmT51EtgECK9g-wanl8nx_MH0i9Q/async\",\n \"severity\": \"Critical\",\n \"eventType\": \"F5Vx1EuAAKc__F5V-TcTAEJ8__n8n-test\",\n \"sf_schema\": 2,\n \"timestamp\": \"2023-09-06T14:17:00Z\",\n \"detectorId\": \"F5V-TcTAEJ8\",\n \"incidentId\": \"F5VAq10AEAA\",\n \"runbookUrl\": null,\n \"description\": \"The value of cpu.utilization is above 0.2.\",\n \"detectorUrl\": \"https://app.eu0.signalfx.com/#/detector/F5V-TcTAEJ8/edit?incidentId=F5VAq10AEAA&is=ok\",\n \"messageBody\": \"Rule \\\"n8n-test\\\" in detector \\\"n8n-test\\\" cleared at Wed, 6 Sep 2023 14:17:00 GMT.\\n\\nCurrent signal value for n8n.test: 0.1670342357065173\\n\\nSignal details:\\n{sf_metric=cpu.utilization, host.name=n8n-enterprise-demo, os.type=linux}\",\n \"messageTitle\": \"Back to normal: n8n-test (n8n-test)\",\n \"statusExtended\": \"ok\",\n \"detectOnCondition\": \"when(A > threshold(0.2))\",\n \"originatingMetric\": \"cpu.utilization\",\n \"triggeredWhileMuted\": false\n },\n \"query\": {},\n \"params\": {},\n \"headers\": {\n \"host\": \"internal.users.n8n.cloud\",\n \"x-real-ip\": \"10.255.0.2\",\n \"user-agent\": \"Apache-HttpClient/4.5.14 (Java/1.8.0_372)\",\n \"content-type\": \"application/json; charset=utf-8\",\n \"content-length\": \"1366\",\n \"accept-encoding\": \"gzip,deflate\",\n \"x-forwarded-for\": \"10.255.0.2\",\n \"x-forwarded-host\": \"internal.users.n8n.cloud\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\",\n \"x-forwarded-server\": \"e591fa1c2d01\"\n }\n }\n }\n ]\n },\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"3985cac2-7f23-4d27-b826-0edfb0544b58\",\n \"connections\": {\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Set Host Name\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search Ticket\": {\n \"main\": [\n [\n {\n \"node\": \"IF Ticket Not Exists\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Set Host Name\": {\n \"main\": [\n [\n {\n \"node\": \"Search Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"IF Ticket Not Exists\": {\n \"main\": [\n [\n {\n \"node\": \"Create Ticket\",\n \"type\": \"main\",\n \"index\": 0\n }\n ],\n [\n {\n \"node\": \"Add Ticket Comment\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
58
1
2
true
combined_workflows.json
{ "input": "The workflow's goal is to automatically create or update Jira tickets from Splunk alerts.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 8846, "processed_size": 8846, "processed_timestamp": "2025-04-09T03:08:39.859496", "timestamp": "2025-04-09T02:37:55.193104", "token_count": 997, "tokens": 743, "workflow_chunk_info": { "is_truncated": false, "original_size": 8846, "processed_size": 8846, "workflow_hash": "7c8f21526d94eae9b06a74c86a9451b3" }, "workflow_hash": "7c8f21526d94eae9b06a74c86a9451b3" }
<s>[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow automates incident management by integrating PagerDuty, Jira, and Mattermost. It handles incident acknowledgement and resolution, updating statuses in PagerDuty and Jira, and sending notifications to Mattermost channels. Analyze this workflow: ```json { "nodes": [ { "name": "Ack", "type": "n8n-nodes-base.webhook", "position": [ -160, 1440 ], "webhookId": "d3025d6c-5956-439e-9c9a-db3ef524a24f", "parameters": { "path": "/ack", "options": {}, "httpMethod": "POST" }, "typeVersion": 1 }, { "name": "Resolve", "type": "n8n-nodes-base.webhook", "position": [ 120, 1880 ], "webhookId": "92d7ddfa-20f9-49bc-976e-4f6c76c0b3b4", "parameters": { "path": "/resolve", "options": {}, "httpMethod": "POST" }, "typeVersion": 1 }, { "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 60, 1040 ], "webhookId": "9888d896-dd23-4e97-9d16-c12055b64133", "parameters": { "path": "9888d896-dd23-4e97-9d16-c12055b64133", "options": {}, "httpMethod": "POST" }, "typeVersion": 1 }, { "name": "Jira1", "type": "n8n-nodes-base.jira", "position": [ 680, 1040 ], "parameters": { "project": "10016", "summary": "={{$node[\"Webhook\"].json[\"body\"][\"event\"][\"data\"][\"title\"]}}", "issueType": "10007", "additionalFields": { "assignee": "qwertz12345" } }, "credentials": { "jiraSoftwareCloudApi": { "id": "64", "name": "Jira SW Cloud account" } }, "typeVersion": 1 }, { "name": "Jira2", "type": "n8n-nodes-base.jira", "position": [ 540, 1880 ], "parameters": { "issueKey": "={{$node[\"Resolve\"].json[\"body\"][\"context\"][\"jira_key\"]}}", "operation": "update", "updateFields": { "statusId": "31" } }, "credentials": { "jiraSoftwareCloudApi": { "id": "64", "name": "Jira SW Cloud account" } }, "typeVersion": 1 }, { "name": "PagerDuty1", "type": "n8n-nodes-base.pagerDuty", "position": [ 60, 1440 ], "parameters": { "email": "address@mail.com", "resource": "incident", "operation": "update", "incidentId": "={{$json[\"body\"][\"context\"][\"pagerduty_incident\"]}}", "updateFields": { "status": "acknowledged" }, "authentication": "apiToken", "conferenceBridgeUi": {} }, "credentials": { "pagerDutyApi": { "id": "65", "name": "PagerDuty account" } }, "typeVersion": 1 }, { "name": "PagerDuty2", "type": "n8n-nodes-base.pagerDuty", "position": [ 340, 1880 ], "parameters": { "email": "address@mail.com", "resource": "incident", "operation": "update", "incidentId": "={{$json[\"body\"][\"context\"][\"pagerduty_incident\"]}}", "updateFields": { "status": "resolved" }, "authentication": "apiToken", "conferenceBridgeUi": {} }, "credentials": { "pagerDutyApi": { "id": "65", "name": "PagerDuty account" } }, "typeVersion": 1 }, { "name": "Mattermost5", "type": "n8n-nodes-base.mattermost", "position": [ 300, 1440 ], "parameters": { "message": "πŸ’ͺ🏼 Incident status has been changed to Acknowledged on PagerDuty.", "channelId": "={{$node[\"Ack\"].json[\"body\"][\"channel_id\"]}}", "attachments": [], "otherOptions": {} }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Mattermost6", "type": "n8n-nodes-base.mattermost", "position": [ 760, 1760 ], "parameters": { "message": "πŸ’ͺ This issue got closed in PagerDuty and Jira.", "channelId": "={{$node[\"Resolve\"].json[\"body\"][\"channel_id\"]}}", "attachments": [], "otherOptions": {} }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Mattermost4", "type": "n8n-nodes-base.mattermost", "position": [ 900, 1180 ], "parameters": { "message": "=⚠️ {{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"log_entries\"][0][\"incident\"][\"summary\"]}}\nPagerDuty incident: {{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"log_entries\"][0][\"incident\"][\"html_url\"]}}\nJira issue: https://n8n.atlassian.net/browse/{{$json[\"key\"]}}", "channelId": "={{$node[\"Mattermost1\"].json[\"id\"]}}", "attachments": [ { "actions": { "item": [ { "name": "Acknowledge", "type": "button", "options": {}, "data_source": "custom", "integration": { "item": { "url": "https://username.app.n8n.cloud/webhook/ack", "context": { "property": [ { "name": "pagerduty_incident", "value": "={{ $node[\"Webhook\"].json[\"body\"][\"event\"][\"data\"][\"id\"] }}" } ] } } } }, { "name": "Resolve", "type": "button", "options": {}, "data_source": "custom", "integration": { "item": { "url": "https://username.app.n8n.cloud/webhook/resolve", "context": { "property": [ { "name": "jira_key", "value": "={{$json[\"key\"]}}" }, { "name": "pagerduty_incident", "value": "={{ $node[\"Webhook\"].json[\"body\"][\"event\"][\"data\"][\"id\"] }}" } ] } } } } ] } } ], "otherOptions": {} }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Mattermost3", "type": "n8n-nodes-base.mattermost", "position": [ 900, 940 ], "parameters": { "message": "=🚨 New incident: \nAuxiliary Channel -> https://mattermost.internal.n8n.io/test/channels/{{$node[\"Mattermost1\"].json[\"name\"]}}\nPagerDuty Incident -> {{$node[\"Webhook\"].json[\"body\"][\"event\"][\"data\"][\"html_url\"]}}\nJira Issue -> https://n8n.atlassian.net/browse/{{$json[\"key\"]}}", "channelId": "qwertz12345", "attachments": [], "otherOptions": {} }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Mattermost2", "type": "n8n-nodes-base.mattermost", "position": [ 480, 1040 ], "parameters": { "userId": "qwertz12345", "resource": "channel", "channelId": "={{$json[\"id\"]}}", "operation": "addUser" }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Mattermost1", "type": "n8n-nodes-base.mattermost", "position": [ 280, 1040 ], "parameters": { "teamId": "qwertz12345", "channel": "={{$json[\"body\"][\"event\"][\"data\"][\"incident_key\"]}}", "resource": "channel", "displayName": "={{$json[\"body\"][\"event\"][\"data\"][\"title\"]}}" }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 }, { "name": "Mattermost7", "type": "n8n-nodes-base.mattermost", "position": [ 760, 1980 ], "parameters": { "message": "=πŸŽ‰ The incident ({{$node[\"PagerDuty2\"].json[\"summary\"]}}) was resolved by the lovely folks in the on-call team!", "channelId": "qwertz12345", "attachments": [], "otherOptions": {} }, "credentials": { "mattermostApi": { "id": "61", "name": "Mattermost account" } }, "typeVersion": 1 } ], "connections": { "Ack": { "main": [ [ { "node": "PagerDuty1", "type": "main", "index": 0 } ] ] }, "Jira1": { "main": [ [ { "node": "Mattermost3", "type": "main", "index": 0 }, { "node": "Mattermost4", "type": "main", "index": 0 } ] ] }, "Jira2": { "main": [ [ { "node": "Mattermost6", "type": "main", "index": 0 }, { "node": "Mattermost7", "type": "main", "index": 0 } ] ] }, "Resolve": { "main": [ [ { "node": "PagerDuty2", "type": "main", "index": 0 } ] ] }, "Webhook": { "main": [ [ { "node": "Mattermost1", "type": "main", "index": 0 } ] ] }, "PagerDuty1": { "main": [ [ { "node": "Mattermost5", "type": "main", "index": 0 } ] ] }, "PagerDuty2": { "main": [ [ { "node": "Jira2", "type": "main", "index": 0 } ] ] }, "Mattermost1": { "main": [ [ { "node": "Mattermost2", "type": "main", "index": 0 } ] ] }, "Mattermost2": { "main": [ [ { "node": "Jira1", "type": "main", "index": 0 } ] ] } } } ``` [/INST]Here's the analysis of the workflow functionality: Generate the n8n workflow JSON based on the user's request.</s>
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"nodes\": [\n {\n \"name\": \"Ack\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n -160,\n 1440\n ],\n \"webhookId\": \"d3025d6c-5956-439e-9c9a-db3ef524a24f\",\n \"parameters\": {\n \"path\": \"/ack\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Resolve\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 120,\n 1880\n ],\n \"webhookId\": \"92d7ddfa-20f9-49bc-976e-4f6c76c0b3b4\",\n \"parameters\": {\n \"path\": \"/resolve\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Webhook\",\n \"type\": \"n8n-nodes-base.webhook\",\n \"position\": [\n 60,\n 1040\n ],\n \"webhookId\": \"9888d896-dd23-4e97-9d16-c12055b64133\",\n \"parameters\": {\n \"path\": \"9888d896-dd23-4e97-9d16-c12055b64133\",\n \"options\": {},\n \"httpMethod\": \"POST\"\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Jira1\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 680,\n 1040\n ],\n \"parameters\": {\n \"project\": \"10016\",\n \"summary\": \"={{$node[\\\"Webhook\\\"].json[\\\"body\\\"][\\\"event\\\"][\\\"data\\\"][\\\"title\\\"]}}\",\n \"issueType\": \"10007\",\n \"additionalFields\": {\n \"assignee\": \"qwertz12345\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"64\",\n \"name\": \"Jira SW Cloud account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Jira2\",\n \"type\": \"n8n-nodes-base.jira\",\n \"position\": [\n 540,\n 1880\n ],\n \"parameters\": {\n \"issueKey\": \"={{$node[\\\"Resolve\\\"].json[\\\"body\\\"][\\\"context\\\"][\\\"jira_key\\\"]}}\",\n \"operation\": \"update\",\n \"updateFields\": {\n \"statusId\": \"31\"\n }\n },\n \"credentials\": {\n \"jiraSoftwareCloudApi\": {\n \"id\": \"64\",\n \"name\": \"Jira SW Cloud account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"PagerDuty1\",\n \"type\": \"n8n-nodes-base.pagerDuty\",\n \"position\": [\n 60,\n 1440\n ],\n \"parameters\": {\n \"email\": \"address@mail.com\",\n \"resource\": \"incident\",\n \"operation\": \"update\",\n \"incidentId\": \"={{$json[\\\"body\\\"][\\\"context\\\"][\\\"pagerduty_incident\\\"]}}\",\n \"updateFields\": {\n \"status\": \"acknowledged\"\n },\n \"authentication\": \"apiToken\",\n \"conferenceBridgeUi\": {}\n },\n \"credentials\": {\n \"pagerDutyApi\": {\n \"id\": \"65\",\n \"name\": \"PagerDuty account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"PagerDuty2\",\n \"type\": \"n8n-nodes-base.pagerDuty\",\n \"position\": [\n 340,\n 1880\n ],\n \"parameters\": {\n \"email\": \"address@mail.com\",\n \"resource\": \"incident\",\n \"operation\": \"update\",\n \"incidentId\": \"={{$json[\\\"body\\\"][\\\"context\\\"][\\\"pagerduty_incident\\\"]}}\",\n \"updateFields\": {\n \"status\": \"resolved\"\n },\n \"authentication\": \"apiToken\",\n \"conferenceBridgeUi\": {}\n },\n \"credentials\": {\n \"pagerDutyApi\": {\n \"id\": \"65\",\n \"name\": \"PagerDuty account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost5\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 300,\n 1440\n ],\n \"parameters\": {\n \"message\": \"πŸ’ͺ🏼 Incident status has been changed to Acknowledged on PagerDuty.\",\n \"channelId\": \"={{$node[\\\"Ack\\\"].json[\\\"body\\\"][\\\"channel_id\\\"]}}\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost6\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 760,\n 1760\n ],\n \"parameters\": {\n \"message\": \"πŸ’ͺ This issue got closed in PagerDuty and Jira.\",\n \"channelId\": \"={{$node[\\\"Resolve\\\"].json[\\\"body\\\"][\\\"channel_id\\\"]}}\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost4\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 900,\n 1180\n ],\n \"parameters\": {\n \"message\": \"=⚠️ {{$node[\\\"Webhook\\\"].json[\\\"body\\\"][\\\"messages\\\"][0][\\\"log_entries\\\"][0][\\\"incident\\\"][\\\"summary\\\"]}}\\nPagerDuty incident: {{$node[\\\"Webhook\\\"].json[\\\"body\\\"][\\\"messages\\\"][0][\\\"log_entries\\\"][0][\\\"incident\\\"][\\\"html_url\\\"]}}\\nJira issue: https://n8n.atlassian.net/browse/{{$json[\\\"key\\\"]}}\",\n \"channelId\": \"={{$node[\\\"Mattermost1\\\"].json[\\\"id\\\"]}}\",\n \"attachments\": [\n {\n \"actions\": {\n \"item\": [\n {\n \"name\": \"Acknowledge\",\n \"type\": \"button\",\n \"options\": {},\n \"data_source\": \"custom\",\n \"integration\": {\n \"item\": {\n \"url\": \"https://username.app.n8n.cloud/webhook/ack\",\n \"context\": {\n \"property\": [\n {\n \"name\": \"pagerduty_incident\",\n \"value\": \"={{ $node[\\\"Webhook\\\"].json[\\\"body\\\"][\\\"event\\\"][\\\"data\\\"][\\\"id\\\"] }}\"\n }\n ]\n }\n }\n }\n },\n {\n \"name\": \"Resolve\",\n \"type\": \"button\",\n \"options\": {},\n \"data_source\": \"custom\",\n \"integration\": {\n \"item\": {\n \"url\": \"https://username.app.n8n.cloud/webhook/resolve\",\n \"context\": {\n \"property\": [\n {\n \"name\": \"jira_key\",\n \"value\": \"={{$json[\\\"key\\\"]}}\"\n },\n {\n \"name\": \"pagerduty_incident\",\n \"value\": \"={{ $node[\\\"Webhook\\\"].json[\\\"body\\\"][\\\"event\\\"][\\\"data\\\"][\\\"id\\\"] }}\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n ],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost3\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 900,\n 940\n ],\n \"parameters\": {\n \"message\": \"=🚨 New incident: \\nAuxiliary Channel -> https://mattermost.internal.n8n.io/test/channels/{{$node[\\\"Mattermost1\\\"].json[\\\"name\\\"]}}\\nPagerDuty Incident -> {{$node[\\\"Webhook\\\"].json[\\\"body\\\"][\\\"event\\\"][\\\"data\\\"][\\\"html_url\\\"]}}\\nJira Issue -> https://n8n.atlassian.net/browse/{{$json[\\\"key\\\"]}}\",\n \"channelId\": \"qwertz12345\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost2\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 480,\n 1040\n ],\n \"parameters\": {\n \"userId\": \"qwertz12345\",\n \"resource\": \"channel\",\n \"channelId\": \"={{$json[\\\"id\\\"]}}\",\n \"operation\": \"addUser\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost1\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 280,\n 1040\n ],\n \"parameters\": {\n \"teamId\": \"qwertz12345\",\n \"channel\": \"={{$json[\\\"body\\\"][\\\"event\\\"][\\\"data\\\"][\\\"incident_key\\\"]}}\",\n \"resource\": \"channel\",\n \"displayName\": \"={{$json[\\\"body\\\"][\\\"event\\\"][\\\"data\\\"][\\\"title\\\"]}}\"\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n },\n {\n \"name\": \"Mattermost7\",\n \"type\": \"n8n-nodes-base.mattermost\",\n \"position\": [\n 760,\n 1980\n ],\n \"parameters\": {\n \"message\": \"=πŸŽ‰ The incident ({{$node[\\\"PagerDuty2\\\"].json[\\\"summary\\\"]}}) was resolved by the lovely folks in the on-call team!\",\n \"channelId\": \"qwertz12345\",\n \"attachments\": [],\n \"otherOptions\": {}\n },\n \"credentials\": {\n \"mattermostApi\": {\n \"id\": \"61\",\n \"name\": \"Mattermost account\"\n }\n },\n \"typeVersion\": 1\n }\n ],\n \"connections\": {\n \"Ack\": {\n \"main\": [\n [\n {\n \"node\": \"PagerDuty1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Jira1\": {\n \"main\": [\n [\n {\n \"node\": \"Mattermost3\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Mattermost4\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Jira2\": {\n \"main\": [\n [\n {\n \"node\": \"Mattermost6\",\n \"type\": \"main\",\n \"index\": 0\n },\n {\n \"node\": \"Mattermost7\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Resolve\": {\n \"main\": [\n [\n {\n \"node\": \"PagerDuty2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Webhook\": {\n \"main\": [\n [\n {\n \"node\": \"Mattermost1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"PagerDuty1\": {\n \"main\": [\n [\n {\n \"node\": \"Mattermost5\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"PagerDuty2\": {\n \"main\": [\n [\n {\n \"node\": \"Jira2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Mattermost1\": {\n \"main\": [\n [\n {\n \"node\": \"Mattermost2\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Mattermost2\": {\n \"main\": [\n [\n {\n \"node\": \"Jira1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
59
0
1
false
combined_workflows.json
{ "input": "This workflow automates incident management by integrating PagerDuty, Jira, and Mattermost. It handles incident acknowledgement and resolution, updating statuses in PagerDuty and Jira, and sending notifications to Mattermost channels.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 6893, "processed_size": 6893, "processed_timestamp": "2025-04-09T03:08:39.877496", "timestamp": "2025-04-09T02:37:56.471833", "token_count": 3945, "tokens": 525, "workflow_chunk_info": { "is_truncated": false, "original_size": 6893, "processed_size": 6893, "workflow_hash": "07e1cd2564627385f8f8e18db850f9a4" }, "workflow_hash": "07e1cd2564627385f8f8e18db850f9a4" }
[INST] You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality. Generate the n8n workflow JSON based on the user's request. Input Context: This workflow detects anomalies in crop images by comparing a new image's similarity to a database of known crop images. Analyze this workflow: ```json { "id": "G8jRDBvwsMkkMiLN", "meta": { "instanceId": "205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa" }, "name": "[3/3] Anomaly detection tool (crops dataset)", "tags": [ { "id": "spMntyrlE9ydvWFA", "name": "anomaly-detection", "createdAt": "2024-12-08T22:05:15.945Z", "updatedAt": "2024-12-09T12:50:19.287Z" } ], "nodes": [ { "id": "e01bafec-eb24-44c7-b3c4-a60f91666350", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -1200, 180 ], "parameters": { "color": 6, "width": 400, "height": 740, "content": "We are working here with crops dataset: \nExisting (so not anomalies) crops images in dataset are:\n- 'pearl_millet(bajra)',\n- 'tobacco-plant',\n- 'cherry',\n- 'cotton',\n- 'banana',\n- 'cucumber',\n- 'maize',\n- 'wheat',\n- 'clove',\n- 'jowar',\n- 'olive-tree',\n- 'soyabean',\n- 'coffee-plant',\n- 'rice',\n- 'lemon',\n- 'mustard-oil',\n- 'vigna-radiati(mung)',\n- 'coconut',\n- 'gram',\n- 'pineapple',\n- 'sugarcane',\n- 'sunflower',\n- 'chilli',\n- 'fox_nut(makhana)',\n- 'jute',\n- 'papaya',\n- 'tea',\n- 'cardamom',\n- 'almond'\n" }, "typeVersion": 1 }, { "id": "b9943781-de1f-4129-9b81-ed836e9ebb11", "name": "Embed image", "type": "n8n-nodes-base.httpRequest", "position": [ 680, 60 ], "parameters": { "url": "https://api.voyageai.com/v1/multimodalembeddings", "method": "POST", "options": {}, "jsonBody": "={{\n{\n \"inputs\": [\n {\n \"content\": [\n {\n \"type\": \"image_url\",\n \"image_url\": $('Image URL hardcode').first().json.imageURL\n }\n ]\n }\n ],\n \"model\": \"voyage-multimodal-3\",\n \"input_type\": \"document\"\n}\n}}", "sendBody": true, "specifyBody": "json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth" }, "credentials": { "httpHeaderAuth": { "id": "Vb0RNVDnIHmgnZOP", "name": "Voyage API" } }, "typeVersion": 4.2 }, { "id": "47b72bc2-4817-48c6-b517-c1328e402468", "name": "Get similarity of medoids", "type": "n8n-nodes-base.httpRequest", "position": [ 940, 60 ], "parameters": { "url": "={{ $('Variables for medoids').first().json.qdrantCloudURL }}/collections/{{ $('Variables for medoids').first().json.collectionName }}/points/query", "method": "POST", "options": {}, "jsonBody": "={{\n{\n \"query\": $json.data[0].embedding,\n \"using\": \"voyage\",\n \"limit\": $('Info About Crop Labeled Clusters').first().json.cropsNumber,\n \"with_payload\": true,\n \"filter\": {\n \"must\": [\n { \n \"key\": $('Variables for medoids').first().json.clusterCenterType,\n \"match\": {\n \"value\": true\n }\n }\n ]\n }\n}\n}}", "sendBody": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "nodeCredentialType": "qdrantApi" }, "credentials": { "qdrantApi": { "id": "it3j3hP9FICqhgX6", "name": "QdrantApi account" } }, "typeVersion": 4.2 }, { "id": "42d7eb27-ec38-4406-b5c4-27eb45358e93", "name": "Compare scores", "type": "n8n-nodes-base.code", "position": [ 1140, 60 ], "parameters": { "language": "python", "pythonCode": "points = _input.first()['json']['result']['points']\nthreshold_type = _('Variables for medoids').first()['json']['clusterThresholdCenterType']\n\nmax_score = -1\ncrop_with_max_score = None\nundefined = True\n\nfor center in points:\n if center['score'] >= center['payload'][threshold_type]:\n undefined = False\n if center['score'] > max_score:\n max_score = center['score']\n crop_with_max_score = center['payload']['crop_name']\n\nif undefined:\n result_message = \"ALERT, we might have a new undefined crop!\"\nelse:\n result_message = f\"Looks similar to {crop_with_max_score}\"\n\nreturn [{\n \"json\": {\n \"result\": result_message\n }\n}]\n" }, "typeVersion": 2 }, { "id": "23aa604a-ff0b-4948-bcd5-af39300198c0", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -1200, -220 ], "parameters": { "width": 400, "height": 380, "content": "## Crop Anomaly Detection Tool\n### This is the tool that can be used directly for anomalous crops detection. \nIt takes as input (any) **image URL** and returns a **text message** telling if whatever this image depicts is anomalous to the crop dataset stored in Qdrant. \n\n* An Image URL is received via the Execute Workflow Trigger which is used to generate embedding vectors via the Voyage.ai Embeddings API.\n* The returned vectors are used to query the Qdrant collection to determine if the given crop is known by comparing it to **threshold scores** of each image class (crop type).\n* If the image scores lower than all thresholds, then the image is considered an anomaly for the dataset." }, "typeVersion": 1 }, { "id": "3a79eca2-44f9-4aee-8a0d-9c7ca2f9149d", "name": "Variables for medoids", "type": "n8n-nodes-base.set", "position": [ -200, 60 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "dbbc1e7b-c63e-4ff1-9524-8ef3e9f6cd48", "name": "clusterCenterType", "type": "string", "value": "is_medoid" }, { "id": "a994ce37-2530-4030-acfb-ec777a7ddb05", "name": "qdrantCloudURL", "type": "string", "value": "https://152bc6e2-832a-415c-a1aa-fb529f8baf8d.eu-central-1-0.aws.cloud.qdrant.io" }, { "id": "12f0a9e6-686d-416e-a61b-72d034ec21ba", "name": "collectionName", "type": "string", "value": "=agricultural-crops" }, { "id": "4c88a617-d44f-4776-b457-8a1dffb1d03c", "name": "clusterThresholdCenterType", "type": "string", "value": "is_medoid_cluster_threshold" } ] } }, "typeVersion": 3.4 }, { "id": "13b25434-bd66-4293-93f1-26c67b9ec7dd", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -340, 260 ], "parameters": { "color": 6, "width": 360, "height": 200, "content": "**clusterCenterType** - either\n* \"is_text_anchor_medoid\" or\n* \"is_medoid\"\n\n\n**clusterThresholdCenterType** - either\n* \"is_text_anchor_medoid_cluster_threshold\" or\n* \"is_medoid_cluster_threshold\"" }, "typeVersion": 1 }, { "id": "869b0962-6cae-487d-8230-539a0cc4c14c", "name": "Info About Crop Labeled Clusters", "type": "n8n-nodes-base.set", "position": [ 440, 60 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "5327b254-b703-4a34-a398-f82edb1d6d6b", "name": "=cropsNumber", "type": "number", "value": "={{ $json.result.hits.length }}" } ] } }, "typeVersion": 3.4 }, { "id": "5d3956f8-f43b-439e-b176-a594a21d8011", "name": "Total Points in Collection", "type": "n8n-nodes-base.httpRequest", "position": [ 40, 60 ], "parameters": { "url": "={{ $json.qdrantCloudURL }}/collections/{{ $json.collectionName }}/points/count", "method": "POST", "options": {}, "jsonBody": "={\n \"exact\": true\n}", "sendBody": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "nodeCredentialType": "qdrantApi" }, "credentials": { "qdrantApi": { "id": "it3j3hP9FICqhgX6", "name": "QdrantApi account" } }, "typeVersion": 4.2 }, { "id": "14ba3db9-3965-4b20-b333-145616d45c3a", "name": "Each Crop Counts", "type": "n8n-nodes-base.httpRequest", "position": [ 240, 60 ], "parameters": { "url": "={{ $('Variables for medoids').first().json.qdrantCloudURL }}/collections/{{ $('Variables for medoids').first().json.collectionName }}/facet", "method": "POST", "options": {}, "jsonBody": "={{\n{\n \"key\": \"crop_name\",\n \"limit\": $json.result.count,\n \"exact\": true\n}\n}}", "sendBody": true, "specifyBody": "json", "authentication": "predefinedCredentialType", "nodeCredentialType": "qdrantApi" }, "credentials": { "qdrantApi": { "id": "it3j3hP9FICqhgX6", "name": "QdrantApi account" } }, "typeVersion": 4.2 }, { "id": "e37c6758-0556-4a56-ab14-d4df663cb53a", "name": "Image URL hardcode", "type": "n8n-nodes-base.set", "position": [ -480, 60 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "46ceba40-fb25-450c-8550-d43d8b8aa94c", "name": "imageURL", "type": "string", "value": "={{ $json.query.imageURL }}" } ] } }, "typeVersion": 3.4 }, { "id": "b24ad1a7-0cf8-4acc-9c18-6fe9d58b10f2", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ -720, 60 ], "parameters": {}, "typeVersion": 1 }, { "id": "50424f2b-6831-41bf-8de4-81f69d901ce1", "name": "Sticky Note2",
[ { "content": "You are an expert in analyzing and understanding n8n workflows. Provide clear and accurate descriptions of workflow functionality.", "role": "system" }, { "content": "Generate the n8n workflow JSON based on the user's request.\n\nWorkflow JSON:\n```json\n{\n \"id\": \"G8jRDBvwsMkkMiLN\",\n \"meta\": {\n \"instanceId\": \"205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa\"\n },\n \"name\": \"[3/3] Anomaly detection tool (crops dataset)\",\n \"tags\": [\n {\n \"id\": \"spMntyrlE9ydvWFA\",\n \"name\": \"anomaly-detection\",\n \"createdAt\": \"2024-12-08T22:05:15.945Z\",\n \"updatedAt\": \"2024-12-09T12:50:19.287Z\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"e01bafec-eb24-44c7-b3c4-a60f91666350\",\n \"name\": \"Sticky Note1\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1200,\n 180\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 400,\n \"height\": 740,\n \"content\": \"We are working here with crops dataset: \\nExisting (so not anomalies) crops images in dataset are:\\n- 'pearl_millet(bajra)',\\n- 'tobacco-plant',\\n- 'cherry',\\n- 'cotton',\\n- 'banana',\\n- 'cucumber',\\n- 'maize',\\n- 'wheat',\\n- 'clove',\\n- 'jowar',\\n- 'olive-tree',\\n- 'soyabean',\\n- 'coffee-plant',\\n- 'rice',\\n- 'lemon',\\n- 'mustard-oil',\\n- 'vigna-radiati(mung)',\\n- 'coconut',\\n- 'gram',\\n- 'pineapple',\\n- 'sugarcane',\\n- 'sunflower',\\n- 'chilli',\\n- 'fox_nut(makhana)',\\n- 'jute',\\n- 'papaya',\\n- 'tea',\\n- 'cardamom',\\n- 'almond'\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"b9943781-de1f-4129-9b81-ed836e9ebb11\",\n \"name\": \"Embed image\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 680,\n 60\n ],\n \"parameters\": {\n \"url\": \"https://api.voyageai.com/v1/multimodalembeddings\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={{\\n{\\n \\\"inputs\\\": [\\n {\\n \\\"content\\\": [\\n {\\n \\\"type\\\": \\\"image_url\\\",\\n \\\"image_url\\\": $('Image URL hardcode').first().json.imageURL\\n }\\n ]\\n }\\n ],\\n \\\"model\\\": \\\"voyage-multimodal-3\\\",\\n \\\"input_type\\\": \\\"document\\\"\\n}\\n}}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpHeaderAuth\"\n },\n \"credentials\": {\n \"httpHeaderAuth\": {\n \"id\": \"Vb0RNVDnIHmgnZOP\",\n \"name\": \"Voyage API\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"47b72bc2-4817-48c6-b517-c1328e402468\",\n \"name\": \"Get similarity of medoids\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 940,\n 60\n ],\n \"parameters\": {\n \"url\": \"={{ $('Variables for medoids').first().json.qdrantCloudURL }}/collections/{{ $('Variables for medoids').first().json.collectionName }}/points/query\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={{\\n{\\n \\\"query\\\": $json.data[0].embedding,\\n \\\"using\\\": \\\"voyage\\\",\\n \\\"limit\\\": $('Info About Crop Labeled Clusters').first().json.cropsNumber,\\n \\\"with_payload\\\": true,\\n \\\"filter\\\": {\\n \\\"must\\\": [\\n { \\n \\\"key\\\": $('Variables for medoids').first().json.clusterCenterType,\\n \\\"match\\\": {\\n \\\"value\\\": true\\n }\\n }\\n ]\\n }\\n}\\n}}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"qdrantApi\"\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"it3j3hP9FICqhgX6\",\n \"name\": \"QdrantApi account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"42d7eb27-ec38-4406-b5c4-27eb45358e93\",\n \"name\": \"Compare scores\",\n \"type\": \"n8n-nodes-base.code\",\n \"position\": [\n 1140,\n 60\n ],\n \"parameters\": {\n \"language\": \"python\",\n \"pythonCode\": \"points = _input.first()['json']['result']['points']\\nthreshold_type = _('Variables for medoids').first()['json']['clusterThresholdCenterType']\\n\\nmax_score = -1\\ncrop_with_max_score = None\\nundefined = True\\n\\nfor center in points:\\n if center['score'] >= center['payload'][threshold_type]:\\n undefined = False\\n if center['score'] > max_score:\\n max_score = center['score']\\n crop_with_max_score = center['payload']['crop_name']\\n\\nif undefined:\\n result_message = \\\"ALERT, we might have a new undefined crop!\\\"\\nelse:\\n result_message = f\\\"Looks similar to {crop_with_max_score}\\\"\\n\\nreturn [{\\n \\\"json\\\": {\\n \\\"result\\\": result_message\\n }\\n}]\\n\"\n },\n \"typeVersion\": 2\n },\n {\n \"id\": \"23aa604a-ff0b-4948-bcd5-af39300198c0\",\n \"name\": \"Sticky Note4\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -1200,\n -220\n ],\n \"parameters\": {\n \"width\": 400,\n \"height\": 380,\n \"content\": \"## Crop Anomaly Detection Tool\\n### This is the tool that can be used directly for anomalous crops detection. \\nIt takes as input (any) **image URL** and returns a **text message** telling if whatever this image depicts is anomalous to the crop dataset stored in Qdrant. \\n\\n* An Image URL is received via the Execute Workflow Trigger which is used to generate embedding vectors via the Voyage.ai Embeddings API.\\n* The returned vectors are used to query the Qdrant collection to determine if the given crop is known by comparing it to **threshold scores** of each image class (crop type).\\n* If the image scores lower than all thresholds, then the image is considered an anomaly for the dataset.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"3a79eca2-44f9-4aee-8a0d-9c7ca2f9149d\",\n \"name\": \"Variables for medoids\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -200,\n 60\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"dbbc1e7b-c63e-4ff1-9524-8ef3e9f6cd48\",\n \"name\": \"clusterCenterType\",\n \"type\": \"string\",\n \"value\": \"is_medoid\"\n },\n {\n \"id\": \"a994ce37-2530-4030-acfb-ec777a7ddb05\",\n \"name\": \"qdrantCloudURL\",\n \"type\": \"string\",\n \"value\": \"https://152bc6e2-832a-415c-a1aa-fb529f8baf8d.eu-central-1-0.aws.cloud.qdrant.io\"\n },\n {\n \"id\": \"12f0a9e6-686d-416e-a61b-72d034ec21ba\",\n \"name\": \"collectionName\",\n \"type\": \"string\",\n \"value\": \"=agricultural-crops\"\n },\n {\n \"id\": \"4c88a617-d44f-4776-b457-8a1dffb1d03c\",\n \"name\": \"clusterThresholdCenterType\",\n \"type\": \"string\",\n \"value\": \"is_medoid_cluster_threshold\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"13b25434-bd66-4293-93f1-26c67b9ec7dd\",\n \"name\": \"Sticky Note3\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -340,\n 260\n ],\n \"parameters\": {\n \"color\": 6,\n \"width\": 360,\n \"height\": 200,\n \"content\": \"**clusterCenterType** - either\\n* \\\"is_text_anchor_medoid\\\" or\\n* \\\"is_medoid\\\"\\n\\n\\n**clusterThresholdCenterType** - either\\n* \\\"is_text_anchor_medoid_cluster_threshold\\\" or\\n* \\\"is_medoid_cluster_threshold\\\"\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"869b0962-6cae-487d-8230-539a0cc4c14c\",\n \"name\": \"Info About Crop Labeled Clusters\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n 440,\n 60\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"5327b254-b703-4a34-a398-f82edb1d6d6b\",\n \"name\": \"=cropsNumber\",\n \"type\": \"number\",\n \"value\": \"={{ $json.result.hits.length }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"5d3956f8-f43b-439e-b176-a594a21d8011\",\n \"name\": \"Total Points in Collection\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 40,\n 60\n ],\n \"parameters\": {\n \"url\": \"={{ $json.qdrantCloudURL }}/collections/{{ $json.collectionName }}/points/count\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={\\n \\\"exact\\\": true\\n}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"qdrantApi\"\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"it3j3hP9FICqhgX6\",\n \"name\": \"QdrantApi account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"14ba3db9-3965-4b20-b333-145616d45c3a\",\n \"name\": \"Each Crop Counts\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"position\": [\n 240,\n 60\n ],\n \"parameters\": {\n \"url\": \"={{ $('Variables for medoids').first().json.qdrantCloudURL }}/collections/{{ $('Variables for medoids').first().json.collectionName }}/facet\",\n \"method\": \"POST\",\n \"options\": {},\n \"jsonBody\": \"={{\\n{\\n \\\"key\\\": \\\"crop_name\\\",\\n \\\"limit\\\": $json.result.count,\\n \\\"exact\\\": true\\n}\\n}}\",\n \"sendBody\": true,\n \"specifyBody\": \"json\",\n \"authentication\": \"predefinedCredentialType\",\n \"nodeCredentialType\": \"qdrantApi\"\n },\n \"credentials\": {\n \"qdrantApi\": {\n \"id\": \"it3j3hP9FICqhgX6\",\n \"name\": \"QdrantApi account\"\n }\n },\n \"typeVersion\": 4.2\n },\n {\n \"id\": \"e37c6758-0556-4a56-ab14-d4df663cb53a\",\n \"name\": \"Image URL hardcode\",\n \"type\": \"n8n-nodes-base.set\",\n \"position\": [\n -480,\n 60\n ],\n \"parameters\": {\n \"options\": {},\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"46ceba40-fb25-450c-8550-d43d8b8aa94c\",\n \"name\": \"imageURL\",\n \"type\": \"string\",\n \"value\": \"={{ $json.query.imageURL }}\"\n }\n ]\n }\n },\n \"typeVersion\": 3.4\n },\n {\n \"id\": \"b24ad1a7-0cf8-4acc-9c18-6fe9d58b10f2\",\n \"name\": \"Execute Workflow Trigger\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"position\": [\n -720,\n 60\n ],\n \"parameters\": {},\n \"typeVersion\": 1\n },\n {\n \"id\": \"50424f2b-6831-41bf-8de4-81f69d901ce1\",\n \"name\": \"Sticky Note2\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -240,\n -80\n ],\n \"parameters\": {\n \"width\": 180,\n \"height\": 120,\n \"content\": \"Variables to access Qdrant's collection we uploaded & prepared for anomaly detection in 2 previous pipelines\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"2e8ed3ca-1bba-4214-b34b-376a237842ff\",\n \"name\": \"Sticky Note5\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 40,\n -120\n ],\n \"parameters\": {\n \"width\": 560,\n \"height\": 140,\n \"content\": \"These three nodes are needed just to figure out how many different classes (crops) we have in our Qdrant collection: **cropsNumber** (needed in *\\\"Get similarity of medoids\\\"* node. \\n[Note] *\\\"Total Points in Collection\\\"* -> *\\\"Each Crop Counts\\\"* were used&explained already in *\\\"[2/4] Set up medoids (2 types) for anomaly detection (crops dataset)\\\"* pipeline.\\n\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"e2fa5763-6e97-4ff5-8919-1cb85a3c6968\",\n \"name\": \"Sticky Note6\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 620,\n 240\n ],\n \"parameters\": {\n \"height\": 120,\n \"content\": \"Here, we're embedding the image passed to this workflow tool with the Voyage embedding model to compare the image to all crop images in the database.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"cdb6b8d3-f7f4-4d66-850f-ce16c8ed98b9\",\n \"name\": \"Sticky Note7\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n 920,\n 220\n ],\n \"parameters\": {\n \"width\": 400,\n \"height\": 180,\n \"content\": \"Checking how similar the image is to all the centres of clusters (crops).\\nIf it's more similar to the thresholds we set up and stored in centres in the previous workflow, the image probably belongs to this crop class; otherwise, it's anomalous to the class. \\nIf image is anomalous to all the classes, it's an anomaly.\"\n },\n \"typeVersion\": 1\n },\n {\n \"id\": \"03b4699f-ba43-4f5f-ad69-6f81deea2641\",\n \"name\": \"Sticky Note22\",\n \"type\": \"n8n-nodes-base.stickyNote\",\n \"position\": [\n -620,\n 580\n ],\n \"parameters\": {\n \"color\": 4,\n \"width\": 540,\n \"height\": 300,\n \"content\": \"### For anomaly detection\\n1. The first pipeline is uploading (crops) dataset to Qdrant's collection.\\n2. The second pipeline sets up cluster (class) centres in this Qdrant collection & cluster (class) threshold scores.\\n3. **This is the anomaly detection tool, which takes any image as input and uses all preparatory work done with Qdrant (crops) collection.**\\n\\n### To recreate it\\nYou'll have to upload [crops](https://www.kaggle.com/datasets/mdwaquarazam/agricultural-crops-image-classification) dataset from Kaggle to your own Google Storage bucket, and re-create APIs/connections to [Qdrant Cloud](https://qdrant.tech/documentation/quickstart-cloud/) (you can use **Free Tier** cluster), Voyage AI API & Google Cloud Storage\\n\\n**In general, pipelines are adaptable to any dataset of images**\\n\"\n },\n \"typeVersion\": 1\n }\n ],\n \"active\": false,\n \"pinData\": {\n \"Execute Workflow Trigger\": [\n {\n \"json\": {\n \"query\": {\n \"imageURL\": \"https://storage.googleapis.com/n8n-qdrant-demo/agricultural-crops%2Fcotton%2Fimage%20(36).jpg\"\n }\n }\n }\n ]\n },\n \"settings\": {\n \"executionOrder\": \"v1\"\n },\n \"versionId\": \"f67b764b-9e1a-4db0-b9f2-490077a62f74\",\n \"connections\": {\n \"Embed image\": {\n \"main\": [\n [\n {\n \"node\": \"Get similarity of medoids\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Each Crop Counts\": {\n \"main\": [\n [\n {\n \"node\": \"Info About Crop Labeled Clusters\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Image URL hardcode\": {\n \"main\": [\n [\n {\n \"node\": \"Variables for medoids\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Variables for medoids\": {\n \"main\": [\n [\n {\n \"node\": \"Total Points in Collection\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Execute Workflow Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Image URL hardcode\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get similarity of medoids\": {\n \"main\": [\n [\n {\n \"node\": \"Compare scores\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Total Points in Collection\": {\n \"main\": [\n [\n {\n \"node\": \"Each Crop Counts\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Info About Crop Labeled Clusters\": {\n \"main\": [\n [\n {\n \"node\": \"Embed image\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n }\n}\n```", "role": "user" }, { "content": "Generate the n8n workflow JSON based on the user's request.", "role": "assistant" } ]
60
0
2
true
combined_workflows.json
{ "input": "This workflow detects anomalies in crop images by comparing a new image's similarity to a database of known crop images.", "instruction": "Generate the n8n workflow JSON based on the user's request.", "is_truncated": false, "is_workflow": true, "model_specific": { "chat_template": true, "format_version": "1.0", "model": "mistral" }, "model_used": "models/gemini-2.0-flash-lite", "original_size": 11962, "processed_size": 11962, "processed_timestamp": "2025-04-09T03:08:39.958502", "timestamp": "2025-04-09T02:37:56.893447", "token_count": 4095, "tokens": 1128, "workflow_chunk_info": { "is_truncated": false, "original_size": 11962, "processed_size": 11962, "workflow_hash": "99b6cb39dc7dca3650ca856e55c8634a" }, "workflow_hash": "99b6cb39dc7dca3650ca856e55c8634a" }