Skip to Content
kusaw docsv1.0.0
Step protocol

Step protocol

The contract a step process speaks with the factory: handshake, request, events, result, and environment variables.

Step protocol

The contract a step process speaks with the factory: handshake, request, events, result, and environment variables.

Versions

Newest first. A step may advertise several versions; the factory picks the newest one it accepts.

VersionStatus
2accepted

How a step starts

  1. Handshake. The factory starts the command with KUSAW_HANDSHAKE=1 and the other KUSAW_* names set empty. The step prints one handshake line on stdout and exits.
  2. Request. The factory starts the real attempt. A non-interactive step receives the request JSON on stdin. An interactive step reads it from KUSAW_REQUEST.
  3. Events. While it runs, the step prints one JSON object per stdout line (or appends to KUSAW_EVENTS when interactive).
  4. Result. The last line is a result object (or KUSAW_RESULT when interactive). The factory then waits for the process to exit.

Timeouts

LimitDuration
Handshake5s
Kill grace after SIGTERM10s
Stdout drain after exit2s
Step deadlineThe step's timeout key in kusaw.yaml (default 10m).

Outcomes

OutcomeDescription
okThe step finished successfully.
failThe step failed.
retryThe step asked to be tried again.
rejectThe step rejected the work.
skippedThe step did not run.
killedThe factory stopped the step.

On this page