Skip to content

Graph runs on Praxis

Praxis naming: This page documents Praxis, the AIWS workflow engine. Existing engine/* source paths, /engine/... routes, aiws-engine/* protocol identifiers, and existing script names remain unchanged for compatibility.

A graph run is the second run kind beside coding runs: Praxis runs a finite-v1 Graph with its Contract and grants, using the SDK’s reduce and readyNodes, and supplies every trusted fact itself. M12 built it as a source-only engine profile; the completion record states the claim and what it leaves out. The contracts are GRAPH-WORKFLOWS.md, GRAPH-BINDING.md and GRAPH-TRIGGERS.md; every record they name is STABLE (#659): a change within a format version only adds optional fields, and anything else is a new format version served beside the old one.

A graph workflow is a named bundle the host stores: one graph, one aiws-graph-binding/1 binding, one contract, one grant set, and the child graphs its SUBWORKFLOW nodes run, each with its own binding. The graph says what kind of work each node does; the binding says what Praxis runs there: an agent with its commands and exposure, a protocol tool call, a host-installed function, or a human task.

  1. praxis graphs check NAME --graph FILE --binding FILE --contract FILE --grant FILE checks a bundle on the host and writes nothing. Each fault names its file, an RFC 6901 path and a code.
  2. praxis graphs submit NAME ... stores it as a candidate. A candidate grants nothing and cannot run.
  3. The owner admits or rejects it on its admission page in the web view, under a one-use challenge over a review digest that covers each agent’s readiness binding and each function’s digest. No praxis command and no CLI session decides. Admission makes the revision current; it never moves backwards, and retiring closes the name to new runs.

Submission refuses a HUMAN entry on a LOOP. FUNCTION, HUMAN and SUBWORKFLOW work is accepted. A COMPENSATION node is accepted too, and Praxis runs it: see Compensations. Its entry names the one ancestor TASK it compensates and a validation sub-entry; a LOOP as the target is refused COMPENSATES_LOOP, because compensating a LOOP is not specified.

praxis run NAME creates a run of the current admitted revision. The run pins that revision and waits in AWAITING_APPROVAL; while an earlier run of the name is held or was never approved, nothing is created and praxis exits 7. The run’s one approval fixes its budget scope, node assignments and capability digests. A human takes that approval, a ready APPROVAL or ACCEPTANCE node of any graph in the run, a child’s acceptance and a resume on the run page, each confirmed once under a one-use challenge in a browser session verified within five minutes; a CLI or agent session is refused HUMAN_REQUIRED (#656).

Once approved, the runner dispatches ready nodes through the scheduler queue under the run’s limits, and the engine’s scope ledger is the authority for its cost.

  • A binding entry may name its authority, the grant, action and resource its operation is admitted under; without one it takes the bundle’s first grant. A node whose grant does not cover its action when it is dispatched holds AUTHORITY_DENIED, and a human cancels the run.
  • A failed or UNKNOWN node holds itself and its downstream nodes while independent branches run on. Praxis never retries on its own: a verified human takes a hold’s exit on the run page, reconciling an UNKNOWN attempt, retrying only after proof it had no effect, or re-attempting with the host’s proof. An exhausted attempt, loop or wait limit fails the run, as finite-v1 says.
  • A VERIFICATION node is verified by Praxis from the run’s VALIDATION entries, never from WORK, and a LOOP iterates until its validation passes every criterion in one iteration.
  • A HUMAN task is work done outside Praxis, never an approval. It is listed for holders of its permission, and a freshly verified holder reports it on its task page. Past its due time it holds HUMAN_TASK_OVERDUE for a human’s reconciliation.
  • A TIMER wait is satisfied on the engine clock, an EXTERNAL wait by an event from its admitted source carrying its correlation, and an INPUT wait by a session’s answer, never a worker’s. A wait that reaches its deadline fails the run.
  • A SUBWORKFLOW node runs its child graph as a child run in the same work order, under the one approval; any child failure fails the parent.

praxis follow, status, hold and open read the run’s operator view (aiws-graph-operator-view/1), which names the graph workflow, the revision the run runs and when the run was created and last changed, and the run page in the web view takes hold exits and the cancel. A cancel starts no new work, and an attempt in flight still settles. Once every attempt has settled the run is CANCELED; an attempt left UNKNOWN keeps it CANCELING, with its hold open, until a human resolves it. A run’s approval bounds its work order’s elapsed time by the contract deadline: an attempt of any node authorized at or after it is refused ELAPSED_LIMIT_EXHAUSTED on the work order, which holds every node until a human cancels the run.

A compensation is a human-approved operation on a COMPENSATION node that counteracts the applied effect of one earlier TASK. It was decided after M12 completed (#693) and is built; its contract, “Compensations” in GRAPH-WORKFLOWS.md and “COMPENSATION entries” in GRAPH-BINDING.md, is PROVISIONAL, and so is the checkpoint report.

  • Two human decisions. A ready COMPENSATION node dispatches nothing. A human approves it, or declines it, on the run page before any attempt exists; the run’s approval, an agent or a rule never starts one. After the attempt Praxis runs the entry’s validation, and the human records COMPENSATED or PARTIALLY_COMPENSATED. The run page offers COMPENSATED only when every criterion is PASS, and the host refuses it COMPENSATION_CRITERIA_FAILED otherwise. It never offers a rejection.
  • The original effect is never rewritten. Praxis links the compensation to the operation that completed its target. That operation stays CONFIRMED_APPLIED: a partial compensation reads PARTIALLY_COMPENSATED beside an originalEffect still CONFIRMED_APPLIED. An operation released from a re-attempted target that applied is listed as uncovered at both decisions.
  • Its criteria are its own. They are not contract criteria: a failed one never fails the run’s verification. Either status completes the node with {status} as its data, so a DECISION after it can take the two paths apart.
  • Every other end holds for a human. A decline holds COMPENSATION_DECLINED over the node and its downstream nodes until a human approves after all or cancels. A failed attempt holds EXECUTION_FAILED, an uncertain one is UNKNOWN until a human reconciles it, and INCONCLUSIVE criteria hold UNKNOWN_REQUIRES_RECONCILIATION, with a REVALIDATE while the entry’s revalidations allow and the host has a release verifier, and a human’s RULE where the validation call returned and gave no verdict (below); otherwise a human cancels the run and then takes CLOSE_UNRESOLVED. Praxis never runs a compensation a second time by itself.
  • No reserve, and no override. A reached cost, active-time, elapsed or attempt limit refuses the dispatch whatever was approved. The entry names its own authority: a grant of the bundle, and the action and resource the compensation is admitted for. Nothing is inherited from its target, and submission refuses an entry without one. The grant is checked at the compensation’s own dispatch, so one that lapsed, or does not cover the action, refuses it: the node holds AUTHORITY_DENIED, with no exit, while its target’s grant may still be current (#703).

The operator view carries each compensation on its node and on its pending decision. A hold with no hold card, such as a limit reached on the run or the work order, or STORE_CORRUPT on a work order whose step met a stored state no engine build writes (the host then steps the run no more until a human cancels it, and praxis serve logs the step once), is in the view’s scopeHolds; praxis hold --json prints hold cards only, so read praxis status --json for those. GET /engine/graph-checkpoint-report/v1/<workOrderId> answers aiws-graph-checkpoint-report/1 with no model request: the run’s workflow, workflowRevision and revision, each node’s status and phase with the operation that completed it, the open holds, the pending[] keys, and every compensation beside the original effect, still applied.

A cancelled run still CANCELING after the host’s cancellationResponseLimitMs (default 60 minutes; a praxis serve host reads it from its configuration file) is FAILED, never CANCELED: its unsettled attempts stay UNKNOWN and their holds stay open for reconciliation. A child run its failed parent ended, which no human cancelled, is under the same limit, counted from the moment it became CANCELING; a later cancel never restarts that count. While a run is CANCELING, a LOOP’s or a compensation’s UNKNOWN_REQUIRES_RECONCILIATION hold offers CLOSE_UNRESOLVED, which closes it with no result recorded, so the run can end CANCELED. After a restart, an attempt the stopped process left in flight is UNKNOWN and holds its node. One whose outcome was recorded but not settled is settled from that record, and nothing runs again. What a call returned is stored with its outcome when the node declares an outputSchema (at most 65,536 bytes of JSON, kept for the run’s life; it is the same result.data the run’s event log holds once the node completes), so a TASK completed that way keeps its result.data. Only an attempt recorded by an earlier build, which stored none, can still hold EXECUTION_FAILED with the cause OUTPUT_LOST_AT_RESTART. A compensation whose target was skipped, with no operation on it applied, has nothing to compensate: Praxis completes its node with no approval and no dispatch, its compensation reads NOT_APPLICABLE with no original operation, and the nodes after it run; a target skipped after a released operation applied is still compensated the ordinary way, by a human’s approval (#717).

A human may rule where a validation gave no verdict. A validation’s TOOL call that returned an error result, and every direct reply through an A2A binding, is INCONCLUSIVE: the call applied, and the check said nothing. On a VALIDATION task, a LOOP and a compensation, the hold card then offers RULE while the run goes on. The one exception is a VALIDATION task whose outputSchema requires result data: a ruling supplies none, so the card leaves RULE out and says why (ruleWithheld). A human holding the hold exit permission gives PASS or FAIL for each criterion the card names, with an evidence reference and a written reason. It needs no release verifier and runs nothing again, so a praxis serve host takes it. The engine’s own result stays INCONCLUSIVE; the ruling is recorded beside it and shown with ruledBy. From there it counts as the engine’s result would: the task completes and is verified, the LOOP’s iteration settles, the compensation waits for its status. A timeout, a lost answer or a restart offers no ruling, since nothing shows the call returned: those are reconciled. Whoever reported the HUMAN work a validation checks is refused VALIDATOR_IS_IMPLEMENTER (GRAPH-BINDING.md, “Human rulings”).

Not built: compensating a LOOP. Praxis ships no host proof for RELEASE_AND_REATTEMPT and REVALIDATE (#706): a host supplies its own release verifier, in code or, on a praxis serve host, as the command its configuration file names; a praxis serve host whose file names none has none. A command that gives no proof refuses the exit RECONCILIATION_UNPROVEN. A host with no verifier refuses both exits RECONCILIATION_AUTHORITY_REQUIRED; its hold cards name them in needsHostVerifier, and the run page and praxis hold show them as unavailable with the reason (GRAPH-WORKFLOWS.md, “Host proof”).

An event source is the only sender of events: any session submits one, the owner admits it, and the host shows its secret once and keeps only the hash. A relay sends events on the loopback-only events route under that secret, and each event id gets one receipt.

A graph trigger targets one graph workflow and is submitted and admitted on its own. SCHEDULED triggers fire on the engine clock, and EVENT and CONDITION triggers from each received event; MANUAL, EXTERNAL_RESPONSE, RESOURCE_CHANGE, WORKFLOW_LIFECYCLE and RESUME_WAIT are refused at submission. A fire never approves anything: an admitted fire creates a run waiting in AWAITING_APPROVAL, and a refused one is recorded with its reason and never retried. Any session may disable or retire a trigger; only the owner enables it again. praxis triggers checks, submits, reads, withdraws, disables and retires triggers, and praxis event-sources list lists the sources; see GRAPH-TRIGGERS.md, “The praxis commands”.

Terminal window
npm run test:engine:m12-conformance # every graph profile case (GW) in CONFORMANCE.md
npm run example:engine:m12-graph-workflows