Skip to main content
RecordEngine’s webhook and API system is designed to work with any automation platform. This guide covers the core patterns and building blocks that apply regardless of which automation tool you use — so you can build reliable integrations without starting from scratch every time.

The Two Directions

Every RecordEngine integration involves data flowing in one or both directions: Most real-world integrations use both directions — documents arrive from one system, get processed, and extracted data flows to another.

The Standard Outbound Pattern

This pattern handles the most common use case: something happens in RecordEngine → data goes to an external system.
Step 1: Configure an incoming webhook URL in your automation platform. Copy the URL. Step 2: Paste the URL into RecordEngine Settings → Document Webhook URL. Step 3: In your automation platform, build:
  • Trigger: Incoming webhook
  • Action: Whatever the external system needs (create a Bill, update a CRM record, send a notification)
Step 4: Test by exporting a document in RecordEngine. Confirm the webhook fires and the external system is updated. That’s the entire pattern. Every outbound integration — QuickBooks, Xero, Salesforce, HubSpot, WeCom, custom ERP — is a variation of these four steps.

The Standard Inbound Pattern

This pattern handles uploading documents into RecordEngine from an external trigger.
Step 1: Set up a trigger in your automation platform. This could be:
  • A new email with an attachment
  • A CRM stage change
  • A file appearing in a shared folder
  • A scheduled time (e.g. every morning at 8am)
Step 2: Add an HTTP action that POSTs to the RecordEngine upload endpoint:
Step 3: Optionally save the returned document_id so you can query the document’s status or results later.

Handling the Async Gap

Document processing in RecordEngine is asynchronous — you upload a file and it’s processed in the background. There’s a gap between when you upload and when the extracted data is ready. There are two ways to handle this: Don’t poll for results. Instead, let RecordEngine tell you when it’s done:
  1. Upload the document with external_refs containing a reference ID from your system
  2. When the document is exported (status = Export), the outbound webhook fires with the full payload including external_refs
  3. Your automation uses external_refs to match the webhook payload back to the originating record in your system
This is the cleanest pattern — no polling, no delays, no wasted API calls.

Option B — Status Polling

If you need the results synchronously (e.g. a user is waiting on a web page):

Key Building Blocks

Parsing the Webhook Payload

The webhook payload is a JSON object. The most commonly used fields:

Iterating Over Line Items

Line items come as an array. In your automation platform, use an iterator/loop to process each one:
Most automation platforms have a built-in “For each” or “Iterator” module — feed it line_items from the payload.

Conditional Logic

Add conditions to your scenario to handle different document types differently:

Error Handling

Always add an error handler to your automation scenario. If the external system is down or returns an error, you want to:
  1. Log the failure (save to a data store or spreadsheet)
  2. Send an alert (email or WeCom message)
  3. Optionally retry after a delay
Without error handling, failed webhook deliveries disappear silently.

Testing Your Integration

1

Use webhook.site for initial testing

Before building your full scenario, point the RecordEngine webhook at webhook.site. Export a document and inspect the exact payload shape — field names, data types, nesting. This prevents surprises later.
2

Test with a real document

Use a real invoice or document that represents your most common case. Verify every field maps correctly to the destination system.
3

Test edge cases

Test with: a document with no line items, a document with a missing field, a document in Chinese, a very low confidence document. Confirm your scenario handles each gracefully.
4

Monitor the first week

After going live, check the Audit Log daily for webhook failures. Your automation platform’s execution history shows every run — review it for errors during the first week.

Any automation platform that supports webhooks and HTTP requests works with RecordEngine. Platforms with native connectors for common destinations (Xero, QuickBooks, Salesforce, HubSpot) reduce the amount of custom HTTP configuration needed. For WeCom integration specifically, confirm your chosen platform supports outbound HTTP requests to the WeCom API (some platforms block certain domains from China).