Skip to main content
Queued invoke stores a unary device RPC call and delivers it when the device is reachable. Use it when the device may be offline, when you want the platform to retry transient failures, or when your integration prefers enqueue-and-poll over holding an HTTP connection open. Synchronous invoke (no enqueue/ prefix) blocks until the device responds or the proxy times out. Queued invoke returns immediately with a call_id you poll until the call reaches a terminal state.
Queued invoke is unary-only. Server-streaming methods use the /streams/ path and require the device to be online — see Invoking methods.

When to use queued vs sync invoke

For online devices and low-latency control paths, prefer sync invoke. Use queued invoke for offline-tolerant workflows, batch jobs, and integrations that already poll for completion.

At-least-once delivery

Queued RPC is at-least-once delivery. The platform may invoke the same logical call on the device more than once — for example when the device succeeds but the platform fails to mark the row succeeded, or when a stale in_flight row is reclaimed after 120 seconds and retried.Your device handlers must implement idempotency. The platform does not forward call_id to the device. Design protobuf request messages with an explicit idempotency key, or make handlers safe to run multiple times with the same payload.
Send Idempotency-Key on enqueue so HTTP retries return the same call_id instead of creating duplicate rows. Use a fresh key for every distinct operation; reuse a key only when retrying an identical enqueue.

Enqueue a call

Optional query: ?ttl_seconds={n} — how long the platform keeps trying before marking the call expired.

Required headers

Example

Response (202 Accepted):
Save call_id for polling. The request body uses the same protobuf schema rules as sync invoke.

ttl_seconds

Poll call status

Uses the management API on api.ilyama.golain.io, not the RPC host. Requires can_invoke_rpc on the device.
Example poll response:

Call states

On succeeded, the response field is base64-encoded protobuf response bytes. Decode with your protobuf response type (or a Connect client) after base64 decode — it is not Connect JSON.

Platform behavior

Device-side idempotency

The platform does not attach call_id to the gRPC payload sent to the device.
Non-idempotent handlers (motor start, payment capture, counter increment) will misbehave under queued delivery unless you add explicit deduplication.
→ Edge engineers: see Omega setup — idempotency

Local development

Common errors

Successful enqueue returns 202 with call_id (see above).