maestro-orchestrator. It is not on npm; install it from a clone, after npm run build there:
Running a workflow
run() returns at once with a handle:
Options
Events
Every event is emitted under its own type name and under'event'.
Runners
AnthropicRunner({ client?, maxTurns?, maxTokens?, structuredMode? })CodexRunner({ model?, ignoreUserConfig?, customToolsMcp? })RoutingRunner({ anthropic?, codex?, route? })FakeRunner, for tests and dry runs: it answers from the schema and never touches the network.
Giving the Workflow tool to your own agent
If you run your own agent loop on the Claude API, you can hand it the sameWorkflow tool Claude Code gets.
maestroToolDefinition()returns the tool definition. Its description tells the model when a workflow is worth starting and when it is not.handleWorkflowToolCall()validates the call, starts the run in the background and returns at once. A bad call returns{ is_error: true, content }; it does not throw.- The result arrives through
onCompleteas{ ok: true, result }or{ ok: false, error }.
false or null for an unknown or finished run.
One budget for several runs
To make your main loop’s workflows share one pool, create aBudget and pass the same instance to every call: