{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Asynchronous Operations"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"asynchronous-operations","__idx":0},"children":["Asynchronous Operations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some MoreLogin operations accept work before the underlying browser, Cloud Phone, file, application, or RPA execution reaches its final state. A successful submission response means the request was accepted; it does not always mean the requested state has already been reached."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"client-state-model","__idx":1},"children":["Client state model"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"State"},"children":["State"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Client action"},"children":["Client action"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Submitted"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The API accepted the command or created a task"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Save returned IDs and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]},"; do not immediately submit the same write again"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Pending or running"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The downstream operation is still progressing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Poll the documented status/result endpoint with increasing intervals"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Succeeded"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The target resource or task reached its successful terminal state"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stop polling and continue the workflow"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Failed"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status/result endpoint reports failure or a terminal business error"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stop automatic retries; retain IDs, failure details, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unknown outcome"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The write timed out or the connection closed without a usable response"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Query current resource/task state before deciding whether to retry"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"polling-rules","__idx":2},"children":["Polling rules"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Start around 1 second, then increase the interval to 2, 4, 8 seconds, capped at 15–30 seconds."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Apply jitter so concurrent clients do not poll at the same instant."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Stop on a documented terminal state; do not poll indefinitely."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data: null"]}," as pending only when the endpoint explicitly documents that behavior."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A transport timeout on a write is not proof of failure."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"documented-workflows","__idx":3},"children":["Documented workflows"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Workflow"},"children":["Workflow"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Submit operation"},"children":["Submit operation"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Observation operation"},"children":["Observation operation"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Terminal state"},"children":["Terminal state"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cloud browser start/stop"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudbrowser/start"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/cloudbrowser/stop"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudbrowser/page"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Runtime reaches the intended state or disappears after stop"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cloud Phone power"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/powerOn"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/cloudphone/powerOff"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/page"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["envStatus=4"]}," powered on or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["envStatus=2"]}," powered off; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," is creation failure"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cloud Phone file upload"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Upload to the signed URL, then ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadFile"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/uploadFileResult"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=1"]}," success or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=2"]}," failure; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data: null"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=0"]}," are pending"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cloud Phone download"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/download"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/download/result"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=20"]}," success, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["30"]}," failure, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["40"]}," cancelled; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10"]}," is running"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Application installation"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/app/install"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/app/installedList"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Requested package appears in the installed-app list"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RPA schedule/execution"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/rpa/task/save"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/onceTask/save"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/rpa/task/page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/subTask/page"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/subTask/detail/{id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["taskState=2"]}," completed or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]}," cancelled; inspect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["handleResult"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," failed, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," succeeded)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Live streaming"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/live/start"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/live/end"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudphone/live/status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Status confirms streaming started or stopped"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cloud storage upload"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudstorage/upload/init"]},", followed by object-store ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /cloudstorage/upload/complete"]}," after every required PUT succeeds"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Completion response succeeds; never call complete before object upload succeeds"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Local API equivalents use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api"]}," prefix where documented. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/getting-started/endpoint-behavior"},"children":["Endpoint Retry and Completion Matrix"]}," for operation-by-operation guidance."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"timeout-recovery-example","__idx":4},"children":["Timeout recovery example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"try:\n    submit_operation()\nexcept TimeoutError:\n    # The write may already have succeeded.\n    current = query_current_state()\n    if current.is_terminal_success:\n        pass\n    elif current.is_pending:\n        poll_until_terminal()\n    else:\n        decide_whether_retry_is_safe(current)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The public API does not currently define a general idempotency-key header. Resource IDs, task IDs, state queries, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]}," are therefore essential to safe recovery."]}]},"headings":[{"value":"Asynchronous Operations","id":"asynchronous-operations","depth":1},{"value":"Client state model","id":"client-state-model","depth":2},{"value":"Polling rules","id":"polling-rules","depth":2},{"value":"Documented workflows","id":"documented-workflows","depth":2},{"value":"Timeout recovery example","id":"timeout-recovery-example","depth":2}],"frontmatter":{"seo":{"title":"Asynchronous Operations"}},"lastModified":"2026-09-02T11:22:17.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/api-reference/getting-started/async-operations","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}