{
  "name": "n8n_Heartbeat",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "id": "schedule-heartbeat",
      "name": "\u23f0 \u041f\u0443\u043b\u044c\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043a\u0430\u0436\u0434\u044b\u0435 15 \u043c\u0438\u043d)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "operation": "upsert",
        "schema": "public",
        "table": "automation_flows",
        "dataMode": "manual",
        "manualConfigData": {
          "columns": [
            {
              "column": "project_id",
              "value": "64c94e87-630c-470e-8ab1-8f7c8c835efa"
            },
            {
              "column": "name",
              "value": "\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 (Core)"
            },
            {
              "column": "status",
              "value": "active"
            },
            {
              "column": "last_run",
              "value": "={{ $now }}"
            }
          ]
        },
        "options": {
          "upsertKey": "name",
          "upsertConflictColumns": [
            "project_id",
            "name"
          ]
        }
      },
      "id": "supabase-heartbeat",
      "name": "\ud83d\udcbe \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 (Core)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "values": {
          "boolean": [
            {
              "name": "success",
              "value": true
            }
          ],
          "string": [
            {
              "name": "message",
              "value": "\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e"
            },
            {
              "name": "timestamp",
              "value": "={{ $now.format('DD.MM.YYYY HH:mm:ss') }}"
            }
          ]
        },
        "options": {}
      },
      "id": "set-success",
      "name": "\u2705 \u0421\u0438\u0441\u0442\u0435\u043c\u0430 OK",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "errorMessage": "={{ $json.error || '\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b' }}",
        "options": {}
      },
      "id": "error-trigger",
      "name": "\u274c \u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b",
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        240,
        500
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "schema": "public",
        "table": "automation_flows",
        "updateKey": "name",
        "updateKeyValue": "\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 (Core)",
        "dataMode": "manual",
        "manualConfigData": {
          "columns": [
            {
              "column": "status",
              "value": "error"
            },
            {
              "column": "last_run",
              "value": "={{ $now }}"
            }
          ]
        }
      },
      "id": "supabase-error-log",
      "name": "\ud83d\udcbe \u0417\u0430\u043f\u0438\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0438",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        500
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "\u23f0 \u041f\u0443\u043b\u044c\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043a\u0430\u0436\u0434\u044b\u0435 15 \u043c\u0438\u043d)": {
      "main": [
        [
          {
            "node": "\ud83d\udcbe \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 (Core)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcbe \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 (Core)": {
      "main": [
        [
          {
            "node": "\u2705 \u0421\u0438\u0441\u0442\u0435\u043c\u0430 OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u274c \u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b": {
      "main": [
        [
          {
            "node": "\ud83d\udcbe \u0417\u0430\u043f\u0438\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0438",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "versionId": "1"
}