Events

Wait for an event

Blocks until an event after since matches, or the timeout passes. The wait reads the timeline first, so an event that already happened is answered at once, then wakes as new events land. A timeout is a 200 with matched: false, never an error: nothing went wrong, the thing has not happened yet, and next_since says where to continue. Timeouts are 1s to 90s (default 30s); loop with next_since for longer. match keys are top-level fields of the event's data: field compares as JSON, field_contains requires a string containing the value. Deterministic: the same timeline and request always answer the same event. At most 16 waits per organisation may be open at once.

post/v1/runs/{runId}/wait

Request

  • Base URL: https://api.ironfang.com/rig
  • URL: https://api.ironfang.com/rig/v1/runs/{runId}/wait
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Request body

matchobject
resourcestring

Limit to one of the run's resources, by name.

sinceinteger

Consider only events with a greater sequence.

timeoutstring
typestring required

Example request

{
  "match": {
    "method": "POST"
  },
  "timeout": "30s",
  "type": "callback.received"
}

Response

Matched, or timed out without a match

matchedboolean required
next_sinceinteger required

The last sequence examined; pass it as since to continue.

waited_msinteger required

Example response

{
  "event": {
    "type": "resource.allocated"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.