Is this state transition allowed by the caller's workflow definition, and what is allowed instead?

$0.005 USDC per call · Agent infrastructure · POST /api/v1/workflow-transition · Id workflow-transition

Given a caller-supplied state machine (transitions with optional event names and required facts), the current state and a requested event or target state, says whether the transition is allowed, which required facts are false or unknown, and which transitions are available from the current state. For an agent about to move an order, ticket, deployment or approval to its next state. Terminal states allow nothing. Ambiguous requests (one event leading to several states) are reported, not guessed. Does not know any workflow by itself and does not persist state.

What you get

Rejects an illegal state change before it is written, with the legal alternatives.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/workflow-transition. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/workflow-transition \
  -H 'content-type: application/json' \
  -d '{"transitions":[{"from":"draft","to":"review","event":"submit","requires":["has_title"]},{"from":"review","to":"published","event":"approve","requires":["approved_by_editor"]}],"current":"draft","request":{"event":"submit"},"facts":[{"name":"has_title","value":true}]}'

Input

FieldTypeRequiredDescription
transitionsarray<object>; max 300 itemsyes
terminalarray<string; length 1..200>; max 100 itemsnoStates with no outgoing transitions allowed even if listed.
currentstring; length 1..200yes
requestobjectyesGive event, to, or both.
factsarray<object>; max 200 itemsno

Example request body

{
  "transitions": [
    {
      "from": "draft",
      "to": "review",
      "event": "submit",
      "requires": [
        "has_title"
      ]
    },
    {
      "from": "review",
      "to": "published",
      "event": "approve",
      "requires": [
        "approved_by_editor"
      ]
    }
  ],
  "current": "draft",
  "request": {
    "event": "submit"
  },
  "facts": [
    {
      "name": "has_title",
      "value": true
    }
  ]
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
allowedbooleanno
targetstringnoThe resolved target state, when the request resolves to one transition.
missingFactsarray<string>noRequired facts that are false.
unknownFactsarray<string>noRequired facts not supplied.
availablearray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the execution-safety-kit package.

Machine-readable