Skip to content

Run one of an agent's scheduled jobs now, outside its schedule

POST
/api/v1/agents/{name}/upcoming/run
curl --request POST \
--url http://localhost:11044/api/v1/agents/example/upcoming/run \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "job": "example" }'
name
required
string

The agent’s name

job names one of the agent’s scheduled jobs, as job in its upcoming work; it is started now, outside its schedule, and the run appears on the agent’s runs. 409 when the agent has no such job

Media typeapplication/json

One of an agent’s scheduled jobs to run now, outside its schedule; sent to POST /agents/{name}/upcoming/run

object
job
required

Name of the scheduled job, as a firing’s job in GET /agents/{name}/upcoming

string

Example generated

{
"job": "example"
}

The upcoming work; the run appears on the agent’s runs

Media typeapplication/json

What an agent will do next after a skip or a run-now, or why the change was refused

object
refused

Why the change was refused, in words; null when it was made

string
upcoming

The agent’s upcoming work after the change; null when it was refused

object
agent
required

Name of the agent, as asked

string
counts
required

What it has done lately, in the units a budget is set in

object
requestsToday
required

Requests it raised today for a person to approve, from the same midnight

integer format: int32
runsLastHour
required

Runs started in the last hour, skipped firings excluded, counted over its 500 most recent runs

integer format: int32
writesToday
required

Changes it made today: receipts where a call acted, plus requests a person approved. Today starts at midnight in the user’s time zone, UTC when they have none

integer format: int32
expected
required

Duties whose next check is expected to raise requests again

Array<object>

A duty whose last check found violations and that declares a repair: the next check will raise its requests again if nothing changes

object
duty
required

Name of the duty

string
lastCheckedAt

ISO-8601 instant of that check

string format: date-time
violations
required

Violations its last check found

integer format: int32
firings
required

Its scheduled duty checks and routines, soonest first, those with no next time last. Only jobs the scheduler holds: a duty whose agent is off duty has none

Array<object>

One of an agent’s scheduled jobs, a duty check or a routine, with when it next fires

object
cron
required

The job’s six-field cron expression, seconds first

string
job
required

Name of the scheduler’s job: the job to send to skip or run-now

string
kind
required

duty or routine

string
nextAt

ISO-8601 instant of its next firing; null when the cron does not parse or its zone cannot be read

string format: date-time
postponedTo

When the skipped firing was postponed rather than dropped, the ISO-8601 instant it runs instead; null otherwise

string format: date-time
skipped
required

True when a person has marked the next firing to be skipped

boolean
work
required

Name of the duty or routine the job runs

string
zone
required

IANA zone id the cron is read in: the job’s own when it declares one, else the user’s (UTC when they have none)

string
inFlight
required

Its runs still in progress, from its 500 most recent

Array<object>

A run of the agent’s still in progress

object
deadline
required

ISO-8601 instant 30 minutes after it started; a run still open past it is closed as timed out

string format: date-time
runId
required

Id of the run, as in GET /agents/{name}/runs/{id}

string
startedAt
required

ISO-8601 instant it started

string format: date-time
work
required

The routine, duty or conversation it is running, as its run records it

string
onSignals
required

Names of the routines it holds that have no scheduled job: the ones that run when something happens rather than at a time

Array<string>

Example generated

{
"refused": "example",
"upcoming": {
"agent": "example",
"counts": {
"requestsToday": 1,
"runsLastHour": 1,
"writesToday": 1
},
"expected": [
{
"duty": "example",
"lastCheckedAt": "2026-04-15T12:00:00Z",
"violations": 1
}
],
"firings": [
{
"cron": "example",
"job": "example",
"kind": "example",
"nextAt": "2026-04-15T12:00:00Z",
"postponedTo": "2026-04-15T12:00:00Z",
"skipped": true,
"work": "example",
"zone": "example"
}
],
"inFlight": [
{
"deadline": "2026-04-15T12:00:00Z",
"runId": "example",
"startedAt": "2026-04-15T12:00:00Z",
"work": "example"
}
],
"onSignals": [
"example"
]
}
}

No authenticated principal

One of:

A refusal with a machine-readable code and a plain-language message. ApiErrorAdvice answers it for a failed validation, a missing resource or a conflicting state, and some controllers answer it directly

object
code
required

Machine-readable key to branch on, such as validation_failed, unknown_field, not_found or conflict. Open: a surface may answer codes of its own

string
detail

Extra context where there is some, such as the fields a body may carry; null otherwise

string
message
required

A plain-language explanation, written to be shown. Never carries an exception message

string

Example generated

{
"code": "example",
"detail": "example",
"message": "example"
}

Refused: the agent has no such scheduled job

Media typeapplication/json

What an agent will do next after a skip or a run-now, or why the change was refused

object
refused

Why the change was refused, in words; null when it was made

string
upcoming

The agent’s upcoming work after the change; null when it was refused

object
agent
required

Name of the agent, as asked

string
counts
required

What it has done lately, in the units a budget is set in

object
requestsToday
required

Requests it raised today for a person to approve, from the same midnight

integer format: int32
runsLastHour
required

Runs started in the last hour, skipped firings excluded, counted over its 500 most recent runs

integer format: int32
writesToday
required

Changes it made today: receipts where a call acted, plus requests a person approved. Today starts at midnight in the user’s time zone, UTC when they have none

integer format: int32
expected
required

Duties whose next check is expected to raise requests again

Array<object>

A duty whose last check found violations and that declares a repair: the next check will raise its requests again if nothing changes

object
duty
required

Name of the duty

string
lastCheckedAt

ISO-8601 instant of that check

string format: date-time
violations
required

Violations its last check found

integer format: int32
firings
required

Its scheduled duty checks and routines, soonest first, those with no next time last. Only jobs the scheduler holds: a duty whose agent is off duty has none

Array<object>

One of an agent’s scheduled jobs, a duty check or a routine, with when it next fires

object
cron
required

The job’s six-field cron expression, seconds first

string
job
required

Name of the scheduler’s job: the job to send to skip or run-now

string
kind
required

duty or routine

string
nextAt

ISO-8601 instant of its next firing; null when the cron does not parse or its zone cannot be read

string format: date-time
postponedTo

When the skipped firing was postponed rather than dropped, the ISO-8601 instant it runs instead; null otherwise

string format: date-time
skipped
required

True when a person has marked the next firing to be skipped

boolean
work
required

Name of the duty or routine the job runs

string
zone
required

IANA zone id the cron is read in: the job’s own when it declares one, else the user’s (UTC when they have none)

string
inFlight
required

Its runs still in progress, from its 500 most recent

Array<object>

A run of the agent’s still in progress

object
deadline
required

ISO-8601 instant 30 minutes after it started; a run still open past it is closed as timed out

string format: date-time
runId
required

Id of the run, as in GET /agents/{name}/runs/{id}

string
startedAt
required

ISO-8601 instant it started

string format: date-time
work
required

The routine, duty or conversation it is running, as its run records it

string
onSignals
required

Names of the routines it holds that have no scheduled job: the ones that run when something happens rather than at a time

Array<string>

Example generated

{
"refused": "example",
"upcoming": {
"agent": "example",
"counts": {
"requestsToday": 1,
"runsLastHour": 1,
"writesToday": 1
},
"expected": [
{
"duty": "example",
"lastCheckedAt": "2026-04-15T12:00:00Z",
"violations": 1
}
],
"firings": [
{
"cron": "example",
"job": "example",
"kind": "example",
"nextAt": "2026-04-15T12:00:00Z",
"postponedTo": "2026-04-15T12:00:00Z",
"skipped": true,
"work": "example",
"zone": "example"
}
],
"inFlight": [
{
"deadline": "2026-04-15T12:00:00Z",
"runId": "example",
"startedAt": "2026-04-15T12:00:00Z",
"work": "example"
}
],
"onSignals": [
"example"
]
}
}