# Halowerk State Machine Step

> Halowerk State Machine Step is a paid API for AI agents from agent.halowerk.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-11).

Computes a single deterministic state-machine transition given a machine definition, current state, and an event, with optional guard conditions evaluated against context or payload fields.

## Facts

- Endpoint: POST https://agent.halowerk.com/v1/state-machine-step?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-state-machine-step-f22ad916
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UMP1_sgEERamWOy189t6j

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability halowerk-state-machine-step-f22ad916 -d '<json body>'
```

Example prompt: Run one step of my state machine — the machine has states 'idle', 'processing', and 'done', currently in 'idle', and I'm sending the event 'start' with payload {userId: '42'} and a guard that checks payload.userId exists before moving to 'processing'.

## When to prefer this

Choose this endpoint when you need a stateless, sandboxed, single-step FSM evaluation that cannot execute arbitrary code — guard conditions are declarative comparisons (field, operator, value), never expressions, so it is safe to hand in externally-supplied machine definitions. Prefer it over full workflow engines when you want lightweight, per-step control with explicit action labels rather than side-effectful execution.

## Known failure modes

- Guard condition not met — no transition taken, machine stays in current state
- Event name does not match any transition in current state — no-op response
- Current state is marked final — no events accepted, returns error or no-op
- Invalid dotted path in guard field — field resolution fails
- Machine definition missing required 'initial' or 'states' fields — validation error
- State referenced in transition target does not exist in machine definition

## How this service works

Takes a machine definition, the current state, one event and an optional context, and computes a single step. Transitions may carry a guard, which is a declared comparison — field, operator, value — and never an expression: the field is a dotted path into context or payload, so a machine handed in by a stranger cannot execute anything on this server.

## Output

Returns the next state name the machine transitions to, along with any action labels declared on the taken transition, or an indication that no transition was taken (e.g. guard failed or no matching event handler in the current state).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "event": {
   "type": "object",
   "required": [
    "name"
   ],
   "properties": {
    "name": {
     "type": "string",
     "maxLength": 64,
     "minLength": 1,
     "description": "Event name."
    },
    "payload": {
     "type": "object",
     "description": "Event data, addressable in guards as payload.<field>."
    }
   },
   "description": "The event to apply.",
   "additionalProperties": false
  },
  "context": {
   "type": "object",
   "description": "Machine context, addressable in guards as context.<field>. Never modified."
  },
  "machine": {
   "type": "object",
   "required": [
    "initial",
    "states"
   ],
   "properties": {
    "states": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "name"
      ],
      "properties": {
       "on": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "event",
          "target"
         ],
         "properties": {
          "event": {
           "type": "string",
           "maxLength": 64,
           "minLength": 1,
           "description": "Event name this transition reacts to."
          },
          "guard": {
           "type": "object",
           "required": [
            "field",
            "op"
           ],
           "properties": {
            "op": {
             "enum": [
              "eq",
              "ne",
              "gt",
              "gte",
              "lt",
              "lte",
              "in",
              "not_in",
              "exists",
              "not_exists"
             ],
             "type": "string",
             "description": "Comparison operator."
            },
            "field": {
             "type": "string",
             "maxLength": 200,
             "minLength": 1,
             "description": "Dotted path starting with context. or payload., e.g. context.attempts."
            },
            "value": {
             "description": "Right-hand operand. Not used by exists and not_exists; an array for in and not_in."
            }
           },
           "description": "Condition that must hold for this transition to be taken.",
           "additionalProperties": false
          },
          "target": {
           "type": "string",
           "maxLength": 64,
           "minLength": 1,
           "description": "State to move to."
          },
          "actions": {
           "type": "array",
           "item
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-state-machine-step-f22ad916/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.halowerk.com](https://www.zero.xyz/host/agent.halowerk.com/llms.txt)
