Overview

A WorkflowNode is one step of a workflow. Its type decides what it does and which settings config holds; inputs wires each of its input ports to an output port of an earlier node. Phone node types: phone-session, open-app, wait-for-screen, check-screen, read-text, tap, type, swipe, key, pause, merge, overlays, commit, end-session. Control node types: input, text, if, not, branch, random, random-route, chance, regex, for-each, repeat, collect, destructure, passthrough (Output). List Node Types returns each type’s guide, its default config and its ports. A phone workflow is a chain: phone-session (its phoneId input from an input node) gives a phone output, each phone step takes phone in and passes it on, and end-session ends the chain. The graph has no cycles: to repeat steps, use repeat (or set swipe’s count for swipes alone). phone-session waits until the phone’s network is ready, for as long as Phones Inc is still bringing it up (at most 6 minutes; usually under a minute). If the network fails, the step fails and ends the session it started. When a run ends without reaching end-session for a phone (a step failed, a branch skipped it, or the run was stopped), Phones Inc ends the session the run started on that phone; a session your organization already held before the run is kept. pause waits a random time between its minSeconds and maxSeconds (each 0..600, min <= max), for example 3-8 s of watch time per video; the run log says how long. Wiring a number (for example from an input) into its optional minSeconds or maxSeconds input port takes the place of the config value. repeat is a loop. Its phone input carries the phone in; the steps wired from its phone and index outputs are the loop body and run once per iteration, one iteration after another (index is 0, 1, 2, …). The steps wired from done (the phone) and iterations (how many ran) run once, after the loop: continue the chain from done, not from the last step of the body. It stops when times iterations have run or seconds have passed since it started, whichever comes first; set them in config or wire numbers into its times and seconds input ports (0 means no limit; one of them must be set; at most 500 iterations and 6 hours). A new iteration only starts before the time is up, so the loop can run over by one iteration. It also stops after an iteration in which a step failed (the run then fails) or every step was skipped. Random draws (pause, chance, random) are new in every iteration. A loop inside a loop is not supported. chance sends the phone down yes with probability probability (0..1, in config or wired into its probability input) and down no otherwise; the other branch is skipped. Rejoin the two with merge. text fills {{name}} placeholders from its inputs (text, numbers or booleans) and {{runId}} with the run’s id, so {{runId}}-{{index}} with a repeat’s index gives a commit an idempotencyKey unique to each iteration. merge rejoins branches of one phone chain: wire each branch’s phone into in1..in4 (none is required). It runs once every wired branch has finished or been skipped and passes on the first phone present (in1 first); when none is present its phone output is skipped, and so are the steps after it. overlays holds pop-up handlers for the whole workflow and is not wired. config.handlers is a list of {screenId, action}, where action is {tap: target} (a target as tap takes it, such as {text: "Not now"}) or {key: "back"}; several overlays nodes add up. While wait-for-screen waits, a pop-up whose screen shows is cleared and the wait goes on (same timeout); check-screen clears pop-ups (up to 3 rounds) before answering none; tap clears one and tries once more when its target is not on screen. The run log says overlay <screen name> cleared. A step clears at most 10 pop-ups and then fails. Screens are per platform: wait-for-screen, check-screen and the pop-up handlers only consider screens whose platform is the phone’s. A wait-for-screen whose screens are all for the other platform fails; on check-screen such screens keep their outputs but never match. Each wired input must name an output the source node has: a save with, for example, a bare screen id where check-screen’s output is screen:<screenId> is refused with the source’s outputs listed. A port declared without isArray carries one value.

Properties

string
The node’s id, unique in its workflow.
string
The node type.
string
An optional display name.
number
Where the editor draws it (horizontal).
number
Where the editor draws it (vertical).
object
The node’s settings; their names depend on type (for example appId for open-app, screenId (or screenIds, to wait for any one of several screens, such as the Android and the iPhone version of one screen) and timeoutSeconds for wait-for-screen, region, exact, timeoutSeconds and subject for read-text (it outputs the text in that region; wire an expected text input to fail the run when the screen shows something else, e.g. the wrong signed-in account), direction and count for swipe, minSeconds and maxSeconds for pause, times and seconds for repeat, probability for chance, handlers for overlays, grant (the kind of action, as /v1/commit’s kind: post, like, follow, comment, delete, send or other) and target for commit).
object
For each input port, where its value comes from.
string
The earlier node.
string
Its output port.