Automation library · Alerts and monitoring

Enhance & expand Telegram images to 3:2 with LightX AI

Started by an incoming Telegram message, and works across S3 and Telegram. 26 steps, 2 branches, 3 loops or waits: large, and worth reading before you trust it with anything live.

Large

26 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
3Loops or waits
2Services it connects to

The flow

Starts it 1Logic 15Service 10

The steps in the order they run, from what starts it.

  1. 1Telegram Trigger1Telegram triggerStarts it
  2. 2Check If Photo Exists1IfLogic
  3. 3Set Input URL for AI ModelSetLogic
  4. 4Generate Input File Name (.jpeg)SetLogic
  5. 5Generate Output File Name (.png)SetLogic
  6. 6Upload Original Photo to S1Aws S3Service
  7. 7AI Upscale Image via ReplicateHttp RequestService
  8. 8Generate Public URL for Original ImageSetLogic
  9. 9Wait After UpscaleWaitLogic
  10. 10Download Upscaled Image from Replicate1Http RequestService
  11. 11Calculate Padding for 3:2 RatioCodeLogic
  12. 12Get File Size (in Bytes)CodeLogic
  13. 13Merge Data for UploadMergeLogic
  14. 14Request Upload Link from LightXHttp RequestService
  15. 15Upload File to LightX via PUTHttp RequestService
  16. 16Extract Upload Link from LightX ResponseSetLogic
  17. 17Request AI Expansion from LightXHttp RequestService
  18. 18Iterate Until Expansion is ReadySplit In BatchesLogic
  19. 19Wait Before Checking Status AgainWaitLogic
  20. 20Check LightX Expansion StatusHttp RequestService
  21. 21Check If Expansion Is CompleteIfLogic
  22. 22Generate Output Filename (.jpeg) FinalSetLogic
  23. 23Download Final Photo from LightXHttp RequestService
  24. 24Upload Final Photo to S1Aws S3Service
  25. 25Generate Public URL for Final ImageSetLogic
  26. 26Send Final URL to User via TelegramTelegramService

How it's built

Starts on
An incoming Telegram message
Steps
26, with 2 branches, 3 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
S3, Telegram
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own S3 and Telegram accounts. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 26 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 26 steps before you point it at anything that matters.