typedefstruct{charname[TINY_ORCH_NAME_LEN];tiny_orch_state_tstate;// current statetiny_orch_step_tsteps[TINY_ORCH_MAX_STEPS_PER_FLOW];intstep_count;intlast_executed;// last completed step indexboolused;}tiny_orch_flow_t;
CREATED ──(add step)──→ DEFINED ──(go)──→ RUNNING ──(complete)──→ DONE
──(error)──→ ERROR
──(destroy)──→ (deleted)
typedefenum{TINY_ORCH_STATE_NONE=0,// not created / destroyedTINY_ORCH_STATE_DEFINED=1,// created, steps can be addedTINY_ORCH_STATE_DONE=2,// last execution completed successfullyTINY_ORCH_STATE_ERROR=3,// last execution failed}tiny_orch_state_t;
TINY_ORCH_OK=0TINY_ORCH_ERR_NULL=-1// NULL pointer argumentTINY_ORCH_ERR_NOT_FOUND=-2// flow name does not existTINY_ORCH_ERR_FULL=-3// max flows reachedTINY_ORCH_ERR_EXISTS=-4// flow name already existsTINY_ORCH_ERR_NAME_LEN=-5// name exceeds max lengthTINY_ORCH_ERR_STEP_FULL=-6// step count exceededTINY_ORCH_ERR_SRC_NOT_FOUND=-7// source data slot does not existTINY_ORCH_ERR_TOOL_NOT_FOUND=-8// tool not registeredTINY_ORCH_ERR_TYPE_MISMATCH=-9// src type ≠ tool input typeTINY_ORCH_ERR_EXEC_FAILED=-10// runtime execution failed