API Reference
Executor heartbeat
Renewed by each executor on a fixed cadence. Reports active run IDs so the control plane can renew their run leases and detect zombies. The response returns cancelRunIds — run I…
POST /api/executors/heartbeat
Renewed by each executor on a fixed cadence. Reports active run IDs so
the control plane can renew their run leases and detect zombies. The
response returns cancelRunIds — run IDs the executor still believes
are live but whose DB rows are already terminal (e.g. failed by the
run reaper during a partition). Executors serving a single control
plane fence (cancel) those tasks; multi-CP executors ignore the list
to avoid cross-CP run-ID collisions.
Operation ID: executorHeartbeat
Authentication
- ExecutorKeyAuth (
http bearer) Shared executor secret (ENVOY_EXECUTOR_KEY). Used by internal executor-to-control-plane routes (registration, heartbeat, completion/log callbacks). Internal executor authentication: use the documented shared executor key. Do not replace it with a user API key.
Request body
The request body is required.
application/json
- Type:
object - Properties:
url(string,required) — Executor base URL (matchesruns.executor_id).activeTasks(integer,required) — Number of tasks currently executing on the executor.maxConcurrent(integer) — Optional updated concurrency capacity.labels(object) — Optional updated label set used for dispatch selection.- Description: Optional updated label set used for dispatch selection.
- Additional properties:
- Type:
string | boolean | number - One of:
- Variant 1:
- Type:
string
- Type:
- Variant 2:
- Type:
boolean
- Type:
- Variant 3:
- Type:
number
- Type:
- Variant 1:
- Type:
runIds(array<integer>) — Run IDs the executor currently has in flight. Omit (or send a non-array) for legacy executors — the control plane then renews every non-terminal run owned byurl. An empty array means the executor is idle (nothing to renew).- Description: Run IDs the executor currently has in flight. Omit (or send a non-array) for legacy executors — the control plane then renews every non-terminal run owned by
url. An empty array means the executor is idle (nothing to renew). - Items:
- Type:
integer
- Type:
- Description: Run IDs the executor currently has in flight. Omit (or send a non-array) for legacy executors — the control plane then renews every non-terminal run owned by
Success responses
200
Heartbeat acknowledged; lease renewal attempted and fencing list returned.
Content type: application/json
- Type:
object - Properties:
ok(boolean)cancelRunIds(array<integer>) — Run IDs the executor reports as live but whose DB rows are already terminal — fence (cancel) these.- Description: Run IDs the executor reports as live but whose DB rows are already terminal — fence (cancel) these.
- Items:
- Type:
integer
- Type:
Error responses
404
Resource not found
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Example:
{
"error": "NOT_FOUND",
"message": "Resource not found"
}Examples
cURL
curl --request POST \
--url 'https://your-envoy.example.com/api/executors/heartbeat' \
--header 'Authorization: Bearer $EXECUTOR_KEY' \
--header 'Content-Type: application/json' \
--data '{
"url": "string",
"activeTasks": 0
}'JavaScript (fetch)
const response = await fetch('https://your-envoy.example.com/api/executors/heartbeat', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_EXECUTOR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"url": "string",
"activeTasks": 0
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);