Extraction Workers

Antei uses Cloudflare Workers to process and transform incoming data from connected integrations. These Workers extract, normalize, and prepare structured records across multiple entity types for downstream validation and reconciliation.


Purpose

The Extraction Workers serve as the first point of transformation after ingestion. Their primary functions include:

  • Parsing raw payloads from billing, HRIS, and communication tools
  • Flattening nested objects
  • Mapping extracted data to Antei’s internal schema
  • Attaching metadata and sync context

Each Worker is scoped to a specific integration (e.g., Stripe, QuickBooks) but adheres to a universal extraction standard.


Processing Pipeline

1

1. Receive Ingested Payload

Workers are triggered automatically via background jobs or webhook events. The ingested payload is passed to the Worker.

2

2. Normalize Raw Data

The Worker flattens and standardizes the data structure — transforming provider-specific formats into a common internal format.

3

3. Map to Core Entity Types

The normalized data is mapped to Antei’s entity model: transactions, contacts, invoices, products, etc., with correct field-level mapping.

4

4. Attach Metadata

Each extracted object is tagged with sync metadata such as source, extraction ID, version, and timestamp.

5

5. Queue for Validation

The structured data is pushed to the validation queue for further enrichment, deduplication, and processing.


Supported Entity Types

Antei currently maps and processes the following core entities:

EntityDescription
TransactionsPurchases, refunds, and payments across platforms
ProductsTaxable goods/services with jurisdictional and taxability configurations
ContactsUnified representation of customers, vendors, tax authorities, and locations
InvoicesBilling and compliance documents mapped with product and contact references
Transaction OpsOperational breakdowns such as payment splits, refunds, and adjustments

Naming Convention

Each Worker is named by function and integration. Examples:

  • extract-stripe-payment-intent
  • extract-xero-invoices
  • extract-outlook-emails
  • extract-quickbooks-transactions

All Workers follow a versioned folder-based architecture with shared utility libraries (/shared/log.js, /shared/auth.js).


Reliability & Security

  • Execution Environment: Cloudflare Workers
  • Deployment: CI via Wrangler CLI
  • Logging: Logs pushed to Xano for audit and error tracking
  • Authentication: Bearer token verification on every invocation
  • Rate Limiting: Enforced at the token level for partner-facing endpoints

Error Handling

Each Worker is equipped with:

  • Schema validation (during extraction)
  • Try-catch wrappers for every field mapping
  • Structured error logs with payload_id, error_type, and affected_entity
  • Retry logic for transient failures

Output Example

{
  "entity_type": "invoice",
  "extracted_id": "abc123",
  "payload_id": "xyz456",
  "mapped_data": {
    "invoice_id": "INV-001",
    "contact_id": "CUST-42",
    "amount": 1200,
    "currency": "USD",
    "tax_rate": 0.18
  },
  "metadata": {
    "source": "stripe_invoice",
    "sync_time": "2025-05-13T10:30:00Z",
    "version": "v1.3"
  }
}

Next Steps


Questions

If you have questions about how Extraction Workers function or need support with integration-specific behavior, please contact: tech@antei.com

All Worker activity is logged and traceable from the Org Settings → Audit Trail section.