Skip to main content
The return code is not a label. It decides whether the platform retries, waits, gives up, or raises a security incident, and it decides what an operator is told about a device they may never see. Getting it wrong does not fail loudly. It produces a fleet that quietly reports the wrong thing. This applies to every node: C-ABI nodes on macOS and Linux, and COM nodes on Windows share one code space and one set of JSON shapes.

Return codes

node_invoke (Unix) or Invoke (Windows) returns a 32-bit code. One number space, three regions, and only one of them is yours.

0, success

The operation did what it was asked. The platform marks the invoke acked and the deployment or schedule moves on. Return 0 only when the work actually happened. A node that returns success for an op it does not implement is worse than one that fails, because the plan proceeds as though the device is in a state it is not.

1 and above, your failures

Everything positive is yours to define. The platform marks the invoke failed and shows your message against the device. Give each value one meaning and keep it stable across versions. Operators build runbooks on these numbers.

Negative, never

Omega synthesises these itself when a node never ran, and the platform reacts to each one differently. Returning one from your code makes an operator believe the platform failed when your code did. Two are actively dangerous to borrow. -101 parks the invoke forever with nobody alerted. -105 sends somebody hunting a compromise that did not happen. For “I am not ready yet”, use a positive code and say so in the message.
On Windows there is a second axis: Invoke also returns an HRESULT. A failed operation returns S_OK with a non-zero returnCode. A failed HRESULT means the node itself is broken, and Omega reports a dispatch error and drops your message.

What you are acting for

Every request JSON Omega hands you carries a reserved _omega object alongside the op’s own parameters. It says what this invoke is for, which the parameters never do.
Log request_id on every operation that changes the machine. It is the only value that ties your event to the deployment or command that caused it, months later, without the Console in front of you. _omega is reserved. Do not accept it as a parameter of your own, and if your input_schema sets additionalProperties: false, allow _omega explicitly or every invoke fails validation. Omega overwrites whatever a caller put there, so source: "ota" really does mean a signed plan step.

Messages

The message is displayed in the Console beside the device name and stored with the invoke result. A person reads it, usually while something is wrong, about a machine they cannot reach. Avoid Error 2 (the code has its own field), OK (says nothing about what changed), and stack traces (they render in a table cell). Always set a message, including on success. collected 23 components tells an operator the run was real. The message is capped at 1 MiB. It is a status line, not a data channel. Bulk output belongs in your node’s own database, replicated separately.

Health

Omega polls health in a child process and reports a change on node/report/health. Answer honestly: returning healthy unconditionally removes the only signal anyone has that your node is broken. Answer cheaply: check a cached flag, not the network.

Capabilities

idempotent is load-bearing. It means running the op twice is indistinguishable from running it once, which is what makes a retry after a lost response safe. If your op appends to a log, charges something, or reboots a machine, it is not idempotent, and claiming otherwise gets it run twice. cadence_secs is a request, not a guarantee. An operator can retune the schedule from the Console, and the platform’s value wins. The device reports the schedule it is actually running in node/report/registry.

Checklist

  • Success is exactly 0, and only when the work happened
  • Every failure code is positive and has one stable meaning
  • No negative code is ever returned
  • No panic, exception, or crash can escape invoke
  • Every result sets a message a person can act on
  • Health is cheap, honest, and never lies about healthy
  • idempotent is true only where a second run genuinely changes nothing
  • No op is named unregister
  • _omega.request_id is logged for every operation that changes the machine
  • _omega is allowed by any strict input_schema, and never a parameter of your own