{"workflow":{"id":14745,"name":"Keep Supabase free plan projects alive with scheduled database pings","views":14,"recentViews":3,"totalViews":14,"createdAt":"2026-04-05T10:21:14.021Z","description":"# Supabase Free Plan Keep-Alive\n\nPrevents Supabase from pausing an inactive project by writing randomised pings to a database table on a recurring schedule.\n\n---\n\n## Overview\n\nThe workflow runs every 4 days and performs 25 sequential database writes to the `ping` table in Supabase. Each write is separated by a random delay between 20 and 60 seconds to simulate organic activity rather than a mechanical burst.\n\n---\n\n## Nodes\n\n**Schedule Trigger**\nFires every 4 days automatically. A manual trigger is also included for testing.\n\n**Code – Generate Items**\nCreates an array of 25 identical items to drive the loop.\n\n**Loop Over Items**\nProcesses one item per iteration until all 25 are complete.\n\n**Code – Random Wait**\nAssigns a random integer between 20 and 60 seconds to each item before the wait step.\n\n**Wait**\nPauses execution for the duration assigned in the previous step.\n\n**Create a Row**\nInserts a row into the `ping` table in Supabase with the current timestamp as `created_at`.\n\n---\n\n## Setup\n\n1. Create a `ping` table in your Supabase project with a `created_at` column (timestamptz).\n2. Add your Supabase credentials to the **Create a Row** node.\n3. Activate the workflow to enable the schedule.\n\n---\n\n## Customization\n\n- Change the trigger interval in **Schedule Trigger** if 4 days does not match your project's inactivity threshold.\n- Adjust the item count in the first code node to write more or fewer rows per run.\n- Modify the random range (currently 20–60 s) in the second code node to change the spacing between writes.","workflow":{"meta":{"instanceId":"c66762406062d6f96baac676fbcb1ad043cf6c0875d0fc4a63da087ec2d9f92e","templateCredsSetupCompleted":true},"nodes":[{"id":"5756a95d-b6ff-4a78-b4c6-7ad6bc8733b8","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-544,-16],"parameters":{"rule":{"interval":[{"daysInterval":4}]}},"typeVersion":1.3},{"id":"0698ceea-1ea3-4606-a905-d13d6effb299","name":"Create a row","type":"n8n-nodes-base.supabase","position":[560,16],"parameters":{"tableId":"ping","fieldsUi":{"fieldValues":[{"fieldId":"created_at","fieldValue":"={{ $now }}"}]}},"credentials":{"supabaseApi":{"id":"RELzbdagzPDAAWA5","name":"Supabase Lumizone"}},"typeVersion":1},{"id":"c0084d94-d281-4de2-842d-2a1367024c05","name":"When clicking ‘Execute workflow’","type":"n8n-nodes-base.manualTrigger","position":[-544,176],"parameters":{},"typeVersion":1},{"id":"a7230917-3e63-4dae-b49a-9d602275e0b4","name":"Code in JavaScript","type":"n8n-nodes-base.code","position":[-304,0],"parameters":{"jsCode":"return Array.from({ length: 25 }, () => ({\n  json: {\n    value: 1\n  }\n}));"},"typeVersion":2},{"id":"826f8668-07d9-457f-b762-3539680e5647","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","position":[32,0],"parameters":{"options":{}},"typeVersion":3},{"id":"851b0d53-ce1a-44ca-bb8a-f4c0724569af","name":"Code in JavaScript1","type":"n8n-nodes-base.code","position":[240,16],"parameters":{"jsCode":"return $input.all().map(item => {\n  return {\n    json: {\n      ...item.json,\n      seconds: Math.floor(Math.random() * (60 - 20 + 1)) + 20\n    }\n  };\n});"},"typeVersion":2},{"id":"2ca743c9-5595-4468-85f3-53ce577074d0","name":"Wait","type":"n8n-nodes-base.wait","position":[384,16],"webhookId":"9c24df49-82b4-4dfa-958d-c96efd3e6018","parameters":{"amount":"={{ $json.seconds }}"},"typeVersion":1.1},{"id":"53cbc8a7-2a96-46cb-89f7-a3aa0a417e3f","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-672,-176],"parameters":{"color":7,"width":528,"height":544,"content":"## Trigger and batch setup\n\nStarts the workflow on a schedule or manually, then generates 25 items to drive the ping loop."},"typeVersion":1},{"id":"b19145c5-f94b-4d3e-8c3c-8d0f42d8eb86","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-112,-176],"parameters":{"color":7,"width":864,"height":544,"content":"## Randomised ping loop\n\nIterates over each item, waits a random interval between 20 and 60 seconds, then writes a row to Supabase."},"typeVersion":1},{"id":"a2ae8bde-11e1-40b0-bf67-da741cd03a94","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[496,-32],"parameters":{"color":3,"height":224,"content":"## Warning"},"typeVersion":1},{"id":"cf5f1bf0-9403-4072-bb62-f186690b990e","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-1472,-240],"parameters":{"width":752,"height":608,"content":"## Supabase free plan keep-alive\n\n### How it works\n\n1. Schedule Trigger fires every 4 days to prevent Supabase from pausing the project due to inactivity.\n2. A JavaScript code node generates 25 identical items to drive a loop of database writes.\n3. Loop Over Items processes one item at a time, cycling through the full batch.\n4. A second code node assigns a random wait duration between 20 and 60 seconds to each iteration.\n5. The Wait node pauses execution for the randomised interval to simulate organic activity.\n6. The Supabase node inserts a row with the current timestamp into the `ping` table.\n\n### Setup\n\n- [ ] Add your Supabase credentials to the **Create a row** node (Supabase API)\n- [ ] Create a table named `ping` in your Supabase project with a `created_at` column\n- [ ] Activate the workflow so the schedule runs automatically\n\n### Customization\n\nAdjust the interval in Schedule Trigger if 4 days is too infrequent for your project. Change the loop count in the first code node to write more or fewer rows per run."},"typeVersion":1}],"pinData":{},"connections":{"Wait":{"main":[[{"node":"Create a row","type":"main","index":0}]]},"Create a row":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"Code in JavaScript1","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"Code in JavaScript","type":"main","index":0}]]},"Code in JavaScript":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Code in JavaScript1":{"main":[[{"node":"Wait","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"Code in JavaScript","type":"main","index":0}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":11,"nodeTypes":{"n8n-nodes-base.code":{"count":2},"n8n-nodes-base.wait":{"count":1},"n8n-nodes-base.supabase":{"count":1},"n8n-nodes-base.stickyNote":{"count":4},"n8n-nodes-base.manualTrigger":{"count":1},"n8n-nodes-base.splitInBatches":{"count":1},"n8n-nodes-base.scheduleTrigger":{"count":1}}},"status":"published","readyToDemo":null,"user":{"name":"LukaszB","username":"lukaszb","bio":"AI Automation Expert | Web & Mobile App Integrator\nWith 2+ years of experience, I build smart automations, web & mobile app workflows, and scalable platforms using tools like n8n, Make, and more. I help businesses reduce operational costs, save time, and scale faster with AI-powered solutions.  For business enquiries, send me an email at  lukasz.b@lumizone.pl","verified":true,"links":["https://lumizone.pl"],"avatar":"https://gravatar.com/avatar/8888822a36f0d4961537d8de86f7b766b339b585475797094f88609e64d9ec2d?r=pg&d=retro&size=200"},"nodes":[{"id":39,"icon":"fa:sync","name":"n8n-nodes-base.splitInBatches","codex":{"data":{"alias":["Loop","Concatenate","Batch","Split","Split In Batches"],"resources":{"generic":[{"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/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"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"organization\"]","defaults":{"name":"Loop Over Items","color":"#007755"},"iconData":{"icon":"sync","type":"icon"},"displayName":"Loop Over Items (Split in Batches)","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":514,"icon":"fa:pause-circle","name":"n8n-nodes-base.wait","codex":{"data":{"alias":["pause","sleep","delay","timeout"],"resources":{"generic":[{"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/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.wait/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Flow"]}}},"group":"[\"organization\"]","defaults":{"name":"Wait","color":"#804050"},"iconData":{"icon":"pause-circle","type":"icon"},"displayName":"Wait","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":545,"icon":"file:supabase.svg","name":"n8n-nodes-base.supabase","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.supabase/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/supabase/"}]},"categories":["Data & Storage"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"input\"]","defaults":{"name":"Supabase"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDkiIGhlaWdodD0iMTEzIiBmaWxsPSJub25lIj48cGF0aCBmaWxsPSJ1cmwoI2EpIiBkPSJNNjMuNzA4IDExMC4yODRjLTIuODYgMy42MDEtOC42NTggMS42MjgtOC43MjctMi45N2wtMS4wMDctNjcuMjUxaDQ1LjIyYzguMTkgMCAxMi43NTggOS40NiA3LjY2NSAxNS44NzR6Ii8+PHBhdGggZmlsbD0idXJsKCNiKSIgZmlsbC1vcGFjaXR5PSIuMiIgZD0iTTYzLjcwOCAxMTAuMjg0Yy0yLjg2IDMuNjAxLTguNjU4IDEuNjI4LTguNzI3LTIuOTdsLTEuMDA3LTY3LjI1MWg0NS4yMmM4LjE5IDAgMTIuNzU4IDkuNDYgNy42NjUgMTUuODc0eiIvPjxwYXRoIGZpbGw9IiMzRUNGOEUiIGQ9Ik00NS4zMTcgMi4wNzFjMi44Ni0zLjYwMSA4LjY1Ny0xLjYyOCA4LjcyNiAyLjk3bC40NDIgNjcuMjUxSDkuODNjLTguMTkgMC0xMi43NTktOS40Ni03LjY2NS0xNS44NzV6Ii8+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iNTMuOTc0IiB4Mj0iOTQuMTYzIiB5MT0iNTQuOTc0IiB5Mj0iNzEuODI5IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agc3RvcC1jb2xvcj0iIzI0OTM2MSIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzNFQ0Y4RSIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMzYuMTU2IiB4Mj0iNTQuNDg0IiB5MT0iMzAuNTc4IiB5Mj0iNjUuMDgxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3AvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1vcGFjaXR5PSIwIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+"},"displayName":"Supabase","typeVersion":1,"nodeCategories":[{"id":3,"name":"Data & Storage"}]},{"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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SJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Code","typeVersion":2,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":838,"icon":"fa:mouse-pointer","name":"n8n-nodes-base.manualTrigger","codex":{"data":{"resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.manualworkflowtrigger/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"trigger\"]","defaults":{"name":"When clicking ‘Execute workflow’","color":"#909298"},"iconData":{"icon":"mouse-pointer","type":"icon"},"displayName":"Manual Trigger","typeVersion":1,"nodeCategories":[{"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"}]}],"categories":[{"id":16,"name":"DevOps"}],"image":[]}}