Skip to Content
Payload Bay
Runner

Runner as a forwarding target

A target group can contain Runner targets next to plain HTTP targets. A Runner target delivers events to a private receiver (a localhost or LAN application) through the outbound-only Runner, so the application needs no public port, tunnel or health endpoint. Core issue #30 tracks this feature; the Runner itself is unreleased.

Set up

  1. Create a target group and a forwarding route as usual.

  2. Add a target with "kind": "runner":

    POST /api/v1/target-groups/{groupId}/targets
    {"kind": "runner", "name": "laptop", "position": 1}

    A Runner target has no deliveryUrl or healthUrl: the local address belongs to the Runner's operator and the server never sends one.

  3. Create its credential with POST /api/v1/targets/{targetId}/runner. The pabr_... token is returned once and only its hash is stored. Posting again rotates it and revokes the previous token; DELETE revokes it. The caller needs destinations.configure and payload.read, and those permissions of the credential's creator, including any API-key restriction, are checked again on every claim and acknowledgement.

  4. Start the Runner with the token, the Core origin and the local target URL. See the Runner guide.

Health

A Runner target is healthy while its Runner is connected. Polling is the connection: every authenticated claim (including the idle ones that return 204) and every acknowledgement counts. The target is healthy when

  • its Runner polled within the last 20 seconds, or holds a delivery lease that has not yet been acknowledged or expired, and
  • it is not on hold after a failed delivery (see below).

It is unhealthy before the first poll, after the Runner stops, and during a hold. The HTTP prober never touches a Runner target, and no health URL exists to probe. GET responses show the current state without waiting for any background job:

runner.stateMeaning
never_connectedNo Runner has used the credential yet.
connectedHealthy.
disconnectedThe Runner has not polled within 20 seconds.
delivery_failedThe Runner is connected but the last delivery failed; the target is held out of rotation for healthIntervalSeconds (default 15).

health.healthy, health.lastCheckedAt (the last poll), health.lastError and health.consecutiveFailures are filled for both kinds, so a client can render all targets the same way. The agent defaults to a 2-second poll interval and rejects anything above 10 seconds, so it always stays inside the 20-second window.

Delivery

Selection is unchanged: the first healthy enabled target by position receives the event, so a group can mix kinds, for example a developer laptop first and a shared preview second. A disconnected Runner is skipped and the next healthy target is used. When no target is healthy the event waits in the queue without spending its attempt limit, and is delivered once a Runner (or an HTTP target) becomes healthy, within the group's maxWaitSeconds.

For a Runner target the stored request is encrypted with the instance encryption key, queued, and delivered on the Runner's next claim. The headers and the bytes of the body are the same as for an HTTP target: the provider's headers and signature unchanged, hop-by-hop headers dropped, plus x-payloadbay-event-id, x-payloadbay-attempt and the delivery identity header. The Runner sends the request to its fixed local URL, never following redirects, and reports back at most 64 KiB of the response.

Lease. A claim takes a lease on one delivery. The lease expires with the target's deliveryTimeoutMs (default 15 seconds, at least 1 second must remain for a claim). A Runner acknowledges with the lease token; an acknowledgement that is late, replayed, for another target or after revocation is rejected with stale_delivery and changes nothing.

Outcome. The Runner's report is classified exactly like an HTTP response:

OutcomeResult
2xxThe event succeeds. A held target rejoins rotation.
3xx, 408, 425, 429, 5xxThe target is held out of rotation and the next healthy target is tried.
Other 4xxThe application refused the event: it fails as target_rejected_<status> and no other target is tried.
The Runner could not reach its local receiver (runner_local_delivery_failed)As a failed delivery: held, next target.
No Runner took the delivery before the timeout (runner_unclaimed)As a failed delivery.
The Runner took the lease and never reported, for example it was killed or lost its network (runner_lease_expired)As a failed delivery. The expired lease cannot be used again.

A failed delivery holds the target for its healthIntervalSeconds, even if the Runner keeps polling, so a Runner whose local receiver is down does not receive every event only to fail it. The hold ends by itself and after any successful delivery.

Redelivery and duplicates. Delivery is at least once. A Runner that dropped mid-lease may have already invoked the receiver, so the event can arrive again, from this target after it reconnects or from the next one. The delivery identity header (x-payloadbay-delivery-id) is the same on every attempt of one execution, so the receiver can deduplicate on it. For a Runner target it is a 64-character hexadecimal digest derived from the execution, not the execution identifier an HTTP target receives; it is stable per execution for a given target kind. An explicit replay is a new execution with a new key.

Attempts

Every delivery attempt is recorded with its target. GET /api/v1/events/{eventId} and the event list return target_id, target_name and target_kind (http or runner) for each attempt, and the event inspector shows the target name followed by "(Runner)" for Runner attempts (HTTP targets show the name alone). Failed attempts show the reason above in network_error.

Limits

  • One Runner credential and connection per target. Several Runners behind one target, fan-out to several targets, and load balancing beyond priority order are not supported.
  • Request and response bodies for Runner targets are bounded by the Runner protocol (the stored request up to the ingress limit, the reported response up to 64 KiB).
  • There is no dashboard form for Runner targets yet; configure them through the API.
Edit this page

On this page