8
n8n 한국어amn8n.com

Notion 데이터베이스에서 빈 페이지 아카이빙

중급

이것은Building Blocks분야의자동화 워크플로우로, 10개의 노드를 포함합니다.주로 If, Cron, Notion, Function, SplitInBatches 등의 노드를 사용하며. Notion 데이터베이스에서 빈 페이지 아카이빙

사전 요구사항
  • Notion API Key

카테고리

워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": 115,
  "name": "Archive empty pages in Notion Database",
  "nodes": [
    {
      "name": "모든 데이터베이스 가져오기",
      "type": "n8n-nodes-base.notion",
      "position": [
        240,
        300
      ],
      "parameters": {
        "resource": "database",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "notionApi": {
          "id": "36",
          "name": "Notion account"
        }
      },
      "typeVersion": 2,
      "id": "--0"
    },
    {
      "name": "모든 데이터베이스 페이지 가져오기",
      "type": "n8n-nodes-base.notion",
      "position": [
        420,
        300
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "operation": "getAll",
        "returnAll": true,
        "databaseId": "={{$json[\"id\"]}}"
      },
      "credentials": {
        "notionApi": {
          "id": "36",
          "name": "Notion account"
        }
      },
      "typeVersion": 2,
      "id": "--1"
    },
    {
      "name": "페이지 블록 가져오기",
      "type": "n8n-nodes-base.notion",
      "position": [
        1180,
        280
      ],
      "parameters": {
        "blockId": "={{$json[\"id\"]}}",
        "resource": "block",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "notionApi": {
          "id": "36",
          "name": "Notion account"
        }
      },
      "typeVersion": 2,
      "alwaysOutputData": true,
      "id": "--2"
    },
    {
      "name": "블록 처리하기",
      "type": "n8n-nodes-base.function",
      "position": [
        1360,
        280
      ],
      "parameters": {
        "functionCode": "let returnData = {\n  json: {\n    toDelete: false,\n    pageID: $node[\"SplitInBatches\"].json[\"id\"],\n  }\n};\n\nif (!items[0].json.id) {\n  returnData.json.toDelete = true;\n  return [returnData];\n}\n\nfor (item of items) {\n  \n  let toDelete = false;\n\n  let type = item.json.type;\n  let data = item.json[type];\n\n  if (!toDelete) {\n    if (data.text.length == 0) {\n      toDelete = true;\n    } else {\n      returnData.json.toDelete = false;\n      break;\n    }\n  }\n\n  returnData.json.toDelete = toDelete;\n}\n\nreturn [returnData];"
      },
      "typeVersion": 1,
      "id": "--3"
    },
    {
      "name": "배치로 나누기",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1000,
        280
      ],
      "parameters": {
        "options": {},
        "batchSize": 1
      },
      "typeVersion": 1,
      "id": "--4"
    },
    {
      "name": "빈 속성 확인하기",
      "type": "n8n-nodes-base.function",
      "position": [
        600,
        300
      ],
      "parameters": {
        "functionCode": "for (item of items) {\n\n  let toDelete = false;\n  for (const key in item.json.properties) {\n    let type = item.json.properties[key].type;\n    let data = item.json.properties[key][type];\n    \n    if (!data || data.length == 0) {\n      toDelete = true;\n    } else {\n      toDelete = false;\n      break;\n    }\n  }\n\n  item.json.toDelete = toDelete;\n}\n\nreturn items;"
      },
      "typeVersion": 1,
      "id": "--5"
    },
    {
      "name": "페이지 보관하기",
      "type": "n8n-nodes-base.notion",
      "position": [
        1760,
        260
      ],
      "parameters": {
        "pageId": "={{$json[\"pageID\"]}}",
        "operation": "archive"
      },
      "credentials": {
        "notionApi": {
          "id": "36",
          "name": "Notion account"
        }
      },
      "typeVersion": 2,
      "id": "--6"
    },
    {
      "name": "삭제 여부 확인",
      "type": "n8n-nodes-base.if",
      "position": [
        1560,
        280
      ],
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{$json[\"toDelete\"]}}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 1,
      "id": "--7"
    },
    {
      "name": "빈 속성 확인",
      "type": "n8n-nodes-base.if",
      "position": [
        760,
        300
      ],
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{$json[\"toDelete\"]}}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 1,
      "id": "--8"
    },
    {
      "name": "매일 오전 2시",
      "type": "n8n-nodes-base.cron",
      "position": [
        80,
        300
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 2
            }
          ]
        }
      },
      "typeVersion": 1,
      "id": "-2--9"
    }
  ],
  "active": false,
  "settings": {},
  "connections": {
    "--7": {
      "main": [
        [
          {
            "node": "--6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--3": {
      "main": [
        [
          {
            "node": "--7",
            "type": "main",
            "index": 0
          },
          {
            "node": "--4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--4": {
      "main": [
        [
          {
            "node": "--2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "-2--9": {
      "main": [
        [
          {
            "node": "--0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--2": {
      "main": [
        [
          {
            "node": "--3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--0": {
      "main": [
        [
          {
            "node": "--1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--8": {
      "main": [
        [
          {
            "node": "--4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--1": {
      "main": [
        [
          {
            "node": "--5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--5": {
      "main": [
        [
          {
            "node": "--8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 빌딩 블록

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수10
카테고리1
노드 유형5
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34