{"workflow":{"id":14310,"name":"Send overdue invoice payment reminders with iFirma, Gmail, PostGrid and Slack","views":28,"recentViews":3,"totalViews":28,"createdAt":"2026-03-25T10:37:00.891Z","description":"# Overdue Invoice Payment Reminder Workflow Documentation\n\n## What Is This?\n\nThis workflow is an automated invoice payment tracking and reminder system for the Polish accounting service iFirma.pl. It monitors unpaid and overdue invoices, then automatically sends escalating reminders to contractors based on configurable time thresholds. The system handles three escalation levels: payment reminders before/at due date, pre-trial summons, and formal legal action notices.\n\n## Who Is It For?\n\nDesigned for Polish businesses, accounting departments, and financial controllers using iFirma.pl for invoice management. This workflow is essential for companies struggling with late payments and cash flow management, particularly those needing to enforce payment terms professionally and systematically.\n\nB2B service providers, consultancies, software development agencies, and any business issuing invoices to other companies will benefit from automated payment enforcement. The workflow eliminates manual tracking of payment deadlines and ensures consistent, professional follow-up with delinquent clients.\n\nWhether managing a handful of high-value invoices or processing hundreds of transactions monthly, this automation delivers timely notifications without manual calendar monitoring or spreadsheet management.\n\n## How Does It Work?\n\nThis end-to-end invoice monitoring automation consists of four main stages:\n\n**1. Configuration & Authentication**  \nSets up user credentials (email/login, API key), defines escalation timeframes (X days before due date, Y days after, Z days after), and prepares company details for legal correspondence. The workflow then constructs a cryptographic authentication signature using HMAC-SHA1 algorithm, which iFirma requires for API access.\n![image.png](fileId:5144)\n\n**2. Invoice Retrieval & Filtering**  \nConnects to iFirma API to fetch all unpaid, partially paid, and overdue invoices, then filters them based on payment deadline dates. Only invoices that are either overdue or approaching their due date (within X days) proceed to the next stage.\n![image.png](fileId:5143)\n\n**3. Contractor Data Enrichment**  \nFor each qualifying invoice, the workflow fetches complete contractor information from iFirma (since invoice records contain only partial contractor data). This includes email addresses, company names, and addresses needed for sending reminders. The workflow deduplicates contractors to avoid redundant API calls.\n![image.png](fileId:5142)\n\n**4. Escalation Logic & Notification Dispatch**  \nInvoices are categorized into three groups based on how overdue they are:\n\n- **Payment Reminder**: Due today or X days before due date → Sends reminder via iFirma's built-in notification system\n- **Pre-Trial Summons**: Y days after due date → Sends formal legal warning via email and optionally physical mail (PostGrid)\n- **Legal Action Notice**: Z days after due date → Sends notice of commenced legal proceedings via email and optionally physical mail\n![image.png](fileId:5146)\n\nEach action triggers a Slack notification to keep your team informed.\n![image.png](fileId:5145)\n\n## How To Set It Up?\n\n**Prerequisites:**\n\n- An active N8N account or self-hosted instance\n- An iFirma.pl account with API access enabled\n- A Slack workspace with appropriate bot permissions\n- (Optional) PostGrid account for physical mail delivery\n- (Optional) Gmail account configured for sending emails\n\n**Required Configuration:**\n\nIn the \"Configuration\" node, set the following parameters:\n\n1. **Email/Login**: Your iFirma.pl account email or login username\n2. **API Key Invoice**: API key from iFirma.pl (found at: Start &gt; Data and Configuration &gt; Extensions and Integrations &gt; API)\n3. **X days before due date**: How many days before payment deadline to send the first reminder (default: 7)\n4. **Y days after due date**: When to send pre-trial summons (default: 7 days overdue)\n5. **Z days after due date**: When to send legal action notice (default: 14 days overdue)\n\n**Your Company Details Configuration:**\n\nIn the \"Your Company Details\" node, provide:\n\n- Company Name, Email, Phone\n- Full address (Street, City, Postal Code, Country Code)\n- Bank details (Bank Name, Account Number, SWIFT Code)\n- Tax Identification Number (TIN/NIP)\n\nThis information is used for professional letterheads in legal correspondence and PostGrid physical mail delivery.\n\n**Credentials Setup:**\n\n- Configure Slack OAuth2 credentials for notifications\n- Set up Gmail OAuth2 credentials for email sending (if using email route)\n- Configure PostGrid API credentials for physical letter delivery (if using mail route)\n\n**Scheduling:**  \nThe workflow runs automatically every 24 hours via the Schedule Trigger node. For testing, execute manually using the \"Execute workflow\" button.\n\n## What's More?\n\n**Custom Authentication Implementation:**  \niFirma.pl requires HMAC-SHA1 authentication, which N8N doesn't provide natively. The workflow includes a complete JavaScript implementation of the SHA-1 cryptographic hash function and HMAC (Hash-based Message Authentication Code) algorithm. This ensures secure API access without external dependencies.\n\n**Endpoint Mapping Intelligence:**  \nThe workflow automatically maps invoice types (Rodzaj) to the correct iFirma API endpoints. Different invoice types (domestic, foreign, construction, advance payments, etc.) require different API paths for sending reminders.\n\n**Professional HTML Templates:**  \nPre-trial summons and legal action notices use professionally formatted HTML templates with proper legal language, payment details, deadlines, and consequences clearly outlined. These templates maintain consistent branding and meet legal communication standards.\n\n![Invoice email.png](fileId:5147)\n\n**Multi-Channel Notification:**  \nReminders can be sent via multiple channels simultaneously: iFirma's e-invoice system, email, physical mail (PostGrid), and internal Slack notifications for team awareness.\n\n## Understanding the HMAC-SHA1 Authentication\n\nThe \"Encode API Key\" nodes implement a critical security function that N8N cannot perform natively. Here's what happens and why:\n\n**What the iFirma API Requires:**\n\niFirma.pl uses HMAC-SHA1 for request authentication. Each API request must include an `Authentication` header formatted as:\n\n```\nIAPIS user={userLogin}, hmac-sha1={hash}\n```\n\nThe hash is calculated from: `URL + userLogin + keyName + requestBody`\n\n**Why Custom Implementation is Needed:**\n\nN8N's crypto functions don't include SHA-1 (it's considered outdated for modern security, though still required by some legacy APIs). Therefore, the workflow implements the entire SHA-1 and HMAC algorithms in pure JavaScript.\n\n**How the Algorithm Works:**\n\n1. **Message Construction**: Combines the API endpoint URL, user login, key name (\"faktura\"), and request body (if any) into a single string\n2. **Hex Key Conversion**: The API key from iFirma is provided in hexadecimal format and must be converted to raw bytes\n3. **HMAC Process**:\n    - Creates inner and outer padding arrays using XOR operations with specific constants (0x36 and 0x5C)\n    - Hashes the inner padded message using SHA-1\n    - Hashes the outer padding combined with the inner hash result\n4. **SHA-1 Implementation**: Uses bitwise operations, rotating functions, and four rounds of 20 operations each to produce a 160-bit hash\n5. **Header Generation**: Formats the final hash as a hex string and constructs the authentication header\n\n**Why Each Step Matters:**\n\n- **Deterministic Hashing**: The same input always produces the same hash, allowing iFirma to verify request authenticity\n- **Binary Key Conversion**: The hex-to-bytes conversion ensures the secret key is interpreted correctly\n- **HMAC Security**: Using both inner and outer hashing with different padding prevents length extension attacks\n- **Message Integrity**: Including the URL and request body in the hash ensures the request hasn't been tampered with\n\n## Thank You, Perfect!\n\nVisit my profile for other free business automations. And if you're looking for dedicated software development or custom n8n workflow solutions, don't hesitate to reach out at [developers@sailingbyte.com](mailto:developers@sailingbyte.com) or on [sailingbyte.com](sailingbyte.com)!\n","workflow":{"meta":{"instanceId":"","templateCredsSetupCompleted":true},"nodes":[{"id":"633ea179-d323-4cad-a9e9-8be577dae54d","name":"Encode API Key","type":"n8n-nodes-base.code","position":[-80,752],"parameters":{"jsCode":"const apiKeyHex = $('Configuration').first().json[\"API Key Invoice\"];\nconst url = $input.first().json.url ?? \"\";\nconst userLogin =  $('Configuration').first().json[\"Email/Login\"];\nconst keyName = \"faktura\";\nconst requestBody = $input.first().json.requestBody ?? \"\" \nconst message = (url + userLogin + keyName + requestBody).trim();\n\nfunction hexToBytes(hex) {\n    let bytes = \"\";\n    for (let i = 0; i < hex.length; i += 2) {\n        bytes += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n    }\n    return bytes;\n}\n\nfunction hmacSha1(key, message) {\n    var blocksize = 64;\n    if (key.length > blocksize) {\n        key = sha1_bin(key);\n    }\n    \n    var ipad = [], opad = [];\n    for (var i = 0; i < blocksize; i++) {\n        var k = (i < key.length) ? key.charCodeAt(i) : 0;\n        ipad[i] = k ^ 0x36;\n        opad[i] = k ^ 0x5C;\n    }\n\n    var hash = sha1_bin(String.fromCharCode.apply(null, ipad) + message);\n    return sha1_hex(String.fromCharCode.apply(null, opad) + hash);\n\n    function sha1_hex(s) { return bin2hex(sha1_bin(s)); }\n    \n    function bin2hex(bin) {\n        var hex = \"0123456789abcdef\";\n        var str = \"\";\n        for (var i = 0; i < bin.length; i++) {\n            var c = bin.charCodeAt(i);\n            str += hex.charAt((c >> 4) & 0xF) + hex.charAt(c & 0xF);\n        }\n        return str;\n    }\n\n    function sha1_bin(s) {\n        var nblk = ((s.length + 8) >> 6) + 1, blks = new Array(nblk * 16);\n        for (var i = 0; i < nblk * 16; i++) blks[i] = 0;\n        for (var i = 0; i < s.length; i++) blks[i >> 2] |= s.charCodeAt(i) << (24 - (i % 4) * 8);\n        blks[s.length >> 2] |= 0x80 << (24 - (s.length % 4) * 8);\n        blks[nblk * 16 - 1] = s.length * 8;\n        var w = new Array(80), a = 1732584193, b = -271733879, c = -1732584194, d = 271733878, e = -1+1234567890;\n        for (var i = 0; i < blks.length; i += 16) {\n            var olda = a, oldb = b, oldc = c, oldd = d, olde = e;\n            for (var j = 0; j < 80; j++) {\n                if (j < 16) w[j] = blks[i + j];\n                else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n                var t = add(add(rol(a, 5), ft(j, b, c, d)), add(add(e, w[j]), kt(j)));\n                e = d; d = c; c = rol(b, 30); b = a; a = t;\n            }\n            a = add(a, olda); b = add(b, oldb); c = add(c, oldc); d = add(d, oldd); e = add(e, olde);\n        }\n        return String.fromCharCode((a >> 24) & 0xFF, (a >> 16) & 0xFF, (a >> 8) & 0xFF, a & 0xFF,\n                                   (b >> 24) & 0xFF, (b >> 16) & 0xFF, (b >> 8) & 0xFF, b & 0xFF,\n                                   (c >> 24) & 0xFF, (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF,\n                                   (d >> 24) & 0xFF, (d >> 16) & 0xFF, (d >> 8) & 0xFF, d & 0xFF,\n                                   (e >> 24) & 0xFF, (e >> 16) & 0xFF, (e >> 8) & 0xFF, e & 0xFF);\n    }\n\n    function ft(t, b, c, d) {\n        if (t < 20) return (b & c) | ((~b) & d);\n        if (t < 40) return b ^ c ^ d;\n        if (t < 60) return (b & c) | (b & d) | (c & d);\n        return b ^ c ^ d;\n    }\n    function kt(t) { return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514; }\n    function add(x, y) {\n        var l = (x & 0xFFFF) + (y & 0xFFFF), m = (x >> 16) + (y >> 16) + (l >> 16);\n        return (m << 16) | (l & 0xFFFF);\n    }\n    function rol(n, c) { return (n << c) | (n >>> (32 - c)); }\n}\n\nconst binaryKey = hexToBytes(apiKeyHex);\nconst generatedHash = hmacSha1(binaryKey, message);\nconst authHeader = `IAPIS user=${userLogin}, hmac-sha1=${generatedHash}`;\n// console.log(hmacSha1('111111', '222222')===\"1558ab6c5ab2b0d1cd129b9ad11527cf33486705\")\nreturn { authHeader };"},"typeVersion":2},{"id":"d0196ab5-bb90-436d-8112-5fd5bb35c3bb","name":"Configuration","type":"n8n-nodes-base.set","position":[-1072,752],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e5c314b8-5915-4d18-855d-c201954d0d4a","name":"Email/Login","type":"string","value":""},{"id":"138ffe50-4a20-4eee-b7ac-1466ca5d6f54","name":"API Key Invoice","type":"string","value":""},{"id":"e0e86492-3e24-4848-88bb-3e547c889348","name":"X days before due date","type":"number","value":7},{"id":"efcbc7dc-5fc9-4a2a-a88f-36d7623876f2","name":"Y days after due date","type":"number","value":7},{"id":"a2862444-9426-4f37-9baa-62cdf08a6d7a","name":"Z days after due date","type":"number","value":14}]}},"typeVersion":3.4},{"id":"85c2afd6-cafb-41b0-8ff3-48a2218f7615","name":"URL to Fetch Invoices","type":"n8n-nodes-base.set","position":[-240,752],"parameters":{"options":{},"assignments":{"assignments":[{"id":"400dd6ee-1ded-48d8-8dfc-b9e17bc35e8f","name":"url","type":"string","value":"=https://www.ifirma.pl/iapi/faktury.json"},{"id":"6c174c47-5d70-40b7-8ad9-be9f55233118","name":"requestBody","type":"string","value":""}]}},"typeVersion":3.4},{"id":"f96ad6a2-042e-4535-a0dc-140b7104c4dd","name":"Fetch Invoices from System","type":"n8n-nodes-base.httpRequest","notes":"Gets all issued (unpaid) invoices from ifirma.pl","position":[80,752],"parameters":{"url":"={{ $('URL to Fetch Invoices').first().json.url }}","options":{"pagination":{"pagination":{"parameters":{"parameters":[{"name":"strona","value":"=1"}]}}}},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"status","value":"przeterminowane,nieoplacone,oplaconeCzesciowo"}]},"headerParameters":{"parameters":[{"name":"Authentication","value":"={{ $json.authHeader }}"}]}},"typeVersion":4.1},{"id":"a4284dbd-0447-48ef-8018-77fa8a923d1b","name":"Filter Unpaid Invoices Due Today or Earlier","type":"n8n-nodes-base.filter","position":[656,752],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"or","conditions":[{"id":"ffa36a46-67a0-4d40-89f5-ea08125e6114","operator":{"type":"dateTime","operation":"beforeOrEquals"},"leftValue":"={{new Date($json.TerminPlatnosci) }}","rightValue":"={{ $now }}"},{"id":"4e0d94d3-878a-4e0e-aa1f-5789a98a479c","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.TerminPlatnosci }}","rightValue":"={{ $now.minus($('Configuration').first().json[\"X days before due date\"], 'days').format('yyyy-MM-dd') }}"}]},"looseTypeValidation":true},"typeVersion":2.3},{"id":"77da7546-bd92-4c09-aca4-39569c1d075a","name":"Z Days After Due Date","type":"n8n-nodes-base.filter","position":[2352,912],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"556037c9-d033-4f89-b23d-f7c15c203d97","operator":{"type":"dateTime","operation":"equals"},"leftValue":"={{ new Date($json.TerminPlatnosci).format('yyyy-LL-dd') }}","rightValue":"={{ $now.minus($('Configuration').first().json[\"Z days after due date\"], 'days').format('yyyy-LL-dd') }}"}]}},"typeVersion":2.3},{"id":"ccfdb67a-9cd1-43ee-a16a-c8cfca698115","name":"Y Days After Due Date","type":"n8n-nodes-base.filter","position":[2352,768],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"556037c9-d033-4f89-b23d-f7c15c203d97","operator":{"type":"dateTime","operation":"equals"},"leftValue":"={{ new Date($json.TerminPlatnosci).format('yyyy-LL-dd') }}","rightValue":"={{ $now.minus($('Configuration').first().json[\"Y days after due date\"], 'days').format('yyyy-LL-dd') }}"}]}},"typeVersion":2.3},{"id":"b9ff5bb2-132c-456e-8d58-617558365696","name":"Assign Endpoint to Invoice Type","type":"n8n-nodes-base.code","position":[848,752],"parameters":{"jsCode":"const endpointsMap = {\n    // Standard Domestic & Specialized\n    prz_faktura_kraj: \"fakturakraj\",\n    prz_faktura_wysylka: \"fakturawysylka\",\n    prz_faktura_paragon: \"fakturakraj\",\n    prz_faktura_szczeg_obow: \"fakturakraj\",\n    prz_faktura_met_kasowa: \"fakturakraj\",\n    prz_faktura_odwr_obciaz: \"fakturakraj\",\n    prz_faktura_odwr_obciaz_budowa: \"fakturakraj\",\n    prz_faktura_budowa: \"fakturakraj\",\n    \n    // Foreign Currency / Specialized Domestic\n    prz_faktura_wys_ter_kraj: \"fakturawaluta\",\n\n    // International & EU\n    prz_dostawa_ue_towarow: \"fakturawdt\",\n    prz_eksport_towarow: \"fakturaeksporttowarow\",\n    prz_eksport_dost_uslug_ue: \"fakturaeksportuslugue\",\n    prz_eksport_dost_uslug_nie_ue: \"fakturaeksportuslug\",\n\n    // Proforma (Note: Rodzaj for proforma is often prz_faktura_proforma)\n    prz_faktura_proforma: \"fakturaproformakraj\",\n\n    // Advance & Final (Mapping to the most likely send endpoints)\n    prz_faktura_zal: \"fakturazaliczka\",\n    prz_faktura_kon: \"fakturakoncowa\",\n\n    // Accounts / Non-VAT\n    prz_rachunek_kraj: \"rachunekkraj\",\n    prz_rachunek_zagr: \"rachunekue\"\n};\nfor (const item of $input.all()) {\n  item.json.endpoint = endpointsMap[item.json.Rodzaj];\n}\n\nreturn $input.all();"},"typeVersion":2},{"id":"c851d834-3d5d-4731-b560-92cc43f4d006","name":"Payment Reminder","type":"n8n-nodes-base.set","position":[2688,624],"parameters":{"options":{},"assignments":{"assignments":[{"id":"d1103dc3-bb9a-431e-8fa3-c29059c966e6","name":"Reminder Text","type":"string","value":"=This is a reminder about payment for invoice {{ $input.item.json.PelnyNumer }} issued on {{ $input.item.json.DataWystawienia }} for the amount of {{ $input.item.json.Brutto }}"},{"id":"186999e4-c7f5-493c-88cb-20e1fb1e5d6e","name":"Can Pay by Transfer","type":"boolean","value":true},{"id":"e4b7c469-2357-466a-b7d2-4d430ddcba41","name":"Can Pay Cash on Delivery","type":"boolean","value":false},{"id":"0d992cc6-f75a-4f23-b73f-984fff383ea3","name":"Can Pay MTransfer","type":"boolean","value":false},{"id":"c9c45b01-bcb6-465b-95c3-ff196b98d579","name":"Email Address to Send From","type":"string","value":""},{"id":"3ef65fcd-b002-4424-a7d6-f076e8782570","name":"Email Template","type":"string","value":""},{"id":"25f97d49-730e-4224-85b5-dbfba2d391ca","name":"Send by Traditional Mail","type":"boolean","value":false},{"id":"dad319d9-1709-4482-b790-8815adca5067","name":"Send E-Invoice","type":"boolean","value":true}]},"includeOtherFields":true},"typeVersion":3.4,"alwaysOutputData":false},{"id":"03443c2d-5ce1-4e78-84f5-a6d51c185105","name":"Encode API Key for Sending Reminder","type":"n8n-nodes-base.code","position":[3248,432],"parameters":{"jsCode":"const apiKeyHex = $('Configuration').first().json[\"API Key Invoice\"];\nconst url = $input.first().json.url ?? \"\";\nconst userLogin =  $('Configuration').first().json[\"Email/Login\"];\nconst keyName = \"faktura\";\nconst requestBody = $input.first().json.requestBody ?? \"\" \nconst message = url + userLogin + keyName + requestBody;\n\nfunction hexToBytes(hex) {\n    let bytes = \"\";\n    for (let i = 0; i < hex.length; i += 2) {\n        bytes += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n    }\n    return bytes;\n}\n\nfunction hmacSha1(key, message) {\n    var blocksize = 64;\n    if (key.length > blocksize) {\n        key = sha1_bin(key);\n    }\n    \n    var ipad = [], opad = [];\n    for (var i = 0; i < blocksize; i++) {\n        var k = (i < key.length) ? key.charCodeAt(i) : 0;\n        ipad[i] = k ^ 0x36;\n        opad[i] = k ^ 0x5C;\n    }\n\n    var hash = sha1_bin(String.fromCharCode.apply(null, ipad) + message);\n    return sha1_hex(String.fromCharCode.apply(null, opad) + hash);\n\n    function sha1_hex(s) { return bin2hex(sha1_bin(s)); }\n    \n    function bin2hex(bin) {\n        var hex = \"0123456789abcdef\";\n        var str = \"\";\n        for (var i = 0; i < bin.length; i++) {\n            var c = bin.charCodeAt(i);\n            str += hex.charAt((c >> 4) & 0xF) + hex.charAt(c & 0xF);\n        }\n        return str;\n    }\n\n    function sha1_bin(s) {\n        var nblk = ((s.length + 8) >> 6) + 1, blks = new Array(nblk * 16);\n        for (var i = 0; i < nblk * 16; i++) blks[i] = 0;\n        for (var i = 0; i < s.length; i++) blks[i >> 2] |= s.charCodeAt(i) << (24 - (i % 4) * 8);\n        blks[s.length >> 2] |= 0x80 << (24 - (s.length % 4) * 8);\n        blks[nblk * 16 - 1] = s.length * 8;\n        var w = new Array(80), a = 1732584193, b = -271733879, c = -1732584194, d = 271733878, e = -1+1234567890;\n        for (var i = 0; i < blks.length; i += 16) {\n            var olda = a, oldb = b, oldc = c, oldd = d, olde = e;\n            for (var j = 0; j < 80; j++) {\n                if (j < 16) w[j] = blks[i + j];\n                else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n                var t = add(add(rol(a, 5), ft(j, b, c, d)), add(add(e, w[j]), kt(j)));\n                e = d; d = c; c = rol(b, 30); b = a; a = t;\n            }\n            a = add(a, olda); b = add(b, oldb); c = add(c, oldc); d = add(d, oldd); e = add(e, olde);\n        }\n        return String.fromCharCode((a >> 24) & 0xFF, (a >> 16) & 0xFF, (a >> 8) & 0xFF, a & 0xFF,\n                                   (b >> 24) & 0xFF, (b >> 16) & 0xFF, (b >> 8) & 0xFF, b & 0xFF,\n                                   (c >> 24) & 0xFF, (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF,\n                                   (d >> 24) & 0xFF, (d >> 16) & 0xFF, (d >> 8) & 0xFF, d & 0xFF,\n                                   (e >> 24) & 0xFF, (e >> 16) & 0xFF, (e >> 8) & 0xFF, e & 0xFF);\n    }\n\n    function ft(t, b, c, d) {\n        if (t < 20) return (b & c) | ((~b) & d);\n        if (t < 40) return b ^ c ^ d;\n        if (t < 60) return (b & c) | (b & d) | (c & d);\n        return b ^ c ^ d;\n    }\n    function kt(t) { return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514; }\n    function add(x, y) {\n        var l = (x & 0xFFFF) + (y & 0xFFFF), m = (x >> 16) + (y >> 16) + (l >> 16);\n        return (m << 16) | (l & 0xFFFF);\n    }\n    function rol(n, c) { return (n << c) | (n >>> (32 - c)); }\n}\n\nconst binaryKey = hexToBytes(apiKeyHex);\nconst generatedHash = hmacSha1(binaryKey, message);\nconst authHeader = `IAPIS user=${userLogin}, hmac-sha1=${generatedHash}`;\nconsole.log(hmacSha1('111111', '222222')===\"1558ab6c5ab2b0d1cd129b9ad11527cf33486705\")\nreturn $input.all().map((i)=>{\n  return ({...i.json, authHeader})\n})\nreturn { authHeader };"},"typeVersion":2},{"id":"6753a503-ed6f-42dc-bcad-237b2843d268","name":"Send Reminder","type":"n8n-nodes-base.httpRequest","position":[3440,432],"parameters":{"url":"={{ $(\"URL for Sending Reminder\").first().json.url }}","method":"POST","options":{},"sendBody":true,"sendQuery":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"Tekst","value":"={{ $json['Reminder Text'] }}"},{"name":"Przelew","value":"={{ $json['Can Pay by Transfer'] }}"},{"name":"Pobranie","value":"={{ $json['Can Pay Cash on Delivery'] }}"},{"name":"MTransfer","value":"={{ $json['Can Pay MTransfer'] }}"},{"name":"SkrzynkaEmail ","value":"={{ $json['Email Address to Send From'] }}"},{"name":"SzablonEmail ","value":"={{ $json['Email Template'] }}"},{"name":"SkrzynkaEmailOdbiorcy ","value":"={{ $json['EmailDlaFaktury'] }}"}]},"queryParameters":{"parameters":[{"name":"wyslijEfaktura","value":"={{ $json['Send E-Invoice'] }}"},{"name":"wyslijPoczta","value":"={{ $json['Send by Traditional Mail'] }}"}]},"headerParameters":{"parameters":[{"name":"Authentication","value":"={{$json.authHeader}}"}]}},"typeVersion":4.3},{"id":"e1d6f5f6-998e-41c4-b13b-9542086b8318","name":"URL for Sending Reminder","type":"n8n-nodes-base.set","position":[3056,336],"parameters":{"options":{},"assignments":{"assignments":[{"id":"400dd6ee-1ded-48d8-8dfc-b9e17bc35e8f","name":"url","type":"string","value":"=https://www.ifirma.pl/iapi/{{$input.item.json.endpoint}}/send/{{$input.item.json.FakturaId}}.json"},{"id":"6c174c47-5d70-40b7-8ad9-be9f55233118","name":"requestBody","type":"object","value":"{}"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"ea1944d1-9c42-44e1-b63f-828912fdf3ff","name":"Error Fetching Invoices","type":"n8n-nodes-base.stopAndError","position":[432,608],"parameters":{"errorType":"errorObject","errorObject":"={\n  \"message\": \"Error fetching invoices\",\n  \"body\": {{ JSON.stringify($(\"Fetch Invoices from System\").last().json.response) }}\n}"},"typeVersion":1},{"id":"f1a99040-3958-4763-889f-8e93747ed08c","name":"Encode API Key to Fetch Contractor Information","type":"n8n-nodes-base.code","position":[1376,848],"parameters":{"jsCode":"const apiKeyHex = $('Configuration').first().json[\"API Key Invoice\"];\nconst url = $input.first().json.url ?? \"\";\nconst userLogin =  $('Configuration').first().json[\"Email/Login\"];\nconst keyName = \"faktura\";\nconst requestBody = $input.first().json.requestBody ?? \"\" \nconst message = url + userLogin + keyName + requestBody;\n\nfunction hexToBytes(hex) {\n    let bytes = \"\";\n    for (let i = 0; i < hex.length; i += 2) {\n        bytes += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n    }\n    return bytes;\n}\n\nfunction hmacSha1(key, message) {\n    var blocksize = 64;\n    if (key.length > blocksize) {\n        key = sha1_bin(key);\n    }\n    \n    var ipad = [], opad = [];\n    for (var i = 0; i < blocksize; i++) {\n        var k = (i < key.length) ? key.charCodeAt(i) : 0;\n        ipad[i] = k ^ 0x36;\n        opad[i] = k ^ 0x5C;\n    }\n\n    var hash = sha1_bin(String.fromCharCode.apply(null, ipad) + message);\n    return sha1_hex(String.fromCharCode.apply(null, opad) + hash);\n\n    function sha1_hex(s) { return bin2hex(sha1_bin(s)); }\n    \n    function bin2hex(bin) {\n        var hex = \"0123456789abcdef\";\n        var str = \"\";\n        for (var i = 0; i < bin.length; i++) {\n            var c = bin.charCodeAt(i);\n            str += hex.charAt((c >> 4) & 0xF) + hex.charAt(c & 0xF);\n        }\n        return str;\n    }\n\n    function sha1_bin(s) {\n        var nblk = ((s.length + 8) >> 6) + 1, blks = new Array(nblk * 16);\n        for (var i = 0; i < nblk * 16; i++) blks[i] = 0;\n        for (var i = 0; i < s.length; i++) blks[i >> 2] |= s.charCodeAt(i) << (24 - (i % 4) * 8);\n        blks[s.length >> 2] |= 0x80 << (24 - (s.length % 4) * 8);\n        blks[nblk * 16 - 1] = s.length * 8;\n        var w = new Array(80), a = 1732584193, b = -271733879, c = -1732584194, d = 271733878, e = -1+1234567890;\n        for (var i = 0; i < blks.length; i += 16) {\n            var olda = a, oldb = b, oldc = c, oldd = d, olde = e;\n            for (var j = 0; j < 80; j++) {\n                if (j < 16) w[j] = blks[i + j];\n                else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n                var t = add(add(rol(a, 5), ft(j, b, c, d)), add(add(e, w[j]), kt(j)));\n                e = d; d = c; c = rol(b, 30); b = a; a = t;\n            }\n            a = add(a, olda); b = add(b, oldb); c = add(c, oldc); d = add(d, oldd); e = add(e, olde);\n        }\n        return String.fromCharCode((a >> 24) & 0xFF, (a >> 16) & 0xFF, (a >> 8) & 0xFF, a & 0xFF,\n                                   (b >> 24) & 0xFF, (b >> 16) & 0xFF, (b >> 8) & 0xFF, b & 0xFF,\n                                   (c >> 24) & 0xFF, (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF,\n                                   (d >> 24) & 0xFF, (d >> 16) & 0xFF, (d >> 8) & 0xFF, d & 0xFF,\n                                   (e >> 24) & 0xFF, (e >> 16) & 0xFF, (e >> 8) & 0xFF, e & 0xFF);\n    }\n\n    function ft(t, b, c, d) {\n        if (t < 20) return (b & c) | ((~b) & d);\n        if (t < 40) return b ^ c ^ d;\n        if (t < 60) return (b & c) | (b & d) | (c & d);\n        return b ^ c ^ d;\n    }\n    function kt(t) { return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514; }\n    function add(x, y) {\n        var l = (x & 0xFFFF) + (y & 0xFFFF), m = (x >> 16) + (y >> 16) + (l >> 16);\n        return (m << 16) | (l & 0xFFFF);\n    }\n    function rol(n, c) { return (n << c) | (n >>> (32 - c)); }\n}\n\nconst binaryKey = hexToBytes(apiKeyHex);\nconst generatedHash = hmacSha1(binaryKey, message);\nconst authHeader = `IAPIS user=${userLogin}, hmac-sha1=${generatedHash}`;\nconsole.log(hmacSha1('111111', '222222')===\"1558ab6c5ab2b0d1cd129b9ad11527cf33486705\")\nreturn { authHeader };"},"typeVersion":2},{"id":"0736637b-ce5b-475c-85fb-5b49bc67de84","name":"URL to Fetch Contractor Information","type":"n8n-nodes-base.set","position":[1200,848],"parameters":{"options":{},"assignments":{"assignments":[{"id":"400dd6ee-1ded-48d8-8dfc-b9e17bc35e8f","name":"url","type":"string","value":"=https://www.ifirma.pl/iapi/kontrahenci/id/{{$json.IdentyfikatorKontrahenta}}.json"},{"id":"6c174c47-5d70-40b7-8ad9-be9f55233118","name":"requestBody","type":"string","value":""}]}},"typeVersion":3.4},{"id":"70190ca0-612d-4f65-b448-a4e559961525","name":"Fetch Contractor Information","type":"n8n-nodes-base.httpRequest","position":[1536,848],"parameters":{"url":"={{ $(\"URL to Fetch Contractor Information\").item.json }}","options":{},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authentication","value":"={{ $json.authHeader }}"}]}},"typeVersion":4.3},{"id":"cd406348-87ab-4daa-8262-c2dd68cdd8aa","name":"Error Fetching Contractor Data","type":"n8n-nodes-base.stopAndError","position":[1888,656],"parameters":{"errorType":"errorObject","errorObject":"={\n  \"message\": \"Error fetching contractor data\",\n  \"body\": {{ JSON.stringify($(\"Fetch Invoices from System\").last().json.response) }}\n}"},"typeVersion":1},{"id":"e3d10c56-c354-43db-8801-c7faef9a2ac2","name":"Contains Error?","type":"n8n-nodes-base.if","position":[256,752],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"3413047a-8e5d-4d8b-8370-a5c57ecd4468","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.response.Kod }}","rightValue":0}]}},"typeVersion":2.3},{"id":"b62dcb1a-b06e-4890-927b-3f3da7f60ff4","name":"Contains Error? 2","type":"n8n-nodes-base.if","position":[1712,848],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"3413047a-8e5d-4d8b-8370-a5c57ecd4468","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.response.Kod }}","rightValue":0}]}},"typeVersion":2.3},{"id":"49e7ef49-da66-49f1-af06-34718c2aac40","name":"Extract Contractor Data","type":"n8n-nodes-base.set","position":[1888,848],"parameters":{"mode":"raw","options":{},"jsonOutput":"={{ JSON.stringify($input.item.json.response.Wynik[0], null, 2) }}"},"typeVersion":3.4},{"id":"b851e357-b230-4603-85b0-bbd1b851c7f8","name":"Deduplicate Contractors","type":"n8n-nodes-base.removeDuplicates","position":[1040,848],"parameters":{"compare":"selectedFields","options":{},"fieldsToCompare":"IdentyfikatorKontrahenta"},"typeVersion":2},{"id":"0293ccfd-73d1-4d7d-bb0e-82a75f03c3db","name":"Invoices for Reminder","type":"n8n-nodes-base.filter","position":[2352,624],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"556037c9-d033-4f89-b23d-f7c15c203d97","operator":{"type":"dateTime","operation":"equals"},"leftValue":"={{ $json.TerminPlatnosci }}","rightValue":"={{ $now.format('yyyy-LL-dd') }}"},{"id":"92dd91d3-a39e-460a-adf8-61a3ecdc41a4","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.TerminPlatnosci }}","rightValue":"={{ $now.minus($('Configuration').first().json[\"X days before due date\"], 'days').format('yyyy-LL-dd') }}"}]}},"typeVersion":2.3},{"id":"09a28451-a524-469d-902d-b80e24ff79f6","name":"Extract Invoices","type":"n8n-nodes-base.splitOut","position":[432,752],"parameters":{"options":{},"fieldToSplitOut":"response.Wynik"},"typeVersion":1},{"id":"846b1115-0094-4f7a-aca5-0549ccaafd65","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-2112,192],"parameters":{"width":672,"height":976,"content":"## iFirma Overdue Invoice Vindication\n\n**This workflow automates payment recovery for overdue invoices issued in** [iFirma](https://ifirma.pl)**. It fetches unpaid invoices daily, enriches them with full contractor data, and sends the appropriate notification — payment reminder, pre-trial summons, or court summons — via Gmail and/or physical mail through** [PostGrid](https://postgrid.com)**. Every action is reported to a Slack channel.**\n\n### How it works\n\nEach day the workflow fetches all unpaid invoices from iFirma using HMAC-SHA1 authenticated API calls, then enriches each invoice with full contractor details. Invoices are split into three escalation tiers based on configurable day thresholds:\n\n- **Reminder** — due today or X days before due date\n- **Pre-trial summons** — Y days after due date\n- **Court summons** — Z days after due date\n\nEach tier can independently send email, a physical letter via PostGrid, or both.\n\n### Setup\n1. Fill out the **Configuration** node with your iFirma login, API key (found under *Data and Configuration → Extensions and Integrations → API*), and the X/Y/Z day thresholds\n2. Fill out **Your Company Details** — used in letter and email templates and as the PostGrid sender address\n3. Configure PostGrid auth in both PostGrid nodes using Custom Auth:\n```json\n{ \"headers\": { \"x-api-key\": \"\" } }\n```\n\n### How to customize\nThe **Payment Reminder**, **Pre-trial summon Reminder**, and **Summons to court Reminder** nodes each have `Send by Traditional Mail` and `Send by Email` toggles — flip these to control delivery channel per escalation tier. HTML templates can be freely edited in the corresponding **Prepare Mail and Letter HTML Contents** nodes.\n\n\n\n\n\n\n\n\n\n\nNeed help? Contact us at [developers@sailingbyte.com](mailto:developers@sailingbyte.com) or visit [sailingbyte.com](https://sailingbyte.com)!\n\nHappy hacking!"},"typeVersion":1},{"id":"66183aef-61c0-4bbe-a606-30df3e1e6759","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1424,432],"parameters":{"color":3,"width":560,"height":736,"content":"## Fill out config\n1. Email/Login - Email or login used to log into the iFirma service\n2. API Key Invoice - API key that can be found at: \nStart > \nData and Configuration > \nExtensions and Integrations > \nAPI\n3. X days before due date - Number of days before payment deadline for reminder - How many days before payment deadline to send reminder (default 7)\n4. Y days after due date - Number of days after payment deadline to send notification about intent to pursue legal action\n5. Z days after due date - Number of days after payment deadline to send notification about pursuing legal action"},"typeVersion":1},{"id":"1430302c-976e-4f8f-91f5-2f40eea877f3","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[-288,432],"parameters":{"color":7,"width":880,"height":736,"content":"## Step 1: Fetching Invoice List\nFetching the invoice list from the service requires creating an encryption key that is not available to generate using standard N8N tools because it uses SHA-1 algorithm. Because iFirma returns error in response body, we first check if response contains an error, if not we extract items from the body to loop over them."},"typeVersion":1},{"id":"d77d322a-b8a5-4b86-818b-de59b80f3477","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[608,432],"parameters":{"color":7,"width":384,"height":736,"content":"## Step 2: Filtering paid invoices, map appropriate endpoints\nInvoices are filtered based on the `TerminPlatnosci` (Payment Deadline) value. Based on `Rodzaj` value from the response we map appropriate endpoint to our object."},"typeVersion":1},{"id":"ecccd537-3efd-4322-8ce7-6fc5e7fd4861","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","position":[2576,432],"parameters":{"color":3,"width":320,"height":736,"content":"## Configuration\nThese are values that are going to be added to the requests sent to iFirma\n\nValues you can fill in can be found [here](https://api.ifirma.pl/wysylanie-faktur-poczta-tradycyjna-oraz-na-adres-e-mail-kontrahenta/)"},"typeVersion":1},{"id":"94810f38-69c1-4718-97ce-ab8874d0f6f2","name":"Sticky Note13","type":"n8n-nodes-base.stickyNote","position":[1008,432],"parameters":{"color":7,"width":1200,"height":736,"content":"## Step 3: Fetch Contractor Data and Merge with Invoice Data\nBecause iFirma sends only partial data about contractor we need to make additional fetches so we have complete object with all necessary data. For these we use `IdentyfikatorKontrahenta`"},"typeVersion":1},{"id":"a2383336-11ef-4049-afc9-3471e66bfeae","name":"Sticky Note14","type":"n8n-nodes-base.stickyNote","position":[2224,432],"parameters":{"color":7,"width":336,"height":736,"content":"## Step 4: Logic Separation\nAt this point, the logic separates invoices into:\n1. Payment reminder\n2. Notification about intent to pursue legal action\n3. Notification about pursuing legal action"},"typeVersion":1},{"id":"14d852be-0d05-4a88-a380-c8efb030eabc","name":"Sticky Note15","type":"n8n-nodes-base.stickyNote","position":[3024,144],"parameters":{"color":2,"width":592,"height":464,"content":"## Notify Contractor About Approaching Payment Deadline"},"typeVersion":1},{"id":"0689d199-a955-4560-8762-7e73b36e301b","name":"Schedule Daily Check","type":"n8n-nodes-base.scheduleTrigger","notes":"Runs every day at 9:00 AM","position":[-1328,752],"parameters":{"rule":{"interval":[{"field":"hours","hoursInterval":24}]}},"typeVersion":1},{"id":"a1a49e9a-792e-4b83-ab29-269472412e0f","name":"Your Company Details","type":"n8n-nodes-base.set","position":[-624,752],"parameters":{"options":{},"assignments":{"assignments":[{"id":"61884a08-afef-4e5d-9e73-860e5bebe76a","name":"Company Name","type":"string","value":""},{"id":"03b6e8b6-a48a-4e06-939d-6fd32f0c3234","name":"Email","type":"string","value":""},{"id":"e5c56d54-f4cb-4856-9cc8-1e99483b1dbe","name":"Phone","type":"string","value":""},{"id":"e383c8f2-1c46-406e-a079-82228e65859b","name":"Country Code","type":"string","value":""},{"id":"c7d26305-a13e-43a6-a9c3-025b6f5929fa","name":"City","type":"string","value":""},{"id":"7c59db00-640e-411f-9ff0-a0aa05e97488","name":"Street","type":"string","value":""},{"id":"c2bd2535-112b-4766-a4fb-6117fc44d56a","name":"Postal Code","type":"string","value":""},{"id":"1ef4679e-421a-428a-94d8-93efa37dd951","name":"Swift Code","type":"string","value":""},{"id":"1c48a217-2fe0-40ff-bdc6-2d31da4ea887","name":"Bank Name","type":"string","value":""},{"id":"6d70aba1-efe4-4818-be1d-f130538ba642","name":"Bank Account Number","type":"string","value":""},{"id":"da47e651-5c03-410b-9600-3846411ebafd","name":"TIN (Tax Identification Number)","type":"string","value":""}]}},"typeVersion":3.4},{"id":"483d1bc0-42f9-4abc-86ff-199591dc1fdf","name":"Sticky Note16","type":"n8n-nodes-base.stickyNote","position":[-848,432],"parameters":{"color":3,"width":544,"height":736,"content":"## Your company details (Needed for PostGrid)\nThis data is needed for PostGrid API to work. It will be used to send letters in your name for Pre-trial summons and Summons to court when invoice is not paid"},"typeVersion":1},{"id":"fc3a4b45-97c8-4fad-93bb-16fa014c08f1","name":"Send pre-trial summon letter via PostGrid","type":"n8n-nodes-base.httpRequest","position":[3440,688],"parameters":{"url":"https://api.postgrid.com/print-mail/v1/letters","method":"POST","options":{},"jsonBody":"={\n  \"to\": {\n    \"companyName\": \"{{ $json['KontrahentNazwa'] }}\",\n    \"addressLine1\": \"{{$json['Ulica']}}\",\n    \"city\": \"{{$json['Miejscowosc']}}\",\n    \"provinceOrState\": \"\",\n    \"postalOrZip\": \"{{$json['KodPocztowy']}}\",\n    \"countryCode\": \"{{$json['PrefiksUE']}}\"\n  },\n  \"from\": {\n    \"companyName\": \"{{$('Your Company Details').first().json['Company Name']}}\",\n    \"addressLine1\": \"{{$('Your Company Details').first().json['Street']}}\",\n    \"city\": \"{{$('Your Company Details').first().json['City']}}\",\n    \"postalOrZip\": \"{{$('Your Company Details').first().json['Postal Code']}}\",\n    \"countryCode\": \"{{$('Your Company Details').first().json['Country Code']}}\"\n  },\n  \"html\": {{JSON.stringify($json['Message Content'])}},\n  \"description\": \"Overdue Invoice Reminder - {{$json['FakturaId']}}\",\n  \"color\": false,\n  \"doubleSided\": false,\n  \"addressPlacement\": \"top_first_page\"\n}","sendBody":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpCustomAuth"},"credentials":{"httpCustomAuth":{"id":"credential-id","name":"PostGrid API Key"}},"typeVersion":4.3},{"id":"461a7137-e6a1-46e7-b835-e2eb56e804fc","name":"Payment Reminder Slack Notification","type":"n8n-nodes-base.slack","position":[3248,240],"webhookId":"be9a268e-1023-45b2-8589-40e5862b05df","parameters":{"select":"channel","blocksUi":"={\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Payment reminder has been sent:\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Invoice No:*\\n{{$json.PelnyNumer}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Overdue:*\\n{{$now.diffTo($json.TerminPlatnosci.toDateTime(), 'days').floor()}} days\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Contractor:*\\n{{$json.KontrahentNazwa}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Payment Deadline:*\\n{{$json.TerminPlatnosci}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Amount:*\\n{{$json.Brutto}} {{$json.Waluta}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Issue Date:*\\n{{$json.DataWystawienia}}\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"*<fakeLink.toEmployeeProfile.com|View>*\"\n\t\t\t}\n\t\t}\n\t]\n}","channelId":{"__rl":true,"mode":"list","value":"channel-to-send-invoice-reminders","cachedResultName":"channel-to-send-invoice-reminders"},"messageType":"block","otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"credential-id","name":"Slack OAuth2"}},"typeVersion":2.4},{"id":"80a48c4c-5f8a-415a-8586-2f172f726ca5","name":"Prepare Mail and Letter HTML Contents for Pre-trial summon","type":"n8n-nodes-base.set","position":[3056,848],"parameters":{"options":{},"assignments":{"assignments":[{"id":"393b8e7b-fc27-4d99-bd11-152e16609e25","name":"Message Content","type":"string","value":"=<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <style>\n    body {\n      font-family: Arial, Helvetica, sans-serif;\n      line-height: 1.6;\n      color: #333333;\n      margin: 0;\n      padding: 0;\n      background-color: #ffffff;\n    }\n    .container {\n      max-width: 650px;\n      margin: 0 auto;\n      padding: 40px 30px;\n    }\n    .header {\n      border-bottom: 3px solid #c62828;\n      padding-bottom: 20px;\n      margin-bottom: 30px;\n    }\n    .company-name {\n      font-size: 24px;\n      font-weight: bold;\n      color: #c62828;\n      margin: 0 0 5px 0;\n    }\n    .company-tagline {\n      font-size: 14px;\n      color: #666666;\n      margin: 0;\n    }\n    h1 {\n      color: #c62828;\n      font-size: 22px;\n      margin: 0 0 20px 0;\n      text-transform: uppercase;\n    }\n    .urgent-notice {\n      background-color: #ffebee;\n      border-left: 4px solid #c62828;\n      padding: 15px 20px;\n      margin: 25px 0;\n    }\n    .urgent-notice p {\n      margin: 5px 0;\n      font-size: 15px;\n      font-weight: bold;\n      color: #c62828;\n    }\n    .invoice-details {\n      background-color: #f5f5f5;\n      padding: 20px;\n      border-radius: 5px;\n      margin: 25px 0;\n    }\n    .invoice-details table {\n      width: 100%;\n      border-collapse: collapse;\n    }\n    .invoice-details td {\n      padding: 8px 0;\n      font-size: 15px;\n    }\n    .invoice-details td:first-child {\n      color: #666666;\n      width: 45%;\n    }\n    .invoice-details td:last-child {\n      font-weight: bold;\n      text-align: right;\n    }\n    .amount-due {\n      font-size: 20px;\n      color: #c62828;\n    }\n    .overdue-status {\n      color: #c62828;\n      font-weight: bold;\n    }\n    .legal-warning {\n      background-color: #fff3cd;\n      border: 2px solid #ff6f00;\n      padding: 20px;\n      margin: 25px 0;\n      border-radius: 5px;\n    }\n    .legal-warning h2 {\n      color: #c62828;\n      font-size: 18px;\n      margin: 0 0 15px 0;\n      text-transform: uppercase;\n    }\n    .legal-warning p {\n      margin: 10px 0;\n      font-size: 14px;\n      line-height: 1.8;\n    }\n    .legal-warning ul {\n      margin: 15px 0;\n      padding-left: 20px;\n    }\n    .legal-warning li {\n      margin: 8px 0;\n    }\n    .payment-section {\n      background-color: #f5f5f5;\n      border-left: 4px solid #666666;\n      padding: 20px;\n      margin: 25px 0;\n    }\n    .payment-section h2 {\n      color: #333333;\n      font-size: 18px;\n      margin: 0 0 15px 0;\n    }\n    .payment-details {\n      font-size: 14px;\n      line-height: 1.8;\n    }\n    .payment-details strong {\n      display: inline-block;\n      width: 140px;\n      color: #666666;\n    }\n    .deadline-box {\n      background-color: #c62828;\n      color: #ffffff;\n      padding: 20px;\n      text-align: center;\n      border-radius: 5px;\n      margin: 25px 0;\n    }\n    .deadline-box h2 {\n      margin: 0 0 10px 0;\n      font-size: 20px;\n    }\n    .deadline-box p {\n      margin: 5px 0;\n      font-size: 16px;\n    }\n    .deadline-date {\n      font-size: 24px;\n      font-weight: bold;\n      margin: 10px 0;\n    }\n    .footer {\n      margin-top: 40px;\n      padding-top: 20px;\n      border-top: 1px solid #e0e0e0;\n      font-size: 13px;\n      color: #666666;\n      text-align: center;\n    }\n    .formal-signature {\n      margin-top: 30px;\n      font-size: 14px;\n    }\n    @media print {\n      body { background-color: #ffffff; }\n    }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <!-- Header -->\n    <div class=\"header\">\n      <p class=\"company-name\">{{$('Your Company Details').first().json['Company Name']}}</p>\n      <p class=\"company-tagline\">Software Development & Automation Solutions</p>\n    </div>\n\n    <!-- Main Content -->\n    <h1>Pre-Trial Summons - Notice of Intent to Pursue Legal Action</h1>\n    \n    <p>Dear {{ $json.KontrahentNazwa }},</p>\n    \n    <p><strong>RE: OVERDUE INVOICE - FORMAL NOTICE OF INTENT TO COMMENCE LEGAL PROCEEDINGS</strong></p>\n\n    <!-- Urgent Notice Box -->\n    <div class=\"urgent-notice\">\n      <p>URGENT: Invoice #{{ $json.FakturaId }} is now {{$now.diffTo($json['TerminPlatnosci'].toDateTime(), 'days').abs().floor()}} days overdue</p>\n      <p>Immediate action required to avoid legal proceedings</p>\n    </div>\n\n    <p>This is a formal notice regarding your outstanding payment obligation. Despite our previous communications, payment for the following invoice remains unpaid:</p>\n\n    <!-- Invoice Details -->\n    <div class=\"invoice-details\">\n      <table>\n        <tr>\n          <td>Invoice Number:</td>\n          <td>{{$json['PelnyNumer']}}</td>\n        </tr>\n        <tr>\n          <td>Issue Date:</td>\n          <td>{{$json['DataWystawienia']}}</td>\n        </tr>\n        <tr>\n          <td>Original Due Date:</td>\n          <td>{{$json['TerminPlatnosci']}}</td>\n        </tr>\n        <tr>\n          <td>Days Overdue:</td>\n          <td class=\"overdue-status\">{{$now.diffTo($json['TerminPlatnosci'].toDateTime(), 'days').abs().floor()}} days</td>\n        </tr>\n        <tr style=\"border-top: 2px solid #dddddd;\">\n          <td style=\"padding-top: 15px;\">Outstanding Amount:</td>\n          <td class=\"amount-due\" style=\"padding-top: 15px;\">{{$json.Brutto}} {{ $json.Waluta }}</td>\n        </tr>\n        <tr>\n          <td>Late Payment Interest:</td>\n          <td class=\"overdue-status\">+ Interest accruing daily</td>\n        </tr>\n      </table>\n    </div>\n\n    <!-- Legal Warning -->\n    <div class=\"legal-warning\">\n      <h2>Legal Consequences Notice</h2>\n      <p><strong>We hereby formally notify you of our intent to pursue legal action if this matter is not resolved immediately.</strong></p>\n      \n      <p>Failure to settle this debt within the deadline specified below will result in:</p>\n      <ul>\n        <li><strong>Commencement of legal proceedings</strong> in the appropriate court of law</li>\n        <li><strong>Additional legal costs and court fees</strong> added to the outstanding amount</li>\n        <li><strong>Statutory interest charges</strong> continuing to accrue on the unpaid balance</li>\n        <li><strong>Debt collection agency involvement</strong> and potential credit reporting</li>\n        <li><strong>Enforcement of judgment</strong> through asset seizure or wage garnishment</li>\n        <li><strong>Damage to your business credit rating</strong> and commercial reputation</li>\n      </ul>\n\n      <p>This action may significantly impact your ability to conduct business and obtain credit in the future.</p>\n    </div>\n\n    <!-- Final Deadline -->\n    <div class=\"deadline-box\">\n      <h2>FINAL PAYMENT DEADLINE</h2>\n      <p class=\"deadline-date\">{{$now.plus(( $('Configuration').first().json['Z days after due date'] - $('Configuration').first().json['Y days after due date'] ), 'days').format('MMMM dd, yyyy')}}</p>\n      <p>You have {{( $('Configuration').first().json['Z days after due date'] - $('Configuration').first().json['Y days after due date'] )}} days from the date of this notice to settle this debt in full</p>\n      <p>After this date, legal proceedings will commence without further notice</p>\n    </div>\n\n    <!-- Payment Information -->\n    <div class=\"payment-section\">\n      <h2>Immediate Payment Required</h2>\n      <p><strong>To avoid legal action, payment must be received by the deadline stated above.</strong></p>\n      <div class=\"payment-details\">\n        <p><strong>Bank Name:</strong> {{$('Your Company Details').first().json['Bank Name']}}</p>\n        <p><strong>Account Number:</strong> {{$('Your Company Details').first().json['Bank Account Number']}}</p>\n        <p><strong>SWIFT Code:</strong> {{$('Your Company Details').first().json['Swift Code']}}</p>\n        <p><strong>Payment Reference:</strong> {{$json['PelnyNumer']}} (MANDATORY)</p>\n      </div>\n      <p style=\"margin-top: 15px; color: #c62828;\"><strong>Important:</strong> Include the invoice number in your payment reference to ensure proper allocation.</p>\n    </div>\n\n    <p><strong>Proof of Payment Required:</strong> Upon payment, immediately send proof of transfer to {{$('Your Company Details').first().json['Email']}} to halt legal proceedings.</p>\n\n    <p><strong>Dispute of Debt:</strong> If you dispute this debt, you must provide written notice with supporting documentation within {{ $('Configuration').first().json['Z days after due date'] - $('Configuration').first().json['Y days after due date'] }} business days. Failure to do so will be considered acknowledgment of the debt.</p>\n\n    <!-- Formal Signature -->\n    <div class=\"formal-signature\">\n      <p>This notice is issued in accordance with applicable debt collection regulations.</p>\n      \n      <p style=\"margin-top: 20px;\">\n        Respectfully,<br><br>\n        <strong>Legal & Collections Department</strong><br>\n        {{$('Your Company Details').first().json['Company Name']}}<br>\n        {{$('Your Company Details').first().json['Email']}}<br>\n        {{$('Your Company Details').first().json['Phone']}}\n      </p>\n\n      <p style=\"margin-top: 20px; font-size: 12px; color: #999999;\">\n        <strong>Date of Notice:</strong> {{$now.format('MMMM dd, yyyy')}}<br>\n        <strong>Reference Number:</strong> LEGAL-{{$json['Invoice Id']}}-{{$now.format('yyyyMMdd')}}\n      </p>\n    </div>\n\n    <!-- Footer -->\n    <div class=\"footer\">\n      <p><strong>{{$('Your Company Details').first().json['Company Name']}}</strong></p>\n      <p>{{$('Your Company Details').first().json['Country Code']}} | {{$('Your Company Details').first().json['City']}}, {{$('Your Company Details').first().json['Street']}} | {{$('Your Company Details').first().json['Postal Code']}}</p>\n      <p>TIN: {{$('Your Company Details').first().json['TIN (Tax Identification Number)']}}</p>\n      <hr style=\"margin: 15px 0; border: none; border-top: 1px solid #e0e0e0;\">\n      <p style=\"font-size: 11px; color: #999999;\">\n        <strong>LEGAL NOTICE:</strong> This communication constitutes a formal demand for payment and notice of intent to commence legal proceedings. \n        This message is sent from an automated system but represents official legal correspondence. \n        All communications regarding this matter should be directed to our legal department at the contact details provided above.\n      </p>\n      <p style=\"font-size: 11px; color: #999999; margin-top: 10px;\">\n        Preservation Notice: Please retain this notice for your records. It may be presented as evidence in legal proceedings.\n      </p>\n    </div>\n  </div>\n</body>\n</html>"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"19f79a1e-dc9f-40a0-a215-2fdafde507d2","name":"Pre-trial summon Slack Notification","type":"n8n-nodes-base.slack","position":[3056,688],"webhookId":"884fcca6-5767-44d9-b467-12cc51d88c73","parameters":{"select":"channel","blocksUi":"={\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Will to enter a legal route has been sent:\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Invoice No:*\\n{{$json.PelnyNumer}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Overdue:*\\n{{$now.diffTo($json.TerminPlatnosci.toDateTime(), 'days').floor()}} days\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Contractor:*\\n{{$json.KontrahentNazwa}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Payment Deadline:*\\n{{$json.TerminPlatnosci}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Amount:*\\n{{$json.Brutto}} {{$json.Waluta}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Issue Date:*\\n{{$json.DataWystawienia}}\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}","channelId":{"__rl":true,"mode":"list","value":"C0A8W2JSHC6","cachedResultName":"ifirma-faktury-przypomnienia"},"messageType":"block","otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"credential-id","name":"Slack OAuth2"}},"typeVersion":2.4},{"id":"fd9a6089-a857-4616-8dba-be962cb4a1b9","name":"Sticky Note17","type":"n8n-nodes-base.stickyNote","position":[3024,624],"parameters":{"color":2,"width":592,"height":416,"content":"## Notify contractor about will to enter legal route"},"typeVersion":1},{"id":"2168d77f-5d93-4a93-98e3-4fa3802a414b","name":"Pre-trial summon Reminder","type":"n8n-nodes-base.set","position":[2688,768],"parameters":{"options":{},"assignments":{"assignments":[{"id":"25f97d49-730e-4224-85b5-dbfba2d391ca","name":"Send by Traditional Mail","type":"boolean","value":false},{"id":"b11a4b36-b3e7-4f8e-9a44-87294b9e8eb8","name":"Send by Email","type":"boolean","value":true}]},"includeOtherFields":true},"typeVersion":3.4,"alwaysOutputData":false},{"id":"6e914bbb-3f83-4e40-a046-c2ee13cdac43","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[3024,1056],"parameters":{"color":2,"width":592,"height":416,"content":"## Notify contractor about entering legal route"},"typeVersion":1},{"id":"df24f35b-8f8d-4c8a-9a18-6582fced27c8","name":"Send pre-trial summon mail","type":"n8n-nodes-base.gmail","position":[3440,848],"webhookId":"38dee251-d2d1-4520-819a-9ebc307e5c07","parameters":{"sendTo":"={{ $json.EmailDlaFaktury }}","message":"={{ $json[\"Message Content\"] }}","options":{},"subject":"=Pre-trial summon for invoice {{ $json.PelnyNumer }}"},"credentials":{"gmailOAuth2":{"id":"credential-id","name":"Google OAuth2"}},"typeVersion":2.2},{"id":"63cc1f7a-5541-4b67-ba6c-f5835a4f2282","name":"Send pre-trial summon with post office?","type":"n8n-nodes-base.if","position":[3248,688],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"6d022d95-b552-4b7f-9a77-1b5f5cc2eccb","operator":{"type":"boolean","operation":"equals"},"leftValue":"={{ $json[\"Send by Traditional Mail\"] }}","rightValue":true}]}},"typeVersion":2.3},{"id":"3464eddc-724c-430a-b099-7e8476f47d45","name":"Summons to court Reminder","type":"n8n-nodes-base.set","position":[2688,912],"parameters":{"options":{},"assignments":{"assignments":[{"id":"25f97d49-730e-4224-85b5-dbfba2d391ca","name":"Send by Traditional Mail","type":"boolean","value":false},{"id":"b11a4b36-b3e7-4f8e-9a44-87294b9e8eb8","name":"Send by Email","type":"boolean","value":true}]},"includeOtherFields":true},"typeVersion":3.4,"alwaysOutputData":false},{"id":"f8d2f3b0-29a0-4e88-b6b2-c43649ce48a6","name":"Send pre-trial summon via Email?","type":"n8n-nodes-base.if","position":[3248,848],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"6d022d95-b552-4b7f-9a77-1b5f5cc2eccb","operator":{"type":"boolean","operation":"equals"},"leftValue":"={{ $json[\"Send by Email\"] }}","rightValue":true}]}},"typeVersion":2.3},{"id":"d8376d55-70a3-468a-bc37-ffe466e44c0c","name":"Entering legal route Slack Notification","type":"n8n-nodes-base.slack","position":[3056,1120],"webhookId":"814fc7fd-ca3a-4e2b-9ad3-ca298805ae14","parameters":{"select":"channel","blocksUi":"={\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Will to enter a legal route has been sent:\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"fields\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Invoice No:*\\n{{$json.PelnyNumer}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Overdue:*\\n{{$now.diffTo($json.TerminPlatnosci.toDateTime(), 'days').floor()}} days\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Contractor:*\\n{{$json.KontrahentNazwa}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Payment Deadline:*\\n{{$json.TerminPlatnosci}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Amount:*\\n{{$json.Brutto}} {{$json.Waluta}}\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\t\"text\": \"*Issue Date:*\\n{{$json.DataWystawienia}}\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"*<fakeLink.toEmployeeProfile.com|View>*\"\n\t\t\t}\n\t\t}\n\t]\n}","channelId":{"__rl":true,"mode":"list","value":"C0A8W2JSHC6","cachedResultName":"ifirma-faktury-przypomnienia"},"messageType":"block","otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"credential-id","name":"Slack OAuth2"}},"typeVersion":2.4},{"id":"6efa4825-c165-4e3d-a791-e297bf7039ef","name":"Prepare Mail and Letter HTML Contents for entering legal route","type":"n8n-nodes-base.set","position":[3056,1280],"parameters":{"options":{},"assignments":{"assignments":[{"id":"393b8e7b-fc27-4d99-bd11-152e16609e25","name":"Message Content","type":"string","value":"=<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <style>\n    body {\n      font-family: Arial, Helvetica, sans-serif;\n      line-height: 1.6;\n      color: #333333;\n      margin: 0;\n      padding: 0;\n      background-color: #ffffff;\n    }\n    .container {\n      max-width: 650px;\n      margin: 0 auto;\n      padding: 40px 30px;\n    }\n    .header {\n      border-bottom: 3px solid #1a237e; /* Navy blue for formal court notice */\n      padding-bottom: 20px;\n      margin-bottom: 30px;\n    }\n    .company-name {\n      font-size: 24px;\n      font-weight: bold;\n      color: #1a237e;\n      margin: 0 0 5px 0;\n    }\n    .company-tagline {\n      font-size: 14px;\n      color: #666666;\n      margin: 0;\n    }\n    h1 {\n      color: #c62828;\n      font-size: 22px;\n      margin: 0 0 20px 0;\n      text-transform: uppercase;\n    }\n    .urgent-notice {\n      background-color: #ffebee;\n      border-left: 4px solid #c62828;\n      padding: 15px 20px;\n      margin: 25px 0;\n    }\n    .urgent-notice p {\n      margin: 5px 0;\n      font-size: 15px;\n      font-weight: bold;\n      color: #c62828;\n    }\n    .case-details {\n      background-color: #f5f5f5;\n      padding: 20px;\n      border-radius: 5px;\n      margin: 25px 0;\n      border: 1px solid #e0e0e0;\n    }\n    .case-details table {\n      width: 100%;\n      border-collapse: collapse;\n    }\n    .case-details td {\n      padding: 8px 0;\n      font-size: 15px;\n    }\n    .case-details td:first-child {\n      color: #666666;\n      width: 45%;\n    }\n    .case-details td:last-child {\n      font-weight: bold;\n      text-align: right;\n    }\n    .legal-warning {\n      background-color: #fff3cd;\n      border: 2px solid #ff6f00;\n      padding: 20px;\n      margin: 25px 0;\n      border-radius: 5px;\n    }\n    .legal-warning h2 {\n      color: #c62828;\n      font-size: 18px;\n      margin: 0 0 15px 0;\n      text-transform: uppercase;\n    }\n    .deadline-box {\n      background-color: #1a237e; /* Navy for the finality of court */\n      color: #ffffff;\n      padding: 20px;\n      text-align: center;\n      border-radius: 5px;\n      margin: 25px 0;\n    }\n    .deadline-box h2 {\n      margin: 0 0 10px 0;\n      font-size: 20px;\n    }\n    .deadline-date {\n      font-size: 24px;\n      font-weight: bold;\n      margin: 10px 0;\n    }\n    .footer {\n      margin-top: 40px;\n      padding-top: 20px;\n      border-top: 1px solid #e0e0e0;\n      font-size: 13px;\n      color: #666666;\n      text-align: center;\n    }\n    .formal-signature {\n      margin-top: 30px;\n      font-size: 14px;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <p class=\"company-name\">{{$('Your Company Details').first().json['Company Name']}}</p>\n      <p class=\"company-tagline\">Legal Department - Litigation Division</p>\n    </div>\n\n    <h1>FORMAL COURT SUMMONS & NOTICE OF LITIGATION</h1>\n    \n    <p>Dear {{ $json.KontrahentNazwa }},</p>\n    \n    <p><strong>RE: FINAL NOTICE PRIOR TO JUDICIAL ENFORCEMENT - CASE REF: {{$json['FakturaId']}}</strong></p>\n\n    <div class=\"urgent-notice\">\n      <p>STATUS: LEGAL PROCEEDINGS FORMALLY INITIATED</p>\n      <p>This is your final administrative opportunity to prevent a court hearing.</p>\n    </div>\n\n    <p>You are hereby notified that <strong>{{$('Your Company Details').first().json['Company Name']}}</strong> has moved your account to active litigation. A petition for the recovery of debt has been prepared for filing against you for the following outstanding balance:</p>\n\n    <div class=\"case-details\">\n      <table>\n        <tr>\n          <td>Claim Reference:</td>\n          <td>LIT-{{$json['FakturaId']}}-{{$now.format('yyyy')}}</td>\n        </tr>\n        <tr>\n          <td>Associated Invoice:</td>\n          <td>{{$json['PelnyNumer']}}</td>\n        </tr>\n        <tr>\n          <td>Principal Amount:</td>\n          <td>{{$json.Brutto}} {{ $json.Waluta }}</td>\n        </tr>\n        <tr>\n          <td>Current Interest & Fees:</td>\n          <td style=\"color: #c62828;\">+ Statutory Charges Accruing</td>\n        </tr>\n        <tr style=\"border-top: 2px solid #dddddd;\">\n          <td style=\"padding-top: 15px; font-weight: bold;\">TOTAL CLAIM VALUE:</td>\n          <td style=\"padding-top: 15px; font-size: 20px; color: #1a237e;\">{{$json.Brutto}} {{ $json.Waluta }}*</td>\n        </tr>\n      </table>\n      <p style=\"font-size: 11px; margin-top: 10px;\">*Excluding future court costs and bailiff execution fees.</p>\n    </div>\n\n    <div class=\"legal-warning\">\n      <h2>Notice of Judicial Action</h2>\n      <p>Upon the expiration of the deadline below, the following actions will proceed without further warning:</p>\n      <ul>\n        <li><strong>Filing of Lawsuit:</strong> Formal entry of the claim into the civil court system.</li>\n        <li><strong>Public Record:</strong> The litigation will be registered against your credit profile, affecting future financing.</li>\n        <li><strong>Asset Attachment:</strong> Application for the seizure of bank accounts or property to satisfy the debt.</li>\n        <li><strong>Additional Costs:</strong> You will be held liable for all legal fees, process server costs, and court levies.</li>\n      </ul>\n    </div>\n\n    <div class=\"deadline-box\">\n      <h2>FINAL SETTLEMENT DEADLINE</h2>\n      <p class=\"deadline-date\">{{$now.plus(( $('Configuration').first().json['Z days after due date'] - $('Configuration').first().json['Y days after due date'] ), 'days').format('MMMM dd, yyyy')}}</p>\n      <p>All legal actions will be stayed ONLY if full payment is confirmed before this date.</p>\n    </div>\n\n    <p><strong>TO STOP LEGAL PROCEEDINGS:</strong> You must immediately transfer the total amount due to the account details provided below and provide a PDF confirmation to our legal department.</p>\n\n    <div style=\"background-color: #f5f5f5; padding: 20px; border-radius: 5px; margin: 25px 0; border-left: 4px solid #1a237e;\">\n      <p style=\"margin-top: 0;\"><strong>Bank Name:</strong> {{$('Your Company Details').first().json['Bank Name']}}</p>\n      <p><strong>Account Number:</strong> {{$('Your Company Details').first().json['Bank Account Number']}}</p>\n      <p><strong>SWIFT/BIC:</strong> {{$('Your Company Details').first().json['Swift Code']}}</p>\n      <p><strong>Reference:</strong> CASE-{{$json['PelnyNumer']}}</p>\n    </div>\n\n    <div class=\"formal-signature\">\n      <p>\n        Respectfully,<br><br>\n        <strong>Litigation & Recovery Department</strong><br>\n        {{$('Your Company Details').first().json['Company Name']}}<br>\n        {{$('Your Company Details').first().json['Email']}}\n      </p>\n      <p style=\"margin-top: 20px; font-size: 12px; color: #999999;\">\n        <strong>Date of Issue:</strong> {{$now.format('MMMM dd, yyyy')}}\n      </p>\n    </div>\n\n    <div class=\"footer\">\n      <p><strong>{{$('Your Company Details').first().json['Company Name']}}</strong></p>\n      <p>This is an official communication. Failure to respond has serious legal consequences.</p>\n    </div>\n  </div>\n</body>\n</html>"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"a46a3c6a-4344-479a-80fb-9e6e491d6bc5","name":"Send entering legal route with post office?","type":"n8n-nodes-base.if","position":[3248,1120],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"6d022d95-b552-4b7f-9a77-1b5f5cc2eccb","operator":{"type":"boolean","operation":"equals"},"leftValue":"={{ $json[\"Send by Traditional Mail\"] }}","rightValue":true}]}},"typeVersion":2.3},{"id":"8fac7c98-8a48-45c1-b949-b360235c639c","name":"Send entering legal route via Email?","type":"n8n-nodes-base.if","position":[3248,1280],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"6d022d95-b552-4b7f-9a77-1b5f5cc2eccb","operator":{"type":"boolean","operation":"equals"},"leftValue":"={{ $json[\"Send by Email\"] }}","rightValue":true}]}},"typeVersion":2.3},{"id":"778d6a5a-7f82-4620-aaca-6eaa1d636a09","name":"Send entering legal route letter via PostGrid","type":"n8n-nodes-base.httpRequest","position":[3440,1120],"parameters":{"url":"https://api.postgrid.com/print-mail/v1/letters","method":"POST","options":{},"jsonBody":"={\n  \"to\": {\n    \"companyName\": \"{{ $json['KontrahentNazwa'] }}\",\n    \"addressLine1\": \"{{$json['Ulica']}}\",\n    \"city\": \"{{$json['Miejscowosc']}}\",\n    \"provinceOrState\": \"\",\n    \"postalOrZip\": \"{{$json['KodPocztowy']}}\",\n    \"countryCode\": \"{{$json['PrefiksUE']}}\"\n  },\n  \"from\": {\n    \"companyName\": \"{{$('Your Company Details').first().json['Company Name']}}\",\n    \"addressLine1\": \"{{$('Your Company Details').first().json['Street']}}\",\n    \"city\": \"{{$('Your Company Details').first().json['City']}}\",\n    \"postalOrZip\": \"{{$('Your Company Details').first().json['Postal Code']}}\",\n    \"countryCode\": \"{{$('Your Company Details').first().json['Country Code']}}\"\n  },\n  \"html\": {{JSON.stringify($json['Message Content'])}},\n  \"description\": \"Overdue Invoice Reminder - {{$json['FakturaId']}}\",\n  \"color\": false,\n  \"doubleSided\": false,\n  \"addressPlacement\": \"top_first_page\"\n}","sendBody":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpCustomAuth"},"credentials":{"httpCustomAuth":{"id":"credential-id","name":"PostGrid API Key"}},"typeVersion":4.3},{"id":"e88a7c2b-0309-4b80-9980-fbdf1ebd7303","name":"Send entering legal route mail","type":"n8n-nodes-base.gmail","position":[3440,1280],"webhookId":"f0eca86e-75d6-4c4d-bb26-6ea16d0c4543","parameters":{"sendTo":"={{ $json.EmailDlaFaktury }}","message":"={{ $json['Message Content'] }}","options":{},"subject":"=Summon to court over invoice {{ $json.FakturaId }}"},"credentials":{"gmailOAuth2":{"id":"credential-id","name":"Google OAuth2"}},"typeVersion":2.2},{"id":"e0cdb2b3-f637-4ffa-8783-98e2f9822ac1","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2912,48],"parameters":{"color":7,"width":816,"height":1536,"content":"## Step 5: Send reminder"},"typeVersion":1},{"id":"12e59b84-1b8d-4a26-93da-433177ae2fae","name":"Merge Invoice with contractor","type":"n8n-nodes-base.merge","position":[2080,768],"parameters":{"mode":"combine","options":{},"advanced":true,"mergeByFields":{"values":[{"field1":"IdentyfikatorKontrahenta","field2":"Identyfikator"}]}},"typeVersion":3.2}],"pinData":{},"connections":{"Configuration":{"main":[[{"node":"Your Company Details","type":"main","index":0}]]},"Encode API Key":{"main":[[{"node":"Fetch Invoices from System","type":"main","index":0}]]},"Contains Error?":{"main":[[{"node":"Error Fetching Invoices","type":"main","index":0}],[{"node":"Extract Invoices","type":"main","index":0}]]},"Extract Invoices":{"main":[[{"node":"Filter Unpaid Invoices Due Today or Earlier","type":"main","index":0}]]},"Payment Reminder":{"main":[[{"node":"URL for Sending Reminder","type":"main","index":0}]]},"Contains Error? 2":{"main":[[{"node":"Error Fetching Contractor Data","type":"main","index":0}],[{"node":"Extract Contractor Data","type":"main","index":0}]]},"Schedule Daily Check":{"main":[[{"node":"Configuration","type":"main","index":0}]]},"Your Company Details":{"main":[[{"node":"URL to Fetch Invoices","type":"main","index":0}]]},"Invoices for Reminder":{"main":[[{"node":"Payment Reminder","type":"main","index":0}]]},"URL to Fetch Invoices":{"main":[[{"node":"Encode API Key","type":"main","index":0}]]},"Y Days After Due Date":{"main":[[{"node":"Pre-trial summon Reminder","type":"main","index":0}]]},"Z Days After Due Date":{"main":[[{"node":"Summons to court Reminder","type":"main","index":0}]]},"Deduplicate Contractors":{"main":[[{"node":"URL to Fetch Contractor Information","type":"main","index":0}]]},"Extract Contractor Data":{"main":[[{"node":"Merge Invoice with contractor","type":"main","index":1}]]},"URL for Sending Reminder":{"main":[[{"node":"Encode API Key for Sending Reminder","type":"main","index":0},{"node":"Payment Reminder Slack Notification","type":"main","index":0}]]},"Pre-trial summon Reminder":{"main":[[{"node":"Prepare Mail and Letter HTML Contents for Pre-trial summon","type":"main","index":0},{"node":"Pre-trial summon Slack Notification","type":"main","index":0}]]},"Summons to court Reminder":{"main":[[{"node":"Entering legal route Slack Notification","type":"main","index":0},{"node":"Prepare Mail and Letter HTML Contents for entering legal route","type":"main","index":0}]]},"Fetch Invoices from System":{"main":[[{"node":"Contains Error?","type":"main","index":0}]]},"Fetch Contractor Information":{"main":[[{"node":"Contains Error? 2","type":"main","index":0}]]},"Merge Invoice with contractor":{"main":[[{"node":"Invoices for Reminder","type":"main","index":0},{"node":"Y Days After Due Date","type":"main","index":0},{"node":"Z Days After Due Date","type":"main","index":0}]]},"Assign Endpoint to Invoice Type":{"main":[[{"node":"Deduplicate Contractors","type":"main","index":0},{"node":"Merge Invoice with contractor","type":"main","index":0}]]},"Send pre-trial summon via Email?":{"main":[[{"node":"Send pre-trial summon mail","type":"main","index":0}]]},"Encode API Key for Sending Reminder":{"main":[[{"node":"Send Reminder","type":"main","index":0}]]},"URL to Fetch Contractor Information":{"main":[[{"node":"Encode API Key to Fetch Contractor Information","type":"main","index":0}]]},"Send entering legal route via Email?":{"main":[[{"node":"Send entering legal route mail","type":"main","index":0}]]},"Send pre-trial summon with post office?":{"main":[[{"node":"Send pre-trial summon letter via PostGrid","type":"main","index":0}]]},"Filter Unpaid Invoices Due Today or Earlier":{"main":[[{"node":"Assign Endpoint to Invoice Type","type":"main","index":0}]]},"Send entering legal route with post office?":{"main":[[{"node":"Send entering legal route letter via PostGrid","type":"main","index":0}]]},"Encode API Key to Fetch Contractor Information":{"main":[[{"node":"Fetch Contractor Information","type":"main","index":0}]]},"Prepare Mail and Letter HTML Contents for Pre-trial summon":{"main":[[{"node":"Send pre-trial summon via Email?","type":"main","index":0},{"node":"Send pre-trial summon with post office?","type":"main","index":0}]]},"Prepare Mail and Letter HTML Contents for entering legal route":{"main":[[{"node":"Send entering legal route via Email?","type":"main","index":0},{"node":"Send entering legal route with post office?","type":"main","index":0}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":53,"nodeTypes":{"n8n-nodes-base.if":{"count":6},"n8n-nodes-base.set":{"count":11},"n8n-nodes-base.code":{"count":4},"n8n-nodes-base.gmail":{"count":2},"n8n-nodes-base.merge":{"count":1},"n8n-nodes-base.slack":{"count":3},"n8n-nodes-base.filter":{"count":4},"n8n-nodes-base.splitOut":{"count":1},"n8n-nodes-base.stickyNote":{"count":12},"n8n-nodes-base.httpRequest":{"count":5},"n8n-nodes-base.stopAndError":{"count":2},"n8n-nodes-base.scheduleTrigger":{"count":1},"n8n-nodes-base.removeDuplicates":{"count":1}}},"status":"published","readyToDemo":null,"user":{"name":"Łukasz","username":"lukaszpp","bio":"Developer, automation architect and CTO/CEO helping businesses turn complex processes into scalable systems. I build smart automations and SaaS solutions for Real Estate, advertising, logistics and more.\n\nMy focus is to remove manual work, increase efficiency, and create measurable business impact.\n\nI support founders and decision-makers in turning ideas into structured, automated operations.\n\nLet’s connect 🤝","verified":true,"links":["https://sailingbyte.com"],"avatar":"https://gravatar.com/avatar/aae1a29225cc13556a92db7f75050da4bb664bf68e1d73407da6c9cd5a7a9a8a?r=pg&d=retro&size=200"},"nodes":[{"id":19,"icon":"file:httprequest.svg","name":"n8n-nodes-base.httpRequest","codex":{"data":{"alias":["API","Request","URL","Build","cURL"],"resources":{"generic":[{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/automatically-pulling-and-visualizing-data-with-n8n/","icon":"📈","label":"Automatically pulling and visualizing data with n8n"},{"url":"https://n8n.io/blog/learn-how-to-automatically-cross-post-your-content-with-n8n/","icon":"✍️","label":"Learn how to automatically cross-post your content with n8n"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/running-n8n-on-ships-an-interview-with-maranics/","icon":"🛳","label":"Running n8n on ships: An interview with Maranics"},{"url":"https://n8n.io/blog/what-are-apis-how-to-use-them-with-no-code/","icon":" 🪢","label":"What are APIs and how to use them with no code"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/world-poetry-day-workflow/","icon":"📜","label":"Celebrating World Poetry Day with a daily poem in Telegram"},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/automate-designs-with-bannerbear-and-n8n/","icon":"🎨","label":"Automate Designs with Bannerbear and n8n"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/building-an-expense-tracking-app-in-10-minutes/","icon":"📱","label":"Building an expense tracking app in 10 minutes"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/how-to-use-the-http-request-node-the-swiss-army-knife-for-workflow-automation/","icon":"🧰","label":"How to use the HTTP Request Node - The Swiss Army Knife for Workflow Automation"},{"url":"https://n8n.io/blog/learn-how-to-use-webhooks-with-mattermost-slash-commands/","icon":"🦄","label":"Learn how to use webhooks with Mattermost slash commands"},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/a-low-code-bitcoin-ticker-built-with-questdb-and-n8n-io/","icon":"📈","label":"A low-code bitcoin ticker built with QuestDB and n8n.io"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/automations-for-activists/","icon":"✨","label":"How Common Knowledge use workflow automation for activism"},{"url":"https://n8n.io/blog/creating-scheduled-text-affirmations-with-n8n/","icon":"🤟","label":"Creating scheduled text affirmations with n8n"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"output\"]","defaults":{"name":"HTTP Request","color":"#0004F5"},"iconData":{"type":"file","fileBuffer":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OTMgMjguNzExIDMwLjg2OCAyOS4zNzc0IDI3LjY4NDdIMzUuMTA0NkMzMy4yNTEgMzEuMzMyMiAzMC4xMDY4IDM0LjIxNzkgMjYuMjc2NiAzNS43NDI3Wk0xMy43MjM0IDM1Ljc0MjdDOS44OTM2OSAzNC4yMTc5IDYuNzUxNTUgMzEuMzMyNCA0Ljg5MjkzIDI3LjY4NDdIMTAuNjIyNkMxMS4yODkgMzAuODY4IDEyLjM2MzUgMzMuNjM5MyAxMy43MjM0IDM1Ljc0MjdaIiBmaWxsPSIjM0E0MkU5Ii8+Cjwvc3ZnPgo="},"displayName":"HTTP Request","typeVersion":4,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":20,"icon":"fa:map-signs","name":"n8n-nodes-base.if","codex":{"data":{"alias":["Router","Filter","Condition","Logic","Boolean","Branch"],"details":"The IF node can be used to implement binary conditional logic in your workflow. You can set up one-to-many conditions to evaluate each item of data being inputted into the node. That data will either evaluate to TRUE or FALSE and route out of the node accordingly.\n\nThis node has multiple types of conditions: Bool, String, Number, and Date & Time.","resources":{"generic":[{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/create-a-toxic-language-detector-for-telegram/","icon":"🤬","label":"Create a toxic language detector for Telegram in 4 step"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/automation-for-maintainers-of-open-source-projects/","icon":"🏷️","label":"How to automatically manage contributions to open-source projects"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/","icon":"🧠","label":"Why this Product Manager loves workflow automation with n8n"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.if/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"transform\"]","defaults":{"name":"If","color":"#408000"},"iconData":{"icon":"map-signs","type":"icon"},"displayName":"If","typeVersion":2,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":24,"icon":"file:merge.svg","name":"n8n-nodes-base.merge","codex":{"data":{"alias":["Join","Concatenate","Wait"],"resources":{"generic":[{"url":"https://n8n.io/blog/how-to-sync-data-between-two-systems/","icon":"🏬","label":"How to synchronize data between two systems (one-way vs. two-way sync"},{"url":"https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/","icon":"🎫","label":"Supercharging your conference registration process with n8n"},{"url":"https://n8n.io/blog/migrating-community-metrics-to-orbit-using-n8n/","icon":"📈","label":"Migrating Community Metrics to Orbit using n8n"},{"url":"https://n8n.io/blog/build-your-own-virtual-assistant-with-n8n-a-step-by-step-guide/","icon":"👦","label":"Build your own virtual assistant with n8n: A step by step guide"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.merge/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Merge"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTc3XzUxOCkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCI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CAxMTJWNDhaTTEwNCA0OEMxMDguNDE4IDQ4IDExMiA1MS41ODE3IDExMiA1NlYxMDRDMTEyIDEwOC40MTggMTA4LjQxOCAxMTIgMTA0IDExMkg1NkM1MS41ODE3IDExMiA0OCAxMDguNDE4IDQ4IDEwNFY1NkM0OCA1MS41ODE3IDUxLjU4MTcgNDggNTYgNDhIMTA0Wk00NTYgMjI0QzQ2MC40MTggMjI0IDQ2NCAyMjcuNTgyIDQ2NCAyMzJWMjgwQzQ2NCAyODQuNDE4IDQ2MC40MTggMjg4IDQ1NiAyODhINDA4QzQwMy41ODIgMjg4IDQwMCAyODQuNDE4IDQwMCAyODBWMjMyQzQwMCAyMjcuNTgyIDQwMy41ODIgMjI0IDQwOCAyMjRINDU2Wk0xMTIgNDA4QzExMiA0MDMuNTgyIDEwOC40MTggNDAwIDEwNCA0MDBINTZDNTEuNTgxNyA0MDAgNDggNDAzLjU4MiA0OCA0MDhWNDU2QzQ4IDQ2MC40MTggNTEuNTgxNyA0NjQgNTYgNDY0SDEwNEMxMDguNDE4IDQ2NCAxMTIgNDYwLjQxOCAxMTIgNDU2VjQwOFoiIGZpbGw9IiM1NEI4QzkiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTc3XzUxOCI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Merge","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":38,"icon":"fa:pen","name":"n8n-nodes-base.set","codex":{"data":{"alias":["Set","JS","JSON","Filter","Transform","Map"],"resources":{"generic":[{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/automatically-pulling-and-visualizing-data-with-n8n/","icon":"📈","label":"Automatically pulling and visualizing data with n8n"},{"url":"https://n8n.io/blog/database-monitoring-and-alerting-with-n8n/","icon":"📡","label":"Database Monitoring and Alerting with n8n"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/building-an-expense-tracking-app-in-10-minutes/","icon":"📱","label":"Building an expense tracking app in 10 minutes"},{"url":"https://n8n.io/blog/the-ultimate-guide-to-automate-your-video-collaboration-with-whereby-mattermost-and-n8n/","icon":"📹","label":"The ultimate guide to automate your video collaboration with Whereby, Mattermost, and n8n"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/learn-to-build-powerful-api-endpoints-using-webhooks/","icon":"🧰","label":"Learn to Build Powerful API Endpoints Using Webhooks"},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/a-low-code-bitcoin-ticker-built-with-questdb-and-n8n-io/","icon":"📈","label":"A low-code bitcoin ticker built with QuestDB and n8n.io"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Data Transformation"]}}},"group":"[\"input\"]","defaults":{"name":"Edit Fields"},"iconData":{"icon":"pen","type":"icon"},"displayName":"Edit Fields (Set)","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":40,"icon":"file:slack.svg","name":"n8n-nodes-base.slack","codex":{"data":{"alias":["human","form","wait","hitl","approval"],"resources":{"generic":[{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/build-your-own-virtual-assistant-with-n8n-a-step-by-step-guide/","icon":"👦","label":"Build your own virtual assistant with n8n: A step by step guide"},{"url":"https://n8n.io/blog/how-to-automatically-give-kudos-to-contributors-with-github-slack-and-n8n/","icon":"👏","label":"How to automatically give kudos to contributors with GitHub, Slack, and n8n"},{"url":"https://n8n.io/blog/automations-for-activists/","icon":"✨","label":"How Common Knowledge use workflow automation for activism"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/slack/"}]},"categories":["Communication","HITL"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"HITL":["Human in the Loop"]}}},"group":"[\"output\"]","defaults":{"name":"Slack"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiB2aWV3Qm94PSIwIDAgMTUwLjg1MiAxNTAuODUyIj48dXNlIHhsaW5rOmhyZWY9IiNhIiB4PSIuOTI2IiB5PSIuOTI2Ii8+PHN5bWJvbCBpZD0iYSIgb3ZlcmZsb3c9InZpc2libGUiPjxnIHN0cm9rZS13aWR0aD0iMS44NTIiPjxwYXRoIGZpbGw9IiNlMDFlNWEiIHN0cm9rZT0iI2UwMWU1YSIgZD0iTTQwLjc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yMDggNi42MDcgMTQuODE1IDE0LjgxNSAxNC44MTVzMTQuODE1LTYuNjA3IDE0LjgxNS0xNC44MTUtNi42MDctMTQuODE1LTE0LjgxNS0xNC44MTVINzcuNzc4eiIvPjxwYXRoIGZpbGw9IiMyZmI2N2MiIHN0cm9rZT0iIzJmYjY3YyIgZD0iTTEzMy4zMzQgNzAuMzcxaC0xNC44MTVWNTUuNTU2YzAtOC4yMDcgNi42MDctMTQuODE1IDE0LjgxNS0xNC44MTVzMTQuODE1IDYuNjA3IDE0LjgxNSAxNC44MTUtNi42MDcgMTQuODE1LTE0LjgxNSAxNC44MTV6Ii8+PHBhdGggZmlsbD0iI2UwMWU1YSIgc3Ryb2tlPSIjZTAxZTVhIiBkPSJNMTQuODE1IDc3Ljc3OEgyOS42M3YxNC44MTVjMCA4LjIwNy02LjYwNyAxNC44MTUtMTQuODE1IDE0LjgxNVMwIDEwMC44IDAgOTIuNTkzczYuNjA3LTE0LjgxNSAxNC44MTUtMTQuODE1eiIvPjxwYXRoIGZpbGw9IiMzNmM1ZjEiIHN0cm9rZT0iIzM2YzVmMSIgZD0iTTcwLjM3MSAxNC44MTVWMjkuNjNINTUuNTU2Yy04LjIwNyAwLTE0LjgxNS02LjYwNy0xNC44MTUtMTQuODE1UzQ3LjM0OCAwIDU1LjU1NiAwczE0LjgxNSA2LjYwNyAxNC44MTUgMTQuODE1eiIvPjwvZz48L2c+PC9zeW1ib2w+PC9zdmc+"},"displayName":"Slack","typeVersion":2,"nodeCategories":[{"id":6,"name":"Communication"},{"id":28,"name":"HITL"}]},{"id":356,"icon":"file:gmail.svg","name":"n8n-nodes-base.gmail","codex":{"data":{"alias":["email","human","form","wait","hitl","approval"],"resources":{"generic":[{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/","icon":"🎫","label":"Supercharging your conference registration process with n8n"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/your-business-doesnt-need-you-to-operate/","icon":" 🖥️","label":"Hey founders! Your business doesn't need you to operate"},{"url":"https://n8n.io/blog/using-automation-to-boost-productivity-in-the-workplace/","icon":"💪","label":"Using Automation to Boost Productivity in the Workplace"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"}]},"categories":["Communication","HITL"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"HITL":["Human in the Loop"]}}},"group":"[\"transform\"]","defaults":{"name":"Gmail"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTYiIGhlaWdodD0iMTkzIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZmlsbD0iIzQyODVGNCIgZD0iTTU4LjE4MiAxOTIuMDVWOTMuMTRMMjcuNTA3IDY1LjA3NyAwIDQ5LjUwNHYxMjUuMDkxYzAgOS42NTggNy44MjUgMTcuNDU1IDE3LjQ1NSAxNy40NTV6Ii8+PHBhdGggZmlsbD0iIzM0QTg1MyIgZD0iTTE5Ny44MTggMTkyLjA1aDQwLjcyN2M5LjY1OSAwIDE3LjQ1NS03LjgyNiAxNy40NTUtMTcuNDU1VjQ5LjUwNWwtMzEuMTU2IDE3LjgzNy0yNy4wMjYgMjUuNzk4eiIvPjxwYXRoIGZpbGw9IiNFQTQzMzUiIGQ9Im01OC4xODIgOTMuMTQtNC4xNzQtMzguNjQ3IDQuMTc0LTM2Ljk4OUwxMjggNjkuODY4bDY5LjgxOC01Mi4zNjQgNC42NyAzNC45OTItNC42NyA0MC42NDRMMTI4IDE0NS41MDR6Ii8+PHBhdGggZmlsbD0iI0ZCQkMwNCIgZD0iTTE5Ny44MTggMTcuNTA0VjkzLjE0TDI1NiA0OS41MDRWMjYuMjMxYzAtMjEuNTg1LTI0LjY0LTMzLjg5LTQxLjg5LTIwLjk0NXoiLz48cGF0aCBmaWxsPSIjQzUyMjFGIiBkPSJtMCA0OS41MDQgMjYuNzU5IDIwLjA3TDU4LjE4MiA5My4xNFYxNy41MDRMNDEuODkgNS4yODZDMjQuNjEtNy42NiAwIDQuNjQ2IDAgMjYuMjN6Ii8+PC9zdmc+"},"displayName":"Gmail","typeVersion":2,"nodeCategories":[{"id":6,"name":"Communication"},{"id":28,"name":"HITL"}]},{"id":528,"icon":"fa:exclamation-triangle","name":"n8n-nodes-base.stopAndError","codex":{"data":{"alias":["Throw error","Error","Exception"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.stopanderror/"}]},"categories":["Core Nodes","Utility"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"input\"]","defaults":{"name":"Stop and Error","color":"#ff0000"},"iconData":{"icon":"exclamation-triangle","type":"icon"},"displayName":"Stop and Error","typeVersion":1,"nodeCategories":[{"id":7,"name":"Utility"},{"id":9,"name":"Core Nodes"}]},{"id":565,"icon":"fa:sticky-note","name":"n8n-nodes-base.stickyNote","codex":{"data":{"alias":["Comments","Notes","Sticky"],"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\"]","defaults":{"name":"Sticky Note","color":"#FFD233"},"iconData":{"icon":"sticky-note","type":"icon"},"displayName":"Sticky Note","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":834,"icon":"file:code.svg","name":"n8n-nodes-base.code","codex":{"data":{"alias":["cpde","Javascript","JS","Python","Script","Custom Code","Function"],"details":"The Code node allows you to execute JavaScript in your workflow.","resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Code"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTcxXzQ0MSkiPgo8cGF0aCBkPSJNMTcwLjI4MyA0OEgxOTYuNUMyMDMuMTI3IDQ4IDIwOC41IDQyLjYyNzQgMjA4LjUgMzZWMTJDMjA4LjUgNS4zNzI1OCAyMDMuMTI3IDAgMTk2LjUgMEgxNzAuMjgzQzEyNi4xIDAgOTAuMjgzIDM1LjgxNzIgOTAuMjgzIDgwVjE3NkM5MC4yODMgMjA2LjkyOCA2NS4yMTA5IDIzMiAzNC4yODMgMjMySDIzQzE2LjM3MjYgMjMyIDExIDIzNy4zNzIgMTEgMjQ0VjI2OEMxMSAyNzQuNjI3IDE2LjM3MjQgMjgwIDIyLjk5OTYgMjgwTDM0LjI4MyAyODBDNjUuMjEwOSAyODAgOTAuMjgzIDMwNS4wNzIgOTAuMjgzIDMzNlY0NDBDOTAuMjgzIDQ3OS43NjQgMTIyLjUxOCA1MTIgMTYyLjI4MyA1MTJIMTk2LjVDMjAzLjEyNyA1MTIgMjA4LjUgNTA2LjYyNyAyMDguNSA1MDBWNDc2Q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M3LjM3MyA0OTYuNjI4IDIzMiA0OTAgMjMyTDQ3OC45NzkgMjMyQzQ0OC4wNTEgMjMyIDQyMi45NzggMjA2LjkyOCA0MjIuOTc4IDE3NlY4MEM0MjIuOTc4IDM1LjgxNzIgMzg3LjE2MSAwIDM0Mi45NzkgMEgzMTdDMzEwLjM3MyAwIDMwNSA1LjM3MjU4IDMwNSAxMlYzNloiIGZpbGw9IiNGRjk5MjIiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Code","typeVersion":2,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":839,"icon":"fa:clock","name":"n8n-nodes-base.scheduleTrigger","codex":{"data":{"alias":["Time","Scheduler","Polling","Cron","Interval"],"resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"trigger\",\"schedule\"]","defaults":{"name":"Schedule Trigger","color":"#31C49F"},"iconData":{"icon":"clock","type":"icon"},"displayName":"Schedule Trigger","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":844,"icon":"fa:filter","name":"n8n-nodes-base.filter","codex":{"data":{"alias":["Router","Filter","Condition","Logic","Boolean","Branch"],"details":"The Filter node can be used to filter items based on a condition. If the condition is met, the item will be passed on to the next node. If the condition is not met, the item will be omitted. Conditions can be combined together by AND(meet all conditions), or OR(meet at least one condition).","resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.filter/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Filter","color":"#229eff"},"iconData":{"icon":"filter","type":"icon"},"displayName":"Filter","typeVersion":2,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":1238,"icon":"file:removeDuplicates.svg","name":"n8n-nodes-base.removeDuplicates","codex":{"data":{"alias":["Dedupe","Deduplicate","Duplicates","Remove","Unique","Transform","Array","List","Item"],"details":"","resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.removeduplicates/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Remove Duplicates"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJub25lIj48ZyBmaWxsPSIjNTRCOEM5IiBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGQ9Ik0xMzQuMDk3IDExMWgzOC44Mjl2MzIuNTA4SDEzOC4xNnYzNC42MzVoLTMyLjUwOHYtMzguNjk5YzAtMTUuNzA5IDEyLjczNS0yOC40NDQgMjguNDQ1LTI4LjQ0NG03Ny42NTggMzIuNTA4VjExMWg3Ny42NTd2MzIuNTA4em0xMTYuNDg2IDBWMTExaDc3LjY1OHYzMi41MDh6bTExNi40ODcgMFYxMTFoMzguODI5YzE1LjcxIDAgMjguNDQ1IDEyLjczNSAyOC40NDUgMjguNDQ0djM4LjY5OWgtMzIuNTA4di0zNC42MzV6bTM0Ljc2NiA3My4yMzhoMzIuNTA4djM4LjY5OGMwIDE1LjcxLTEyLjczNSAyOC40NDUtMjguNDQ1IDI4LjQ0NWgtMzguODI5di0zMi41MDhoMzQuNzY2ek0wIDI0NC41MzdDMCAyMjkuMzI5IDEyLjczNSAyMTcgMjguNDQ0IDIxN2gzNDkuNDYxYzE1LjcwOSAwIDI4LjQ0NCAxMi4zMjkgMjguNDQ0IDI3LjUzN3YxMjkuODE1YzAgMTUuMjA4LTEyLjczNSAyNy41MzctMjguNDQ0IDI3LjUzN0gyOC40NDVDMTIuNzM0IDQwMS44ODkgMCAzODkuNTYgMCAzNzQuMzUyeiIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoNTEydjUxMkgweiIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg=="},"displayName":"Remove Duplicates","typeVersion":2,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":1239,"icon":"file:splitOut.svg","name":"n8n-nodes-base.splitOut","codex":{"data":{"alias":["Split","Nested","Transform","Array","List","Item"],"details":"","resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitout/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Split Out"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJub25lIj48ZyBmaWxsPSIjOUI2REQ1IiBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4MCAxNDhjMC02LjYyNy01LjM3My0xMi0xMi0xMkgzMjJjLTYuNjI3IDAtMTIgNS4zNzMtMTIgMTJ2MjRjMCA2LjYyNyA1LjM3MyAxMiAxMiAxMmgxNDZjNi42MjcgMCAxMi01LjM3MyAxMi0xMnptMCA5NmMwLTYuNjI3LTUuMzczLTEyLTEyLTEySDMy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yNyA1LjM3MyAxMiAxMiAxMmgxMTJjNi42MjcgMCAxMi01LjM3MyAxMi0xMnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik01MTIgMEgwdjUxMmg1MTJ6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+"},"displayName":"Split Out","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]}],"categories":[{"id":34,"name":"Invoice Processing"}],"image":[{"id":5142,"url":"https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_1c18bb7b3c.png"},{"id":5143,"url":"https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_3bde08351d.png"},{"id":5144,"url":"https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_cb13c6c585.png"},{"id":5145,"url":"https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_8fb1ce34e4.png"},{"id":5146,"url":"https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_1ad36dc1c1.png"},{"id":5147,"url":"https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/Invoice_email_89f48de8ab.png"}]}}