Fixing Memory Leaks When Scraping Millions of URLs with aiohttp in Python

When running an async web scraper across 500,000 product pages, my server crashed after 45 minutes due to an Out Of Memory (OOM) error. Python RAM usage ballooned from 150 MB to over 7 GB. The Culprit: Unclosed ClientSessions and Unlimited Concurrency Creating a new ClientSession() inside every async task prevents connection reuse and leaks … Read more

Publishing Articles to WordPress via REST API with n8n and Application Passwords

Connecting automation pipelines directly to WordPress allows you to draft articles programmatically without ever opening the admin dashboard. Here is how I set up n8n to publish draft posts with custom tags and categories. Authentication: WordPress Application Passwords Instead of sharing master admin credentials, go to Users > Profile in WordPress, scroll down to Application … Read more

Building an Automated Folder Cleaner in Python to Organize Downloads Daily

Like most developers, my Downloads folder quickly turns into an unrecognizable wasteland of installers, PDFs, ZIP archives, and random screenshots. I wrote a small background daemon in Python to automatically sort files into neat subdirectories based on extension. The Python Cleaner Script import os import shutil from pathlib import Path DOWNLOADS_DIR = Path.home() / “Downloads” … Read more

Catching and Alerting Failed Nodes in n8n Workflows with Discord Webhooks

There is nothing worse than discovering an automation stopped running three days ago because of an expired API token. To prevent silent failures, I configured a centralized Error Trigger workflow in n8n. How Error Triggers Work in n8n In workflow settings, you can designate an Error Workflow. Whenever any node crashes, n8n invokes this handler … Read more

Extracting Dirty Tables from Multi-Page PDFs into Clean Pandas DataFrames

Extracting financial tables from scanned and vector PDFs is notoriously frustrating. Libraries like tabula-py often miss borders or misalign columns. Here is the exact routine I built using pdfplumber and pandas. Implementation Code import pdfplumber import pandas as pd def extract_clean_tables(pdf_path): all_rows = [] with pdfplumber.open(pdf_path) as pdf: for page in pdf.pages: table = page.extract_table() … Read more

Handling Webhook Timeouts in n8n When Processing Heavy AI Workflows

When triggering an n8n workflow via an incoming webhook that runs an LLM chain, the HTTP request frequently timed out with a 504 Gateway Timeout because the AI analysis took 20 to 45 seconds. The Architectural Fix: Decoupling Response from Processing Instead of making the client wait for the final AI output, I changed the … Read more

Automating Daily PostgreSQL Backups to AWS S3 in Under 50 Lines of Python

Relying on manual database dumps is a recipe for disaster. I wrote a lightweight, self-contained Python script to dump a remote Postgres database, compress it with gzip, and upload it directly to an Amazon S3 bucket with date versioning. The Script import os import subprocess from datetime import datetime import boto3 DB_NAME = “production_db” DB_USER … Read more

Syncing Google Sheets to PostgreSQL in n8n Without Dropping Data

Many clients use Google Sheets as a lightweight CRM. To build real analytics, I needed an automated pipeline in n8n that periodically syncs modified rows into an internal PostgreSQL database. The Problem: Duplicate Primary Key Collisions A naive sync workflow crashes whenever an existing row is re-saved, throwing duplicate key value violates unique constraint. Conversely, … Read more

Bypassing Cloudflare 403 While Scraping Real Estate Data with Python and Playwright

I was building an automated Python scraper to track local real estate price drops. The target website was protected by Cloudflare Turnstile, and simple requests or vanilla Playwright runs immediately resulted in a 403 Forbidden block. Why Standard Headless Browsers Fail Cloudflare checks navigator properties, WebGL fingerprints, and browser automation flags like navigator.webdriver = true. … Read more