Remote Agent

Define inputs/outputs, call your service, and return a result. Great for internal APIs.

Python Helper

Use the RemoteAgent class to register a function that streams Firestore tasks and pushes results back into Hurozo in real time.

from hurozo import RemoteAgent

def my_remote_agent(name):
    return {"greeting": f"Hello {name}"}

RemoteAgent(my_remote_agent, {
    "inputs": ["name"],
    "outputs": ["greeting"]
})

Firestore Realtime Handshake

Hurozo now writes remote_requests documents under users/<uid>/remote_requests. The editor automatically listens and dispatches them to window.hurozoRemoteAgentHandlers.

window.hurozoRemoteAgentHandlers["MyRemoteAgent"] = async (inputs) => {
  const result = await runMyBackend(inputs);
  return {
    response: result.message,
    debug: result.metadata
  };
};

Return an object whose keys map to the node outputs. Throw an error (or return Promise.reject) to transition the Firestore request to status = "error"; the backend surfaces the error text in the workflow run.

As of Hurozo 3.0.0 the WebSocket transport was removed; Firestore is the sole realtime channel.

CLI Remote Agents

The Python package’s RemoteAgent helper now authenticates with Firebase automatically. Provide HUROZO_API_TOKEN (or HUROZO_TOKEN) and it will:

  1. Register metadata with /api/remote_agents/register so the editor lists it.
  2. Mint a Firebase custom token via /api/firebase_token and exchange it for user credentials.
  3. Open a Firestore gRPC watch on users/<uid>/remote_requests for pending work.
  4. Update the matching document (status, outputs, errors) and emit execution events without hitting the REST polling endpoints.