AutomationFlowsAI & RAG › Housemate

Housemate

Housemate. Uses telegramTrigger, openAi, googleDrive, telegram. Event-driven trigger; 34 nodes.

Event trigger★★★★★ complexityAI-powered34 nodesTelegram TriggerOpenAIGoogle DriveTelegramAgentMemory Buffer WindowGoogle SheetsAgent Tool
AI & RAG Trigger: Event Nodes: 34 Complexity: ★★★★★ AI nodes: yes Added:

This workflow follows the Agent → Agenttool recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Housemate",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -1792,
        256
      ],
      "id": "b000fa14-9c1d-4ae4-9abd-078f61bb1b21",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "id": "49c349bd-957b-4285-8d35-37430ba63bd5"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "3b78cf24-b4cd-4f8e-ac64-ac942baa26ca",
                    "leftValue": "={{ $json.message.voice.file_unique_id }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Voice"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "367ed937-edcb-461b-a410-9476589467a7",
                    "leftValue": "={{ $json.message.photo[0].file_unique_id }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Photo"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -1536,
        224
      ],
      "id": "53c92306-550a-493f-90a4-798f68b1a37e",
      "name": "Switch"
    },
    {
      "parameters": {
        "resource": "audio",
        "operation": "transcribe",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        -1168,
        288
      ],
      "id": "a0e25ac4-7b88-49a8-8da0-0f3b7fd35f6c",
      "name": "Transcribe a recording",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "inputDataFieldName": "=data",
        "name": "={{ $json.result.file_unique_id }}.jpg",
        "driveId": {
          "__rl": true,
          "value": "My Drive",
          "mode": "list",
          "cachedResultName": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive"
        },
        "folderId": {
          "__rl": true,
          "value": "1n5H_RylzoHybrJoyM7iF0miplniOL1Qu",
          "mode": "list",
          "cachedResultName": "Ai_agent",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1n5H_RylzoHybrJoyM7iF0miplniOL1Qu"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -1168,
        432
      ],
      "id": "a4d9d21b-a0fd-4d38-9167-9fff67fe6744",
      "name": "Upload file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $('Telegram Trigger').item.json.message.photo[3].file_id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -1296,
        432
      ],
      "id": "911ef83d-638c-4827-b446-2348f801944c",
      "name": "Get a photo",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.message.voice.file_id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -1296,
        288
      ],
      "id": "b050d70b-5c1a-45f0-b0d6-7dea9cc49438",
      "name": "Get a voice",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "2fd15951-2c71-42bc-84d8-8d18dc0ff2d7",
              "name": "text",
              "value": "=\ub2e4\uc74c \ud30c\uc77c \uc815\ubcf4\ub97c \uae30\uc5b5\ud558\uace0 \uc788\ub2e4\uac00 \ub0b4 \ub2e4\uc74c \uc694\uccad\uc5d0 \uc0ac\uc6a9\ud574 \uc918. \nID: \ud30c\uc77c\uba85:{{ $json.name }} \ndownload_URL:{{ $json.webContentLink }} \nview_url(\uacf5\uc720,\ud655\uc778\uc6a9):{{ $json.webViewLink }}\nFile ID : {{ $json.id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1040,
        432
      ],
      "id": "3d2db559-69be-40b0-886f-ddb50f1614da",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.text }}",
        "needsFallback": true,
        "options": {
          "systemMessage": "\ub2f9\uc2e0\uc740 Parent AI Agent\ub2e4.\n\uc0ac\uc6a9\uc790\uc758 \uc694\uccad\uc744 \uc9c1\uc811 \ucc98\ub9ac\ud558\uc9c0 \ub9d0\uace0, \ud56d\uc0c1 \uac00\uc7a5 \uc801\uc808\ud55c \u201c\ub3c4\uad6c(\uc11c\ube0c\uc6cc\ud06c\ud50c\ub85c\uc6b0 \uc5d0\uc774\uc804\ud2b8)\u201d\ub97c \uc120\ud0dd\u00b7\ud638\ucd9c\ud574\uc11c \uacb0\uacfc\ub9cc \ubc1b\uc544 \ud55c\uad6d\uc5b4\ub85c \uc9e7\uac8c \uc694\uc57d\ud55c\ub2e4.\nJSON \uc804\uc6a9 \ucd9c\ub825 \uaddc\uce59\uc740 \uc5c6\ub2e4. \ub0b4\ubd80 \ucd94\ub860(Chain-of-thought)\uc740 \uc808\ub300 \ub178\ucd9c\ud558\uc9c0 \uc54a\ub294\ub2e4.\n\n\uc5ed\ud560\n- \uc804\ub7b5 \uc624\ucf00\uc2a4\ud2b8\ub808\uc774\ud130: \uc0ac\uc6a9\uc790 \uc758\ub3c4\ub97c \ubd84\ub958\ud558\uace0, \ud544\uc694\ud55c \uc2ac\ub86f(\ud544\uc218/\uc120\ud0dd)\uc744 \uc810\uac80\ud55c \ub4a4, \ud544\uc694\ud55c \ub3c4\uad6c\ub97c \uc5f0\uc1c4 \ud638\ucd9c\ud55c\ub2e4.\n- \uc815\ubcf4\uac00 \ubd80\uc871/\ubaa8\ud638\ud558\uba74 Think\ub97c \ud638\ucd9c\ud574 1~3\ubb38\ud56d\uc73c\ub85c \ube60\ub974\uac8c \uc2ac\ub86f\uc744 \uc218\uc9d1\u00b7\uc815\uaddc\ud654\ud55c \ub2e4\uc74c \ub2e4\uc2dc \ub3c4\uad6c\ub97c \ud638\ucd9c\ud55c\ub2e4.\n- \ud55c \uc751\ub2f5 \uc548\uc5d0\uc11c \uc5ec\ub7ec \ub3c4\uad6c\ub97c \uc21c\ucc28 \ud638\ucd9c\ud574\ub3c4 \ub41c\ub2e4(\uc608: SmartThings \ubaa9\ub85d\u2192\uc0c1\ud0dc\u2192\uba85\ub839\u2192\uc7ac\ud655\uc778).\n\n[\uc0ac\uc6a9 \ub3c4\uad6c = \uc11c\ube0c \uc5d0\uc774\uc804\ud2b8(\uac01 \uc6cc\ud06c\ud50c\ub85c\uc6b0)]\n1) SmartThings Agent\n   - \uc785\ub825: \uc0ac\uc6a9\uc790 \uc6d0\ubb38 text.\n   - \uc11c\ube0c\ub294 ST_List \u2192 (\ub2e8\uc77c \ud6c4\ubcf4\uba74 \uc989\uc2dc) ST_Status/Command \uc21c\uc73c\ub85c **\uc2a4\uc2a4\ub85c** \ucc98\ub9ac.\n   - \uc7a5\uce58\uac00 \ubaa8\ud638\ud560 \ub54c\ub3c4 \uc11c\ube0c\uac00 \u201c\ucd5c\ub300 \uc720\uc0ac\ub3c4 1\uac1c \uc790\ub3d9 \uc120\ud0dd(\uc784\uacc4\uce58 \ucd08\uacfc)\u201d \uaddc\uce59\uc73c\ub85c \uc9c4\ud589. \uc9c8\ubb38 \uae08\uc9c0.\n   - delta(\u201c1\ub3c4 \ub0ae\ucdb0/\uc62c\ub824\u201d)\ub294 \uc11c\ube0c\uac00 ST_Status\ub85c \ud604\uc7ac\uac12\uc744 \uc77d\uace0 \uc808\ub300\uac12 setpoint\ub85c \ubcc0\ud658 \ud6c4 /commands\uc5d0 commands[]\ub85c \ud55c\ubc88\uc5d0 \uc804\uc1a1. (/v1/devices, /status, /commands \uc0ac\uc6a9) \n   - \ubb34\uc870\uac74 tool \ucf5c\uc744 \ud55c\ub2e4\n2) Calendar Agent\n   - \uc785\ub825: \uc6d0\ubb38 text.\n   - \ubd80\uc871 \uc2ac\ub86f\uc774 \uc788\uc5b4\ub3c4 \uc6b0\uc120 \uc2e4\ud589:\n     - create \uc758\ub3c4 \ucd94\uc815 \uc2dc: start\ub97c \u201c\uac00\uc7a5 \uac00\uae4c\uc6b4 30\ubd84\u201d \uae30\ubcf8\uac12, duration 30m, timeZone=\uc0ac\uc6a9\uc790TZ\ub85c \uac00\uc815\ud558\uc5ec draft \uc0dd\uc131 \uc2dc\ub3c4.\n     - find/freebusy \uc9c8\uc758\ub294 \uae30\ubcf8 \uae30\uac04(\uc624\ub298~\ub0b4\uc77c)\ub85c \uc2dc\ub3c4. (Google Calendar freebusy.query \ubc0f events API) \n3) Gemini Image Agent(\ud3b8\uc9d1 \uc804\uc6a9\uc77c \uacbd\uc6b0: edit\ub9cc)\n   - \uc785\ub825: \uc6d0\ubb38 text(+\ucca8\ubd80/URL). downloadUrl\uc774 \uc5c6\uc73c\uba74 \uc11c\ube0c\uac00 \uc790\uccb4 \uc5d0\ub7ec/\uc694\uccad \uba54\ud0c0\ub9cc \ubc18\ud658(\ubd80\ubaa8\ub294 \uc9c8\ubb38\ud558\uc9c0 \uc54a\uc74c).\n4) Think(\ubcf4\uc870)\n   - \uc9c8\ubb38 \uae08\uc9c0. \uc2ac\ub86f \ud45c\uc900\ud654/\uae30\ubcf8\uac12 \ucc44\uc6b0\uae30\ub9cc \uc218\ud589.\n\n[\ub8e8\ud305 \uaddc\uce59]\n- SmartThings \uc5b4\ud718(\uc5d0\uc5b4\ucee8/\uc870\uba85/\ucf1c/\uaebc/\ubaa8\ub4dc/\uc628\ub3c4/\uc7a5\uba74 \ub4f1) \u2192 SmartThings Agent\n- \uc77c\uc815/\ud68c\uc758/\uce98\ub9b0\ub354/\uac00\uc6a9\uc2dc\uac04 \u2192 Calendar Agent\n- \uc774\ubbf8\uc9c0/\uc0ac\uc9c4/\ud3b8\uc9d1/\uc790\ub974\uae30/\ubc30\uacbd\uc81c\uac70 \u2192 Gemini Image Agent\n- \ubd88\uba85\ud655\ud558\uba74 SmartThings \u2192 Calendar \u2192 Image \uc21c\uc73c\ub85c \ud558\ub098\ub97c \uc120\ud0dd\ud574 **\uc989\uc2dc 1\ud68c \ud638\ucd9c** \ud6c4 \uacb0\uacfc\ub85c \uc774\uc5b4\uac04\ub2e4.\n\n[\uc751\ub2f5]\n- \ud56d\uc0c1 1\u20132\ubb38\uc7a5 \ud55c\uad6d\uc5b4 \uc694\uc57d. (\uc11c\ube0c\uac00 \uad6c\uc870\ud654 JSON\uc744 \uc8fc\uba74 \ub367\ubd99\uc5ec\ub3c4 \ub418\ub098 JSON \uac15\uc81c\ub294 \uc5c6\uc74c)\n- \uc624\ub958 \uc2dc: \uc6d0\uc778 + \ub2e4\uc74c \uc870\uce58(\ud1a0\ud070/\uad8c\ud55c/\uc785\ub825\uac12 \uc218\uc815, \ub77c\ubca8 \uc7ac\uc120\ud0dd \ub4f1) 1\uc904. \ud544\uc694 \uc2dc 1\ud68c \uc7ac\uc2dc\ub3c4.\n\n(\ucc38\uace0) \ub3c4\uad6c \uc5f0\uacb0\uc740 n8n\uc758 Tools Agent/AI Agent Tool \ub610\ub294 Execute Sub-workflow\ub85c \uad6c\uc131\ud55c\ub2e4. \ud234 \ud30c\ub77c\ubbf8\ud130\ub294 $fromAI()\ub85c \uc8fc\uc785. \ud544\uc694 \uc2dc \ubaa8\ub378\uc758 tool_choice\ub97c required\ub85c \uc124\uc815\ud574 \u201c\ud234 \uc0ac\uc6a9 \uac15\uc81c\u201d\ub97c \uc801\uc6a9\ud55c\ub2e4."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -496,
        336
      ],
      "id": "db3cedc0-3dbe-46d5-a24f-f55b0bc85c71",
      "name": "AI Agent",
      "retryOnFail": false,
      "maxTries": 2,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -704,
        768
      ],
      "id": "1f8a11ab-6cfa-41ca-9e92-09e1c1ffc31f",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "jsCode": "function parseJSONLoose(raw) {\n  if (raw == null) return {};\n  if (typeof raw === 'object') return raw;\n  let s = String(raw).trim();\n  if (s.startsWith('```')) s = s.replace(/^```[a-zA-Z0-9]*\\n?/, '').replace(/```$/, '');\n  try { return JSON.parse(s); } catch (_) {}\n  try {\n    return JSON.parse(\n      s.replace(/\\r?\\n/g, '')\n       .replace(/,\\s*}/g, '}')\n       .replace(/,\\s*]/g, ']')\n    );\n  } catch (_) {}\n  return {};\n}\n\n// 1) \ud604\uc7ac \uc544\uc774\ud15c\ub9cc \uc0ac\uc6a9\nconst raw = $json.output ?? $json.content ?? $json;\nconst p = parseJSONLoose(raw);\n\n// 2) \uc548\uc804 \ucd94\ucd9c\nconst goal = p.goal_recap ?? p.goal ?? null;\nconst tasks = p?.plan?.tasks ?? p?.plan ?? p?.actions ?? null;\nconst toolToCall = p?.action?.tool_to_call ?? null;\n\nconst needs = Array.isArray(p?.safety?.needs_confirmation) ? p.safety.needs_confirmation : [];\nconst risksArr = Array.isArray(p?.safety?.risks) ? p.safety.risks : (p?.safety?.risks ? [p.safety.risks] : []);\nconst risks = needs.length ? [...risksArr, `\uc2b9\uc778 \ud544\uc694: ${needs.join(', ')}`] : risksArr;\n\n// 3) \uc0ac\uc6a9\uc790 \uba54\uc2dc\uc9c0 \uc6b0\uc120\uc21c\uc704\nconst msg =\n  p?.action?.parameters?.message_to_user ??\n  p?.parameters?.message_to_user ??\n  p?.message_to_user ??\n  p?.response ??\n  p?.rationale ??\n  '\uacb0\uacfc\uac00 \ube44\uc5b4\uc788\uc2b5\ub2c8\ub2e4.';\n\n// 4) \ub2e4\uc74c \ub178\ub4dc\uc5d0\uc11c \ubc14\ub85c \uc4f0\uae30 \uc88b\uac8c \ud3c9\ud0c4\ud654 \ubc18\ud658\nreturn {\n  json: {\n    output: p,                  // \uc6d0\ubcf8 \uc804\uccb4\n    goal,                       // {summary, user_intent} \uae30\ub300\n    actions: tasks,             // \ud0dc\uc2a4\ud06c \ubc30\uc5f4\n    tool: toolToCall,           // {name, arguments}\n    message_for_user: msg,      // \uba54\uc2e0\uc800 \ub178\ub4dc\uc5d0 \ubc14\ub85c \uc0ac\uc6a9\n    response: msg,              // \ud638\ud658 \ud544\ub4dc\n    risks,\n    needs_confirmation: needs\n  }\n};\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -80,
        208
      ],
      "id": "4b73aa9d-f15d-4316-ab90-81ef336cd71a",
      "name": "Code"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1eb4-ncOq_dj3MSsO4ol9X-iIA1Z9vnzLkyRVi25kHOg",
          "mode": "list",
          "cachedResultName": "Update_log_S",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eb4-ncOq_dj3MSsO4ol9X-iIA1Z9vnzLkyRVi25kHOg/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\uc2dc\ud2b81",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eb4-ncOq_dj3MSsO4ol9X-iIA1Z9vnzLkyRVi25kHOg/edit#gid=0"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": [
            {
              "id": "Column(\uc2dc\ud2b8 \ud5e4\ub354)",
              "displayName": "Column(\uc2dc\ud2b8 \ud5e4\ub354)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "workflow ",
              "displayName": "workflow ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "user_id ",
              "displayName": "user_id ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "goal ",
              "displayName": "goal ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "agent ",
              "displayName": "agent ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "tool ",
              "displayName": "tool ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "message ",
              "displayName": "message ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "risks ",
              "displayName": "risks ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": " needs_confirmation",
              "displayName": " needs_confirmation",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "output",
              "displayName": "output",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "goal",
              "displayName": "goal",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "actions",
              "displayName": "actions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "tool",
              "displayName": "tool",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "message_for_user",
              "displayName": "message_for_user",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "response",
              "displayName": "response",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "risks",
              "displayName": "risks",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "needs_confirmation",
              "displayName": "needs_confirmation",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        80,
        208
      ],
      "id": "b5c11542-dd9d-41b8-ba06-f70c4147bbf2",
      "name": "Append row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "text": "={{ $('AI Agent').item.json.output }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        224,
        208
      ],
      "id": "2b3328f5-3962-49d6-86ad-9f3588c4986a",
      "name": "Send a text message",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const ex = $json.execution ?? {};\nconst wf = $json.workflow ?? {};\nconst err = ex.error ?? $json.error ?? {};\nconst nodeName = err?.node?.name ?? err?.node?.type ?? '\uc54c \uc218 \uc5c6\uc74c';\n\nconst userMsg = [\n  '\u2757\ufe0f\uc791\uc5c5 \uc2e4\ud328 \uc548\ub0b4',\n  `\uc6cc\ud06c\ud50c\ub85c\uc6b0: ${wf?.name ?? 'N/A'}`,\n  `\ub178\ub4dc: ${nodeName}`,\n  `\uc0ac\uc720: ${err?.message ?? '\uc54c \uc218 \uc5c6\ub294 \uc624\ub958'}`\n].join('\\n');\n\nreturn [{\n  json: {\n    message_for_user: userMsg,\n    error_detail: {\n      workflow_id: wf?.id ?? null,\n      workflow_name: wf?.name ?? null,\n      node: nodeName,\n      message: err?.message ?? null,\n      stack: err?.stack ?? null,\n      ts: new Date().toISOString()\n    }\n  }\n}];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -80,
        400
      ],
      "id": "8424c316-4de7-4836-b557-bcd7b6755d13",
      "name": "Code1"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "15fejG2rOaZwrCIADyUJbolOiCupHdk-C6Kw5JEnJw30",
          "mode": "list",
          "cachedResultName": "Update_log_E",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15fejG2rOaZwrCIADyUJbolOiCupHdk-C6Kw5JEnJw30/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\uc2dc\ud2b81",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15fejG2rOaZwrCIADyUJbolOiCupHdk-C6Kw5JEnJw30/edit#gid=0"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": [
            {
              "id": "Column(\uc2dc\ud2b8 \ud5e4\ub354)",
              "displayName": "Column(\uc2dc\ud2b8 \ud5e4\ub354)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "workflow ",
              "displayName": "workflow ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "input ",
              "displayName": "input ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "output",
              "displayName": "output",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "actions",
              "displayName": "actions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "tockens",
              "displayName": "tockens",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "error_message ",
              "displayName": "error_message ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "message_for_user",
              "displayName": "message_for_user",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "error_detail",
              "displayName": "error_detail",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        80,
        400
      ],
      "id": "78ec19ea-4d10-4a6f-8409-0dd4a0f06982",
      "name": "Append row in sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $('Code1').item.json.message_for_user }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        224,
        400
      ],
      "id": "92e62308-05b7-46d2-9f82-9ab04b077a4c",
      "name": "Send a text message1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ec9f8d2c-1dda-4c9c-8528-711cd131b445",
              "name": "text",
              "value": "={{ $json.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1024,
        288
      ],
      "id": "44acdfe1-610c-453b-8daf-0148b5270fa3",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "toolDescription": "Calendar Agent",
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are \"Calendar Agent\". Operate exclusively as a Google Calendar event manager.\nYou must call only the Google Calendar tools (Create/List/Get/Update/Delete).\nIf fields like title, start or end time, location, or attendees are missing, default values must be used:\n\u2022 Title: \"\uc81c\ubaa9\uc5c6\uc74c\" if missing\n\u2022 Start: today at 18:00\n\u2022 End: start + 2 hours\n\u2022 Location: blank\n\u2022 Attendees: skip if only a name or missing\n\u2022 Reminders: use default\nCreate the event immediately even if incomplete.\nAfter success, report event ID, calendar, and reminders to the user.\nIf the user asks to update or delete later, you can handle that.\nNever call a \"Think Agent\" or other agents.\n\nWhen calling the Google Calendar Create tool, you must provide values for:\n- startDateTime: event start time in ISO-8601 format with offset (e.g., 2025-09-01T18:00:00+09:00) OR without offset if using the Time Zone field.\n- endDateTime: event end time, same format as startDateTime.\n\nUse $fromAI('startDateTime') and $fromAI('endDateTime') to populate these fields."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "typeVersion": 2.2,
      "position": [
        -1744,
        560
      ],
      "id": "d31062bb-ca04-4a19-9e8d-b2f8b2b84226",
      "name": "Calendar Agent"
    },
    {
      "parameters": {
        "operation": "getAll",
        "calendar": {
          "__rl": true,
          "value": "terrykim0324@gmail.com",
          "mode": "list",
          "cachedResultName": "terrykim0324@gmail.com"
        },
        "limit": 100,
        "timeMax": "={{ $now.plus({ month: 3 }) }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -1680,
        832
      ],
      "id": "f7d04a30-342b-4aca-8f3a-8f46f9eb2559",
      "name": "List",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "get",
        "calendar": {
          "__rl": true,
          "value": "terrykim0324@gmail.com",
          "mode": "list",
          "cachedResultName": "terrykim0324@gmail.com"
        },
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -1584,
        832
      ],
      "id": "aab5c287-2750-4b1b-924b-e728169b587d",
      "name": "Get",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "calendar": {
          "__rl": true,
          "value": "terrykim0324@gmail.com",
          "mode": "list",
          "cachedResultName": "terrykim0324@gmail.com"
        },
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', ``, 'string') }}",
        "useDefaultReminders": "={{$json.useDefaultReminders !== false}}",
        "updateFields": {
          "end": "={{$fromAI('endDateTime') || ''}}",
          "location": "={{$fromAI('location') || ''}}",
          "start": "={{$fromAI('startDateTime') || ''}}",
          "summary": "{{$fromAI('summary') || ''}}"
        }
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -1488,
        832
      ],
      "id": "7db4c71f-c49b-40e8-a586-0739b0b90fa7",
      "name": "Update",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "delete",
        "calendar": {
          "__rl": true,
          "value": "terrykim0324@gmail.com",
          "mode": "list",
          "cachedResultName": "terrykim0324@gmail.com"
        },
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -1392,
        832
      ],
      "id": "4582d0b8-471e-45d3-8e81-241568cc9648",
      "name": "Delete",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "29b0b9cf-0769-4700-8517-21e3865682d7",
              "name": "text",
              "value": "={{ $json.message.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1328,
        160
      ],
      "id": "6ffb2657-e19c-452b-90ef-7ea22cd95739",
      "name": "Edit Fields2"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "{{$fromAI('description') || ''}}",
        "calendar": {
          "__rl": true,
          "value": "terrykim0324@gmail.com",
          "mode": "list",
          "cachedResultName": "terrykim0324@gmail.com"
        },
        "start": "={{$fromAI('startDateTime')}}",
        "end": "={{$fromAI('endDateTime')}}",
        "useDefaultReminders": "={{$json.useDefaultReminders !== false}}",
        "additionalFields": {
          "attendees": [],
          "location": "={{$fromAI('location') || ''}}",
          "summary": "={{$fromAI('summary')}}"
        }
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -1792,
        832
      ],
      "id": "d35b76e5-2587-4591-a6c1-260604d34cb2",
      "name": "Create",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -1904,
        736
      ],
      "id": "bf39890a-1930-497a-875b-a619ee3280be",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://primary-production-42b01.up.railway.app/webhook/a099d311-150f-4a53-a7fa-e5d6f2bea2dc",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{$fromAI('json')}}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.2,
      "position": [
        -384,
        640
      ],
      "id": "dd2f90c8-88a9-44ba-933a-a295588da0f4",
      "name": "Gemini Image Agent"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "6b95f8dd-42f8-4f4b-833b-b757cd8299f7",
              "leftValue": "={{ $json.output }}",
              "rightValue": "edit",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -240,
        112
      ],
      "id": "12618a1d-4097-4735-a7cb-ea8045b1e128",
      "name": "If"
    },
    {
      "parameters": {
        "jsCode": "const text = $json.output;\n\n// \ud14d\uc2a4\ud2b8 \uad6c\uc870\uc5d0 \ub9de\ub294 \uc0c8\ub85c\uc6b4 \uc815\uaddc\uc2dd\uc744 \uc815\uc758\ud569\ub2c8\ub2e4.\n// 1. \uba54\uc2dc\uc9c0: \uae00 \uc2dc\uc791\ubd80\ud130 '- \ubcf4\uae30 URL:' \uc55e\uae4c\uc9c0\uc758 \ubaa8\ub4e0 \ub0b4\uc6a9\nconst messageRegex = /^([\\s\\S]*?)\\n\\n- \ubcf4\uae30 URL:/;\n\n// 2. \ub2e4\uc6b4\ub85c\ub4dc ID: '- \ub2e4\uc6b4\ub85c\ub4dc URL: ' \ub4a4\uc5d0 \uc788\ub294 id \uac12\nconst idRegex = /- \ub2e4\uc6b4\ub85c\ub4dc URL: .*?\\?id=([\\w-]+)/;\n\n// \uc815\uaddc\uc2dd\uc744 \uc2e4\ud589\ud558\uc5ec \uacb0\uacfc\ub97c \ucc3e\uc2b5\ub2c8\ub2e4.\nconst messageMatch = text.match(messageRegex);\nconst idMatch = text.match(idRegex);\n\n// \ucd94\ucd9c\ub41c \uc815\ubcf4\ub97c \uc0c8\ub85c\uc6b4 JSON \uac1d\uccb4\ub85c \ub9cc\ub4ed\ub2c8\ub2e4.\nconst result = {\n  message: messageMatch ? messageMatch[1].trim() : null,\n  downloadId: idMatch ? idMatch[1] : null\n};\n\nreturn result;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "id": "61273a58-6e91-44cd-bdaa-5dc661a91116",
      "name": "Code2"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.downloadId }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        192,
        0
      ],
      "id": "8d4f89f5-8028-46d8-8c23-56f82ab7af6e",
      "name": "Download file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "binaryData": true,
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        352,
        0
      ],
      "id": "f50b1e78-ad5f-4a23-b662-61a40bade8c5",
      "name": "Send a photo message",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "text": "={{ $('AI Agent').item.json.output }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        544,
        0
      ],
      "id": "043ef80e-f3b9-4c37-8251-4e28828fb6b2",
      "name": "Send a text message2",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "description": "\uc5ed\ud560\n\ub108\ub294 \u2018Think Agent\u2019\ub2e4. Parent\uac00 \uc120\ud0dd\ud55c \uc791\uc5c5\uc744 \uc704\ud574 \ubd80\uc871 \uc2ac\ub86f\ub9cc 1~3\ubb38\ud56d\uc73c\ub85c \uc9e7\uac8c \ubb3c\uc5b4\ubcf4\uace0, \uac01 \ub3c4\uad6c\uac00 \ubc14\ub85c \uc4f8 \uc218 \uc788\ub294 \uc815\uaddc\ud654 \uacb0\uacfc\ub97c \ub3cc\ub824\uc900\ub2e4. \uc9c1\uc811 \uc870\ud68c/\uc81c\uc5b4/\uc0dd\uc131\uc740 \ud558\uc9c0 \uc54a\ub294\ub2e4.\n\n\uc9c8\ubb38 \uc6d0\uce59\n- 1~3\ubb38\ud56d, \ubd88\ub9bf/\ubc88\ud638. \uac00\ub2a5\ud558\uba74 \uc120\ud0dd\uc9c0(\uc608: 22/23/24\u2103, \uc624\ub298/\ub0b4\uc77c, 30/60\ubd84).\n- \uc9c0\uae08\uae4c\uc9c0 \ud30c\uc545\ud55c \ub0b4\uc6a9 + \ubd80\uc871 \uc2ac\ub86f\uc744 \ud55c \uc904 \uc694\uc57d \ud6c4 \uc9c8\ubb38.\n- \ubaa8\ud638\ud558\uba74 \ud55c \ubc88 \ub354 \uc881\ud600 \ubb3b\uace0, \ub098\uba38\uc9c0\ub294 \ubcf4\uc218\uc801 \uae30\ubcf8\uac12.\n- \ub9c8\uc9c0\ub9c9 \uc904\uc5d0 **Output Contract JSON**\uc744 1\uc904(minified)\ub85c \ub123\uace0, \ud0c0\uc785(\uc22b\uc790/\ubc30\uc5f4) \ubcf4\uc874.\n\n\ub3c4\uba54\uc778 \ubd84\ub958\n- domain \u2208 {\"smartthings\",\"calendar\",\"image\"}\n- smartthings: \uc5d0\uc5b4\ucee8/\uc870\uba85/\uc2a4\uc704\uce58/\uc7a5\uba74/\uc628\ub3c4/\ub0c9\ubc29/\ub09c\ubc29/\uc81c\uc2b5\u2026\n- calendar: \uc77c\uc815/\ud68c\uc758/\uc608\uc57d/\uac00\uc6a9\uc2dc\uac04/\uc2dc\uac04/\ub0a0\uc9dc/\ub0b4\uc77c/\uc774\ubc88 \uc8fc\u2026\n- image: \uc0ac\uc9c4/\uc774\ubbf8\uc9c0/\ud3b8\uc9d1/\uc790\ub974\uae30/\ubc30\uacbd \uc81c\uac70/\ubcf4\uc815/\uc2a4\ud2f0\ucee4 \ucd94\uac00/\ud14d\uc2a4\ud2b8 \ub123\uae30\u2026\n\n[SMARTTHINGS]  \n- intent \u2208 {\"list\",\"status\",\"command\",\"scene\"}\n- label(\ub610\ub294 \uacf5\uac04+\uae30\uae30\uba85) \uc2dd\ubcc4, deviceId \ucd94\uce21 \uae08\uc9c0(\uc11c\ube0c\uac00 \uc870\ud68c/\ub9e4\uce6d).\n- delta(\u201c1\ub3c4 \ub0ae\ucdb0/\uc62c\ub824\u201d)\uba74 \ud604\uc7ac setpoint\uac00 \uc5c6\uc73c\uba74 ask\ub85c \ud655\uc778/\uc0c1\ud0dc\uc694\uccad \uc720\ub3c4, \uc788\uc73c\uba74 target=\ud604\uc7ac+delta \uacc4\uc0b0\ud558\uc5ec \uc808\ub300\uac12\uc73c\ub85c commands \uad6c\uc131.\n\n\uc608\uc2dc\n\uc0ac\uc6a9\uc790: \u201c\uac70\uc2e4 \uc5d0\uc5b4\ucee8 1\ub3c4 \ub0ae\ucdb0\u201d\n\u2192 \uc694\uc57d: \uac70\uc2e4 \uc5d0\uc5b4\ucee8\uc744 \ud604\uc7ac \uc124\uc815\uc5d0\uc11c 1\u2103 \ub0ae\ucd94\ub824 \ud569\ub2c8\ub2e4.\n\u2192 {\"ok\":true,\"domain\":\"smartthings\",\"intent\":\"command\",\"missing\":[\"label\"],\"ask\":\"\uc5b4\ub290 \uc5d0\uc5b4\ucee8\uc778\uac00\uc694? \uc608) \uac70\uc2e4/\uc548\ubc29/\uc544\uc774\ubc29\",\"handoff\":{\"text\":\"\uac70\uc2e4 \uc5d0\uc5b4\ucee8 1\ub3c4 \ub0ae\ucdb0\",\"label\":\"\",\"notes\":\"delta:-1\"}}\n\n\n\n\n[CALENDAR]  \n- intent \u2208 {\"find\",\"create\",\"update\",\"freebusy\",\"delete\",\"get\"}\n- \ucd5c\uc18c \uc2ac\ub86f: create=title, start/end(+timeZone); find/freebusy=timeMin/timeMax(+timeZone) \ub4f1.\n\n[Gemini Image Agent]\n- intent(\uace0\uc815): \"edit\"  (generate/variations \uae08\uc9c0)\n- \ud544\uc694\ud55c \uc2ac\ub86f:\n  - **downloadUrl** (\ub610\ub294 \ucca8\ubd80 \uc774\ubbf8\uc9c0): \ud3b8\uc9d1\ud560 \uc6d0\ubcf8 \uc774\ubbf8\uc9c0 \uc704\uce58\n  - **prompt**: \ud3b8\uc9d1 \uc9c0\uc2dc(\uc608: \u201c\ubc30\uacbd \uc81c\uac70\u201d, \u201c\ubc1d\uae30 +15, \ub300\ube44 +10\u201d, \u201c\ud53c\uc0ac\uccb4\ub9cc \ub0a8\uae30\uae30\u201d, \u201c\ubb38\uad6c \u2018SALE\u2019 \ucd94\uac00, \uc88c\uc0c1\ub2e8 36pt\u201d)\n  - **mimeType**: \uacb0\uacfc \ud3ec\ub9f7(\uae30\ubcf8 image/jpeg), **fileName**(\uc120\ud0dd)\n- \uc9c8\ubb38(\ubd80\uc871 \uc2dc):\n  1) \ud3b8\uc9d1\ud560 **\uc774\ubbf8\uc9c0 \ub9c1\ud06c**\uac00 \uc788\uc744\uae4c\uc694? (\uc608: https://\u2026)\n  2) \uc5b4\ub5a4 **\ud3b8\uc9d1**\uc744 \uc6d0\ud558\uc2dc\ub098\uc694? (\uc608: \ubc30\uacbd \uc81c\uac70/\ud06c\ub86d/\ubc1d\uae30/\uc790\ub9c9 \ucd94\uac00/\uc2a4\ud2f0\ucee4 \ucd94\uac00)\n  3) \uacb0\uacfc \ud3ec\ub9f7\uc740? (\uae30\ubcf8 JPG, \uc120\ud0dd: PNG)\n- \uc815\uaddc\ud654 \ub370\uc774\ud130(\ud234\ub85c \uc804\ub2ec):\n  {\n    \"mode\": \"edit\",\n    \"prompt\": \"<\ud3b8\uc9d1 \uc9c0\uc2dc \ud575\uc2ec\uc694\uc57d>\",\n    \"downloadUrl\": \"<\uc774\ubbf8\uc9c0 URL \ub610\ub294 \ud30c\uc77c ID>\",\n    \"mimeType\": \"image/jpeg|image/png\",\n    \"fileName\": \"<\uc120\ud0dd>\"\n  }\n- \uc8fc\uc758: \uc0c8 \uadf8\ub9bc \uc0dd\uc131/\ud569\uc131 \ud504\ub86c\ud504\ud2b8\ub294 \ub9cc\ub4e4\uc9c0 \uc54a\ub294\ub2e4. \ubc18\ub4dc\uc2dc **\uae30\uc874 \uc774\ubbf8\uc9c0 \ud3b8\uc9d1**\ub9cc.\n\n[\ucd9c\ub825 \ud615\uc2dd]\n- \uccab \uc904: \uc0ac\uc6a9\uc790\uc6a9 1\u20132\ubb38\uc7a5 \uc694\uc57d(\ud55c\uad6d\uc5b4).\n- \ub9c8\uc9c0\ub9c9 \uc904: Output Contract JSON(\ud55c \uc904, minified).\n\n[\uc608\uc2dc]\n\uc0ac\uc6a9\uc790: \"\uc774 \uc0ac\uc9c4 \ubc30\uacbd\ub9cc \uc9c0\uc6cc\uc918. PNG\ub85c\"\n\uc694\uc57d: \uc81c\uacf5\ub41c \uc0ac\uc9c4\uc5d0\uc11c \ubc30\uacbd\uc744 \uc81c\uac70\ud574 PNG\ub85c \ub0b4\ubcf4\ub0c5\ub2c8\ub2e4.\nJSON:\n{\"ok\":true,\"domain\":\"image\",\"action\":\"edit\",\"missing\":[],\"ask\":\"\",\"handoff\":{\"text\":\"\uc774 \uc0ac\uc9c4 \ubc30\uacbd\ub9cc \uc9c0\uc6cc\uc918. PNG\ub85c\",\"mode\":\"edit\",\"prompt\":\"\ubc30\uacbd \uc81c\uac70 \ud6c4 \ud22c\uba85 \ubc30\uacbd \uc720\uc9c0\",\"downloadUrl\":\"<\uc0ac\uc6a9\uc790\uac00 \uc900 \ub9c1\ud06c \ub610\ub294 \ud30c\uc77c>\",\"mimeType\":\"image/png\",\"fileName\":\"edited.png\"}}\n\n\uc0ac\uc6a9\uc790: \"\ubc1d\uae30 \uc870\uae08 \uc62c\ub9ac\uace0 \ub300\ube44\ub3c4 \uc0b4\uc9dd \uc62c\ub824\uc918\"\n\uc694\uc57d: \ubc1d\uae30\uc640 \ub300\ube44\ub97c \uc18c\ud3ed \ubcf4\uc815\ud569\ub2c8\ub2e4. \uc6d0\ubcf8 \uc774\ubbf8\uc9c0 \ub9c1\ud06c\uac00 \ud544\uc694\ud569\ub2c8\ub2e4.\nJSON:\n{\"ok\":false,\"domain\":\"image\",\"action\":\"edit\",\"missing\":[\"downloadUrl\"],\"ask\":\"\ud3b8\uc9d1\ud560 \uc774\ubbf8\uc9c0 \ub9c1\ud06c\ub97c \uc54c\ub824\uc8fc\uc138\uc694(\uc608: https://\u2026 ).\",\"handoff\":{\"text\":\"\ubc1d\uae30 \uc870\uae08 \uc62c\ub9ac\uace0 \ub300\ube44\ub3c4 \uc0b4\uc9dd \uc62c\ub824\uc918\",\"mode\":\"edit\",\"prompt\":\"\ubc1d\uae30 +10, \ub300\ube44 +10\"}}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "typeVersion": 1.1,
      "position": [
        -576,
        784
      ],
      "id": "09b89271-137a-4efc-b1bd-a0fd32861a75",
      "name": "Think"
    },
    {
      "parameters": {
        "model": "openai/gpt-5-mini",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -1008,
        672
      ],
      "id": "31a34eac-3738-49fe-bc8a-4b16b382c15b",
      "name": "OpenRouter Chat Model1",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-5",
          "mode": "list",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -864,
        736
      ],
      "id": "45a5b4f0-719a-42a8-8a02-c00c114c1514",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://primary-production-42b01.up.railway.app/webhook/18ed55b9-ed62-487c-b20e-7fd12bc86730",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "deviceId",
              "value": "={{$json.deviceId}}"
            },
            {
              "name": "commands",
              "value": "={{$json.commands}}"
            },
            {
              "name": "summary",
              "value": "={{$json.summary}}"
            },
            {
              "name": "text",
              "value": "={{$fromAI('json')}}"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.2,
      "position": [
        -240,
        640
      ],
      "id": "f7ba5fd2-1675-4f6b-9f75-9b44c38f5779",
      "name": "SmartThings"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get a voice",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get a photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a photo": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a voice": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calendar Agent": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "List": {
      "ai_tool": [
        [
          {
            "node": "Calendar Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get": {
      "ai_tool": [
        [
          {
            "node": "Calendar Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update": {
      "ai_tool": [
        [
          {
            "node": "Calendar Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delete": {
      "ai_tool": [
        [
          {
            "node": "Calendar Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create": {
      "ai_tool": [
        [
          {
            "node": "Calendar Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Calendar Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Image Agent": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a photo message": {
      "main": [
        [
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "SmartThings": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "22aaa548-e003-4266-94bb-4f45ead2fe62",
  "id": "vZnViANFzUditMLw",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Housemate. Uses telegramTrigger, openAi, googleDrive, telegram. Event-driven trigger; 34 nodes.

Source: https://github.com/terrykim12/Housemate/blob/94aa9b610cc478b1a1bc4999d3f3c6c5c04041f2/Housemate.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.

OpenAI, HTTP Request, Form Trigger +7
AI & RAG

BoomerBobBot.TP. Uses agent, telegramTrigger, telegram, memoryBufferWindow. Event-driven trigger; 95 nodes.

Agent, Telegram Trigger, Telegram +10
AI & RAG

Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.

@Blotato/N8N Nodes Blotato, Google Sheets, OpenAI Chat +9
AI & RAG

Telegram Trigger receives incoming messages (text, voice, photo, document). Switch routes by message type to appropriate processors: Text → forwarded as-is. Voice → downloaded and sent to Transcribe a

Memory Buffer Window, Telegram Trigger, Telegram +12
AI & RAG

Transform your Telegram messenger into a powerful, multi-modal personal or team assistant. This n8n workflow creates an intelligent agent that can understand text, voice, images, and documents, and ta

Memory Buffer Window, Telegram Trigger, Telegram +10