Swipe
Swipes or drags across the screen — to scroll, flick, or move something.
Purpose
Performs a directional gesture. Use it to scroll a list, flick a page, or drag an item. A swipe can cover the whole screen, or be confined to a region so it scrolls one panel instead of the whole display.
It also has a second, very different mode: Bring a target to the centre. Instead of saying how far and which way, you name a Find Image node and the runtime swipes exactly far enough to put that match in the middle of the screen — on any screen size, with no pixel values stored in the flow.
When to use it
- Scrolling a list, feed, or inventory panel.
- Flicking between pages.
- Dragging an item from one place to another.
- Centring something you just found, before zooming or reading it.
When not to use it
- To tap or long-press — use Click.
- To zoom — use Zoom.
- For tiny movements. A gesture whose endpoints are nearly the same point is rejected as too short.
Requirements
Direction/distance mode needs a direction and a distance. Centre mode needs a Find Image node that ran earlier on the same path and matched.
How it runs
Nothing about the device size is read from the flow — the runtime measures the live instance. That is what makes centre mode resolution-independent.
Settings
| Setting | Type | Range | Default | What it does |
|---|---|---|---|---|
| Swipe mode | choice | directionDistance, alignTarget | directionDistance | Configure the gesture yourself, or name a target to centre |
| Target (from Find Image) | node ref | — | — | Centre mode only: whose match to bring to the middle |
| Swipe area | choice | screen, region | screen | Whole display, or confined to a rectangle |
| Direction | choice | 4 cardinal + 4 diagonal | — | up, down, left, right, upLeft, upRight, downLeft, downRight |
| Direction mode | choice | fixed, random, noRepeat, weighted | fixed | How a direction is picked per swipe |
| Directions | list | 1–8 unique | — | The candidate set for random modes |
| Direction weights | map | 1–100 each | 1 | Per-direction weight for weighted mode |
| Distance | integer | 1–10000 px | — | Screen mode travel |
| Distance min / max | integer | 1–10000 px | — | When both set, a uniform random distance per swipe |
| Distance percent | number | 1–100 % | — | Region mode travel, as a percentage of the region |
| Region | rectangle | percentage of screen | — | The rectangle the gesture stays inside |
| Random offset | integer | 0–1000 px | 0 | Jitter applied to the whole gesture, kept inside the region |
| Duration | integer | 50–10000 ms | — | Required. How long the gesture takes |
| Delay min / max | integer | 0–60000 ms | — | Random pause after the gesture |
| Drag and drop | boolean | — | false | Renders the gesture as a pick-up, travel, settle, release |
| Swipe region | rectangle | percentage of screen | — | Screen mode only: compute the swipe against this rectangle instead of the whole screen |
The 3% safe border
Both endpoints are clamped 3% away from every screen edge. This stops a gesture from triggering the emulator's own edge gestures — the notification shade, the back gesture, the recents swipe. You cannot reach the extreme edge of the screen with this node, and that is deliberate.
Duration is gesture time, not a pause
Duration is how long the finger is travelling. A long duration reads as a drag; a short one as a flick. It is not a delay after the swipe — for that, use the delay range or a Wait node.
Drag and drop needs the digitizer
dragAndDrop renders a held contact — press, travel, settle, release. This can only be injected over the native input transport; there is no framework fallback.
Ports
| Port | Taken when | Required |
|---|---|---|
| Success | The gesture was dispatched (or the target was already centred) | Yes |
| Failure | The resolved travel was too short, or a point could not be resolved | No |
| Timeout | The input command did not complete in time | No |
| Cancelled | The run was stopped mid-gesture | No — never followed |
| Fatal | Device disconnected, or invalid params (no directions, bad duration) | No — never followed |
Basic example
Scroll a list up one screenful:
- Swipe area: Screen
- Direction: up
- Distance:
600px - Duration:
300ms
Realistic example — scroll one panel only
An inventory list sits in the right-hand half of the screen; scrolling the whole screen would move the map behind it.
- Swipe area: Region, drawn over the inventory panel
- Direction: down
- Distance percent:
70% - Duration:
400ms
The gesture stays inside the panel, and the travel is 70% of the panel's height — so it works whatever size the panel is.
Advanced example — centre a target, then act on it
The pattern that makes map automation resolution-independent:
Note the Wait then re-verify. A swipe animates; reading the screen immediately after it reads mid-animation. This act → settle → verify shape is the single most reliable structure for gesture-driven automation.
Best practices
- Use Region mode to scroll a specific list. It is the difference between scrolling a feed and dragging the world behind it.
- Randomise direction and distance for repeated scrolling.
noRepeatavoids the same direction twice in a row and looks far less mechanical than a fixed loop. - Always settle and verify after a swipe that matters.
- Prefer centre mode over computed pixel distances. It survives every resolution change.
- Use a longer duration for drags, shorter for flicks. 300 ms flicks; 800 ms drags.
Performance notes
- The gesture itself costs its
Duration— a 400 ms swipe blocks the session for at least 400 ms. - Centre mode may issue several shorter gestures when the distance is large, to avoid flinging past the target. Budget more than one duration for long travels.
- Random delay ranges add real wall-clock time to every swipe. In a loop that scrolls 50 times, a 0–2000 ms random delay adds up to 100 seconds.
Memory notes
- Swipe holds no frame. In centre mode it reads an already-recorded Find Image result from the run context; it does not re-capture.
Common mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Distance too small | Rejected as too short → Failure | Increase distance, or the region percentage |
| Scrolling the wrong thing | Screen mode moves everything | Use Region mode over the target panel |
| Treating Duration as a pause | The next node runs immediately after the gesture | Use the delay range or a Wait node |
| Reading the screen straight after a swipe | Reads mid-animation | Wait, then verify |
| Centre mode with no upstream match | Nothing to centre → Failure | Ensure the Find Image ran and matched on this path |
| Expecting to swipe to the very edge | Clamped to a 3% border | Use a region positioned where you need it |
Troubleshooting
Every swipe exits Failure. The resolved travel is below the minimum. In region mode a small percentage of a small region can be only a few pixels.
The swipe scrolls the map instead of the list. Swipe area is Screen. Switch to Region and draw it over the list.
Centre mode does nothing and routes Success. The target was already within tolerance of the centre. That is correct behaviour, not a bug.
Drag and drop behaves like a normal swipe.
The native input transport is not available. Check the flow's nativeInputEnabled feature gate and the instance's input mode.
FAQ
Can I swipe between two exact points?
Older flows can (start/end), but it is legacy and resolution-dependent. Prefer direction + distance or region mode.
Does random direction guarantee variety?
noRepeat draws from a bag so the same direction is not repeated back-to-back. random is uniform and may repeat.
Is distance in screen pixels or device pixels? Input pixels against the live instance profile.
Can I centre something a Read Text node found? No — centre mode reads a Find Image match specifically.
Related nodes
- Find Image — supplies the centre-mode target
- Click — tapping instead of dragging
- Zoom — pair with a swipe to frame a target
- Wait — the settle step after a gesture
Related pages
- Execution Model
- Flow Anatomy — why settling matters