Quick overview
This workflow runs daily to reconcile successful Paystack transactions against order records stored in n8n Data Tables, uses Groq to generate plain-language explanations for any mismatches, emails a reconciliation report via Gmail, and logs all exceptions to an exceptions Data Table for follow-up.
How it works
- Runs every day at 7am and sets reconciliation settings like currency, lookback window, amount tolerance, and report recipient.
- Calculates the payment and order lookup time windows, then fetches all successful Paystack transactions (with pagination) for the period.
- Loads recent orders from an n8n Data Table filtered by the configured order lookback date.
- Reconciles payments to orders using fixed rules (by payment reference first, then by email plus amount and date) and flags issues such as under/overpayments, currency mismatches, duplicates, and missing payments or orders.
- Sends the exception list to Groq to produce a short summary plus one explanation and next-step action per exception (and continues with built-in fallback text if the AI step fails).
- Builds an HTML email report, sends it via Gmail to the configured address, and upserts each exception into an n8n Data Table so the same exception key is not duplicated on reruns.
Setup
- Create two n8n Data Tables for orders and exceptions (for example, recon_orders and recon_exceptions) and select the correct table in each Data Table node.
- Add Paystack Bearer Auth credentials with your Paystack secret key and ensure the workflow currency and subunit settings match your Paystack account.
- Add Groq credentials for the LLM step and Gmail credentials for sending the daily report.
- Update the placeholders in the configuration step (business name and report recipient email) and adjust tolerance and lookback values to match your operations.