AI Inbox - Integration Guide

Integration Guide — AI Inbox, Multiple Subsidiaries

Developed by Phacet

How to connect your email inbox to your Phacet and activate results in your accounting system, Gmail, and team notifications.

This guide covers the technical setup for automating data flow in and out of the AI Inbox template. For what the template does and how to configure it, see the [AI Inbox — Multiple Subsidiaries template article].

Sending Emails to Your Phacet

Manual upload

Download the email attachment and copy the email metadata into Phacet directly. Suitable for testing or low volume (<10 emails/day). Not recommended as a permanent workflow.

Automated push (recommended)

Your automation tool monitors your email inbox and sends new emails with attachments to Phacet automatically. This is the recommended approach for any volume above a handful of emails per day.

Zapier setup

  1. Create a new Zap

  2. Trigger: "New Email Matching Search in Gmail"

    • Filter: emails with PDF attachments, or emails sent to a specific alias (e.g., [email protected])
    • Adjust the search filter to match your supplier email flow — too narrow and you'll miss documents, too broad and you'll process irrelevant emails
  3. Action: Send to Phacet — map these email fields to the corresponding Phacet input columns:

    Email fieldPhacet column
    PDF attachmentFile
    Sender display nameSender Name
    Sender emailSender Address
    Subject lineSubject
    Body textBody Content
    Received timestampReceived At
    Attachment filenameFilename
    Email IDEmail ID
    Thread IDThread ID
    Email web linkEmail Web Link
  4. Deduplication: Add a filter step to skip emails already processed, using the Email ID as unique key. This prevents duplicate processing if your trigger fires on updated emails.

Make setup

The logic is identical to Zapier:

  1. Trigger module: "Watch Emails" in Gmail (or Outlook equivalent)
    • Set the search criteria to match your supplier email flow
  2. Action module: HTTP request to Phacet API — map the same fields from the table above
  3. Deduplication: Use a filter module or the built-in "from date" parameter to skip already-processed emails

n8n setup

  1. Trigger node: Gmail Trigger (or IMAP Email Trigger for non-Gmail)
    • Configure label or search filters matching your supplier flow
  2. Action node: Send to Phacet using the Phacet node — map the same fields from the table above
  3. Deduplication: Add an IF node checking Email ID against previously processed IDs, or use n8n's built-in deduplication

Activating Results in Your Systems

The agent's decisions become real through three activation patterns. Each needs its own automation recipe.

1. Forward to accounting system

Route validated documents to the right entity's accounting system automatically.

When to use: You configured accounting system routing (Phase 3 in the template setup guide) and want validated documents to flow to Pennylane or your ERP without manual forwarding.

StepConfiguration
TriggerPhacet output: item processed
FilterFraud Status = SAFE and Subsidiary ≠ "Not identified"
ActionSend Email via Gmail → to the Pennylane/ERP supplier email, with original PDF attached

Key details:

  • The outbound email must attach the original PDF, not a Phacet summary or extracted text
  • The destination email is the per-entity supplier email you configured in Phase 3 — Phacet outputs this in the "Pennylane Email" column
  • Only SAFE items with an identified subsidiary should be routed — the filter prevents unscreened or unmatched documents from entering your accounting system

2. Apply Gmail labels

Organize processed emails in Gmail automatically by entity and document type.

When to use: You configured Gmail labels (Phase 4 in the template setup guide) and want your inbox organized without manual filing.

StepConfiguration
TriggerPhacet output: item processed
ActionGmail: Add Label to Email → using Email ID + Label Target Company + Label Document Type

Key details:

  • This recipe uses the Email ID from Phacet's output to identify which email to label in Gmail — it applies labels to the original email, not to a new message
  • Phacet outputs two label columns: "Label Target Company" (entity label ID) and "Label Document Type" (document type label ID)
  • No filter needed — every processed email gets labeled regardless of fraud status or match outcome

3. Notify on exceptions

Alert your team when items need human attention.

When to use: Always. This is the mechanism that surfaces flagged and suspicious items to the right people.

StepConfiguration
TriggerPhacet output: item processed
FilterFraud Status = SUSPICIOUS or Review Flag = "To Review"
ActionSlack message or email notification → with summary + link to Phacet Review

Key details:

  • Include in the notification: supplier name, document type, fraud status, and a direct link to the item in Phacet Review
  • Route SUSPICIOUS items to a security-aware team member or channel — these need evaluation, not just filing
  • "To Review" items can go to the general finance team — these are ambiguous classifications or unmatched entities, not security concerns

Integration Troubleshooting

ProblemLikely causeFix
Emails aren't arriving in PhacetTrigger filter is too narrow — wrong label, subject pattern, or attachment type filterCheck task history in your automation tool. Broaden filter conditions. Test with a known email that should match.
Duplicate documents processedTrigger fires on "new or updated" instead of "new only"Add deduplication filter using Email ID as unique key. In Zapier, use a filter step. In Make/n8n, use a filter module or conditional node.
Pennylane forwarding not workingTypo in supplier email address, or automation sends Phacet summary instead of original PDFVerify each address in your Phase 3 config by sending a test email manually. Check that the outbound action attaches the original PDF file, not the Phacet output text.
Gmail labels not appliedUsing label display name instead of label IDRetrieve actual label IDs using one of the methods above. The display name "Invoices" is not the ID.
Automation runs but Phacet shows no new itemsField mapping is incorrect — required columns are empty or mismatchedCompare your automation's output fields against the field mapping table above. Check that Email ID and File (attachment) are mapped correctly — these are the most commonly missed.
Notifications not firing for exceptionsFilter logic doesn't match Phacet output values exactlyCheck that your filter matches the exact strings: "SUSPICIOUS" (not "Suspicious"), "To Review" (not "to review"). Phacet outputs are case-sensitive.