Routing Rules
Routing rules automatically assign actions to documents based on their type. Configure rules to auto-assign schemas, trigger jobs, or route documents to specific workflows. Manage rules from Documents → Routing. Routing is the bridge between document ingestion and structured output — it eliminates the manual step of selecting a schema and starting a job for each new document.
Each routing rule specifies a document type as the trigger condition and one or more actions to execute when a document of that type is processed. Actions include assigning a specific user schema, automatically creating a job run, or tagging the document for a particular workflow. Rules are evaluated in priority order, so you can layer general rules with more specific overrides. If multiple rules match the same document type, the highest-priority rule wins.
Routing rules are especially useful for high-volume ingestion pipelines. If you connect a Google Drive folder that receives hundreds of invoices per week, a routing rule can automatically assign your "Invoice" schema and trigger extraction — turning what would be manual work into a fully automated pipeline. Combined with delivery bindings, this creates an end-to-end flow from document upload to structured output with zero manual intervention.
You can review rule execution history from the routing page to see which rules fired, which documents they matched, and what actions were taken. This audit trail helps you verify that your routing configuration is working as expected and diagnose cases where documents were not routed correctly.
Available Routing Actions
- Assign schema — Automatically link a user schema to matching documents, so they are ready for extraction without manual configuration.
- Trigger job — Create and start a job run as soon as a document of the matching type completes processing.
- Tag workflow — Apply a workflow tag that can be used for filtering, reporting, or downstream delivery bindings.
Worked Example: Automated Invoice Pipeline
Consider a common scenario: your accounting team receives hundreds of invoices weekly via email and cloud storage. Without routing rules, someone must manually navigate to each new document, assign a schema, and trigger extraction. With routing, this entire workflow is automated. First, connect your Gmail or Google Drive source to ingest documents continuously. Then create a routing rule that matches the "Invoice" document type, assigns your Invoice schema, and triggers a job run. Every new invoice that arrives is now automatically processed end-to-end without any manual steps.
To complete the automation, add a delivery binding that pushes approved results to your ERP system via webhook. The result is a fully hands-off pipeline: invoices arrive from email, the platform classifies them, extracts structured data using your schema, and delivers the results to your downstream system. You only need to intervene when the review queue flags a low-confidence extraction or when a new document type appears that does not match any existing routing rule.
Rules are evaluated in priority order, which allows you to layer general and specific rules effectively. For example, you might set a priority-10 general rule that routes all "Invoice" documents to a standard invoice schema, then add a priority-1 specific rule that routes invoices from a particular source to a specialized vendor-specific schema. The higher-priority (lower number) rule wins when both match, giving you fine-grained control over routing behavior without duplicating configuration.
curl https://api.talonic.com/v1/routing-rules \
-H "Authorization: Bearer $TALONIC_API_KEY"{
"data": [
{
"id": "rule_001",
"name": "Invoices to Invoice schema",
"trigger_type": "document_classified",
"conditions": { "document_type": "Invoice" },
"action_type": "route_to_schema",
"actions": { "schema_id": "sch_inv_001" },
"priority": 1,
"is_active": true
}
],
"pagination": { "total": 4, "limit": 20, "has_more": false }
}