Skip to main content
Flomisma

Task Orchestration Layer

Submit, route, and settle AI agent execution tasks. HMAC-signed dispatch with automatic retry, timeout sweeper, and ledger settlement. Bring your own runtime; Flomisma orchestrates the lifecycle.

How it works

  1. 1. Register a runtime. Deploy your execution endpoint anywhere (Lambda, Fly, your own server). Register it via the API with a signing secret.
  2. 2. Submit a task. POST a task with payload, target runtime, and idempotency key. The orchestrator validates and dispatches with HMAC-signed headers.
  3. 3. Runtime executes. Your runtime receives the task, processes it, and POSTs the result back to the callback URL. Retries automatically on failure (up to 3 attempts with exponential backoff).
  4. 4. Settlement recorded. On completion, the orchestrator calculates the settlement fee (via the Ledger API) and marks the task as settled. Timed-out tasks are swept automatically.

State machine

SUBMITTED  ──→  ROUTING  ──→  EXECUTING  ──→  COMPLETED
    │               │            │
    │               ├──→ FAILED  └──→ FAILED
    │               │
    └──→ CANCELLED  └──→ CANCELLED

EXECUTING ──→ TIMED_OUT (swept by timeout sweeper)

API example

# Register a runtime
POST /api/runtimes
x-flomisma-api-key: your_internal_key

{
  "tenantId": "tenant_abc",
  "name": "my-agent-runtime",
  "endpointUrl": "https://my-runtime.fly.dev/execute",
  "signingSecret": "whsec_..."
}

→ 201
{ "id": "rtn_abc123", "name": "my-agent-runtime", "enabled": true }

# Submit a task
POST /api/tasks
x-flomisma-api-key: your_internal_key

{
  "tenantId": "tenant_abc",
  "runtimeId": "rtn_abc123",
  "payload": { "prompt": "Generate a monthly report", "params": { "period": "2026-05" } },
  "idempotencyKey": "report_2026_05_unique"
}

→ 202
{ "taskId": "task_xyz789", "status": "SUBMITTED" }

# Check task status
GET /api/tasks/task_xyz789?tenantId=tenant_abc
x-flomisma-api-key: your_internal_key
x-flomisma-tenant-id: tenant_abc

→ 200
{ "taskId": "task_xyz789", "status": "COMPLETED", "result": { ... } }

Pricing

Developer
Free
100 tasks/mo

1 runtime, basic retry, email notification.

Startup
$49
per month

1K tasks/mo, 3 runtimes, HMAC dispatch, timeout sweeper.

Growth
$199
per month

10K tasks/mo, 10 runtimes, ledger settlement, relay event publishing.

Enterprise
Custom
per month

Unlimited tasks, dedicated runtimes, SLA, custom settlement rules, audit exports.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                   Task Orchestration Layer                   │
│                                                             │
│  POST /api/tasks ──→ submitTask() ──→ dispatchToRuntime()   │
│       │                    │                    │            │
│       │              stateMachine           HMAC sign       │
│       │              idempotency            retry loop      │
│       │              relay publish          timeout         │
│       │                                       │            │
│       │                                       ▼            │
│       │                              ┌──────────────┐       │
│       │                              │  Runtime     │       │
│       │                              │  (your code) │       │
│       │                              └──────┬───────┘       │
│       │                                     │               │
│       │                              POST callback          │
│       │                                     │               │
│       ▼                                     ▼               │
│  POST /api/tasks/{id}/callback ──→ COMPLETED / FAILED       │
│                                            │               │
│                                     recordSettlement()      │
│                                     relay publish event     │
│                                                             │
│  GET /api/tasks/sweep (cron) ──→ TIMED_OUT detection        │
└─────────────────────────────────────────────────────────────┘

FAQ

Where does my runtime run?
Anywhere. Fly.io, Railway, AWS Lambda, your own server. The orchestrator calls your runtime's endpoint via HTTPS. You own the infrastructure; we orchestrate the dispatch.
How is idempotency enforced?
Each task submission requires an idempotencyKey. If you submit the same key twice, the orchestrator returns the existing task without re-dispatching. Callbacks are also idempotent.
What happens if my runtime crashes?
The orchestrator retries up to 3 times with exponential backoff (100ms, 200ms, 400ms). If all retries fail, the task transitions to FAILED. You can resubmit with a new idempotency key.
How are timed-out tasks handled?
A timeout sweeper runs every 60 seconds (via Vercel Cron or server-side interval). Tasks exceeding their configured timeout are transitioned to TIMED_OUT. Your runtime is notified via relay event.
Does settlement happen automatically?
Yes. On COMPLETED status, the orchestrator calls the Ledger API to calculate and record the settlement fee. The settlement amount is drawn from the task metadata. No manual reconciliation needed.