Notion データベースに空白ページをアーカイブ
中級
これはBuilding Blocks分野の自動化ワークフローで、10個のノードを含みます。主にIf, Cron, Notion, Function, SplitInBatchesなどのノードを使用。 Notion データベース内の空のページをアーカイブ
前提条件
- •Notion API Key
使用ノード (10)
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": 115,
"name": "Archive empty pages in Notion Database",
"nodes": [
{
"name": "Get All Databases",
"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": "Get-All-Databases-0"
},
{
"name": "Get All Database Pages",
"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": "Get-All-Database-Pages-1"
},
{
"name": "Get Page Blocks",
"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": "Get-Page-Blocks-2"
},
{
"name": "Process Blocks",
"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": "Process-Blocks-3"
},
{
"name": "SplitInBatches",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1000,
280
],
"parameters": {
"options": {},
"batchSize": 1
},
"typeVersion": 1,
"id": "SplitInBatches-4"
},
{
"name": "Check for empty properties",
"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": "Check-for-empty-properties-5"
},
{
"name": "Archive Page",
"type": "n8n-nodes-base.notion",
"position": [
1760,
260
],
"parameters": {
"pageId": "={{$json[\"pageID\"]}}",
"operation": "archive"
},
"credentials": {
"notionApi": {
"id": "36",
"name": "Notion account"
}
},
"typeVersion": 2,
"id": "Archive-Page-6"
},
{
"name": "If toDelete",
"type": "n8n-nodes-base.if",
"position": [
1560,
280
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$json[\"toDelete\"]}}",
"value2": true
}
]
}
},
"typeVersion": 1,
"id": "If-toDelete-7"
},
{
"name": "If Empty Properties",
"type": "n8n-nodes-base.if",
"position": [
760,
300
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$json[\"toDelete\"]}}",
"value2": true
}
]
}
},
"typeVersion": 1,
"id": "If-Empty-Properties-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": {
"If-toDelete-7": {
"main": [
[
{
"node": "Archive-Page-6",
"type": "main",
"index": 0
}
]
]
},
"Process-Blocks-3": {
"main": [
[
{
"node": "If-toDelete-7",
"type": "main",
"index": 0
},
{
"node": "SplitInBatches-4",
"type": "main",
"index": 0
}
]
]
},
"SplitInBatches-4": {
"main": [
[
{
"node": "Get-Page-Blocks-2",
"type": "main",
"index": 0
}
]
]
},
"-2--9": {
"main": [
[
{
"node": "Get-All-Databases-0",
"type": "main",
"index": 0
}
]
]
},
"Get-Page-Blocks-2": {
"main": [
[
{
"node": "Process-Blocks-3",
"type": "main",
"index": 0
}
]
]
},
"Get-All-Databases-0": {
"main": [
[
{
"node": "Get-All-Database-Pages-1",
"type": "main",
"index": 0
}
]
]
},
"If-Empty-Properties-8": {
"main": [
[
{
"node": "SplitInBatches-4",
"type": "main",
"index": 0
}
]
]
},
"Get-All-Database-Pages-1": {
"main": [
[
{
"node": "Check-for-empty-properties-5",
"type": "main",
"index": 0
}
]
]
},
"Check-for-empty-properties-5": {
"main": [
[
{
"node": "If-Empty-Properties-8",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - ビルディングブロック
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Telegram へ複数の RSS ソースからデータを取得
複数の RSS ソースからデータを Telegram に取得
If
Cron
Function
+
If
Cron
Function
11 ノードValor
ビルディングブロック
[テンプレート] AIペットショップ v8
AIペットショップアシスタント - GPT-4o、Googleカレンダー、WhatsApp/Instagram/Facebookを統合
If
N8n
Set
+
If
N8n
Set
244 ノードAmanda Benks
営業
Blush Pink Week — 7日間のPinterestプランナ(n8n + Notion)
Notionとの連携機能付き7日間のPinterestコンテンツプランナー
If
Set
Cron
+
If
Set
Cron
17 ノードShelly-Ann Davy
ソーシャルメディア
ブログとLinkedInコンテンツ作成自動化
OpenAIとReplicate AI画像を使用して、ブログとLinkedInコンテンツの作成を自動化
If
Set
Code
+
If
Set
Code
28 ノードSagar Budhathoki
コンテンツ作成
エレガントなコンテンツ起動 — RSS → Notion(n8n)
RSS フィードを日次のコンテンツアイデアへ整理し、メールで送信。Notion および Telegram オプションも対応
If
Set
Cron
+
If
Set
Cron
20 ノードShelly-Ann Davy
コンテンツ作成
アフォーム送信機+週次の感謝サマリー(ヘルス)v2
Notion、メール、Telegramを使って隔日の肯定メッセージと週次の感謝要約を送信
If
Set
Cron
+
If
Set
Cron
26 ノードShelly-Ann Davy
個人の生産性