u/cuebicai

Send a raw product photo to Telegram → AI transforms it into a clean ecommerce-ready image automatically

I built an AI-powered ecommerce product photo workflow using n8n.

Now whenever I send a raw product image to my Telegram bot, the automation automatically:

  • removes the messy background
  • cleans edge artifacts
  • aligns and centers the product
  • resizes the image for ecommerce use
  • enhances lighting and presentation using AI
  • generates a clean studio-style product photo
  • preserves the original product shape, colors, labels, and branding
  • sends the final ecommerce-ready image back to Telegram

The entire process takes just a few seconds.

Built with:

  • n8n
  • rembg
  • Sharp
  • OpenAI gpt-image-1
  • Docker
  • Telegram Bot

Most of the heavy processing happens locally using self-hosted tools.

The AI is only used for the final enhancement layer to keep outputs consistent and reduce hallucinations.

u/cuebicai — 5 days ago

How I built an AI Product Photo Studio with n8n that automates ecommerce product photography from raw phone images

A lot of small ecommerce sellers still take product photos using their phones.

The biggest issues are usually:

  • messy backgrounds
  • bad lighting
  • inconsistent image sizes
  • poor product alignment
  • shadows and edge artifacts
  • time spent manually editing images
  • expensive design tools or Photoshop workflows

For marketplaces and ecommerce stores, consistency matters a lot.

Most sellers do not have:

  • a professional camera setup
  • a product photography studio
  • editing skills
  • time to manually process every image

So I wanted to build a fully automated workflow where someone could:

  1. Click a raw product photo
  2. Send it to Telegram
  3. Automatically receive a clean ecommerce-ready product image

The goal was to build a lightweight AI-powered product photo studio using:

  • n8n
  • self-hosted tools
  • OpenAI image generation
  • Docker containers
  • custom image processing APIs

The workflow needed to:

  • remove backgrounds
  • clean edge artifacts
  • resize and align products
  • create consistent ecommerce-style outputs
  • preserve the original product exactly
  • avoid AI hallucinations
  • stay cheap to run

Final Workflow

Telegram Image Input
↓
Download Telegram Image
↓
Primary Background Removal
↓
Product Alignment & Resize
↓
Edge Cleanup & Artifact Removal
↓
AI Product Enhancement
↓
Convert AI Output To Image
↓
Send Enhanced Product Image

Tech Stack

  • n8n: Used as the orchestration layer for the entire pipeline.
  • rembg: I used rembg running inside Docker for AI background removal.

Why rembg?

  • open source
  • lightweight
  • fast
  • self-hosted
  • very cheap to run
  • works well for product extraction

rembg Model Used: birefnet-general

This model produced cleaner product cutouts and better edge quality compared to the default models.

rembg API Endpoint: http://rembg:7000/api/remove

  • Sharp + Express API: After removing the background, the product image still needed:

Why Sharp?

Sharp is extremely fast and lightweight for image processing.

It handles:

  • resizing
  • trimming
  • transparent padding
  • sharpness enhancement
  • image cleanup
  • format conversion

much faster than ImageMagick-based solutions.

The Sharp pipeline performs:

  1. Trim dirty transparent edges
  2. Resize the product
  3. Center the composition
  4. Add transparent spacing
  5. Clean artifacts
  6. Sharpen the final image

This creates a much cleaner input before sending anything to OpenAI.

That is important because cleaner AI inputs produce more stable outputs.

Sharp API Endpoint: http://sharp-api:3000/resize

Why I Split Processing Into Multiple Stages

I intentionally separated: Deterministic Processing

Handled locally using:

  • rembg
  • Sharp

These steps are predictable and controllable.

  • AI Enhancement

Handled by OpenAI.

Used only for:

  • realism
  • lighting
  • ecommerce presentation
  • studio-style enhancement

This architecture reduced:

  • hallucinations
  • redesigns
  • inconsistent outputs
  • API costs

while improving reliability.

OpenAI Image Enhancement

Model Used: gpt-image-1

The OpenAI stage was NOT used for product generation.

Instead, it was used only to:

  • improve lighting
  • improve realism
  • improve presentation
  • create ecommerce-style composition
  • generate clean studio backgrounds

while preserving the original product.

The Biggest Challenge

At first, the AI kept:

  • redesigning products
  • changing labels
  • hallucinating objects
  • altering shapes
  • creating random luxury scenes

So I had to create a highly controlled prompting strategy.

Prompt Engineering Strategy

The final prompts strictly instructed the model to:

  • preserve branding
  • preserve shape
  • preserve colors
  • preserve labels
  • preserve reflections
  • preserve packaging
  • remove unwanted artifacts
  • avoid extra objects
  • avoid human figures
  • avoid props
  • avoid creative reinterpretations

The goal was consistency instead of creativity.

Background Standardization

Instead of allowing random AI-generated scenes, I standardized the outputs using:

  • soft light gray studio backgrounds
  • subtle gradients
  • soft realistic shadows
  • centered composition

This creates a more professional ecommerce catalog appearance.

  • Telegram Integration

Users interact with the workflow entirely through Telegram.

Flow:

  1. User sends image
  2. Workflow processes image
  3. Final enhanced image is returned automatically

This makes the system extremely simple for non-technical users.

Infrastructure Setup

Everything runs using Docker containers connected through an internal Docker network.

Services Running

Service Purpose
n8n Workflow automation
rembg AI background removal
sharp-api Image processing
OpenAI API AI enhancement

Cost Optimization

One of the biggest goals was keeping generation costs low.

Most preprocessing happens locally using self-hosted services.

That means OpenAI only handles the final enhancement layer.

Approximate cost: ~$0.04 per image

Why This Architecture Works Well

This workflow works surprisingly well because:

  • local preprocessing stabilizes AI outputs
  • deterministic cleanup reduces hallucinations
  • Sharp standardizes composition
  • OpenAI focuses only on enhancement
  • the pipeline stays lightweight and scalable

Potential Future Improvements

Things I plan to improve later:

  • automatic shadow generation
  • multi-product support
  • aspect-ratio presets
  • marketplace-specific exports
  • automatic watermarking
  • AI quality scoring
  • batch processing
  • direct Shopify integration
  • custom brand templates

Final Thoughts

This started as a simple experiment using n8n and a few self-hosted AI tools.

But the final result became a fully automated AI-powered ecommerce product photography pipeline.

The workflow can take:

  • raw mobile product photos
  • inconsistent lighting
  • messy backgrounds

and automatically transform them into:

  • clean
  • centered
  • ecommerce-ready
  • studio-style product images

with almost no manual work.

And the best part is that most of the heavy lifting happens using self-hosted tools.

The AI layer is only used where it actually adds value.

u/cuebicai — 9 days ago

Send a receipt photo to Telegram → AI handles the rest automatically

I built an AI-powered expense tracking workflow using n8n.

Now whenever I send a receipt or invoice image to my Telegram bot, the automation automatically:

  • extracts invoice details using OCR
  • structures the messy OCR text with AI
  • detects the merchant/business name
  • extracts total amount, tax, invoice number, and date
  • categorizes the expense automatically
  • uploads the original receipt to Google Drive
  • stores everything neatly inside Google Sheets
  • sends a confirmation message back to Telegram

The entire process takes just a few seconds.

Built with:

  • n8n
  • OCRspace API
  • OpenAI
  • Telegram Bot
  • Google Sheets
  • Google Drive

No manual expense entry anymore.

u/cuebicai — 12 days ago
▲ 68 r/n8n_ai_agents+1 crossposts

How I built an AI expense tracker with Telegram and n8n just send a receipt photo and it automatically extracts, categorizes, and tracks the expense

I wanted a simple way to track expenses without manually typing invoice details into spreadsheets every time.

So I built a small automation system where I can just send a receipt photo to Telegram, and AI automatically extracts and stores everything for me.

The Problem

Most expense tracking apps still require a lot of manual work:

  • Upload receipt
  • Enter merchant name
  • Add amount
  • Select category
  • Save invoice somewhere

Doing this repeatedly becomes annoying very quickly.

I wanted something faster and more automated.

The Solution

Now I simply send a receipt or invoice image to a Telegram bot.

The workflow automatically:

  • Downloads the receipt
  • Extracts text using OCR
  • Uses AI to structure the invoice data
  • Detects merchant name
  • Extracts total amount
  • Finds invoice number and date
  • Categorizes the expense
  • Uploads the original invoice to Google Drive
  • Saves structured data into Google Sheets
  • Sends me a success notification back in Telegram

Everything happens automatically in a few seconds.

Tech Stack Used

  • n8n
  • OCR.space API
  • OpenAI
  • Google Drive
  • Google Sheets
  • Telegram Bot

Workflow Architecture

Telegram → OCR → AI Structuring → Google Drive → Google Sheets → Telegram Confirmation

Example Extracted Data

The AI extracts structured fields like:

  • invoice_biller
  • invoice_number
  • invoice_total_inc
  • invoice_tax
  • invoice_date
  • invoice_category

Example:

  • Biller: JUMBOKING
  • Total: 89
  • Category: Restaurant

Why I Used AI Instead of Regex

OCR text is messy and inconsistent.

Different invoices have:

  • different layouts
  • blurry text
  • different date formats
  • tax variations
  • noisy OCR output

Instead of building hundreds of regex rules, I used AI to normalize and structure the data automatically.

This made the system much more reliable.

Current Result

The workflow now works as a personal AI-powered receipt inbox.

I can send invoices directly from my phone and everything gets:

  • archived
  • categorized
  • stored
  • tracked automatically

Still improving it, but the current setup is already saving a lot of manual work.

u/cuebicai — 12 days ago

Built an AI-powered support workflow in n8n that manages emails, tasks, and auto replies

Handling customer conversations manually was starting to become a mess for me.

Messages were coming from different places emails, forms, replies and keeping track of everything was getting harder over time. I was constantly switching between tools, losing context between conversations, and spending too much time doing repetitive work.

So instead of patching things together manually, I built an AI-driven support workflow using n8n, OpenAI, Telegram, and ClickUp.

The goal was simple:

Create a system that can organize enquiries, help generate replies, track conversations automatically, and still keep me fully in control.

In this post I’ll break down:

  • Why I decided to build it
  • How the automation flow works
  • The tools behind it
  • Different ways this setup can be extended

The problem I wanted to solve

A few things kept slowing me down:

  • Customer messages were scattered everywhere
  • Following up manually became difficult
  • Important context was easy to lose
  • I had no centralized workflow
  • Managing replies across multiple platforms wasted time

I wanted one connected workflow where everything could move automatically without feeling chaotic.

What the system actually does

Think of it like a lightweight AI support operator.

The workflow can:

  • Collect incoming enquiries
  • Organize and store conversations
  • Create tracking tasks automatically
  • Generate AI-assisted replies
  • Let me manage actions directly from Telegram
  • Update statuses dynamically
  • Continue conversations automatically when customers reply

How the workflow runs

Step 1 New enquiry enters the system

Whenever someone submits a form or sends an email:

  • The workflow captures the message
  • Creates a unique reference ID
  • Saves the conversation data
  • Generates a ClickUp task
  • Sends an instant Telegram alert

Everything becomes traceable from the beginning.

Step 2 Managing replies through Telegram

Instead of opening multiple dashboards, I simply respond from Telegram.

I reply naturally like a normal conversation.

The workflow automatically understands which enquiry I’m responding to and extracts the required context.

Step 3 AI handles the routing logic

Based on my response, the system decides the next action automatically.

For example:

  • Send a customer reply
  • Mark conversation as waiting
  • Move task into progress
  • Resolve or close the enquiry

This removed a lot of manual coordination work.

Step 4 Automatic email handling

Once the action is confirmed:

  • AI prepares the response
  • The email gets delivered automatically
  • Task statuses update instantly
  • Notifications are pushed back to Telegram

Step 5 Customer responses are tracked automatically

When the customer replies:

  • The workflow captures the reply
  • Reconnects it to the same thread
  • Updates the enquiry status
  • Notifies me again inside Telegram

So the entire conversation cycle stays connected.

Main tools behind the system

  • n8n for orchestration and automation
  • OpenAI for AI reasoning and responses
  • Telegram as the control interface
  • ClickUp for tracking tasks
  • Gmail for email communication
  • Google Sheets / Database for storing records

The most important design decision

The real challenge was not automation.

It was maintaining context.

Every enquiry is tied to a unique ID, and every action references that same context.

That’s what makes the workflow reliable.

The AI helps with decisions and responses, but human control is always available when needed.

So it’s not “replace humans with AI.”

It’s more about:

Using AI to reduce operational friction.

Other ways this idea could be used

This same structure could work for:

  • Sales pipelines
  • Lead qualification systems
  • Internal operations
  • Client onboarding
  • AI task coordinators
  • Team communication workflows

Basically any process that follows:

Input → decision → action

A few things I learned while building this

If you’re building similar systems:

  • Reliable routing logic matters a lot
  • Fallback handling is extremely important
  • Never blindly automate critical actions
  • Context management is everything
  • Good tracking structure prevents chaos later

Final thoughts

After setting this up:

  • Communication became easier to manage
  • Replies became much faster
  • Context stopped getting lost
  • Task tracking became cleaner
  • I spent less time switching tools

And surprisingly, controlling the whole workflow directly from Telegram turned out to be one of the best parts of the system.

u/cuebicai — 15 days ago

How I Started Securing My n8n Webhook Triggers

The Problem I Noticed

When I first started building automations with n8n, I kept most webhook triggers open with no authentication enabled.

At first it felt fine because the webhook URL looked random and hard to guess.

But after running more workflows in production, I realized something important:

If someone gets access to your webhook URL, they can trigger your workflow anytime.

That can lead to:

  • Spam requests
  • Unwanted workflow executions
  • Increased server load
  • Sensitive data exposure
  • Abuse of automations

A lot of people focus on building workflows fast, but webhook security usually gets ignored.

What Made Me Take It Seriously

While testing public automations and APIs, I noticed how easy it is for webhook endpoints to get shared accidentally between apps, logs, browser history, screenshots, or even client-side code.

Once a webhook URL becomes public, anyone can send requests to it unless you add protection.

That became a bigger concern for me when running automations for production use and client workflows.

The Simple Fix I Started Using

Now, one of the first things I do in important workflows is enable Header Auth inside the Webhook Trigger node.

Instead of leaving:

Authentication: None

I change it to:

Authentication: Header Auth

Then I create custom credentials with:

  • A header name
  • A secret value/key

Only requests with the correct header can trigger the workflow.

Why This Helps

This small change adds a strong extra layer of protection.

It helps:

  • Prevent unauthorized workflow triggers
  • Stop random spam requests
  • Protect sensitive workflow data
  • Allow only trusted apps/services to access automations

Final Thoughts

Webhook security is one of those things many people skip in the beginning, including me.

But once you start running production workflows or handling client automations, securing webhook endpoints becomes extremely important.

The setup only takes a minute, but it can prevent a lot of problems later.

u/cuebicai — 15 days ago
▲ 2 r/n8n_ai_agents+1 crossposts

At first, everything worked fine. A few workflows, light usage… no issues.

But as soon as things scaled more clients, heavier workflows, loops, API calls everything started breaking in ways I didn’t expect.

  • CPU spikes out of nowhere
  • Workflows randomly freezing
  • Webhooks not firing
  • Silent failures I didn’t even notice until clients pointed them out

I spent a lot of time trying to debug and fix these issues one by one. Some were obvious, most were not.

Sharing the main problems I faced and what actually fixed them.

1. CPU hitting 100% and container freezing

Issue:
Workflows with loops + API calls would spike CPU to 100% and completely freeze the instance.

Fix:
Reduced concurrency and broke the workflow into smaller sub-workflows. Also avoided tight loops and added proper batching instead of continuous execution.

2. Loops overwhelming the system

Issue:
Even with wait nodes, loops kept stacking executions and overloading the system.

Fix:
Stopped using aggressive loops. Switched to controlled execution (batching + scheduled triggers) instead of constant looping.

3. Workflows blocking each other

Issue:
One long-running workflow would block webhooks and other executions.

Fix:
Switched to queue mode with workers (separate execution from main instance). This removed blocking completely.

4. Memory usage growing over time

Issue:
Memory and disk usage kept increasing due to execution data being stored.

Fix:
Enabled pruning:

  • EXECUTIONS_DATA_PRUNE=true
  • EXECUTIONS_DATA_MAX_AGE=72

This kept things stable long-term.

5. Random crashes (OOM issues)

Issue:
Large payloads (JSON/files) caused memory spikes and killed the container instantly.

Fix:
Limited payload sizes and split heavy workflows into smaller steps. Also avoided passing large data between nodes.

6. Silent workflow failures

Issue:
Workflows would stop working without errors (tokens expired, APIs changed).

Fix:
Added error workflows + alerts (Slack/email). Also added basic checks to ensure data is actually being processed.

7. No monitoring (big mistake)

Issue:
If the server went down, I had no idea.

Fix:
Set up an external uptime monitor hitting a health endpoint. Now I get alerts instantly if anything breaks.

8. Webhooks breaking after restart

Issue:
Webhook URLs changed after container restart → integrations broke.

Fix:
Set a fixed webhook URL using N8N_WEBHOOK_URL.

9. Losing credentials risk

Issue:
If the encryption key is lost, all credentials are gone.

Fix:
Backed up N8N_ENCRYPTION_KEY securely outside the server.

10. Multi-workflow / multi-client issues

Issue:
One bad workflow could slow down or crash everything.

Fix:
Isolated workflows:

  • Separate instances
  • Or strict limits + queue system

11. Updates breaking things

Issue:
Using latest version caused random breakages.

Fix:
Pinned n8n version and tested updates before upgrading.

Final takeaway

Self-hosting n8n works great at small scale, but once you start running real workloads:

  • You need proper execution control
  • You need cleanup + monitoring
  • You need isolation

Otherwise things break in ways that are hard to debug.

What I did after dealing with all this

After handling and fixing all of this over the past year, I ended up building a simple dashboard for myself to manage everything properly.

Basically just trying to simplify all of this:

  • deployment
  • scaling
  • monitoring
  • stability

So i don’t have to go through all these same issues while self-hosting n8n.

If you’re curious, this is what I’ve been working on: https://cuebicai.com

u/cuebicai — 14 days ago

I was struggling with handling customer enquiries across different channels email, forms, and manual replies. Things were getting messy, context was getting lost, and replying manually was taking too much time.

So I built my own system using n8n + OpenAI + Telegram + ClickUp.

Breaks down:

  • Why I built it
  • How it works
  • How you can build something similar
  • What else you can do with this setup

Why I built this

The main problems I was facing:

  • Enquiries coming from different places (forms, email)
  • Losing context between replies
  • Manually tracking who replied and what’s pending
  • Switching between tools constantly
  • No clear workflow for “what happens next”

I wanted something where:

  • Everything is connected
  • I can reply quickly
  • I don’t lose context
  • AI helps, but I stay in control

What this system does

This is basically a mini AI-powered support system.

It can:

  • Capture new enquiries
  • Store and track them
  • Create tasks automatically
  • Generate replies using AI
  • Let me reply from Telegram
  • Update status (waiting, in progress, closed, resolved)
  • Handle customer email replies and continue the thread

How the workflow works (step by step)

1. Enquiry comes in

  • User fills a form or sends a message
  • System captures the enquiry
  • Generates a unique ID
  • Stores it (Google Sheets / DB)
  • Creates a task (ClickUp)
  • Sends me a Telegram notification

2. I reply from Telegram

  • I just reply naturally (no commands needed)
  • The system extracts the context
  • AI understands what I want to do

3. AI decides the action

Based on my message, it routes to:

  • Send reply to customer
  • Mark as “waiting for reply”
  • Close enquiry
  • Resolve enquiry

4. Email is sent automatically

  • AI generates the response
  • Email is sent to the customer
  • Task status is updated
  • I get notified

5. Customer replies

  • Email reply is captured
  • Linked back to the same enquiry
  • Status changes to “in progress”
  • I get notified again

6. Loop continues until resolved

  • I reply → AI processes → system updates
  • Once done → marked as resolved or closed

Tools used

  • n8n → workflow automation
  • OpenAI → response generation + classification
  • Telegram → control panel (I manage everything from here)
  • ClickUp → task tracking
  • Gmail → sending/receiving emails
  • Google Sheets / DB → storing enquiries

Key idea behind this

The most important part is not automation it’s routing + context.

  • Every enquiry has an ID
  • Every action is tied to that ID
  • AI decides what to do next
  • I can override anytime

So it’s not fully automated it’s AI-assisted with human control

What you can build using this idea

This is not limited to customer support.

You can adapt this to:

  • Lead management systems
  • Sales follow-ups
  • Internal task management
  • Client communication systems
  • AI assistants for operations

Basically anything where: Messages → decisions → actions

Things to keep in mind

If you want to build something like this:

  • Make sure your AI classifier is reliable
  • Always keep a fallback for errors
  • Don’t fully automate critical actions (like closing tasks)
  • Maintain proper context linking (ID system is important)

Final thoughts

This setup made my workflow much simpler:

  • No tool switching
  • No lost context
  • Faster replies
  • Clear tracking

And the best part is I control everything directly from Telegram

If anyone is building something similar or wants help understanding parts of this, happy to discuss.

u/cuebicai — 18 days ago

I’ve been working on an email automation system using n8n that acts like an AI assistant for your inbox.

The goal: stop managing emails manually and let AI handle it end-to-end.

What it does

  • Automatically reads incoming emails
  • Classifies them using AI (Sales, Personal, Promotions, etc.)
  • Applies labels and marks emails as read
  • Summarizes important emails and saves them
  • Writes drafts or replies automatically
  • Forwards emails to the right department

How it’s built

  • n8n → main automation/orchestration engine
  • Gmail Trigger → fires on new incoming emails
  • OpenAI → used for classification + response generation
  • Routing Logic → different flows based on email type
  • Storage Layer → saves summaries for later use
  • Actions → draft, reply, forward (fully automated)

Workflow Overview

  1. New email comes in (Gmail trigger)
  2. AI classifies the email type
  3. Email is routed to the correct workflow branch
  4. Based on type:
    • Summarize + store
    • Write reply/draft
    • Forward to relevant department
  5. Labels applied + email marked as read

Core Idea

This is more than automation it’s delegation.

Instead of manually checking and responding to emails, you have a system that understands, decides, and takes action.

Use Cases

  • Customer support automation
  • Instant handling of sales inquiries
  • Personal inbox management
  • Internal team email routing
  • Building AI-powered assistants for communication

Why I built this

Email is still one of the biggest bottlenecks in workflows.

With tools like n8n + AI, we can turn it into a fully autonomous system instead of a manual task.

What’s next

  • Better context memory for conversations
  • Smarter reply personalization
  • Multi-channel expansion (WhatsApp, Slack, etc.)
  • Integration with tools like CRM / ClickUp

Would love feedback from the n8n community

Always looking to improve the architecture and make it more scalable.

u/cuebicai — 20 days ago

I’ve been working on an email automation system using n8n that acts like an AI assistant for your inbox.

The goal: stop managing emails manually and let AI handle it end-to-end.

What it does

  • Automatically reads incoming emails
  • Classifies them using AI (Sales, Personal, Promotions, etc.)
  • Applies labels and marks emails as read
  • Summarizes important emails and saves them
  • Writes drafts or replies automatically
  • Forwards emails to the right department

How it’s built

  • n8n → main automation/orchestration engine
  • Gmail Trigger → fires on new incoming emails
  • OpenAI → used for classification + response generation
  • Routing Logic → different flows based on email type
  • Storage Layer → saves summaries for later use
  • Actions → draft, reply, forward (fully automated)

Workflow Overview

  1. New email comes in (Gmail trigger)
  2. AI classifies the email type
  3. Email is routed to the correct workflow branch
  4. Based on type:
    • Summarize + store
    • Write reply/draft
    • Forward to relevant department
  5. Labels applied + email marked as read

Core Idea

This is more than automation it’s delegation.

Instead of manually checking and responding to emails,
you have a system that understands, decides, and takes action.

Use Cases

  • Customer support automation
  • Instant handling of sales inquiries
  • Personal inbox management
  • Internal team email routing
  • Building AI-powered assistants for communication

Why I built this

Email is still one of the biggest bottlenecks in workflows.

With tools like n8n + AI, we can turn it into a fully autonomous system instead of a manual task.

What’s next

  • Better context memory for conversations
  • Smarter reply personalization
  • Multi-channel expansion (WhatsApp, Slack, etc.)
  • Integration with tools like CRM / ClickUp

Would love feedback from the n8n community
Always looking to improve the architecture and make it more scalable.

u/cuebicai — 20 days ago