{
  "access": "public",
  "type": "reference",
  "format": "markdown",
  "title": "Demultiplexer",
  "chunked": true,
  "url": "https://library.datagrout.ai/demultiplexer",
  "summary": "**Broadcast one tool call to many systems simultaneously**",
  "content_markdown": "# Demultiplexing\n\n**Broadcast one tool call to many systems simultaneously**\n\nDemultiplexing (demux) is the inverse of multiplexing. Instead of aggregating many integrations behind one endpoint, demux fans out a single tool call to multiple target servers at once — in parallel — and returns all results together.\n\n---\n\n## Modes\n\n### Strict Mode\n\nExecutes the exact same tool on every target server that has it. Tool names must match exactly.\n\n**Example**: Call `quickbooks@1/create_invoice@1` with `demux: true` and `demux_mode: \"strict\"`. The invoice is created on every QuickBooks server configured as a demux target — production, staging, and disaster recovery — simultaneously.\n\n### Fuzzy Mode\n\nExecutes semantically equivalent tools based on Semio type compatibility. The system finds tools that produce the same semantic output type across different integrations, even if their names differ.\n\n**Example**: Call `quickbooks@1/create_invoice@1` with `demux_mode: \"fuzzy\"`. The system finds all tools that produce `billing.invoice@1` — QuickBooks, SAP, NetSuite — and executes them in parallel.\n\n---\n\n## How to Use\n\n### Enable a Server as a Demux Target\n\n1. Open **Server Settings → Policy**\n2. Toggle **Enable as Demux Target**\n3. Configure permissions:\n   - **Allow write operations** — whether write calls replicate to this server\n   - **Enable fuzzy matching** — whether semantic type matching is allowed\n\n### Make a Demux Call\n\nAdd `demux: true` to any tool call. Works with `discovery.perform`, `flow.into`, or a direct JSONRPC call:\n\n```json\n{\n  \"name\": \"data-grout@1/discovery.perform@1\",\n  \"arguments\": {\n    \"tool\": \"quickbooks@1/create_invoice@1\",\n    \"args\": { \"customer_id\": \"123\", \"amount\": 5000 },\n    \"demux\": true,\n    \"demux_mode\": \"strict\"\n  }\n}\n```\n\nOr via the **Demux global tool argument** (enabled in [Interaction Settings](interaction-settings)), which adds `demux` and `demux_mode` parameters to every tool on your server.\n\n---\n\n## Response Format\n\nResults come back as an array, one entry per target server:\n\n```json\n{\n  \"mode\": \"strict\",\n  \"results\": [\n    {\n      \"success\": true,\n      \"server\": \"uuid-production\",\n      \"server_name\": \"QB Production\",\n      \"result\": { \"invoice_id\": \"INV-001\" }\n    },\n    {\n      \"success\": true,\n      \"server\": \"uuid-staging\",\n      \"server_name\": \"QB Staging\",\n      \"result\": { \"invoice_id\": \"INV-002\" }\n    },\n    {\n      \"success\": false,\n      \"server\": \"uuid-dr\",\n      \"server_name\": \"QB DR\",\n      \"error\": \"Rate limit exceeded\"\n    }\n  ],\n  \"total_targets\": 3,\n  \"successful\": 2\n}\n```\n\nFor read operations, results are aggregated by integration type and merged into a single list.\n\n---\n\n## Use Cases\n\n### Multi-Environment Replication\n\nWrite to production, staging, and disaster recovery simultaneously. Every write replicates across all configured targets automatically.\n\n### Cross-System Reporting\n\nQuery invoices, accounts, or any entity across QuickBooks, SAP, and NetSuite in one call. Get all results back merged, without writing separate queries for each system.\n\n### Disaster Recovery\n\nMark backup servers as demux targets. All write operations replicate to them automatically without changing agent code.\n\n---\n\n## Safety Controls\n\n### Write Protection\n\nBy default, demux targets reject write operations. Enable **Allow write operations** only for servers where writes are intentional and safe.\n\n### Fuzzy Mode Opt-In\n\nFuzzy matching must be explicitly enabled per server. This prevents accidental cross-system execution when tools have similar but semantically different outputs.\n\n### Partial Failure\n\nDemux does not require all targets to succeed. If one server fails or times out, others continue. The response reports both successful and failed targets.\n\n---\n\n## Performance\n\n- Targets execute in parallel (up to 10 concurrent)\n- Per-target timeout: 30 seconds\n- Failing targets do not block successful ones\n\n---\n\n## Related\n\n- [Multiplexing](multiplexing) -- Aggregate many integrations behind one endpoint\n- [Interaction Settings](interaction-settings) -- Enable Demux as a global tool argument\n- [Semio Types](semio) -- How fuzzy mode matches tools by semantic type\n"
}