StaticdisconnectingStaticlistList all provisioned secured worker roles.
List all provisioned worker roles for a namespace.
Optionalnamespace?: stringStaticprovisionProvision a scoped Postgres role for a worker. The role can only dequeue, ack, and respond on its assigned stream names via stored procedures — zero direct table access.
Provision a scoped Postgres role for a worker router.
The role can only dequeue/ack/respond on the specified stream names via SECURITY DEFINER stored procedures — it has zero direct table access.
Optionalnamespace?: stringOptionalpassword?: stringStaticrevokeRevoke a secured worker role (disables login).
Revoke a worker role by disabling login. The role is not dropped,
preserving the audit trail in the worker_credentials table.
Optionalnamespace?: stringStaticrotateRotate a secured worker role's password.
Rotate the password for an existing worker role.
Optionalnamespace?: stringOptionalnewActivates a previously deployed version across all connected instances. The quorum coordinates a synchronized version switch so every engine and worker transitions together.
The version string to activate (must match a deployed graph).
Optionaldelay: numberOptional delay in ms before activation takes effect.
Deploys a YAML workflow graph to Postgres. The graph is stored but remains inactive until activate is called.
A file path or raw YAML string defining the workflow graph.
The parsed manifest with version and graph metadata.
Exports the full job state (data, metadata, activity results) as a structured JSON object.
The job/workflow ID.
Export options (e.g., include activity details).
Returns specific searchable fields from a job's HASH record.
The job/workflow ID.
The field names to retrieve.
Returns all raw key-value pairs from a job's HASH record in Postgres. Useful for debugging or low-level inspection.
Returns the structured job state (data + metadata). For a completed job this is the final output; for a running job it reflects the latest persisted state.
The workflow topic.
The job/workflow ID.
Immediately terminates a running job. The job is marked as interrupted and its HASH is expired. Unlike cancel, this does not give the workflow a chance to run cleanup code.
The workflow topic.
The job/workflow ID.
Optional interrupt configuration.
Subscribes to workflow emissions matching a wildcard pattern.
The wildcard pattern (e.g., 'order.*').
Invoked with each matching emission.
Publishes a message to a workflow topic, starting a new job. Returns the job ID immediately (fire-and-forget).
The workflow topic (must match a deployed graph's subscribes).
Input data for the workflow.
Optionalcontext: JobStateOptionalextended: ExtensionTypeThe new job ID.
Publishes a custom message to every instance via the quorum channel. Register a listener with subQuorum to receive these messages.
Unsubscribes from a wildcard pattern previously registered with psub.
Broadcasts a PING to all connected engines and workers via
LISTEN/NOTIFY and collects their profiles. Returns one
QuorumProfile per responding instance, including
cumulative message counts, error_count, stream_depth,
throttle state, and host-level system health (memory/CPU).
Use this for health checks, topology discovery, and throughput monitoring across the mesh.
Optionaldelay: numberTime in ms to wait for PONG responses (default: quorum config).
One profile per responding engine/worker instance.
Sends a signal to a paused workflow, delivering data and resuming
execution. Pairs with condition() in the Durable workflow API.
The signal topic.
Signal payload.
Optionalstatus: StreamStatusOptionalcode: numberSubscribes to all output and interim emissions from a workflow topic.
The topic to subscribe to.
Invoked with each job output or interim emission.
Subscribes to the quorum channel to receive system messages (version activations, throttle commands, roll calls) and custom user messages.
Broadcasts a throttle command to all instances. Use to slow down or pause message consumption across the mesh.
Throttle rate in ms (0 = no throttle, -1 = pause indefinitely).
Optionally scope by guid (single instance) or topic (single worker).
Unsubscribes from a workflow topic previously registered with sub.
Unsubscribes a callback previously registered with subQuorum.
StaticguidStaticinitCreate a HotMesh instance with an engine and optional workers.
The engine manages workflow state in Postgres. Workers are callback functions that consume messages from Postgres streams — they can run on the same process or on entirely separate servers.
Engine connection, worker definitions, app ID, and options.
A running HotMesh instance joined to the quorum.
StaticregisterRegister a global payload codec for encoding/decoding serialized
object data at rest. Once registered, all object values flowing
through the serializer are stored as /b{encoded} instead of
/s{json}. Use this for encryption, compression, or custom encoding.
The codec is global — it applies to all HotMesh and Durable instances
in the process. Pass null to remove a previously registered codec.
Constraints: The codec must be synchronous and its output must be a valid UTF-8 string. Use base64 encoding for binary output.
Staticstop
A distributed service mesh that turns Postgres into a durable workflow orchestration engine. Every
HotMesh.init()call creates a point of presence — an engine, a quorum member, and zero or more workers — that collaborates with its peers through Postgres LISTEN/NOTIFY to form a self-coordinating mesh with no external dependencies.Service Mesh Architecture
Each HotMesh instance joins a quorum — a real-time pub/sub channel backed by Postgres LISTEN/NOTIFY. The quorum is the mesh's nervous system: version activations, throttle commands, roll calls, and custom user messages all propagate instantly to every connected engine and worker across all processes and servers.
Quick Start
Lifecycle
init— Create an engine + workers; join the quorum.deploy— Upload a YAML graph to Postgres (inactive).activate— Coordinate the quorum to switch to the new version.pub/pubsub— Trigger workflow execution.stop— Leave the quorum and release connections.Higher-Level Modules
For most use cases, prefer the higher-level wrappers:
See
https://hotmeshio.github.io/sdk-typescript/ - API reference