Prompt: Create an n8n automation that handles general automation

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 8
- Node Types: n8n-nodes-base.mongoDbTool, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmChatOpenAi, @n8n/n8n-nodes-langchain.memoryBufferWindow, @n8n/n8n-nodes-langchain.toolWorkflow, n8n-nodes-base.stickyNote, @n8n/n8n-nodes-langchain.chatTrigger

**Logic Flow**:
1. **Trigger**: @n8n/n8n-nodes-langchain.chatTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "id": "22PddLUgcjSJbT1w",
  "meta": {
    "instanceId": "fa7d5e2425ec76075df7100dbafffed91cc6f71f12fe92614bf78af63c54a61d",
    "templateCredsSetupCompleted": true
  },
  "name": "MongoDB Agent",
  "tags": [],
  "nodes": [
    {
      "id": "d8c07efe-eca0-48cb-80e6-ea8117073c5f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1300,
        560
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "TreGPMKr9hrtCvVp",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "636de178-7b68-429a-9371-41cf2a950076",
      "name": "MongoDBAggregate",
      "type": "n8n-nodes-base.mongoDbTool",
      "position": [
        1640,
        540
      ],
      "parameters": {
        "query": "={{ $fromAI(\"pipeline\", \"The MongoDB pipeline to execute\" , \"string\" , [{\"$match\" : { \"rating\" : 5 } }])}}",
        "operation": "aggregate",
        "collection": "movies",
        "descriptionType": "manual",
        "toolDescription": "Get from AI the MongoDB Aggregation pipeline to get context based on the provided pipeline, the document structure of the documents is : {\n \"plot\": \"A group of bandits stage a brazen train hold-up, only to find a determined posse hot on their heels.\",\n \"genres\": [\n \"Short\",\n \"Western\"\n ],\n \"runtime\": 11,\n \"cast\": [\n \"A.C. Abadie\",\n \"Gilbert M. 'Broncho Billy' Anderson\",\n ...\n ],\n \"poster\": \"...jpg\",\n \"title\": \"The Great Train Robbery\",\n \"fullplot\": \"Among the earliest existing films in American cinema - notable as the ...\",\n \"languages\": [\n \"English\"\n ],\n \"released\": \"date\"\n },\n \"directors\": [\n \"Edwin S. Porter\"\n ],\n \"rated\": \"TV-G\",\n \"awards\": {\n \"wins\": 1,\n \"nominations\": 0,\n \"text\": \"1 win.\"\n },\n \"lastupdated\": \"2015-08-13 00:27:59.177000000\",\n \"year\": 1903,\n \"imdb\": {\n \"rating\": 7.4,"
      },
      "credentials": {
        "mongoDb": {
          "id": "8xGgiXzf2o0L4a0y",
          "name": "MongoDB account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "e0f248dc-22b7-40a2-a00e-6298b51e4470",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1500,
        540
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.2
    },
    {
      "id": "da27ee52-43db-4818-9844-3c0a064bf958",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1160,
        400
      ],
      "webhookId": "0730df2d-2f90-45e0-83dc-609668260fda",
      "parameters": {
        "mode": "webhook",
        "public": true,
        "options": {
          "allowedOrigins": "*"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "9ad79da9-3145-44be-9026-e37b0e856f5d",
      "name": "insertFavorite",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1860,
        520
      ],
      "parameters": {
        "name": "insertFavorites",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "6QuKnOrpusQVu66Q",
          "cachedResultName": "insertMongoDB"
        },
        "description": "=Use this tool only to add favorites with the structure of {\"title\" : \"recieved title\" }"
      },
      "typeVersion": 1.2
    },
    {
      "id": "4d7713d1-d2ad-48bf-971b-b86195e161ca",
      "name": "AI Agent - Movie Recommendation",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1380,
        300
      ],
      "parameters": {
        "text": "=Assistant for best movies context, you have tools to search using \"MongoDBAggregate\" and you need to provide a MongoDB aggregation pipeline code array as a \"query\" input param. User input and request: {{ $json.chatInput }}. Only when a user confirms a favorite movie use the insert favorite using the \"insertFavorite\" workflow tool of to insertFavorite as { \"title\" : \"<TITLE>\" }.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "2eac8aed-9677-4d89-bd76-456637f5b979",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        300
      ],
      "parameters": {
        "width": 216.0875923062025,
        "height": 499.89779507612025,
        "content": "## AI Agent powered by OpenAI and MongoDB \n\nThis flow is designed to work as an AI autonomous agent that can get chat messages, query data from MongoDB using the aggregation framework.\n\nFollowing by augmenting the results from the sample movies collection and allowing storing my favorite movies back to the database using an \"insert\" flow. "
      },
      "typeVersion": 1
    },
    {
      "id": "4d8130fe-4aed-4e09-9c1d-60fb9ac1a500",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        720
      ],
      "parameters": {
        "content": "## Process\n\nThe message is being processed by the \"Chat Model\" and the correct tool is used according to the message. "
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "879aab24-6346-435f-8fd4-3fca856ba64c",
  "connections": {
    "insertFavorite": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Movie Recommendation",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MongoDBAggregate": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Movie Recommendation",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Movie Recommendation",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Movie Recommendation",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent - Movie Recommendation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```


Prompt: How would you build: Supabase Insertion & Upsertion & Retrieval?

Response:
# Workflow Architecture

**Purpose**: Data Processing + Database

**Key Components**:
- Total Nodes: 21
- Node Types: n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmChatOpenAi, n8n-nodes-base.supabase, @n8n/n8n-nodes-langchain.chainRetrievalQa, @n8n/n8n-nodes-langchain.documentDefaultDataLoader, @n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter, @n8n/n8n-nodes-langchain.embeddingsOpenAi, @n8n/n8n-nodes-langchain.vectorStoreSupabase, n8n-nodes-base.stickyNote, @n8n/n8n-nodes-langchain.retrieverVectorStore

**Logic Flow**:
1. **Trigger**: @n8n/n8n-nodes-langchain.chatTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "meta": {
    "instanceId": "1a23006df50de49624f69e85993be557d137b6efe723a867a7d68a84e0b32704"
  },
  "nodes": [
    {
      "id": "54065cc9-047c-4741-95f6-cec3e352abd7",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2700,
        -1840
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "https://drive.google.com/file/d/xxxxxxxxxxxxxxx/view"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "62af57f5-a001-4174-bece-260a1fc595e8",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        3120,
        -1620
      ],
      "parameters": {
        "loader": "epubLoader",
        "options": {},
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "ce3d9c7c-6ce9-421a-b4d0-4235217cf8e6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2620,
        -2000
      ],
      "parameters": {
        "width": 749.1276349295781,
        "height": 820.5109034066329,
        "content": "# INSERTING\n\n- it's important to use the same embedding model when for any interaction with your vector database (inserting, upserting and retrieval)"
      },
      "typeVersion": 1
    },
    {
      "id": "81cb3d3e-70af-46c8-bc18-3d076a222d0b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        -1160
      ],
      "parameters": {
        "color": 3,
        "width": 873.9739981925188,
        "height": 534.0012007720542,
        "content": "# UPSERTING\n"
      },
      "typeVersion": 1
    },
    {
      "id": "60ebdb71-c7e0-429b-9394-b680cc000951",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        -2000
      ],
      "parameters": {
        "color": 4,
        "width": 876.5116990000852,
        "height": 821.787041589866,
        "content": "# PREPARATION (in Supabase)\n\n- your database needs the extension 'pgvector' enabled -> select Database > Extension > Search for 'vector'\n- make sure you have a table that has the following columns (if not, use the query below in the Supabase SQL Editor)\n\n```\nALTER TABLE \"YOUR TABLE NAME\"\nADD COLUMN embedding VECTOR(1536), // check which number of dimensions you need (depends on the embed model)\nADD COLUMN metadata JSONB,\nADD COLUMN content TEXT;\n```\n\n- make sure you have the right policies set -> select Authentication > Policies\n- make sure you have the custom function `match_documents` set up in Supabase -> This is needed for the Vector Store Node (as query name) \n(if not, use the query below in the Supabase SQL Editor to create that function)\n- make sure you check the size of the AI model as it should be the same vector size for the table \n(e.g. OpenAI's Text-Embedding-3-Small uses 1536)\n\n```\nCREATE OR REPLACE FUNCTION public.match_documents(\n filter JSONB,\n match_count INT,\n query_embedding VECTOR(1536) // should match same dimensions as from insertion\n)\nRETURNS TABLE (\n id BIGINT,\n content TEXT,\n metadata JSONB,\n embedding VECTOR(1536), // should match same dimensions as from insertion\n similarity FLOAT\n)\nLANGUAGE plpgsql AS $$\nBEGIN\n RETURN QUERY\n SELECT\n v.id,\n v.content,\n v.metadata,\n v.embedding,\n 1 - (v.embedding <=> match_documents.query_embedding) AS similarity\n FROM \"YOUR TABLE NAME\" v\n WHERE v.metadata @> filter\n ORDER BY v.embedding <=> match_documents.query_embedding\n LIMIT match_count;\nEND;\n$$\n;\n```\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ae95b0c3-b8b3-44eb-8070-b1bc6cac5cd2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3400,
        -2000
      ],
      "parameters": {
        "color": 5,
        "width": 810.9488123113013,
        "height": 821.9537074055816,
        "content": "# RETRIEVAL"
      },
      "typeVersion": 1
    },
    {
      "id": "58168721-cbd7-498c-9d16-41b4d5c6a68f",
      "name": "Question and Answer Chain",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "position": [
        3680,
        -1860
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "ddf1228f-f051-445b-8a42-54c2510a0b2e",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3600,
        -1680
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "734a2c48-b445-4e62-99b7-dc1dcd921c52",
      "name": "Vector Store Retriever",
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "position": [
        3760,
        -1680
      ],
      "parameters": {
        "topK": 10
      },
      "typeVersion": 1
    },
    {
      "id": "43f761b7-f4da-4b29-8099-9b2c15f79fe9",
      "name": "Recursive Character Text Splitter1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        3120,
        -1460
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "de0d2666-88e4-4a4d-ba46-cf789b9cba85",
      "name": "Customize Response",
      "type": "n8n-nodes-base.set",
      "notes": "output || text",
      "position": [
        4020,
        -1860
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "440fc115-ccae-4e30-85a5-501d0617b2cf",
              "name": "output",
              "type": "string",
              "value": "={{ $json.response.text }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "a396671f-a217-4f05-b969-cb64f10e4b01",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        3480,
        -1860
      ],
      "webhookId": "d7431c58-89aa-4d70-b5bd-044be981b3a9",
      "parameters": {
        "public": true,
        "options": {
          "responseMode": "lastNode"
        },
        "initialMessages": "=Hi there! 🙏\n\nYou can ask me anything about Venerable Geshe Kelsang Gyatso's Book - 'How To Transform Your Life'\n\nWhat would you like to know? "
      },
      "typeVersion": 1.1
    },
    {
      "id": "6312f6bc-c69c-4d4f-8838-8a9d0d22ed55",
      "name": "Retrieve by Query",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        3700,
        -1520
      ],
      "parameters": {
        "options": {
          "queryName": "match_documents"
        },
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "Kadampa",
          "cachedResultName": "Kadampa"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ba6b87b9-e96d-47a3-83f8-169d7172325a",
      "name": "Embeddings OpenAI Retrieval",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        3700,
        -1360
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "bcd1b31f-c60b-4c40-b039-d47dadc86b23",
      "name": "Embeddings OpenAI Insertion",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2920,
        -1620
      ],
      "parameters": {
        "model": "text-embedding-3-small",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "dfd7f734-eb00-4af3-9179-724503422fe4",
      "name": "Placeholder (File/Content to Upsert)",
      "type": "n8n-nodes-base.set",
      "position": [
        1900,
        -1000
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n \"Date\": \"{{ $now.format('dd MMM yyyy') }}\",\n \"Time\": \"{{ $now.format('HH:mm ZZZZ z') }}\"\n}\n"
      },
      "typeVersion": 3.4
    },
    {
      "id": "c54c9458-9b8a-4ef1-a6db-5265729be19d",
      "name": "Embeddings OpenAI Upserting",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2120,
        -840
      ],
      "parameters": {
        "model": "text-embedding-3-small",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "30c18e9e-d047-40d3-8324-f5d0e7892db6",
      "name": "Insert Documents",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        2920,
        -1840
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "Kadampa",
          "cachedResultName": "Kadampa"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3c0ed0ee-9134-4b4e-bcfd-632dd67a57da",
      "name": "Retrieve Rows from Table",
      "type": "n8n-nodes-base.supabase",
      "position": [
        3960,
        -1380
      ],
      "parameters": {
        "tableId": "n8n",
        "operation": "getAll",
        "returnAll": true
      },
      "typeVersion": 1
    },
    {
      "id": "53aca1b4-31e8-4699-b158-673623bc9b95",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2620,
        -1160
      ],
      "parameters": {
        "color": 6,
        "width": 1587.0771183771394,
        "height": 537.3056597675153,
        "content": "# DELETION\n\nAt the moment n8n does not have a built-in Supabase Node to delete records in a Vector Database. For this you would typically use the HTTP Request node to make an authorized API call to Supabase. \n\n## HTTP Request Node\n\nUse this node to send a DELETE request to your Supabase instance.\n\n- Supabase API Endpoint: Use the appropriate URL for your Supabase project. The endpoint will typically look like this: [https://<your-supabase-ref>.supabase.co/rest/v1/<your-vector-table>](https://supabase.com/docs/guides/api). Replace `<your-supabase-ref>` and `<your-vector-table>` with your details.\n### HEADERS:\n- apikey: Your Supabase API key.\n- Authorization: Bearer token with your Supabase JWT.\n- Query Parameters: Use query parameters to specify which record(s) to delete. For example, `?id=eq.<your-record-id>` where `<your-record-id>` is the specific record ID you want to delete \n(You can also reference back to the **Retrieve Rows From Table** Node to get the ID dynamically)\n\nEnsure you have the necessary permissions set up in Supabase to delete records through the API.\n\nPlease refer to the official n8n documentation for more detailed information on using the [HTTP Request Node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/).\n\n_Note:_ Deleting records is a sensitive operation, so make sure that your permissions are correctly configured and that you are targeting the correct records to avoid unwanted data loss."
      },
      "typeVersion": 1
    },
    {
      "id": "4ffaccdb-9e0f-464d-9284-7771f6599fd8",
      "name": "Update Documents",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        2100,
        -1000
      ],
      "parameters": {
        "id": "1",
        "mode": "update",
        "options": {
          "queryName": "match_documents"
        },
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "n8n",
          "cachedResultName": "n8n"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Google Drive": {
      "main": [
        [
          {
            "node": "Insert Documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve by Query": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Insert Documents",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Question and Answer Chain": {
      "main": [
        [
          {
            "node": "Customize Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI Insertion": {
      "ai_embedding": [
        [
          {
            "node": "Insert Documents",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI Retrieval": {
      "ai_embedding": [
        [
          {
            "node": "Retrieve by Query",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI Upserting": {
      "ai_embedding": [
        [
          {
            "node": "Update Documents",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter1": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Placeholder (File/Content to Upsert)": {
      "main": [
        [
          {
            "node": "Update Documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```


Prompt: Design a workflow using @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.memoryBufferWindow to sql agent with memory

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 13
- Node Types: @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.memoryBufferWindow, @n8n/n8n-nodes-langchain.lmChatOpenAi, n8n-nodes-base.compression, n8n-nodes-base.manualTrigger, n8n-nodes-base.stickyNote, n8n-nodes-base.httpRequest, @n8n/n8n-nodes-langchain.chatTrigger, n8n-nodes-base.readWriteFile

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.manualTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "id": "AQJ6QnF2yVdCWMnx",
  "meta": {
    "instanceId": "fb924c73af8f703905bc09c9ee8076f48c17b596ed05b18c0ff86915ef8a7c4a",
    "templateCredsSetupCompleted": true
  },
  "name": "SQL agent with memory",
  "tags": [],
  "nodes": [
    {
      "id": "3544950e-4d8e-46ca-8f56-61c152a5cae3",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1220,
        500
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.2
    },
    {
      "id": "743cc4e7-5f24-4adc-b872-7241ee775bd0",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1000,
        500
      ],
      "parameters": {
        "model": "gpt-4-turbo",
        "options": {
          "temperature": 0.3
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "rveqdSfp7pCRON1T",
          "name": "Ted's Tech Talks OpenAi"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cc30066c-ad2c-4729-82c1-a6b0f4214dee",
      "name": "When clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        500,
        -80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0deacd0d-45cb-4738-8da0-9d1251858867",
      "name": "Get chinook.zip example",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        -80
      ],
      "parameters": {
        "url": "https://www.sqlitetutorial.net/wp-content/uploads/2018/03/chinook.zip",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "61f34708-f8ed-44a9-8522-6042d28511ae",
      "name": "Extract zip file",
      "type": "n8n-nodes-base.compression",
      "position": [
        900,
        -80
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "6a12d9ac-f1b7-4267-8b34-58cdb9d347bb",
      "name": "Save chinook.db locally",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1100,
        -80
      ],
      "parameters": {
        "options": {},
        "fileName": "./chinook.db",
        "operation": "write",
        "dataPropertyName": "file_0"
      },
      "typeVersion": 1
    },
    {
      "id": "701d1325-4186-4185-886a-3738163db603",
      "name": "Load local chinook.db",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        620,
        360
      ],
      "parameters": {
        "options": {},
        "fileSelector": "./chinook.db"
      },
      "typeVersion": 1
    },
    {
      "id": "d7b3813d-8180-4ff1-87a4-bd54a03043af",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -280.9454545454546
      ],
      "parameters": {
        "width": 834.3272727272731,
        "height": 372.9454545454546,
        "content": "## Run this part only once\nThis section:\n* downloads the example zip file from https://www.sqlitetutorial.net/sqlite-sample-database/\n* extracts the archive (it contains only a single file)\n* saves the extracted `chinook.db` SQLite database locally\n\nNow you can use chat to \"talk\" to your data!"
      },
      "typeVersion": 1
    },
    {
      "id": "6bd25563-2c59-44c2-acf9-407bd28a15cf",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        240
      ],
      "parameters": {
        "width": 558.5454545454544,
        "height": 297.89090909090913,
        "content": "## On every chat message:\n* the local SQLite database is loaded\n* JSON from Chat Trigger is combined with SQLite binary data"
      },
      "typeVersion": 1
    },
    {
      "id": "2be63956-236e-46f7-b8e4-0f55e2e25a5c",
      "name": "Combine chat input with the binary",
      "type": "n8n-nodes-base.set",
      "position": [
        820,
        360
      ],
      "parameters": {
        "mode": "raw",
        "options": {
          "includeBinary": true
        },
        "jsonOutput": "={{ $('Chat Trigger').item.json }}\n"
      },
      "typeVersion": 3.3
    },
    {
      "id": "7f4c9adb-eab4-40d7-ad2e-44f2c0e3e30a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        120
      ],
      "parameters": {
        "width": 471.99692219161466,
        "height": 511.16641410437836,
        "content": "### LangChain SQL Agent can make several queries before producing the final answer.\nTry these examples:\n1. \"Please describe the database\". This input usually requires just 1 query + an extra observation to produce a final answer.\n2. \"What are the revenues by genre?\". This input will launch a series of Agent actions, because it needs to make several queries.\n\nThe final answer is stored in the memory and will be recalled on the next input from the user."
      },
      "typeVersion": 1
    },
    {
      "id": "ac819eb5-13b2-4280-b9d6-06ec1209700e",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1020,
        360
      ],
      "parameters": {
        "agent": "sqlAgent",
        "options": {},
        "dataSource": "sqlite"
      },
      "typeVersion": 1.6
    },
    {
      "id": "5ecaa3eb-e93e-4e41-bbc0-98a8c2b2d463",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        420,
        360
      ],
      "webhookId": "fb565f08-a459-4ff9-8249-1ede58599660",
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fbc06ddd-dbd8-49ee-bbee-2f495d5651a2",
  "connections": {
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "Load local chinook.db",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract zip file": {
      "main": [
        [
          {
            "node": "Save chinook.db locally",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Load local chinook.db": {
      "main": [
        [
          {
            "node": "Combine chat input with the binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get chinook.zip example": {
      "main": [
        [
          {
            "node": "Extract zip file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Test workflow\"": {
      "main": [
        [
          {
            "node": "Get chinook.zip example",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine chat input with the binary": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```


Prompt: How would you build: Discord Ai Bot?

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 9
- Node Types: n8n-nodes-base.set, n8n-nodes-base.switch, n8n-nodes-base.manualTrigger, n8n-nodes-base.webhook, n8n-nodes-base.discord, n8n-nodes-base.noOp, n8n-nodes-base.openAi

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.manualTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "id": "180",
  "meta": {
    "instanceId": "fb924c73af8f703905bc09c9ee8076f48c17b596ed05b18c0ff86915ef8a7c4a"
  },
  "name": "Discord AI bot",
  "tags": [],
  "nodes": [
    {
      "id": "6f188270-2c08-491f-bf52-c4a152b33aa0",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1220,
        780
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e4839de2-fc04-40b0-b6bc-596455ad93fe",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1220,
        580
      ],
      "webhookId": "d0cdd428-be96-4821-85bc-65342cf928d0",
      "parameters": {
        "path": "d0cdd428-be96-4821-85bc-65342cf928d0",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "15dcafe1-6361-4775-ace0-e34fd2a143b4",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2120,
        940
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0d28fe8e-da80-458b-9a75-d316019cb3ae",
      "name": "Analyze user request",
      "type": "n8n-nodes-base.openAi",
      "position": [
        1420,
        680
      ],
      "parameters": {
        "model": "gpt-4",
        "prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Act as a service desk agent and help to categorize user messages. Return back only JSON without quotations. Do not return anything else."
            },
            {
              "content": "=Here is a user feedback: \"{{ $json.body.feedback }}\". Please analyse it and put into one of the categories:\n1. \"success-story\" for user appraisal or success story. this will be processed by customer success department\n2. \"urgent-issue\" for extreme dissatisfaction or an urgent problem. this will be escalated to the IT team. Please assess if the request is really urgent and whether it has an immediate impact on the client. If the ticket doesn't look like an immediate problem or an extreme dissatisfaction then proceed as a normal ticket.\n3. \"ticket\" for everything else. This will be processed as normal by customer support team.\n\nPlease return back a JSON with the following structure: category (string), feedback (string), instruction (string).\nCategory must match the analysed category. feedback must match the original text. instruction should contain a text for a department according to the category with a one sentense summary of the feedback. Please be polite and friendly to the colleagues."
            }
          ]
        },
        "options": {
          "maxTokens": 500,
          "temperature": 0.5
        },
        "resource": "chat"
      },
      "credentials": {
        "openAiApi": {
          "id": "63",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ce1c4198-ce21-4436-9ccb-4a2a078cd06e",
      "name": "Select category",
      "type": "n8n-nodes-base.switch",
      "position": [
        1840,
        680
      ],
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "success-story"
            },
            {
              "output": 1,
              "value2": "urgent-issue"
            },
            {
              "output": 2,
              "value2": "ticket"
            }
          ]
        },
        "value1": "={{ $json.gpt_reply.category.toLowerCase() }}",
        "dataType": "string",
        "fallbackOutput": 3
      },
      "typeVersion": 1
    },
    {
      "id": "839cc38d-b393-4fc1-a068-47a8fcf55e3f",
      "name": "Parse JSON",
      "type": "n8n-nodes-base.set",
      "position": [
        1640,
        680
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "gpt_reply",
              "value": "={{ JSON.parse( $json.message.content.replace(/\\n(?=[^\"]*\"(?:[^\"]*\"[^\"]*\")*[^\"]*$)/g, '\\\\n')) }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "4c150439-89af-42bd-bbdc-905d13ada76b",
      "name": "User Success Dept",
      "type": "n8n-nodes-base.discord",
      "position": [
        2120,
        460
      ],
      "parameters": {
        "text": "={{ $json.gpt_reply.instruction }}",
        "options": {},
        "webhookUri": "https://discord.com/api/webhooks/<YOUR WEBHOOK HERE>"
      },
      "typeVersion": 1
    },
    {
      "id": "9a5e5335-9e6c-4f1f-a0f0-b1b022956549",
      "name": "IT Dept",
      "type": "n8n-nodes-base.discord",
      "position": [
        2120,
        620
      ],
      "parameters": {
        "text": "={{ $json.gpt_reply.instruction }}",
        "options": {},
        "webhookUri": "https://discord.com/api/webhooks/<YOUR WEBHOOK HERE>"
      },
      "typeVersion": 1
    },
    {
      "id": "d6d6250a-3a24-49f1-a597-47ebc179949c",
      "name": "Helpdesk",
      "type": "n8n-nodes-base.discord",
      "position": [
        2120,
        780
      ],
      "parameters": {
        "text": "={{ $json.gpt_reply.instruction }}",
        "options": {},
        "webhookUri": "https://discord.com/api/webhooks/<YOUR WEBHOOK HERE>"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "saveManualExecutions": true,
    "saveDataSuccessExecution": "all"
  },
  "versionId": "8871171e-7e18-49ee-a570-facbe97afb79",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Analyze user request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse JSON": {
      "main": [
        [
          {
            "node": "Select category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select category": {
      "main": [
        [
          {
            "node": "User Success Dept",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IT Dept",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Helpdesk",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze user request": {
      "main": [
        [
          {
            "node": "Parse JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Analyze user request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```


Prompt: Show me an n8n workflow for send daily translated calvin and hobbes comics to discord

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 8
- Node Types: n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmChatOpenAi, @n8n/n8n-nodes-langchain.openAi, n8n-nodes-base.scheduleTrigger, n8n-nodes-base.stickyNote, n8n-nodes-base.discord, n8n-nodes-base.httpRequest, @n8n/n8n-nodes-langchain.informationExtractor

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.scheduleTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "nodes": [
    {
      "id": "4bf26356-9c59-4cee-8eb8-8553b23a172f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -120
      ],
      "parameters": {
        "width": 660,
        "height": 460,
        "content": "![](https://raw.githubusercontent.com/2innnnn0/30-Days-of-ChatGPT/refs/heads/main/datapopcorn_logo_50px.png)\n# Daily Cartoon (w/ AI Translate)\n\n### How it works\n- Automates the retrieval of Calvin and Hobbes daily comics.\n- Extracts the comic image URL from the website.\n- Translates comic dialogues to English and Korean(Other Language)\n- Posts the comic and translations to Discord daily.\n\n### Set up steps\n- Estimated setup time: ~10-15 minutes.\n- Use a **Schedule Trigger** to automate the workflow at 9 AM daily.\n- Add nodes for parameter setup, HTTP request, data extraction, and integration with Discord.\n- Add detailed notes to each node in the workflow for easy understanding."
      },
      "typeVersion": 1
    },
    {
      "id": "52d19472-41b4-4d71-874e-064ef9d6f248",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        620,
        380
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bcc15f37-c048-4d9a-83cd-367856470095",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1620,
        380
      ],
      "parameters": {
        "text": "Please write the original language and Korean together. \n\nEXAMPLE)\nCalvin: \"YOU'VE NEVER HAD AN OBLIGATION, AN ASSIGNMENT, OR A DEADLINE IN ALL YOUR LIFE! YOU HAVE NO RESPONSIBILITIES AT ALL! IT MUST BE NICE!\" (너는 평생 한 번도 의무, 과제, 혹은 마감일 없었잖아! 전혀 책임이 없다니! 정말 좋겠다!)\nHobbes: \"WIPE THAT INSOLENT SMIRK OFF YOUR FACE!\" (그 뻔뻔한 미소를 그만 지어!)\n",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "resource": "image",
        "imageUrls": "={{ $json.output.cartoon_image }}",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "kYIZ8ZwQHS2d4GiD",
          "name": "(datapopcorn )OpenAi account"
        }
      },
      "typeVersion": 1.6
    },
    {
      "id": "35004d43-4061-476a-9af6-7d0b82ae86bd",
      "name": "param",
      "type": "n8n-nodes-base.set",
      "position": [
        840,
        380
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "59d36aef-2991-4fd2-9fbe-dad9a701b40f",
              "name": "year",
              "type": "string",
              "value": "={{ $now.format('yyyy') }}"
            },
            {
              "id": "b6b329f2-ba08-4516-bdb9-c5d124c02110",
              "name": "month",
              "type": "string",
              "value": "={{ $now.format('MM') }}"
            },
            {
              "id": "3cba75d1-a281-4e14-9bf7-e0bc0cc7c768",
              "name": "day",
              "type": "string",
              "value": "={{ $now.format('dd') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "cf2c953f-1ff2-4abc-8abd-95e05603e64a",
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1840,
        380
      ],
      "parameters": {
        "content": "=Daily Cartoon ({{ $('param').item.json.year }}/{{ $('param').item.json.month }}/{{ $('param').item.json.day }})\n{{ $('Information Extractor').item.json.output.cartoon_image }}\n\n{{ $json.content }}\n",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "w82RWS7nmXLKDczt",
          "name": "n8n test webhook"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5eec9870-a509-4090-a540-76b22bb3eac9",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1260,
        560
      ],
      "parameters": {
        "model": "gpt-4o-mini-2024-07-18",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "kYIZ8ZwQHS2d4GiD",
          "name": "(datapopcorn )OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "352db81e-7571-47cb-b028-dec18e15ccce",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1260,
        380
      ],
      "parameters": {
        "text": "=Please just extract the src value in the <img class=\"img-fluid Lazyloaded\"> tag from HTML below. I don't need anything other than the value.\n\ne.g.)\nEXAMPLE INPUT)\n<img class=\"img-fluid lazyloaded\" srcset=\"https://assets.amuniversal.com/5ed526b06e94013bda88005056a9545d 900w\" data-srcset=\"https://assets.amuniversal.com/5ed526b06e94013bda88005056a9545d 900w\" sizes=\"\n (min-width: 992px) 900px,\n (min-width: 768px) 600px,\n (min-width: 576px) 300px,\n 900px\" width=\"100%\" alt=\"Calvin and Hobbes Comic Strip for March 03, 2023 \" src=\"https://assets.amuniversal.com/5ed526b06e94013bda88005056a9545d\">\n\n\nEXAMPLE OUTPUT)\nhttps://assets.amuniversal.com/5ed526b06e94013bda88005056a9545d\n\n--\n(INPUT)\n{{ $json.data }}",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "cartoon_image",
              "description": "EXAMPLE OUTPUT) https://assets.amuniversal.com/***"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "517799ed-559c-4d17-b8aa-58bd4ee92ed3",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        380
      ],
      "parameters": {
        "url": "=https://www.gocomics.com/calvinandhobbes/{{ $json.year }}/{{ $json.month }}/{{ $json.day }}",
        "options": {}
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "param": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "param",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```

Send daily translated Calvin and Hobbes Comics to Discord


Prompt: Create an n8n automation that handles general automation

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 8
- Node Types: n8n-nodes-base.set, n8n-nodes-base.rssFeedReadTrigger, @n8n/n8n-nodes-langchain.openAi, n8n-nodes-base.extractFromFile, n8n-nodes-base.discord, n8n-nodes-base.stickyNote, n8n-nodes-base.httpRequest

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.rssFeedReadTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "id": "LF8gz3iz74u45a5i",
  "meta": {
    "instanceId": "889f0d7d968f3b02a88433e2529a399907d2ca89e329934b608193beaa2301f8"
  },
  "name": "YouTube Videos with AI Summaries on Discord",
  "tags": [],
  "nodes": [
    {
      "id": "48c87027-7eea-40b9-a73c-4e002b748783",
      "name": "YouTube Video Trigger",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "position": [
        560,
        220
      ],
      "parameters": {
        "feedUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UC08Fah8EIryeOZRkjBRohcQ",
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "56166228-b365-4043-b48c-098b4de71f6f",
      "name": "Retrieve Caption Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        780,
        220
      ],
      "parameters": {
        "url": "https://www.googleapis.com/youtube/v3/captions",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "videoId",
              "value": "={{ $json.id.match(/(?:[^:]*:){2}\\s*(.*)/)[1] }}"
            },
            {
              "name": "part",
              "value": "snippet"
            }
          ]
        },
        "nodeCredentialType": "youTubeOAuth2Api"
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "uy3xy1Ks2ATwRGr4",
          "name": "Creator Magic - YouTube account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c029ac6f-3071-4045-83f6-2dede0c1f358",
      "name": "Download Captions",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        220
      ],
      "parameters": {
        "url": "=https://www.googleapis.com/youtube/v3/captions/{{ $json.caption.id }}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "youTubeOAuth2Api"
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "uy3xy1Ks2ATwRGr4",
          "name": "Creator Magic - YouTube account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8b45dc14-f10f-4b50-8ca6-a9d0ccfee4dc",
      "name": "Caption File Conversion",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1440,
        220
      ],
      "parameters": {
        "options": {},
        "operation": "text",
        "destinationKey": "content"
      },
      "typeVersion": 1
    },
    {
      "id": "6527adb4-9087-40eb-b63a-8c4cdf5d0a40",
      "name": "Caption Summary with ChatGPT",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1660,
        220
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Summarise this transcript into three bullet points to sum up what the video is about and why someone should watch it: {{ $json[\"content\"] }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "QpdCHVaJVRd9NNYl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2c83f230-bc37-4efb-9ee9-842bcefa0ef4",
      "name": "Post to Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        2000,
        220
      ],
      "parameters": {
        "content": "=🌟 New Video Alert! 🌟\n\n**{{ $('YouTube Video Trigger').item.json[\"title\"] }}**\n\n*What’s it about?*\n\n{{ $json[\"message\"][\"content\"] }}\n\n[Watch NOW]({{ $('YouTube Video Trigger').item.json[\"link\"] }}) and remember to share your thoughts!",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "QQxpAIskycvb8fIE",
          "name": "Discord Webhook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8408887e-1d89-402c-b350-93d5f96f4dea",
      "name": "Find English Captions",
      "type": "n8n-nodes-base.set",
      "position": [
        1000,
        220
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "eaf7dcb5-91cf-4405-917b-38845f0ef78d",
              "name": "caption",
              "type": "object",
              "value": "={{ $jmespath( $json.items, \"[?snippet.language == 'en'] | [0]\" ) }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "71cc0977-1695-4797-9df2-b0a98e41d3de",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -20
      ],
      "parameters": {
        "width": 448.11859838274916,
        "height": 417.2722371967648,
        "content": "### Summarise Your YouTube Videos with AI for Discord\n\n📽 [Watch the Video Tutorial](https://mrc.fm/ai2d)\n\n* Add your [YouTube channel ID](https://www.youtube.com/account_advanced) to the URL in the first node: `https://www.youtube.com/feeds/videos.xml?channel_id=YOUR_CHANNEL_ID`.\n\n* Ensure authorization with the YouTube channel that you want to download captions from."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e8fc6758-02ef-4b65-8ab5-474bd8e3862a",
  "connections": {
    "Download Captions": {
      "main": [
        [
          {
            "node": "Caption File Conversion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find English Captions": {
      "main": [
        [
          {
            "node": "Download Captions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Caption Data": {
      "main": [
        [
          {
            "node": "Find English Captions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube Video Trigger": {
      "main": [
        [
          {
            "node": "Retrieve Caption Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Caption File Conversion": {
      "main": [
        [
          {
            "node": "Caption Summary with ChatGPT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Caption Summary with ChatGPT": {
      "main": [
        [
          {
            "node": "Post to Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```

YouTube Videos with AI Summaries on Discord