{
  "name": "Article to social post, with a Notion review",
  "nodes": [
    {
      "id": "089c2275-716f-4e94-bb36-bf471ec076d0",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -760,
        -625
      ],
      "parameters": {
        "content": "## Article to social post, with a Notion review\nEach new article becomes a draft in Notion. Tick Approved and sprkly schedules it, and your sheet keeps the link.\n\n### You need\n- The sprkly node: Settings, Community nodes, install `n8n-nodes-sprkly` (self-hosted n8n)\n- A sprkly API key: https://sprkly.app/docs/api?utm_source=n8n&utm_medium=workflow&utm_campaign=article-to-social\n- A blog feed (Substack, WordPress or any RSS), or a DEV username\n- A Notion database for reviews, and a Notion login\n- A Google Sheets login and a blank sheet\n- A Telegram bot and your chat ID, for the failure alert\n\n### Set it up\n1. In **Article settings**, pick RSS or DEV. Add the feed link or the username.\n2. In **Article settings**, add your sheet ID, the Notion data source ID and title field, and one sprkly profile ID for text posts.\n3. Add each login where a step asks. Use the same one in every step for that app. The workflow adds the Approved and Caption fields in Notion if they are missing.\n4. Failure alert: put your chat ID in **Write the failure alert** and your bot in **Send the failure alert**. Then in Workflow settings, set Error workflow to this workflow.\n\n### Test it\n- Click Test workflow with **Collect one article now** picked. A review page shows up in Notion.\n- Tick Approved and wait 10 minutes. The post shows in sprkly and the sheet gets its row.",
        "height": 910,
        "width": 560,
        "color": 4
      }
    },
    {
      "id": "ba69114f-f3fa-58e1-8915-47dc3fda7f34",
      "name": "Bring published articles into review",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1310,
        -625
      ],
      "parameters": {
        "content": "## Bring published articles into review\n\nOne recent article enters the queue per run. Its canonical link and Notion marker make a replay safe. A new Notion page starts with approval off.",
        "width": 1780,
        "height": 145,
        "color": 7
      }
    },
    {
      "id": "ba672efe-e0a4-5ac2-b577-04b9245e5065",
      "name": "Schedule only approved captions",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2310,
        95
      ],
      "parameters": {
        "content": "## Schedule only approved captions\n\nEdit the caption in Notion and check Approved. The workflow records the planned time, caption, and profile before requesting one post. For text destinations such as Threads or LinkedIn, the article link goes in the caption.",
        "width": 1200,
        "height": 158,
        "color": 4
      }
    },
    {
      "id": "789c32e3-abaf-5d40-a90d-8c3a3e3de4a4",
      "name": "Record the actual outcome",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1260,
        783
      ],
      "parameters": {
        "content": "## Record the actual outcome\n\nConfirmed posts go to Published Posts. The Article Queue row reflects the actual result, including failures. The receipt uses the same Notion page ID as the scheduling request.",
        "width": 1800,
        "height": 145,
        "color": 6
      }
    },
    {
      "id": "e49b8e11-8cf0-5215-b42e-a5d7bc80cd4e",
      "name": "Article settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        125,
        20
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7c2a95f3-9862-5b90-a4a8-a32961df0262",
              "name": "Source mode",
              "type": "string",
              "value": "RSS"
            },
            {
              "id": "6b8db83c-070f-5029-9ec8-1abe4a7ae7f7",
              "name": "RSS feed URL",
              "type": "string",
              "value": ""
            },
            {
              "id": "a4d6d7d0-80ba-57c4-8b01-a6e05f6810c0",
              "name": "DEV username",
              "type": "string",
              "value": ""
            },
            {
              "id": "3d3ad61a-4d46-552f-ab0d-8adf18e55c85",
              "name": "Lookback days",
              "type": "number",
              "value": 7
            },
            {
              "id": "946373df-eb30-50bd-8574-5191a9cfa873",
              "name": "Spreadsheet ID",
              "type": "string",
              "value": ""
            },
            {
              "id": "c32e1828-eede-5c60-86df-8046c527d43c",
              "name": "Notion data source ID",
              "type": "string",
              "value": ""
            },
            {
              "id": "8222cb77-eb9a-5e77-801a-7497acb59b02",
              "name": "Title property",
              "type": "string",
              "value": "Name"
            },
            {
              "id": "c3821917-8eb7-59b5-8aca-d2864b7c6cec",
              "name": "Approved property",
              "type": "string",
              "value": "Approved"
            },
            {
              "id": "58aab137-7210-5527-af52-d1479a3ef8c4",
              "name": "Caption property",
              "type": "string",
              "value": "Caption"
            },
            {
              "id": "1cd51ad4-5723-5a01-a3dc-ca9bedfe18c7",
              "name": "Sprkly profile ID",
              "type": "string",
              "value": ""
            },
            {
              "id": "a42aaddb-2fda-5d31-b591-d586a09402f6",
              "name": "Schedule lead minutes",
              "type": "number",
              "value": 45
            }
          ]
        },
        "options": {}
      },
      "executeOnce": true
    },
    {
      "id": "02280db1-2d41-5bd4-ae3c-7ff479fb6989",
      "name": "Find new articles every 30 minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -120,
        -325
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      }
    },
    {
      "id": "4c22a9d2-f3cb-58a3-a05a-4770752b469a",
      "name": "Collect one article now",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -120,
        -145
      ],
      "parameters": {}
    },
    {
      "id": "dfcf30d4-258f-5cad-8ccc-5ea3eb122a62",
      "name": "Check Notion approvals every 10 minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -120,
        35
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 10
            }
          ]
        }
      }
    },
    {
      "id": "12e82308-d9ee-59f1-8ac0-42606c7566f1",
      "name": "Article post went live",
      "type": "n8n-nodes-sprkly.sprklyTrigger",
      "typeVersion": 1,
      "position": [
        -120,
        230
      ],
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "event": "postPublished",
        "externalIdPrefix": "article-",
        "stripPrefix": false
      }
    },
    {
      "id": "b1e613bb-c2b1-50a4-b1bd-beff4b2906e8",
      "name": "Article post failed",
      "type": "n8n-nodes-sprkly.sprklyTrigger",
      "typeVersion": 1,
      "position": [
        -120,
        410
      ],
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "event": "postFailed",
        "externalIdPrefix": "article-",
        "stripPrefix": false
      }
    },
    {
      "id": "c52621c4-a557-5f3f-9126-8ca0f5150473",
      "name": "Check article and destination settings",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        360,
        20
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const c=$input.first().json;\nfor(const k of ['Spreadsheet ID','Notion data source ID','Sprkly profile ID']) if(!/^[A-Za-z0-9_-]+$/.test(c[k].trim())) throw new Error('Set '+k+' in Article settings.');\nif(!['RSS','DEV'].includes(c['Source mode'])) throw new Error('Choose RSS or DEV.');\nif(c['Source mode']==='RSS'&&!/^https:\\/\\/[^/\\s]+(?:\\/[^\\s]*)?$/i.test(c['RSS feed URL'].trim())) throw new Error('Enter a public HTTPS feed URL.');\nif(c['Source mode']==='DEV'&&!/^[a-z0-9_-]{1,60}$/i.test(c['DEV username'].trim())) throw new Error('Enter the DEV username.');\nconst fields=['Title property','Approved property','Caption property'].map(k=>c[k].trim());\nif(fields.some(x=>!x)||new Set(fields).size!==3) throw new Error('Set three distinct Notion property names.');\n[c['Title property'],c['Approved property'],c['Caption property']]=fields;\nif(!Number.isInteger(c['Lookback days'])||c['Lookback days']<1||c['Lookback days']>31||\n !Number.isInteger(c['Schedule lead minutes'])||c['Schedule lead minutes']<15||c['Schedule lead minutes']>1440) throw new Error('Set 1, 31 lookback days and 15, 1440 schedule lead minutes.');\nreturn [{json:c}];"
      }
    },
    {
      "id": "7cf4f594-1a13-5615-910c-45388aeecb78",
      "name": "Receipt or preparation",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        590,
        20
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "a450f7b3-42ab-5dfd-8f2b-8a91b1118b62",
              "leftValue": "={{ $('Article post went live').isExecuted || $('Article post failed').isExecuted }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "a5468ba1-d275-5715-9d00-a0edebe6cdfe",
      "name": "Ensure Article Queue tab",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        820,
        20
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "create",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {},
        "title": "Article Queue"
      },
      "alwaysOutputData": true
    },
    {
      "id": "9f236c9c-804d-5157-aad8-4b73b0e9f1fe",
      "name": "Read the article ledger",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1050,
        20
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "read",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Article Queue"
        }
      },
      "alwaysOutputData": true
    },
    {
      "id": "ca068f7b-6ad9-50ef-9741-c62bd51b13af",
      "name": "This run checks approvals",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        2180,
        105
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "7aff86b8-e9d4-5c9a-85ae-33760aaa69b6",
              "leftValue": "={{ $('Check Notion approvals every 10 minutes').isExecuted }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "2ca3bab7-51bd-5b27-8791-0bcf62291393",
      "name": "DEV API is the source",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1505,
        -345
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f8b2403f-8ef7-5810-9c2b-b826f770207d",
              "leftValue": "={{ $(\"Check article and destination settings\").first().json[\"Source mode\"] === 'DEV' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "executeOnce": true
    },
    {
      "id": "1b1af253-b3cc-5ce9-870f-97da142edb5a",
      "name": "Read public DEV articles",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1740,
        -435
      ],
      "parameters": {
        "url": "https://dev.to/api/articles",
        "method": "GET",
        "options": {
          "timeout": 45000,
          "response": {
            "response": {
              "fullResponse": true,
              "neverError": false
            }
          }
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $(\"Check article and destination settings\").first().json[\"DEV username\"].trim() }}"
            },
            {
              "name": "per_page",
              "value": "50"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/vnd.forem.api-v1+json"
            }
          ]
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000
    },
    {
      "id": "ac96b691-187c-5fe8-b972-101ebac9de25",
      "name": "Read the public RSS or Atom feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        1740,
        -270
      ],
      "parameters": {
        "url": "={{ $(\"Check article and destination settings\").first().json[\"RSS feed URL\"].trim() }}",
        "options": {}
      },
      "alwaysOutputData": true
    },
    {
      "id": "f9a4c677-4b07-5015-ac88-9dca758ba0c6",
      "name": "Pick one new canonical article",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1970,
        -345
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const c=$('Check article and destination settings').first().json;\nconst isDev=c['Source mode']==='DEV';\nconst input=$input.all().map(({json})=>json);\nif(isDev&&!Array.isArray(input[0]?.body))throw new Error('DEV did not return an article list.');\nconst known=new Set($('Read the article ledger').all().map(({json})=>json['Article Key']).filter(Boolean));\nconst seen=new Set();\nconst window=$now.minus({days:c['Lookback days']}).toMillis();\nfunction normalizeUrl(raw){\n const m=String(raw||'').trim().match(/^https:\\/\\/([a-z0-9.-]+)([^#\\s]*)/i);\n if(!m)return '';\n const [p,q]=m[2].split('?');\n const query=(q||'').split('&').filter(x=>x&&!/^utm_|^(fbclid|gclid)=/i.test(x)).join('&');\n return 'https://'+m[1].toLowerCase()+(p.replace(/\\/+$/,'')||'/')+(query?'?'+query:'');\n}\nconst entries=[];\nfor(const r of (isDev?input[0].body:input)){\n const url=normalizeUrl(isDev?r.canonical_url||r.url:r.link);\n const title=String(r.title||'').replace(/<[^>]*>/g,'').replace(/\\s+/g,' ').trim().slice(0,140);\n const time=Date.parse(r.published_timestamp||r.published_at||r.isoDate||r.pubDate||'');\n if(!title||!url||!Number.isFinite(time)||time<window||time>$now.toMillis()||known.has(url)||seen.has(url))continue;\n seen.add(url);\n entries.push({url,title,time,source:isDev?'DEV':'RSS / Atom'});\n}\nentries.sort((a,b)=>b.time-a.time||a.url.localeCompare(b.url));\nreturn entries.slice(0,1).map(json=>({json}));"
      }
    },
    {
      "id": "ba499403-a9bb-5db3-b5e1-ba9150cc42b3",
      "name": "Hash the article link",
      "type": "n8n-nodes-base.crypto",
      "typeVersion": 1,
      "position": [
        2200,
        -345
      ],
      "parameters": {
        "action": "hash",
        "type": "SHA256",
        "binaryData": false,
        "value": "={{ $json.url }}",
        "dataPropertyName": "hash",
        "encoding": "hex"
      }
    },
    {
      "id": "61d5f166-ffe3-5290-9683-0aae9b2c6039",
      "name": "Name the review page with a stable key",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2430,
        -345
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const row=$input.first().json;return [{json:{...row,marker:'[Article '+row.hash.slice(0,24)+']'}}];"
      }
    },
    {
      "id": "d9f7aaf2-01d0-5d70-8725-41c5c8607786",
      "name": "Find the existing Notion review",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2660,
        -345
      ],
      "parameters": {
        "url": "={{ 'https://api.notion.com/v1/data_sources/'+$(\"Check article and destination settings\").first().json[\"Notion data source ID\"].trim()+'/query' }}",
        "method": "POST",
        "options": {
          "timeout": 45000
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "notionApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ {page_size:2,filter:{property:$(\"Check article and destination settings\").first().json[\"Title property\"],title:{starts_with:$json.marker}}} }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2025-09-03"
            }
          ]
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000
    },
    {
      "id": "4d4b3dbf-c38b-5c4b-8e05-b142c9ccc5cd",
      "name": "Reuse or prepare an unapproved page",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2890,
        -345
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const q=$input.first().json;\nconst a=$('Name the review page with a stable key').first().json;\nconst c=$('Check article and destination settings').first().json;\nif(!Array.isArray(q.results)||q.has_more||q.results.length>1) throw new Error('Resolve duplicate Notion review pages for '+a.marker);\nconst existing=q.results[0];\nconst body={parent:{type:'data_source_id',data_source_id:c['Notion data source ID'].trim()},\n properties:{\n [c['Title property']]:{title:[{text:{content:a.marker+' '+a.title}}]},\n [c['Approved property']]:{checkbox:false},\n [c['Caption property']]:{rich_text:[{text:{content:a.title+'\\n\\n'+a.url}}]}\n }};\nreturn [{json:{...a,existing,body}}];"
      }
    },
    {
      "id": "1d9ec852-8dea-5e7f-aeee-ed9781c03392",
      "name": "Review page is new",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        3120,
        -345
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "2a2a56f6-b71c-5754-8c2a-5ebb9ccd01c1",
              "leftValue": "={{ !$json.existing }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "85c5667c-0d94-5084-9451-8ae92802652f",
      "name": "Create the unapproved Notion review",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        3350,
        -435
      ],
      "parameters": {
        "url": "https://api.notion.com/v1/pages",
        "method": "POST",
        "options": {
          "timeout": 45000
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "notionApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $json.body }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2025-09-03"
            }
          ]
        }
      }
    },
    {
      "id": "7eb7d911-c753-52d7-aa77-9e0c0e14302e",
      "name": "Link the Notion review to the article",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3580,
        -345
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const a=$('Reuse or prepare an unapproved page').first().json;\nconst p=$('Create the unapproved Notion review').isExecuted?$('Create the unapproved Notion review').first().json:a.existing;\nif(!p?.id||!p.url) throw new Error('Notion did not confirm the review page.');\nreturn [{json:{'Article Key':a.url,'Article URL':a.url,Title:a.title,Source:a.source,\n 'Article Date':new Date(a.time).toISOString(),'Notion Page ID':p.id,'Notion URL':p.url,Status:'Review',\n 'Scheduled At':'','Frozen Caption':'','Profile ID':'','Sprkly Post ID':'','Published At':'','Live URL':'',Issue:''}}];"
      }
    },
    {
      "id": "d6caff51-bf82-5b11-aed2-30ac0604b46f",
      "name": "Upsert the article queue by canonical URL",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3810,
        -345
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {
          "cellFormat": "RAW",
          "handlingExtraData": "insertInNewColumn",
          "useAppend": true
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Article Queue"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Article Key"
          ],
          "schema": []
        }
      }
    },
    {
      "id": "f4fb2b2a-f4e5-5bf6-8d30-96e37826f0e1",
      "name": "Read approved review pages",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1510,
        350
      ],
      "parameters": {
        "url": "={{ 'https://api.notion.com/v1/data_sources/'+$(\"Check article and destination settings\").first().json[\"Notion data source ID\"].trim()+'/query' }}",
        "method": "POST",
        "options": {
          "timeout": 45000,
          "pagination": {
            "pagination": {
              "paginationMode": "updateAParameterInEachRequest",
              "parameters": {
                "parameters": [
                  {
                    "type": "body",
                    "name": "start_cursor",
                    "value": "={{ $response.body?.next_cursor || undefined }}"
                  }
                ]
              },
              "paginationCompleteWhen": "other",
              "completeExpression": "={{ $response.body.has_more !== true }}",
              "limitPagesFetched": true,
              "maxRequests": 20,
              "requestInterval": 300
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "notionApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ {page_size:100,filter:{property:$(\"Check article and destination settings\").first().json[\"Approved property\"],checkbox:{equals:true}}} }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2025-09-03"
            }
          ]
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000,
      "executeOnce": true
    },
    {
      "id": "eae31748-c40e-5f7b-9df6-2660234258b7",
      "name": "Freeze one approved post and its time",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1740,
        350
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const c=$('Check article and destination settings').first().json;\nconst data=$input.all().map(({json})=>json);\nif(!data.length||data.some(x=>!Array.isArray(x.results))||data.at(-1).has_more) throw new Error('The approved Notion queue was incomplete.');\nconst docs=new Map(data.flatMap(x=>x.results).filter(p=>!p.archived&&!p.in_trash&&p.properties?.[c['Approved property']]?.checkbox===true).map(p=>[p.id,p]));\nconst eligible=$('Read the article ledger').all().map(({json})=>json).filter(r=>\n   /^(Review|Scheduling)$/.test(r.Status)&&r['Article Key']&&docs.has(r['Notion Page ID'])&&!r['Sprkly Post ID']);\neligible.sort((a,b)=>String(a['Article Date']).localeCompare(String(b['Article Date'])));\nif(!eligible.length)return [];\nconst row=eligible[0];\nconst page=docs.get(row['Notion Page ID']);\nconst text=page.properties?.[c['Caption property']];\nif(text?.type!=='rich_text') throw new Error('The configured caption property needs to be text.');\nconst approved=text.rich_text.map(t=>t.plain_text||t.text?.content||'').join('').trim();\nconst caption=row.Status==='Scheduling'?String(row['Frozen Caption']||''):\n  approved&&(approved.includes(row['Article URL'])?approved:approved+'\\n\\n'+row['Article URL']);\nconst time=row['Scheduled At']||$now.plus({minutes:c['Schedule lead minutes']}).toISO();\nconst profile=row['Profile ID']||c['Sprkly profile ID'];\nconst issue=!caption?'Fill the approved caption in Notion':\n !Number.isFinite(Date.parse(time))||Date.parse(time)<=$now.plus({minutes:5}).toMillis()?'Clear or move the planned time into the future before approving again':'';\nreturn [{json:{'Article Key':row['Article Key'],'Notion Page ID':row['Notion Page ID'],Title:row.Title,\n  'Scheduled At':time,'Frozen Caption':caption,'Profile ID':profile,'External ID':'article-'+row['Notion Page ID'],\n  Status:issue?'Needs Review':'Scheduling',Issue:issue}}];"
      }
    },
    {
      "id": "460b5ae1-8e56-528d-bcf9-5f30cfee02a4",
      "name": "Save the approved scheduling plan",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1970,
        350
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {
          "cellFormat": "RAW",
          "handlingExtraData": "insertInNewColumn",
          "useAppend": true
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Article Queue"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Article Key"
          ],
          "schema": []
        }
      }
    },
    {
      "id": "e8b3317d-1c9b-54f8-98c5-ae7c6b680523",
      "name": "The frozen plan can be scheduled",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        2200,
        350
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f62d474e-efa3-5b5a-be29-b6730c53e91a",
              "leftValue": "={{ $json.Status === 'Scheduling' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "1e2eee63-a2a8-581d-a63c-a72f2aa8e543",
      "name": "Schedule the approved article post",
      "type": "n8n-nodes-sprkly.sprkly",
      "typeVersion": 1.1,
      "position": [
        2430,
        300
      ],
      "parameters": {
        "resource": "post",
        "operation": "create",
        "accountMode": "list",
        "profileIds": "={{ [$json['Profile ID']] }}",
        "caption": "={{ $json['Frozen Caption'] }}",
        "scheduledTime": "={{ $json['Scheduled At'] }}",
        "output": "resultRow",
        "postNow": false,
        "additionalFields": {
          "externalId": "={{ $json['External ID'] }}",
          "requireExternalId": true,
          "title": "={{ $json.Title }}"
        }
      }
    },
    {
      "id": "9538e730-a69e-5550-b5b8-d6fb0524946d",
      "name": "Record scheduling success or action needed",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2660,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const original=$('Freeze one approved post and its time').first().json;\nconst result=$input.first().json;\nconst id=Array.isArray(result.postIds)&&result.postIds.length===1?String(result.postIds[0]):'';\nconst status=result.ok&&id&&['Scheduled','Published','Failed'].includes(result.status)?result.status:'Needs Review';\nreturn [{json:{'Article Key':original['Article Key'],Status:status,'Sprkly Post ID':id||String(result.postId||''),\n 'Live URL':result.link||'',Issue:status==='Needs Review'||status==='Failed'?String(result.error||'The scheduler did not confirm a single post ID').slice(0,500):''}}];"
      }
    },
    {
      "id": "955c33d0-cf9a-5392-82b0-83944688431d",
      "name": "Save the actual scheduling result",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2890,
        300
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {
          "cellFormat": "RAW",
          "handlingExtraData": "insertInNewColumn",
          "useAppend": true
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Article Queue"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Article Key"
          ],
          "schema": []
        }
      }
    },
    {
      "id": "f48428fc-30af-5b80-94af-fb56ad47058f",
      "name": "Match the publication receipt to article ID",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        820,
        1020
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const success=$('Article post went live').isExecuted;\nconst event=success?$('Article post went live'):$('Article post failed');\nconst byId=new Map();\nfor(const {json:p} of event.all()){\n const id=String(p.id||'');\n const external=String(p.externalId||'');\n const key=String(p.sourceId||external);\n const match=key.match(/^article-([0-9a-f-]{32,36})$/i);\n const valid=success?['posted','published'].includes(p.status):p.status==='failed';\n if(!id||!match||!valid||p.deleted) continue;\n byId.set(id,{json:{'Notion Page ID':match[1],'Post ID':id,'Sprkly Post ID':id,Status:success?'Published':'Failed',\n  Platform:(p.platforms||[]).join(', '),'Account ID':(p.profileIds||[]).join(', '),'External ID':external,\n  'Published At':p.publishedAt||'','Live URL':p.permalink||p.link||'','Issue':success?'':String(p.failedReason||p.error||'See the Sprkly post').slice(0,500)}});\n}\nreturn [...byId.values()];"
      }
    },
    {
      "id": "b19ae185-7ff3-5505-b144-1c50f3b4e478",
      "name": "Receipt confirms a live post",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1050,
        1020
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "c23c7312-c5aa-53f7-a507-3ac477a9096f",
              "leftValue": "={{ $json.Status === 'Published' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "446d0b5d-8597-5279-bc62-7792e128bf90",
      "name": "Ensure Published Posts tab",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1280,
        975
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "create",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {},
        "title": "Published Posts"
      },
      "alwaysOutputData": true,
      "executeOnce": true
    },
    {
      "id": "d80df206-c91b-578b-9f85-63ae070db1ea",
      "name": "Restore every published post in this batch",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1510,
        975
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $('Match the publication receipt to article ID').all().map(({json})=>({json}));"
      }
    },
    {
      "id": "4f0a3d6b-098e-5a3f-8bb4-463e13ee9f92",
      "name": "Upsert live receipts by post ID",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1740,
        975
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {
          "cellFormat": "RAW",
          "handlingExtraData": "insertInNewColumn",
          "useAppend": true
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Published Posts"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Post ID"
          ],
          "schema": []
        }
      }
    },
    {
      "id": "e1be9fb0-33ac-540c-8135-764feb0366be",
      "name": "Apply confirmed receipt to Article Queue",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1970,
        1020
      ],
      "parameters": {
        "resource": "sheet",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\"Check article and destination settings\").first().json[\"Spreadsheet ID\"].trim() }}"
        },
        "options": {
          "cellFormat": "RAW"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Article Queue"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Notion Page ID": "={{ $json[\"Notion Page ID\"] }}",
            "Status": "={{ $json[\"Status\"] }}",
            "Sprkly Post ID": "={{ $json[\"Sprkly Post ID\"] }}",
            "Live URL": "={{ $json[\"Live URL\"] }}",
            "Published At": "={{ $json[\"Published At\"] }}",
            "Issue": "={{ $json[\"Issue\"] }}"
          },
          "matchingColumns": [
            "Notion Page ID"
          ],
          "schema": []
        }
      }
    },
    {
      "id": "348f68f3-2e5c-517a-8c7c-ef3e968cfda5",
      "name": "Read the Notion review fields",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1280,
        -40
      ],
      "parameters": {
        "url": "={{ 'https://api.notion.com/v1/data_sources/'+$(\"Check article and destination settings\").first().json[\"Notion data source ID\"].trim() }}",
        "method": "GET",
        "options": {
          "timeout": 45000
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "notionApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2025-09-03"
            }
          ]
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000,
      "executeOnce": true
    },
    {
      "id": "c2bd1d03-50c4-52b6-990e-dba5ffebbd67",
      "name": "Find only missing review properties",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1515,
        -38
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const c=$('Check article and destination settings').first().json;\nconst fields=$input.first().json.properties;\nif(!fields||!Object.prototype.hasOwnProperty.call(fields,c['Title property'])||fields[c['Title property']].type!=='title')\n throw new Error('The configured Notion title property was not found.');\nconst missing=Object.fromEntries([['Approved property','checkbox'],['Caption property','rich_text']].flatMap(([setting,type])=>{\n const name=c[setting];\n const exists=Object.prototype.hasOwnProperty.call(fields,name);\n if(exists&&fields[name].type!==type) throw new Error('The Notion property '+name+' needs type '+type+'.');\n return exists?[]:[[name,{[type]:{}}]];\n}));\nreturn [{json:{missing}}];"
      }
    },
    {
      "id": "c7e0a414-0dbc-5c51-b8ee-e0f592b3b0aa",
      "name": "Review properties need setup",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1730,
        -40
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "c00400b0-423c-58de-815a-45fe88596800",
              "leftValue": "={{ Object.keys($json.missing).length > 0 }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "9539cb85-dc86-50eb-ae31-49faee09c754",
      "name": "Add missing Approved and Caption fields",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1955,
        -55
      ],
      "parameters": {
        "url": "={{ 'https://api.notion.com/v1/data_sources/'+$(\"Check article and destination settings\").first().json[\"Notion data source ID\"].trim() }}",
        "method": "PATCH",
        "options": {
          "timeout": 45000
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "notionApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ {properties:$json.missing} }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2025-09-03"
            }
          ]
        }
      }
    },
    {
      "id": "559bdbf0-0c8a-455a-801d-e53d1f0a29e8",
      "name": "When this workflow fails",
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -720,
        365
      ],
      "parameters": {}
    },
    {
      "id": "29a0a776-d6fe-421d-9695-1c0c7601f712",
      "name": "Write the failure alert",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -500,
        365
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f1",
              "name": "telegramChatId",
              "type": "string",
              "value": "YOUR_TELEGRAM_CHAT_ID"
            },
            {
              "id": "f2",
              "name": "message",
              "type": "string",
              "value": "={{ 'A workflow stopped.\\n\\nWorkflow: ' + (($json.workflow || {}).name || 'unknown') + '\\nFailed step: ' + (($json.execution || {}).lastNodeExecuted || 'unknown') + '\\nWhy: ' + String((($json.execution || {}).error || {}).message || 'n8n did not give a reason.').slice(0, 300) + (($json.execution || {}).url ? '\\nOpen the run: ' + $json.execution.url : '') }}"
            }
          ]
        },
        "includeOtherFields": false,
        "options": {}
      }
    },
    {
      "id": "236f6693-b637-4cee-904e-900fb4aa5a3f",
      "name": "Send the failure alert",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -280,
        365
      ],
      "parameters": {
        "chatId": "={{ $json.telegramChatId }}",
        "text": "={{ $json.message }}",
        "additionalFields": {
          "appendAttribution": false
        }
      }
    }
  ],
  "connections": {
    "Find new articles every 30 minutes": {
      "main": [
        [
          {
            "node": "Article settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect one article now": {
      "main": [
        [
          {
            "node": "Article settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Notion approvals every 10 minutes": {
      "main": [
        [
          {
            "node": "Article settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Article post went live": {
      "main": [
        [
          {
            "node": "Article settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Article post failed": {
      "main": [
        [
          {
            "node": "Article settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Article settings": {
      "main": [
        [
          {
            "node": "Check article and destination settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check article and destination settings": {
      "main": [
        [
          {
            "node": "Receipt or preparation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receipt or preparation": {
      "main": [
        [
          {
            "node": "Match the publication receipt to article ID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ensure Article Queue tab",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ensure Article Queue tab": {
      "main": [
        [
          {
            "node": "Read the article ledger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read the article ledger": {
      "main": [
        [
          {
            "node": "Read the Notion review fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "This run checks approvals": {
      "main": [
        [
          {
            "node": "Read approved review pages",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DEV API is the source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DEV API is the source": {
      "main": [
        [
          {
            "node": "Read public DEV articles",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Read the public RSS or Atom feed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read public DEV articles": {
      "main": [
        [
          {
            "node": "Pick one new canonical article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read the public RSS or Atom feed": {
      "main": [
        [
          {
            "node": "Pick one new canonical article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick one new canonical article": {
      "main": [
        [
          {
            "node": "Hash the article link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hash the article link": {
      "main": [
        [
          {
            "node": "Name the review page with a stable key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Name the review page with a stable key": {
      "main": [
        [
          {
            "node": "Find the existing Notion review",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find the existing Notion review": {
      "main": [
        [
          {
            "node": "Reuse or prepare an unapproved page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reuse or prepare an unapproved page": {
      "main": [
        [
          {
            "node": "Review page is new",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Review page is new": {
      "main": [
        [
          {
            "node": "Create the unapproved Notion review",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Link the Notion review to the article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create the unapproved Notion review": {
      "main": [
        [
          {
            "node": "Link the Notion review to the article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Link the Notion review to the article": {
      "main": [
        [
          {
            "node": "Upsert the article queue by canonical URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read approved review pages": {
      "main": [
        [
          {
            "node": "Freeze one approved post and its time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Freeze one approved post and its time": {
      "main": [
        [
          {
            "node": "Save the approved scheduling plan",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save the approved scheduling plan": {
      "main": [
        [
          {
            "node": "The frozen plan can be scheduled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "The frozen plan can be scheduled": {
      "main": [
        [
          {
            "node": "Schedule the approved article post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule the approved article post": {
      "main": [
        [
          {
            "node": "Record scheduling success or action needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record scheduling success or action needed": {
      "main": [
        [
          {
            "node": "Save the actual scheduling result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match the publication receipt to article ID": {
      "main": [
        [
          {
            "node": "Receipt confirms a live post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receipt confirms a live post": {
      "main": [
        [
          {
            "node": "Ensure Published Posts tab",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Apply confirmed receipt to Article Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ensure Published Posts tab": {
      "main": [
        [
          {
            "node": "Restore every published post in this batch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore every published post in this batch": {
      "main": [
        [
          {
            "node": "Upsert live receipts by post ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert live receipts by post ID": {
      "main": [
        [
          {
            "node": "Apply confirmed receipt to Article Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read the Notion review fields": {
      "main": [
        [
          {
            "node": "Find only missing review properties",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find only missing review properties": {
      "main": [
        [
          {
            "node": "Review properties need setup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Review properties need setup": {
      "main": [
        [
          {
            "node": "Add missing Approved and Caption fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "This run checks approvals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add missing Approved and Caption fields": {
      "main": [
        [
          {
            "node": "This run checks approvals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When this workflow fails": {
      "main": [
        [
          {
            "node": "Write the failure alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write the failure alert": {
      "main": [
        [
          {
            "node": "Send the failure alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "saveDataSuccessExecution": "none",
    "saveManualExecutions": false
  },
  "pinData": {}
}
