2.2 WorkflowSynapse Protocol
The WorkflowSynapse is the submission format. It is open source, fully inspectable, and any validator can reproduce any miner's score independently.
WorkflowSynapse is the Bittensor synapse that carries task packages from validators to miners and workflow plans back. Defined in cswon/protocol.py.
Class Definition
# cswon/protocol.py
import bittensor as bt
from typing import Optional
class WorkflowSynapse(bt.Synapse):
"""
Validator → Miner: carries the task package.
Miner → Validator: carries the workflow plan (populated by miner).
"""
# ── Validator-populated fields (sent to miner) ──────────────────
task_id: str = ""
task_type: str = ""
description: str = ""
quality_criteria: dict = {}
constraints: dict = {} # max_budget_tao, max_latency_seconds, allowed_subnets
available_tools: dict = {} # per-subnet cost/latency hints
send_block: int = 0 # stamped by query_loop before dispatch
# ── Miner-populated fields (returned to validator) ───────────────
miner_uid: Optional[int] = None
scoring_version: Optional[str] = None
workflow_plan: Optional[dict] = None # nodes, edges, error_handling
total_estimated_cost: Optional[float] = None
total_estimated_latency:Optional[float] = None
confidence: Optional[float] = None
reasoning: Optional[str] = None
def deserialize(self) -> "WorkflowSynapse":
return self
Field Contract
| Field | Set By | Type | Description |
|---|---|---|---|
task_id | Validator | str | Unique task identifier |
task_type | Validator | str | code, rag, agent, data_transform |
description | Validator | str | Natural language task description |
quality_criteria | Validator | dict | Task-specific quality requirements |
constraints | Validator | dict | max_budget_tao, max_latency_seconds, allowed_subnets |
available_tools | Validator | dict | Per-subnet cost/latency hints |
send_block | Validator | int | Block height at dispatch time |
miner_uid | Miner | Optional[int] | Miner's UID on the subnet |
scoring_version | Miner | Optional[str] | Must match validator's SCORING_VERSION |
workflow_plan | Miner | Optional[dict] | DAG: nodes, edges, error_handling |
total_estimated_cost | Miner | Optional[float] | Sum of estimated step costs (TAO) |
total_estimated_latency | Miner | Optional[float] | Critical path latency (seconds) |
confidence | Miner | Optional[float] | Self-assessed confidence [0,1] |
reasoning | Miner | Optional[str] | Free-text explanation of strategy |
Any Optional field left as None by the miner is treated as an invalid response and discarded.
Navigation
| ← Previous | 2.1 System Architecture |
| → Next | 2.3 DAG Execution Model |
| Index | Documentation Index |