Skip to content

Orchestrator

Current execution mechanism

tiny_orch_step() checks data-slot and registered-tool types at runtime and returns TINY_ORCH_ERR_TYPE_MISMATCH on mismatch. A newly created flow is DEFINED; successful completion is DONE, and step failure is ERROR. These interface behaviors supersede the older state sketch below.

Bench stores data pointers, so buffers and tool contexts must remain alive until execution finishes. Matching type labels do not validate array length or algorithm semantics. Some butterworth, fft, sysid_fdd and damage_detect registrations in the Bench-Orch entry point bind _stub_* no-op implementations. Bind actual algorithms and validate shapes and return codes before claiming an end-to-end monitoring chain.

源码 / Source

TinyOrch — Orchestrate Processing Pipelines on TinyBench

TinyOrch manages a "sequence of steps." Each step retrieves data from the TinyBench workbench → invokes a tool → puts the result back onto the bench. Supports predefined flows as well as remote dynamic orchestration via MQTT.


Architecture

  • Flow Definition


    Named flows + ordered steps
    create(flow) / step(flow, idx, src, tool, dst)
    Compile-time type validation — checks src type matches tool at definition time

    API →

  • Execution Engine


    go(flow) — executes all steps in order
    run(src, tool, dst) — one-shot single step
    Terminates immediately on step failure, returns error code + executed step count

    Design →

  • Flow State Machine


    DEFINED → DONE / ERROR
    status(flow) — real-time flow state query
    Clear error traceability

    Design →

  • MQTT Remote Orchestration


    ORCH,CREATE / ORCH,STEP / ORCH,GO
    Users or Agents build and execute flows remotely via MQTT
    Responses published to /mqtt/node

    Test →


Quick Start

#include "tiny_bench.h"
#include "tiny_orch.h"

tiny_bench_t bench;
tiny_bench_init(&bench);
// ... register tools, put data ...

tiny_orch_t orch;
tiny_orch_init(&orch, &bench);

// Define a flow
tiny_orch_create(&orch, "daily_scan");
tiny_orch_step(&orch, "daily_scan", 0, "raw_0",  "butterworth", "filtered");
tiny_orch_step(&orch, "daily_scan", 1, "filtered","fft",         "spectrum");

// Execute
tiny_orch_go(&orch, "daily_scan");  // Executes steps 0→1 in order

TinyBench + TinyOrch Collaboration

TinyBench:   Data slots(raw_0, filtered, ...) + Tool registry(butterworth, fft, ...)
                  ↕ read                    ↕ call
TinyOrch:    Step 0: raw_0 → butterworth → filtered
             Step 1: filtered → fft → spectrum
                  ↕ write
TinyBench:   Data slots updated (filtered, spectrum now have data)