Automating a cloud Android phone with n8n
Automating a cloud Android phone with n8n
Most automation tutorials end at a headless browser, and for a lot of jobs that is fine. But some work has to happen on a real phone: a real Android app, real notifications, a real mobile ip behind it. That is where a cloud phone plus n8n comes in. Here is how to wire n8n to a real cloud Android phone over adb, so a workflow can tap, type, and check things on an actual handset, then carry the result into the rest of your automation.
We run a cloud phone farm in Singapore, every phone real hardware on a rack, each reachable over adb on its own endpoint, and we use n8n to drive the repetitive parts. One thing up front: this is for automating the boring, repeatable steps, scheduled checks, pulling a status, posting something you already approved. The judgement calls stay human, and you follow each platform’s rules. It is not a pitch for a spam bot.
The basic architecture
Here is the shape of the whole thing. n8n is the brain, it decides when something should happen and in what order. The cloud phone is the hands, it does the actual tapping on a real device. Between them sits adb, the standard Android tool, talking over tcp to the phone’s network endpoint. A workflow node runs an adb command, the command lands on the cloud phone in Singapore, the phone does the thing, and adb returns the output into n8n for the next step.
That is the key idea. n8n does not need a special phone integration. It just needs to run shell commands, and adb is a shell command. So any n8n that can reach the phone’s endpoint and has adb installed can drive a real device. No plugin to maintain, no fragile bridge, just n8n, adb, and a cloud phone with an open endpoint.
What you need first
Three things. One, an n8n instance, self hosted or cloud, where you can run the execute command node, because that node is how we call adb. Two, the adb binary on whatever machine runs your n8n, so the node can find it on the path. Three, a cloud phone with an adb endpoint and a token to reach it. On cloudf.one each phone hands you an endpoint like adb-sg.cloudf.one and a port, plus an api to list and lock phones. No usb, no local device, no Android Studio.
One note on hosting. If you run n8n in docker, make sure the adb binary is inside that container or mounted in, otherwise the execute command node can’t find it. The quickest path is a small custom image with the Android platform tools added. Once adb version prints inside the container, you are ready.
The connect step
Every workflow starts the same way, you connect adb to the phone. In n8n that is an execute command node running adb connect adb-sg.cloudf.one:5555. The node returns connected, and from that point the phone is just another adb device. I follow it with adb devices in a second node and check the output contains the word device, so the workflow fails early and loud if the phone did not come up, instead of silently doing nothing.
A small reliability tip. Network adb occasionally needs a second attempt on first contact. So wrap the connect in a tiny retry: if the first connect does not show device, run adb disconnect, wait two seconds, and connect again. n8n’s error handling makes that easy with a retry on the node or a small if branch. Get this right once and the rest of the workflow is solid.
Driving the phone with adb
Now the fun part, making the phone do things. adb shell input is your main tool:
adb shell input tap x ytaps the screen at a pointadb shell input text "string"types textadb shell input swipe x1 y1 x2 y2scrollsadb shell am start -n package/activitylaunches an appadb shell screencapsaves a screenshot you pull back withadb pullto inspect or log
Each is one execute command node, and you chain them in the order the task needs.
A sturdier way to find what to tap is adb shell uiautomator dump, which writes the current screen’s layout to an xml file. You pull that file into n8n, parse it, and read the exact coordinates or resource ids of the buttons you care about. That beats hard coding pixel coordinates, because the layout adjusts if the screen shifts. For steady, repeatable workflows, dump the layout, find the element, then tap it.
A real example workflow
Here is a workflow I actually use, a daily account check. A schedule trigger fires every morning. Node one, connect to the phone. Node two, adb devices, confirm it is up. Node three, am start to open the app. Node four, wait a few seconds for it to load. Node five, uiautomator dump and pull the layout. Node six, parse the xml in a function node and read whether the inbox shows a new message badge. Node seven, an if node: if there is a new message, branch to send me a notification through n8n’s normal channels.
Notice what happened. The phone did the device specific part, opening a real app on a real Singapore ip and reading the real screen, and n8n did the orchestration and the notification. That division is the whole point. The phone handles anything that must happen on a genuine device, and n8n handles scheduling, logic, parsing, and routing to your other tools.
Scheduling and running many phones
Scheduling is just n8n’s schedule trigger, cron style, so a workflow can run every hour, every morning, or on a webhook when something else fires. The phone is simply the target of the run. The more interesting part is fleet scale. Since each phone is its own endpoint, you can loop a list of endpoints from the cloudf.one api and run the same workflow against each phone, or in parallel with split in batches. Ten phones, one workflow, ten runs, each on its own device and ip.
If you run many phones, lock and unlock them through the api so two workflows don’t grab the same phone at once. Fetch a phone, lock it, run your steps, unlock it in a final node even if earlier steps failed. That keeps the fleet clean and stops collisions.
Error handling that keeps it stable
Automation that touches a real device over a network will hit hiccups, so plan for them. Three habits keep it stable. First, always confirm the device is up with adb devices before you tap anything, so you never fire taps into a phone that dropped. Second, put an unlock or disconnect step in the workflow’s error path, so a failed run still releases the phone. Third, screenshot on failure: a screencap and pull when a step errors gives you a picture of exactly what the screen looked like when it broke.
And keep the steps idempotent where you can, so re running a workflow does not double post. Check state before you change it, read the screen, decide, then act, rather than blindly tapping on a schedule. That read then act pattern is what separates a workflow that runs for months from one that breaks the first time the app updates its layout.
The honest part
Let me be straight about scope. This is for automating repetitive, legitimate steps on your own accounts, scheduled checks, routine posting you already approved, status pulls, app testing. It is not a tool for mass fake engagement, and I won’t pretend it makes you undetectable, because nothing does. Follow each platform’s rules. A phone that posts garbage on a schedule still gets the account actioned, real device or not.
It is also worth knowing the limits. adb driving is reliable for clear, structured tasks: open this, read that, tap there. It is not a replacement for a real testing framework if you need deep app testing, where Appium and the uiautomator2 driver are the better tool. n8n plus adb shines for cross tool automation, where the phone is one step in a bigger workflow that also touches your other systems. Use the right tool for the depth you need.
The takeaway
n8n is the brain, adb is the wire, the cloud phone is the hands. You connect with an execute command node, drive the phone with adb shell input and uiautomator dump, parse the screen in n8n, and route the result onward. Schedule it, loop it across a fleet, lock and unlock each phone, and handle errors with device checks and screenshots. That gives you real device automation that is part of your normal n8n stack.
If you want real phones with adb endpoints to point n8n at, that is what we run: real cloud Android phones in Singapore on dedicated hardware, each with a persistent Singapore mobile ip and its own adb endpoint and api. There is a free trial of cloudf.one, with code YT30 on your first month. Wire up one phone and let the boring parts run themselves.
Get new guides and videos first — join the Telegram channel.