Mission Structure
Every mission you create must supply two required fields: agoalSpec describing what the agent should accomplish, and a resourceBudget capping how far the agent can go. These are expressed through the CreateMissionRequest type from @praxa/sdk:
goalSpec is a JSON object whose task field carries your plain-language instruction. You can include additional structured fields to provide context the agent can reference during execution.
MissionProjection — a live snapshot of the mission — and returns HTTP 202 Accepted. Acceptance means the request passed validation and is queued for execution; it is not a guarantee that an external effect has already occurred.
Resource budgets are enforced entirely server-side by the Integration Gateway. Raising the values in your request cannot bypass policy limits configured for your tenant. If your budget request exceeds your tenant’s configured ceiling, the gateway will reject the mission at intake.
Mission Lifecycle
Once created, a mission moves through a set of status values that describe its current execution state. You can read the status at any time by callingclient.getMission(runId) or by streaming real-time events with client.missionEvents(runId).
These values come directly from the
MissionProjection type returned by the gateway:
sequence field is a monotonically increasing integer. You can use it alongside Last-Event-ID to reconnect to the event stream without replaying events you have already processed.
Mission Steps
Steps are the individual actions the agent takes while pursuing your goal. Each step recorded in the mission’ssteps array has a stepId string that uniquely identifies it within the run, and a status string that reflects its current disposition.
client.getTrace(traceId).
Real-Time Events
Missions emit Server-Sent Events (SSE) that you can consume as anAsyncGenerator using client.missionEvents(). This lets you react to state transitions, step completions, and other runtime notifications without polling.
id (cursor), an event type string, and a data payload parsed from JSON. If your connection drops mid-stream, pass the last received id as lastEventId when you reconnect — the gateway replays events from your cursor position within its bounded durable replay window.
Idempotency
Every call tocreateMission() requires an idempotency key as its second argument. The key must be a string between 16 and 128 characters containing only alphanumeric characters, dots, underscores, hyphens, or colons. Using crypto.randomUUID() is the recommended approach.
MissionProjection instead of creating a duplicate mission. This makes createMission() safe to retry in transient failure scenarios without risk of running the same agent task twice.
Idempotency is also required for signalMission() and cancelMission(), for the same reason — signals and cancellations have durable side-effects that must not be applied more than once.