Runs

Eksekusi workflow atas dokumen input. Async (disarankan) atau sync.

Create Run (Async)

Multipart form. File bisa di-attach langsung atau referensi pre-uploaded document IDs.

curl -X POST https://api.platform.kakak.ai/v1/workflows/wf_7Gk2Qp/runs \
  -H "Authorization: Bearer $KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "mode=async" \
  -F "files[]=@doc.pdf" \
  -F 'metadata={"key":"value"}'

Response 202 Accepted dengan run_* ID. Status awal: queued.

Sync Mode (v1)

-F "mode=sync" — evaluasi dijalankan inline. Response 200 OK dengan output langsung. Bounded oleh function timeout (~60s).

curl -X POST https://api.platform.kakak.ai/v1/workflows/wf_7Gk2Qp/runs \
  -H "Authorization: Bearer $KEY" \
  -F "mode=sync" -F "files[]=@small-doc.pdf"

State Machine

queuedrunningsucceededfailedcanceledrefunded

queued → running → succeeded (normal). Failed runs: full refund. Canceled queued runs: full refund.

Endpoints

MethodPathScope
POST/v1/workflows/:id/runsruns:write
GET/v1/runsruns:read
GET/v1/runs/:idruns:read
POST/v1/runs/:id/cancelruns:write
GET/v1/runs/:id/outputruns:read

Idempotency

Gunakan Idempotency-Key header (UUID). Same key + same body → replay response. Same key + different body → 409 conflict. Keys retained 24h.