{"updatedAt": "2026-04-06T16:20:21.752Z", "createdAt": "2026-03-27T23:53:36.662Z", "id": "YOUR_WORKFLOW_ID", "name": "Postiz NocoDB Sync", "description": null, "active": true, "isArchived": false, "nodes": [{"parameters": {"rule": {"interval": [{"field": "cronExpression", "expression": "0 8-22 * * *"}]}}, "id": "cron-trigger", "name": "Every Hour (8am-10pm CT)", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [0, 0]}, {"parameters": {"jsCode": "// Build date range: last 24 hours\nconst now = new Date();\nconst yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);\n\nconst startDate = yesterday.toISOString().replace(/\\.\\d{3}Z$/, '.000Z');\nconst endDate = now.toISOString().replace(/\\.\\d{3}Z$/, '.000Z');\n\nreturn [{ json: { startDate, endDate } }];"}, "id": "build-dates", "name": "Build Date Range", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [220, 0]}, {"parameters": {"method": "GET", "url": "=http://YOUR_POSTIZ_URL/api/public/v1/posts?startDate={{ encodeURIComponent($json.startDate) }}&endDate={{ encodeURIComponent($json.endDate) }}", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "Authorization", "value": "YOUR_POSTIZ_API_KEY43ac61a81686bf081fb7b3f1"}]}, "options": {"response": {"response": {"fullResponse": false}}}}, "id": "fetch-postiz-posts", "name": "Fetch Postiz Posts", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [440, 0]}, {"parameters": {"jsCode": "// Extract PUBLISHED posts from API response and emit one item per post\nconst response = $input.first().json;\nconst posts = response.posts || [];\n\nconsole.log(`Postiz poll: ${posts.length} total posts in window`);\n\nconst published = posts.filter(p => p.state === 'PUBLISHED');\nconsole.log(`Postiz poll: ${published.length} PUBLISHED posts`);\n\nif (published.length === 0) {\n  return [];\n}\n\nreturn published.map(post => ({\n  json: {\n    postId: post.id,\n    content: (post.content || '').replace(/<[^>]*>/g, '').trim(),\n    platform: post.integration?.providerIdentifier || 'unknown',\n    releaseURL: post.releaseURL || '',\n    publishDate: post.publishDate\n  }\n}));"}, "id": "filter-published", "name": "Filter Published Posts", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [660, 0]}, {"parameters": {"method": "GET", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mwoewxv3gj0qaj6", "sendQuery": true, "queryParameters": {"parameters": [{"name": "where", "value": "=(Postiz Post ID,eq,{{ $json.postId }})"}, {"name": "limit", "value": "1"}]}, "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "options": {}}, "id": "search-social-media", "name": "Search Social Media Record", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [880, 0]}, {"parameters": {"jsCode": "// Check if the Social Media record exists and needs updating\nconst searchResult = $input.first().json;\nconst postData = $node[\"Filter Published Posts\"].json;\n\nconst list = searchResult.list || [];\nif (list.length === 0) {\n  console.log('No Social Media record found for Postiz Post ID:', postData.postId);\n  return [];\n}\n\nconst record = list[0];\nif (record.Status === 'Published') {\n  console.log('Already Published - skipping:', postData.postId);\n  return [];\n}\n\n// Pass through with record context\nreturn [{\n  json: {\n    socialRecordId: record.Id,\n    socialTitle: record.Title || '',\n    currentStatus: record.Status,\n    postId: postData.postId,\n    platform: postData.platform,\n    releaseURL: postData.releaseURL\n  }\n}];"}, "id": "check-needs-update", "name": "Needs Update?", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1100, 0]}, {"parameters": {"method": "PATCH", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mwoewxv3gj0qaj6/{{ $json.socialRecordId }}", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "sendBody": true, "bodyParameters": {"parameters": [{"name": "Status", "value": "Published"}]}, "options": {}}, "id": "update-social-media", "name": "Update Social Media Published", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1320, 0]}, {"parameters": {"jsCode": "// After updating the Social Media record, look up the parent Content record\nconst updateResult = $input.first().json;\nconst checkData = $node[\"Needs Update?\"].json;\n\nreturn [{\n  json: {\n    socialTitle: checkData.socialTitle,\n    socialRecordId: checkData.socialRecordId,\n    platform: checkData.platform,\n    releaseURL: checkData.releaseURL,\n    postId: checkData.postId\n  }\n}];"}, "id": "prepare-content-lookup", "name": "Prepare Content Lookup", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1540, 0]}, {"parameters": {"conditions": {"options": {"version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "conditions": [{"id": "check-has-title", "leftValue": "={{ $json.socialTitle }}", "rightValue": "", "operator": {"type": "string", "operation": "isNotEmpty", "singleValue": true}}], "combinator": "and"}, "options": {}}, "id": "if-has-title", "name": "Has Title for Content Lookup?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [1760, 0]}, {"parameters": {"method": "GET", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mxsvmofsnvkt1bs", "sendQuery": true, "queryParameters": {"parameters": [{"name": "where", "value": "=(Name,eq,{{ $json.socialTitle }})"}, {"name": "limit", "value": "1"}]}, "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "options": {}}, "id": "search-content", "name": "Search Content Record", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1980, -120]}, {"parameters": {"jsCode": "// Check if content record found and if all social media records are now Published\nconst searchResult = $input.first().json;\nconst lookupData = $node[\"Prepare Content Lookup\"].json;\n\nconst list = searchResult.list || [];\nif (list.length === 0) {\n  console.log('No Content record found matching title:', lookupData.socialTitle);\n  return [];\n}\n\nconst contentRecord = list[0];\n\n// Already Published\nif (contentRecord.Status === 'Published') {\n  console.log('Content already Published, sending email for social update:', lookupData.postId);\n  return [{ json: { contentRecordId: null, shouldUpdateContent: false, contentTitle: contentRecord.Name || lookupData.socialTitle, platform: lookupData.platform, releaseURL: lookupData.releaseURL } }];\n}\n\nreturn [{ json: { contentRecordId: contentRecord.Id, shouldUpdateContent: true, contentTitle: contentRecord.Name || lookupData.socialTitle, platform: lookupData.platform, releaseURL: lookupData.releaseURL } }];"}, "id": "check-content-status", "name": "Check Content Status", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [2200, -120]}, {"parameters": {"method": "GET", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mwoewxv3gj0qaj6", "sendQuery": true, "queryParameters": {"parameters": [{"name": "where", "value": "=(Title,eq,{{ $json.contentTitle }})"}, {"name": "limit", "value": "50"}]}, "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "options": {}}, "id": "get-all-social-records", "name": "Get All Social Media Records", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [2420, -120]}, {"parameters": {"jsCode": "// Check if ALL social media records for this content are now Published\nconst searchResult = $input.first().json;\nconst contentData = $node[\"Check Content Status\"].json;\n\nconst allRecords = searchResult.list || [];\nif (allRecords.length === 0) {\n  // No social records found - safe to update content\n  return [{ json: { ...contentData, allPublished: true } }];\n}\n\nconst allPublished = allRecords.every(r => r.Status === 'Published');\nconsole.log(`Social records for content: ${allRecords.length} total, allPublished: ${allPublished}`);\n\nreturn [{ json: { ...contentData, allPublished } }];"}, "id": "check-all-published", "name": "All Social Records Published?", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [2640, -120]}, {"parameters": {"conditions": {"options": {"version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "conditions": [{"id": "check-all-pub", "leftValue": "={{ $json.allPublished }}", "rightValue": true, "operator": {"type": "boolean", "operation": "equals"}}, {"id": "check-has-content-id", "leftValue": "={{ $json.shouldUpdateContent }}", "rightValue": true, "operator": {"type": "boolean", "operation": "equals"}}], "combinator": "and"}, "options": {}}, "id": "if-update-content", "name": "All Published & Should Update?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [2860, -120]}, {"parameters": {"method": "PATCH", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mxsvmofsnvkt1bs/{{ $json.contentRecordId }}", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "sendBody": true, "bodyParameters": {"parameters": [{"name": "Status", "value": "Published"}]}, "options": {}}, "id": "update-content", "name": "Update Content Published", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [3080, -240]}, {"parameters": {"sendTo": "your-email@example.com", "subject": "=Published: {{ $node[\"All Social Records Published?\"].json.contentTitle }} ({{ $node[\"All Social Records Published?\"].json.platform }})", "emailType": "text", "message": "=Your {{ $node[\"All Social Records Published?\"].json.platform }} post '{{ $node[\"All Social Records Published?\"].json.contentTitle }}' just went live via Postiz.{{ $node[\"All Social Records Published?\"].json.releaseURL ? '\\n\\n' + $node[\"All Social Records Published?\"].json.releaseURL : '' }}\n\nNocoDB Content record updated to Published.", "options": {}}, "id": "send-email-content-updated", "name": "Send Publish Email (Content Updated)", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [3300, -240], "credentials": {"gmailOAuth2": {"id": "YOUR_CREDENTIAL_ID", "name": "YOUR_GMAILOAUTH2_CREDENTIAL"}}}, {"parameters": {"sendTo": "your-email@example.com", "subject": "=Published: {{ $node[\"All Social Records Published?\"].json.contentTitle }} ({{ $node[\"All Social Records Published?\"].json.platform }})", "emailType": "text", "message": "=Your {{ $node[\"All Social Records Published?\"].json.platform }} post '{{ $node[\"All Social Records Published?\"].json.contentTitle }}' just went live via Postiz.{{ $node[\"All Social Records Published?\"].json.releaseURL ? '\\n\\n' + $node[\"All Social Records Published?\"].json.releaseURL : '' }}\n\nOther platforms still pending \u2014 Content record kept in current status.", "options": {}}, "id": "send-email-partial", "name": "Send Publish Email (Partial)", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [3080, 0], "credentials": {"gmailOAuth2": {"id": "YOUR_CREDENTIAL_ID", "name": "YOUR_GMAILOAUTH2_CREDENTIAL"}}}, {"parameters": {"sendTo": "your-email@example.com", "subject": "=Published: {{ $node[\"Prepare Content Lookup\"].json.socialTitle }} ({{ $node[\"Prepare Content Lookup\"].json.platform }})", "emailType": "text", "message": "=Your {{ $node[\"Prepare Content Lookup\"].json.platform }} post just went live via Postiz.{{ $node[\"Prepare Content Lookup\"].json.releaseURL ? '\\n\\n' + $node[\"Prepare Content Lookup\"].json.releaseURL : '' }}\n\nNote: No matching Content record found in NocoDB.", "options": {}}, "id": "send-email-no-content", "name": "Send Publish Email (No Content Record)", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [1980, 120], "credentials": {"gmailOAuth2": {"id": "YOUR_CREDENTIAL_ID", "name": "YOUR_GMAILOAUTH2_CREDENTIAL"}}}], "connections": {"Every Hour (8am-10pm CT)": {"main": [[{"node": "Build Date Range", "type": "main", "index": 0}]]}, "Build Date Range": {"main": [[{"node": "Fetch Postiz Posts", "type": "main", "index": 0}]]}, "Fetch Postiz Posts": {"main": [[{"node": "Filter Published Posts", "type": "main", "index": 0}]]}, "Filter Published Posts": {"main": [[{"node": "Search Social Media Record", "type": "main", "index": 0}]]}, "Search Social Media Record": {"main": [[{"node": "Needs Update?", "type": "main", "index": 0}]]}, "Needs Update?": {"main": [[{"node": "Update Social Media Published", "type": "main", "index": 0}]]}, "Update Social Media Published": {"main": [[{"node": "Prepare Content Lookup", "type": "main", "index": 0}]]}, "Prepare Content Lookup": {"main": [[{"node": "Has Title for Content Lookup?", "type": "main", "index": 0}]]}, "Has Title for Content Lookup?": {"main": [[{"node": "Search Content Record", "type": "main", "index": 0}], [{"node": "Send Publish Email (No Content Record)", "type": "main", "index": 0}]]}, "Search Content Record": {"main": [[{"node": "Check Content Status", "type": "main", "index": 0}]]}, "Check Content Status": {"main": [[{"node": "Get All Social Media Records", "type": "main", "index": 0}]]}, "Get All Social Media Records": {"main": [[{"node": "All Social Records Published?", "type": "main", "index": 0}]]}, "All Social Records Published?": {"main": [[{"node": "All Published & Should Update?", "type": "main", "index": 0}]]}, "All Published & Should Update?": {"main": [[{"node": "Update Content Published", "type": "main", "index": 0}], [{"node": "Send Publish Email (Partial)", "type": "main", "index": 0}]]}, "Update Content Published": {"main": [[{"node": "Send Publish Email (Content Updated)", "type": "main", "index": 0}]]}}, "settings": {"executionOrder": "v1", "timezone": "America/Chicago", "callerPolicy": "workflowsFromSameOwner", "availableInMCP": false}, "staticData": {"node:Every 30 Min (8am-10pm CT)": {"recurrenceRules": []}, "node:Every Hour (8am-10pm CT)": {"recurrenceRules": []}}, "meta": null, "pinData": null, "versionId": "33a8d4f1-39ef-47c4-9206-5dc3d923eca1", "activeVersionId": "33a8d4f1-39ef-47c4-9206-5dc3d923eca1", "versionCounter": 31, "triggerCount": 1, "shared": [{"updatedAt": "2026-03-27T23:53:36.662Z", "createdAt": "2026-03-27T23:53:36.662Z", "role": "workflow:owner", "workflowId": "YsB2phy3H68uI2nX", "projectId": "6RTJ3ead58ncl4Hy", "project": {"updatedAt": "2025-01-23T18:31:39.020Z", "createdAt": "2025-01-23T05:37:52.794Z", "id": "6RTJ3ead58ncl4Hy", "name": "Edward Chalupa <your-email@example.com>", "type": "personal", "icon": null, "description": null, "creatorId": "YOUR_N8N_USER_ID"}}], "tags": [], "activeVersion": {"updatedAt": "2026-04-06T16:20:21.755Z", "createdAt": "2026-04-06T16:20:21.755Z", "versionId": "33a8d4f1-39ef-47c4-9206-5dc3d923eca1", "workflowId": "YsB2phy3H68uI2nX", "nodes": [{"parameters": {"rule": {"interval": [{"field": "cronExpression", "expression": "0 8-22 * * *"}]}}, "id": "cron-trigger", "name": "Every Hour (8am-10pm CT)", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [0, 0]}, {"parameters": {"jsCode": "// Build date range: last 24 hours\nconst now = new Date();\nconst yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);\n\nconst startDate = yesterday.toISOString().replace(/\\.\\d{3}Z$/, '.000Z');\nconst endDate = now.toISOString().replace(/\\.\\d{3}Z$/, '.000Z');\n\nreturn [{ json: { startDate, endDate } }];"}, "id": "build-dates", "name": "Build Date Range", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [220, 0]}, {"parameters": {"method": "GET", "url": "=http://YOUR_POSTIZ_URL/api/public/v1/posts?startDate={{ encodeURIComponent($json.startDate) }}&endDate={{ encodeURIComponent($json.endDate) }}", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "Authorization", "value": "YOUR_POSTIZ_API_KEY43ac61a81686bf081fb7b3f1"}]}, "options": {"response": {"response": {"fullResponse": false}}}}, "id": "fetch-postiz-posts", "name": "Fetch Postiz Posts", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [440, 0]}, {"parameters": {"jsCode": "// Extract PUBLISHED posts from API response and emit one item per post\nconst response = $input.first().json;\nconst posts = response.posts || [];\n\nconsole.log(`Postiz poll: ${posts.length} total posts in window`);\n\nconst published = posts.filter(p => p.state === 'PUBLISHED');\nconsole.log(`Postiz poll: ${published.length} PUBLISHED posts`);\n\nif (published.length === 0) {\n  return [];\n}\n\nreturn published.map(post => ({\n  json: {\n    postId: post.id,\n    content: (post.content || '').replace(/<[^>]*>/g, '').trim(),\n    platform: post.integration?.providerIdentifier || 'unknown',\n    releaseURL: post.releaseURL || '',\n    publishDate: post.publishDate\n  }\n}));"}, "id": "filter-published", "name": "Filter Published Posts", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [660, 0]}, {"parameters": {"method": "GET", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mwoewxv3gj0qaj6", "sendQuery": true, "queryParameters": {"parameters": [{"name": "where", "value": "=(Postiz Post ID,eq,{{ $json.postId }})"}, {"name": "limit", "value": "1"}]}, "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "options": {}}, "id": "search-social-media", "name": "Search Social Media Record", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [880, 0]}, {"parameters": {"jsCode": "// Check if the Social Media record exists and needs updating\nconst searchResult = $input.first().json;\nconst postData = $node[\"Filter Published Posts\"].json;\n\nconst list = searchResult.list || [];\nif (list.length === 0) {\n  console.log('No Social Media record found for Postiz Post ID:', postData.postId);\n  return [];\n}\n\nconst record = list[0];\nif (record.Status === 'Published') {\n  console.log('Already Published - skipping:', postData.postId);\n  return [];\n}\n\n// Pass through with record context\nreturn [{\n  json: {\n    socialRecordId: record.Id,\n    socialTitle: record.Title || '',\n    currentStatus: record.Status,\n    postId: postData.postId,\n    platform: postData.platform,\n    releaseURL: postData.releaseURL\n  }\n}];"}, "id": "check-needs-update", "name": "Needs Update?", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1100, 0]}, {"parameters": {"method": "PATCH", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mwoewxv3gj0qaj6/{{ $json.socialRecordId }}", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "sendBody": true, "bodyParameters": {"parameters": [{"name": "Status", "value": "Published"}]}, "options": {}}, "id": "update-social-media", "name": "Update Social Media Published", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1320, 0]}, {"parameters": {"jsCode": "// After updating the Social Media record, look up the parent Content record\nconst updateResult = $input.first().json;\nconst checkData = $node[\"Needs Update?\"].json;\n\nreturn [{\n  json: {\n    socialTitle: checkData.socialTitle,\n    socialRecordId: checkData.socialRecordId,\n    platform: checkData.platform,\n    releaseURL: checkData.releaseURL,\n    postId: checkData.postId\n  }\n}];"}, "id": "prepare-content-lookup", "name": "Prepare Content Lookup", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1540, 0]}, {"parameters": {"conditions": {"options": {"version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "conditions": [{"id": "check-has-title", "leftValue": "={{ $json.socialTitle }}", "rightValue": "", "operator": {"type": "string", "operation": "isNotEmpty", "singleValue": true}}], "combinator": "and"}, "options": {}}, "id": "if-has-title", "name": "Has Title for Content Lookup?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [1760, 0]}, {"parameters": {"method": "GET", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mxsvmofsnvkt1bs", "sendQuery": true, "queryParameters": {"parameters": [{"name": "where", "value": "=(Name,eq,{{ $json.socialTitle }})"}, {"name": "limit", "value": "1"}]}, "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "options": {}}, "id": "search-content", "name": "Search Content Record", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1980, -120]}, {"parameters": {"jsCode": "// Check if content record found and if all social media records are now Published\nconst searchResult = $input.first().json;\nconst lookupData = $node[\"Prepare Content Lookup\"].json;\n\nconst list = searchResult.list || [];\nif (list.length === 0) {\n  console.log('No Content record found matching title:', lookupData.socialTitle);\n  return [];\n}\n\nconst contentRecord = list[0];\n\n// Already Published\nif (contentRecord.Status === 'Published') {\n  console.log('Content already Published, sending email for social update:', lookupData.postId);\n  return [{ json: { contentRecordId: null, shouldUpdateContent: false, contentTitle: contentRecord.Name || lookupData.socialTitle, platform: lookupData.platform, releaseURL: lookupData.releaseURL } }];\n}\n\nreturn [{ json: { contentRecordId: contentRecord.Id, shouldUpdateContent: true, contentTitle: contentRecord.Name || lookupData.socialTitle, platform: lookupData.platform, releaseURL: lookupData.releaseURL } }];"}, "id": "check-content-status", "name": "Check Content Status", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [2200, -120]}, {"parameters": {"method": "GET", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mwoewxv3gj0qaj6", "sendQuery": true, "queryParameters": {"parameters": [{"name": "where", "value": "=(Title,eq,{{ $json.contentTitle }})"}, {"name": "limit", "value": "50"}]}, "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "options": {}}, "id": "get-all-social-records", "name": "Get All Social Media Records", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [2420, -120]}, {"parameters": {"jsCode": "// Check if ALL social media records for this content are now Published\nconst searchResult = $input.first().json;\nconst contentData = $node[\"Check Content Status\"].json;\n\nconst allRecords = searchResult.list || [];\nif (allRecords.length === 0) {\n  // No social records found - safe to update content\n  return [{ json: { ...contentData, allPublished: true } }];\n}\n\nconst allPublished = allRecords.every(r => r.Status === 'Published');\nconsole.log(`Social records for content: ${allRecords.length} total, allPublished: ${allPublished}`);\n\nreturn [{ json: { ...contentData, allPublished } }];"}, "id": "check-all-published", "name": "All Social Records Published?", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [2640, -120]}, {"parameters": {"conditions": {"options": {"version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "conditions": [{"id": "check-all-pub", "leftValue": "={{ $json.allPublished }}", "rightValue": true, "operator": {"type": "boolean", "operation": "equals"}}, {"id": "check-has-content-id", "leftValue": "={{ $json.shouldUpdateContent }}", "rightValue": true, "operator": {"type": "boolean", "operation": "equals"}}], "combinator": "and"}, "options": {}}, "id": "if-update-content", "name": "All Published & Should Update?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [2860, -120]}, {"parameters": {"method": "PATCH", "url": "=https://YOUR_NOCODB_URL/api/v1/db/data/noco/YOUR_NOCODB_BASE_ID/mxsvmofsnvkt1bs/{{ $json.contentRecordId }}", "sendHeaders": true, "headerParameters": {"parameters": [{"name": "xc-token", "value": "YOUR_NOCODB_API_TOKEN"}]}, "sendBody": true, "bodyParameters": {"parameters": [{"name": "Status", "value": "Published"}]}, "options": {}}, "id": "update-content", "name": "Update Content Published", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [3080, -240]}, {"parameters": {"sendTo": "your-email@example.com", "subject": "=Published: {{ $node[\"All Social Records Published?\"].json.contentTitle }} ({{ $node[\"All Social Records Published?\"].json.platform }})", "emailType": "text", "message": "=Your {{ $node[\"All Social Records Published?\"].json.platform }} post '{{ $node[\"All Social Records Published?\"].json.contentTitle }}' just went live via Postiz.{{ $node[\"All Social Records Published?\"].json.releaseURL ? '\\n\\n' + $node[\"All Social Records Published?\"].json.releaseURL : '' }}\n\nNocoDB Content record updated to Published.", "options": {}}, "id": "send-email-content-updated", "name": "Send Publish Email (Content Updated)", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [3300, -240], "credentials": {"gmailOAuth2": {"id": "NzuBAEXuTSW836kz", "name": "Whtnxt Gmail"}}}, {"parameters": {"sendTo": "your-email@example.com", "subject": "=Published: {{ $node[\"All Social Records Published?\"].json.contentTitle }} ({{ $node[\"All Social Records Published?\"].json.platform }})", "emailType": "text", "message": "=Your {{ $node[\"All Social Records Published?\"].json.platform }} post '{{ $node[\"All Social Records Published?\"].json.contentTitle }}' just went live via Postiz.{{ $node[\"All Social Records Published?\"].json.releaseURL ? '\\n\\n' + $node[\"All Social Records Published?\"].json.releaseURL : '' }}\n\nOther platforms still pending \u2014 Content record kept in current status.", "options": {}}, "id": "send-email-partial", "name": "Send Publish Email (Partial)", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [3080, 0], "credentials": {"gmailOAuth2": {"id": "NzuBAEXuTSW836kz", "name": "Whtnxt Gmail"}}}, {"parameters": {"sendTo": "your-email@example.com", "subject": "=Published: {{ $node[\"Prepare Content Lookup\"].json.socialTitle }} ({{ $node[\"Prepare Content Lookup\"].json.platform }})", "emailType": "text", "message": "=Your {{ $node[\"Prepare Content Lookup\"].json.platform }} post just went live via Postiz.{{ $node[\"Prepare Content Lookup\"].json.releaseURL ? '\\n\\n' + $node[\"Prepare Content Lookup\"].json.releaseURL : '' }}\n\nNote: No matching Content record found in NocoDB.", "options": {}}, "id": "send-email-no-content", "name": "Send Publish Email (No Content Record)", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [1980, 120], "credentials": {"gmailOAuth2": {"id": "NzuBAEXuTSW836kz", "name": "Whtnxt Gmail"}}}], "connections": {"Every Hour (8am-10pm CT)": {"main": [[{"node": "Build Date Range", "type": "main", "index": 0}]]}, "Build Date Range": {"main": [[{"node": "Fetch Postiz Posts", "type": "main", "index": 0}]]}, "Fetch Postiz Posts": {"main": [[{"node": "Filter Published Posts", "type": "main", "index": 0}]]}, "Filter Published Posts": {"main": [[{"node": "Search Social Media Record", "type": "main", "index": 0}]]}, "Search Social Media Record": {"main": [[{"node": "Needs Update?", "type": "main", "index": 0}]]}, "Needs Update?": {"main": [[{"node": "Update Social Media Published", "type": "main", "index": 0}]]}, "Update Social Media Published": {"main": [[{"node": "Prepare Content Lookup", "type": "main", "index": 0}]]}, "Prepare Content Lookup": {"main": [[{"node": "Has Title for Content Lookup?", "type": "main", "index": 0}]]}, "Has Title for Content Lookup?": {"main": [[{"node": "Search Content Record", "type": "main", "index": 0}], [{"node": "Send Publish Email (No Content Record)", "type": "main", "index": 0}]]}, "Search Content Record": {"main": [[{"node": "Check Content Status", "type": "main", "index": 0}]]}, "Check Content Status": {"main": [[{"node": "Get All Social Media Records", "type": "main", "index": 0}]]}, "Get All Social Media Records": {"main": [[{"node": "All Social Records Published?", "type": "main", "index": 0}]]}, "All Social Records Published?": {"main": [[{"node": "All Published & Should Update?", "type": "main", "index": 0}]]}, "All Published & Should Update?": {"main": [[{"node": "Update Content Published", "type": "main", "index": 0}], [{"node": "Send Publish Email (Partial)", "type": "main", "index": 0}]]}, "Update Content Published": {"main": [[{"node": "Send Publish Email (Content Updated)", "type": "main", "index": 0}]]}}, "authors": "Edward Chalupa", "name": null, "description": null, "autosaved": false, "workflowPublishHistory": [{"createdAt": "2026-04-06T16:20:21.798Z", "id": 255, "workflowId": "YsB2phy3H68uI2nX", "versionId": "33a8d4f1-39ef-47c4-9206-5dc3d923eca1", "event": "deactivated", "userId": "YOUR_N8N_USER_ID"}, {"createdAt": "2026-04-06T16:20:21.812Z", "id": 256, "workflowId": "YsB2phy3H68uI2nX", "versionId": "33a8d4f1-39ef-47c4-9206-5dc3d923eca1", "event": "activated", "userId": "YOUR_N8N_USER_ID"}]}}