Catalog/workflow-fsm-can-transition

Workflow

FSM can-transition check API

Given an FSM, a current state and an event, decides whether the transition is allowed and returns the target state. Answers 'Can I fire this event from this state?', 'What state would this event lead to?'.

Price$0.01per request
MethodPOST
Route/v1/workflow/fsm-can-transition
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
fsmstate-machinetransitionguardeventcanautomataworkflow
API URLhttps://x402.hexl.dev/v1/workflow/fsm-can-transition
Integration docs
Example request
{
  "states": [
    "idle",
    "running",
    "done"
  ],
  "initial": "idle",
  "transitions": [
    {
      "from": "idle",
      "on": "start",
      "to": "running"
    },
    {
      "from": "running",
      "on": "finish",
      "to": "done"
    }
  ],
  "finals": [
    "done"
  ],
  "state": "idle",
  "event": "start"
}
Example response
{
  "allowed": true,
  "from": "idle",
  "event": "start",
  "to": "running",
  "interpretation": "Event 'start' transitions 'idle' -> 'running'."
}
Input schema
{
  "type": "object",
  "required": [
    "states",
    "initial",
    "transitions",
    "state",
    "event"
  ],
  "properties": {
    "states": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "examples": [
        [
          "idle",
          "running",
          "done"
        ]
      ]
    },
    "initial": {
      "type": "string",
      "examples": [
        "idle"
      ]
    },
    "transitions": {
      "type": "array",
      "examples": [
        [
          {
            "from": "idle",
            "on": "start",
            "to": "running"
          },
          {
            "from": "running",
            "on": "finish",
            "to": "done"
          }
        ]
      ]
    },
    "state": {
      "type": "string",
      "examples": [
        "idle"
      ]
    },
    "event": {
      "type": "string",
      "examples": [
        "start"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}