Automation Workflows — Zapier, n8n, Python Scripts & Bots
Automation workflows connect your tools, eliminate repetitive tasks, and run processes without human intervention — this guide covers no-code platforms and custom-coded solutions for every skill level.
What You'll Learn
You'll learn to build automation workflows with Zapier for quick integrations, n8n for complex pipelines, Python scripts for custom logic, and bots for event-driven automation.
Why It Matters
Every development team spends 20-30% of its time on repetitive tasks like deploying, testing, data entry, and notifications. Automating these frees up hours each week and reduces human error.
Real-World Use
DodaZIP's release pipeline uses an n8n workflow that monitors GitHub for new tags, runs build scripts on a cloud server, uploads the compiled binaries to S3, and posts a release announcement to Slack — all without human intervention.
No-Code Automation with Zapier
Zapier connects 7000+ apps through triggers and actions. A Zap consists of a trigger event and one or more actions that execute automatically.
# Example Zapier configuration (conceptual YAML)
zap:
name: "New GitHub Issue to Slack Notification"
trigger:
app: GitHub
event: New Issue
filters:
- label: bug
actions:
- app: Slack
event: Send Channel Message
params:
channel: "#bugs"
message: "New bug report: {{title}}\n{{URL}}"
- app: Google Sheets
event: Add Row
params:
spreadsheet: "Bug Tracker"
row: "{{title}},{{URL}},{{created_at}}"
Expected behavior: When a new GitHub issue with the "bug" label appears, Zapier posts to Slack and logs it in Google Sheets simultaneously.
Multi-Step Zaps
Trigger: Gmail receives email with attachment
→ Action 1: Save attachment to Google Drive
→ Action 2: Extract text via OCR (built-in)
→ Action 3: Send Slack DM with extracted text
→ Action 4: Create Trello card for review
Expected behavior: Each step receives data from the previous one, creating a processing pipeline that handles attachments automatically.
Self-Hosted Automation with n8n
n8n runs on your own infrastructure, offers greater control, and handles complex branching, error handling, and custom code nodes.
// n8n Code Node — transform data before passing to next step
const items = $input.all();
const transformed = items.map(item => ({
json: {
filename: item.json.filename,
size_mb: (item.json.size_bytes / 1048576).toFixed(2),
is_large: item.json.size_bytes > 104857600,
checksum: item.json.checksum || null,
processed_at: new Date().toISOString()
}
}));
return transformed;
Expected output: A transformed data array with computed fields (size in MB, boolean flag for large files, ISO timestamp) ready for the next n8n node.
flowchart LR
A[Webhook Trigger] --> B{File Size Check}
B -->|< 100MB| C[Process Locally]
B -->|>= 100MB| D[Upload to S3]
C --> E[Run Analysis]
D --> F[Queue for Batch Processing]
E --> G[Store Results]
F --> E
G --> H[Send Notification]
n8n Error Handling Workflow
{
"name": "Error Handling Pattern",
"nodes": [
{
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "={{ $json.api_endpoint }}",
"options": {
"timeout": 10000,
"retryOnFail": true,
"maxTries": 3
}
}
},
{
"type": "n8n-nodes-base.if",
"parameters": {
"conditions": {
"string": [
{ "value1": "={{ $json.statusCode }}", "operation": "equal", "value2": "200" }
]
}
}
}
],
"connections": {
"httpRequest": { "error": [{ "node": "errorHandler", "type": "main" }] }
}
}
Expected behavior: If the HTTP request fails, n8n routes to the error handler node instead of breaking the workflow, with automatic retries up to 3 times.
Python Script Automation
For custom logic that no-code tools cannot handle, Python scripts provide unlimited flexibility.
import os
import shutil
import hashlib
from pathlib import Path
def organize_downloads(directory="~/Downloads"):
"""Automatically organize files by type into subfolders."""
directory = os.path.expanduser(directory)
categories = {
"Images": [".jpg", ".jpeg", ".png", ".gif", ".webp"],
"Documents": [".pdf", ".docx", ".txt", ".md"],
"Archives": [".zip", ".tar", ".gz", ".rar"],
"Code": [".py", ".js", ".ts", ".html", ".css"],
}
for file in Path(directory).iterdir():
if file.is_file():
ext = file.suffix.lower()
for folder, extensions in categories.items():
if ext in extensions:
target = Path(directory) / folder
target.mkdir(exist_ok=True)
shutil.move(str(file), str(target / file.name))
print(f"Moved {file.name} → {folder}/")
break
if __name__ == "__main__":
organize_downloads()
Expected output:
Moved screenshot.png → Images/
Moved report.pdf → Documents/
Moved project.zip → Archives/
Moved script.py → Code/
Bot Automation with Python
import schedule
import time
import subprocess
import logging
logging.basicConfig(level=logging.INFO)
def run_backup():
"""Scheduled backup bot."""
timestamp = time.strftime("%Y%m%d_%H%M%S")
archive_name = f"backup_{timestamp}.tar.gz"
subprocess.run([
"tar", "-czf", archive_name,
"/home/user/projects",
"--exclude=node_modules",
"--exclude=.Git]
])
logging.info(f"Backup created: {archive_name}")
def check_disk_space():
"""Monitor disk usage and alert if over 90%."""
result = subprocess.run(
["df", "-h", "/"],
capture_output=True, text=True
)
usage = int(result.stdout.split("\n")[1].split()[4].strip("%"))
if usage > 90:
logging.warning(f"Disk usage critical: {usage}%")
schedule.every().day.at("02:00").do(run_backup)
schedule.every().hour.do(check_disk_space)
while True:
schedule.run_pending()
time.sleep(60)
Expected behavior: The bot runs backups daily at 2 AM, checks disk usage every hour, and logs warnings when disk space runs low.
Choosing the Right Tool
| Factor | Zapier | n8n | Python Script |
|---|---|---|---|
| Setup time | Minutes | Hours | Days |
| Hosting | Cloud | Self-hosted | Any |
| Cost | Free tier, then $20+/mo | Free (self-hosted) | Free |
| Complexity | Simple chains | Complex pipelines | Unlimited |
| Debugging | Limited | Built-in debugger | Full control |
Common Errors
| Error | Cause | Fix |
|---|---|---|
| Zapier task limit exceeded | Too many runs on free plan | Upgrade plan or reduce trigger frequency |
| n8n Webhook timeout | External API too slow | Increase timeout setting |
| Python script permission denied | Running without proper rights | Use sudo or adjust user permissions |
| Bot misses scheduled task | System sleep during schedule | Use wake/sleep triggers |
| Infinite loop in workflow | Action triggers the same trigger | Add condition filters to prevent loops |
Practice Questions
When should you use n8n instead of Zapier? When you need complex branching, self-hosting, custom code nodes, or handle sensitive data that cannot leave your infrastructure.
How does a Python automation script differ from a Zapier Zap? Python scripts require manual execution or scheduling and offer full programming flexibility, while Zaps are event-driven with no coding needed.
What is a common cause of infinite loops in automation workflows? An action that triggers the same event that started the workflow. For example, a Zap that updates a spreadsheet cell which triggers another spreadsheet update.
How can you make a Python bot run on a schedule? Use the
schedulelibrary or a Cron job to trigger the script at specific intervals.Challenge: Build a 4-step automation that watches a directory for new CSV files, validates their headers, imports data into a database, and emails a summary report — combining Python with a scheduling tool.
Mini Project
Build a social media content pipeline. Use n8n to monitor an RSS feed for new blog posts, extract the title and URL, pass them to an LLM to generate a social media summary, and post the result to Twitter and LinkedIn. Add a Python script that collects engagement metrics (likes, retweets, comments) weekly and stores them in a SQLite database for analytics.
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro