Jobs, tasks and idempotency

Follow long-running Local API operations as jobs, run RPA Plus workflows as tasks, and retry POST requests safely with Idempotency-Key.

Local APIÁp dụng cho Quin Camoufox 0.7Cập nhật 2 tháng 11, 2026

Trang này chưa có bản tiếng Việt. Nội dung tiếng Anh được hiển thị bên dưới.

Some operations take longer than an HTTP request should wait: opening a Quin Cloud profile (download, lease, runtime), closing and saving it, or running a workflow on many profiles. The Local API reports these as jobs you can poll, cancel or follow through events.

Where jobs come from

Job kindStarted byId
browser.openPOST /browsers/open with "wait": false → 202 {"job_id", "state"}job_…
browser.closePOST /browsers/{sid}/close with "wait": false → 202 {"job_id", "state"}job_…
rpa.taskPOST /tasks → 201 with task_id and job_id (the same id)task_…

A job is written to Quin's database before it starts and after every change, so its final state survives a restart.

The job object

JSON
{
  "id": "job_8c41d0e2b9a3",
  "kind": "browser.open",
  "state": "COMPLETED",
  "subject": "6f1c2a9e-3b7d-4c55-9a0e-2d8f1b6c4e77",
  "created_by": "api:AbCdEfGhJkMn",
  "created_at": "2026-11-02T09:20:01",
  "updated_at": "2026-11-02T09:20:48",
  "finished_at": "2026-11-02T09:20:48",
  "progress": null,
  "result": {"session_id": "s_3f9c1d2e8a7b6c5d", "state": "RUNNING", "kind": "cloud"}
}

A failed job carries "error": {"code", "message"}. For browser.open the result is the session object; for browser.close it is the session in its final state. An rpa.task job adds task_state (the task's own state) and progress: {"done", "total"} (finished runs / all runs).

Job states

StateMeaning
QUEUEDRecorded, not started
RUNNINGWorking
WAITING_FOR_BROWSERAn RPA task waiting (shown for the task state WAITING_FOR_AGENT)
COMPLETEDDone — a Cloud close job only after the profile is SYNCED
FAILEDEnded with an error (also tasks that ended PARTIAL or MISSED)
CANCELLEDCancelled (also tasks that ended SKIPPED)
RECOVERY_REQUIREDQuin stopped while the job ran (error.code: interrupted); it is not restarted automatically

Endpoints

Method & pathScopeNotes
GET /jobsjobs:readNewest first; query state, page, page_size (≤ 200)
GET /jobs/{id}jobs:readUnknown id → 404 job_not_found
POST /jobs/{id}/canceljobs:cancelReturns the job; a finished job is returned unchanged

Cancelling a browser job stops waiting for it and records CANCELLED. Cancelling an rpa.task job cancels the task. Finished jobs are kept for 30 days.

Shell
JOB=$(curl -s -X POST http://127.0.0.1:50380/api/v1/browsers/open \
  -H "Authorization: Bearer $QUIN_API_TOKEN" -H "Content-Type: application/json" \
  --data '{"profile_id": "AbCd1234", "wait": false}' | jq -r .job_id)
curl -s http://127.0.0.1:50380/api/v1/jobs/$JOB -H "Authorization: Bearer $QUIN_API_TOKEN"

Idempotency keys

Send Idempotency-Key: <your key> (at most 100 characters) on a POST to make a retry safe. If the same token sends the same key to the same path again, Quin does not run the request again: it returns the first response with the header Idempotent-Replay: true.

  • Keys are remembered for about 24 hours.
  • Only JSON responses below HTTP 500 are remembered; after a server error the request can run again.
  • A key longer than 100 characters is 400 invalid_idempotency_key.
  • Use one key per intended operation, for example "{run id}-open", "{run id}-task".

Use it on POST /browsers/open, POST /tasks, POST /profiles and other creating requests. The SDKs retry a non-GET request only when you pass an idempotency key (and always after a 429, which Quin answers before doing anything).

RPA tasks

POST /tasks — scope rpa:execute (and RPA Plus allowed for the account) — runs a published workflow version on one or more profiles, one run per profile.

FieldTypeDefaultNotes
workflow_idstringrequired
versionint ≥ 1the published versionTasks pin a version; editing the workflow never changes a running task. Unpublished → 409 not_published
profile_idsstring[][]Up to 1000; local or Cloud ids
group_idstring–Every profile of a group
filterobject–{q, tags}: name contains q and carries every tag
inputsobject{}Workflow inputs
datasetstring–A CSV/XLSX file in the automation workspace (one row per run; at most 10,000 rows)
concurrencyint 1–81Also capped by RPA Plus → Settings
timeout_sint 10–86400–Per run
retriesint 0–50A failed run is retried unless retrying cannot help (for example profile_not_saved, lease_lost, taken_over)
error_policycontinue | stop_allcontinue
close_policykeep_open | close_and_sync | close_if_opened_by_taskclose_if_opened_by_taskSee Browser lifecycle

A workflow that uses the browser needs at least one profile (400 no_targets).

The answer (and GET /tasks/{id}) is the task:

JSON
{"id": "task_1d2e3f4a5b6c", "task_id": "task_1d2e3f4a5b6c", "job_id": "task_1d2e3f4a5b6c",
 "workflow_id": "…", "version": 3, "name": "Daily report", "source": "api", "state": "QUEUED",
 "created_at": "…", "started_at": null, "finished_at": null, "settings": {…}, "summary": {},
 "runs": [{"id": "run_9a8b7c6d5e4f", "profile_id": "AbCd1234", "idx": 0, "state": "QUEUED",
           "attempt": …, "error_code": null, "error_message": null, "steps_count": …}]}

Task states: QUEUED, RUNNING, COMPLETED, PARTIAL (some runs failed), FAILED, CANCELLED, RECOVERY_REQUIRED, and for scheduled Quin Cloud workflows WAITING_FOR_AGENT, MISSED, SKIPPED. Run states: QUEUED, WAITING_FOR_BROWSER, RUNNING, PAUSED, SAVING, COMPLETED, FAILED, CANCELLED, RECOVERY_REQUIRED.

Method & pathScopeNotes
GET /tasksrpa:readQuery state, workflow_id, page, page_size
GET /tasks/{id}rpa:readWith its runs
POST /tasks/{id}/canceljobs:cancel
GET /runs/{id}rpa:readOne run with its steps (values redacted)
POST /runs/{id}/signalrpa:execute{"name", "value"} for a run waiting in a Wait for external signal block; otherwise 409 not_waiting

Workflows and schedules

Method & pathScopeNotes
GET /workflows, GET /workflows/{id}rpa:readList (query q, page, page_size) and read
POST /workflowsrpa:write{name, description?, tags?, graph?} or a bare quin.workflow/1 graph → 201
PUT /workflows/{id}, DELETE /workflows/{id}rpa:write
POST /workflows/{id}/publishrpa:write{"note"?} — creates a numbered version
POST /workflows/importrpa:write{"data", "mode": "new" | "replace" | "append", "preview"}; validated as untrusted input
GET /workflows/{id}/exportrpa:readOptional version; no secrets
GET /schedulesrpa:read
POST /schedulesrpa:write{name, workflow_id, spec, task_settings?, enabled?} → 201
PATCH /schedules/{id}, DELETE /schedules/{id}rpa:write

A schedule spec has a kind and its fields: once (at), interval (every_minutes), daily (time HH:MM), weekly (time, days 0 = Monday … 6 = Sunday), monthly (time, day 1–31), cron (cron, five fields); plus timezone (IANA, default UTC) and missed (skip or run_once).