Continue in the same Bash session and working directory as the quickstart. First check that the client supports the operations this page uses:
jq -e '.data.operations as $ops | ["validateWorkflow","startRun","getRun","listRunNodes","listRunArtifacts"] - $ops | length == 0' capabilities.jsonChoose a Chromium browser profile. The environment ID is the profile's envId. If you only know the profile's name, find it with ml-cli env find --keyword <keyword> or POST /api/env/page in the Browser Local API, and resolve any ambiguity before you run. To confirm the browser type, check that POST /api/env/detail returns browserTypeId: 1. Pass the ID as a string. List positions and debug ports are not profile IDs.
Use the same template ID, version, environment, and parameters for the preflight and the run. Supply each parameter value as {kind:"json",value:...}. Private parameters are sent as plaintext, and file parameters use absolute local paths (an array for multiple files). This example has no private parameters. Continue only when the validation report shows valid: true and is complete. If the profile is busy, wait until the previous run releases its isolation.
: "${RPA_ENVIRONMENT_ID:?Set the actual Chromium profile ID first}"
jq --arg env "$RPA_ENVIRONMENT_ID" '
.data | {templateId:.id,version,environmentId:$env,
parameters:{targetUrl:{kind:"json",value:"https://example.com"}}}
' created.json > start-run.json &&
jq '{purpose:"run",source:{kind:"template",templateId,version},
environmentId,parameters}' start-run.json > validate-run.json &&
rpa_curl "$RPA_BASE_URL/validations" -H 'Content-Type: application/json' --data-binary @validate-run.json -o validation-run.json &&
jq '.data | {valid,issues,truncated,runtimeChecks}' validation-run.json &&
jq -e '.data.valid == true and .data.truncated == false' validation-run.json([ -s run.key ] || uuidgen > run.key) &&
rpa_curl "$RPA_BASE_URL/runs" \
-H 'Content-Type: application/json' \
-H "X-RPA-Catalog-Revision: $RPA_CATALOG_REVISION" \
-H "Idempotency-Key: $(cat run.key)" \
--data-binary @start-run.json -o started.json &&
RPA_RUN_ID="$(jq -er '.data.id' started.json)" &&
jq '.data | {id,status,template}' started.jsonHTTP 202 means the run is registered, not finished. Keep the run ID, the original key, and the frozen template revision. A transport timeout doesn't cancel the run: use request recovery before you send another write.
for attempt in $(seq 1 100); do
rpa_curl "$RPA_BASE_URL/runs/$RPA_RUN_ID" -o run-detail.json || break
status="$(jq -r '.data.run.status' run-detail.json)"
echo "status: $status"
case "$status" in
success|failed|cancelled|stopped|missed) break ;;
queued) sleep 5 ;;
*) sleep 3 ;;
esac
doneThe loop checks an active run every 3 seconds and a queued run every 5 seconds, and gives up after 100 checks. Active states are queued, preparing, running, and cancel_requested. Terminal states are success, failed, cancelled, stopped, and missed. Keep all observation requests within 40 per minute, and honor Retry-After on 429 or 503.
jq '.data | {status:.run.status,hasNodeErrors:.run.hasNodeErrors,
isolation:.run.isolation,outputs:.result.outputs,error:.result.error}' run-detail.json &&
rpa_curl "$RPA_BASE_URL/runs/$RPA_RUN_ID/nodes?page=1&pageSize=20" -o run-nodes.json &&
rpa_curl "$RPA_BASE_URL/runs/$RPA_RUN_ID/artifacts" -o run-artifacts.jsonThe example returns outputs.result: "https://example.com/". Check data.run.hasNodeErrors, data.run.isolation.state, and both data.result.outputs and data.result.error: a run can succeed while some nodes failed and were skipped.
Node execution records are paged. While a run is active, read from page 1 on each pass and merge by items[].id. After the run reaches a terminal state, read all pages without a status filter. The artifacts endpoint returns metadata only. Redact sensitive output before you share it.
Cancellation is a request: keep checking the actual terminal state and the isolation state. Don't restart automatically when the outcome is uncertain or the environment is still quarantined. For details, see Get run details, List node executions, and Run observation and request recovery.