Skip to content

Orchestration HTTP API

@lastshotlabs/slingshot-orchestration can mount a Hono router that exposes task and workflow execution over HTTP.

createOrchestrationPackage({
adapter,
tasks,
workflows,
routes: true,
routePrefix: '/orchestration',
routeMiddleware: [requireAdmin],
});

Typical middleware looks exactly like any other Hono middleware:

import type { MiddlewareHandler } from 'hono';
export const requireAdmin: MiddlewareHandler = async (c, next) => {
const user = c.get('user');
if (!user || !user.roles?.includes('admin')) {
return c.json({ error: 'forbidden' }, 403);
}
await next();
};

When routes are enabled, routeMiddleware must be non-empty. That is enforced as a hard setup error so orchestration endpoints are never accidentally exposed without a guard.

Orchestration route setup is direct: import middleware and pass it directly.

POST /orchestration/tasks/:name/runs

{
"input": { "email": "user@example.com" },
"idempotencyKey": "signup-123",
"priority": 10,
"tags": { "domain": "signup" },
"metadata": { "source": "admin-ui" }
}

POST /orchestration/workflows/:name/runs

GET /orchestration/runs/:id

DELETE /orchestration/runs/:id

GET /orchestration/runs

Supported query filters currently include:

  • type
  • name
  • status
  • limit
  • offset

POST /orchestration/runs/:id/signal/:signalName

Adapters without signal support return 501 Not Implemented.

If the request context already carries tenantId, the route layer forwards that into the orchestration run options automatically. That keeps runs scoped consistently with the rest of the app surface.