Refused e-invoices explained and fixed in Fatture in Cloud
When the exchange system refuses an e-invoice, this flow explains why, logs it, corrects it from the client record when it can and asks finance before filing it again.
The prompt
When the exchange system refuses one of our e-invoices in Fatture in Cloud, read the rejection reason and explain it in plain words. Log every refusal in our tracking sheet in Google Sheets. If the client record in Fatture in Cloud already has the right recipient code, certified email, VAT number, tax code or address, correct the invoice and check it against the schema. Then ask our finance owner in Slack, with File it again and Leave it with me buttons, and wait for the answer. If there's nothing to fix it from, or the check fails, tell finance in Slack what needs fixing. When an e-invoice is accepted, save its XML to our Google Drive.
FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.
The flow
Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. How importing works
What each step does
- E-invoice status changed Starts the flow when the status of an issued e-invoice changes in Fatture in Cloud.
- Refused or accepted? An accepted e-invoice has its XML downloaded and saved to your Google Drive for the company's own records. A refused one goes to the rejection path, and any other status ends the run.
- Explain the rejection An AI agent takes the refusal code and reason from Fatture in Cloud and turns them into a sentence finance can act on. It also checks whether the client's current record holds the corrected value, and never guesses one that isn't there.
- Log it in the tracking sheet Adds a row with the date, invoice, client, amount, code, explanation and fix to your tracking sheet in Google Sheets, so the backlog is visible before month-end.
- Fix found in the client record? When the client record holds the correction, the flow fixes the invoice. When it doesn't, finance gets a Slack message saying what was refused and what to do.
- Correct the invoice Replaces the client data on the invoice with the values from the client record and checks it against the exchange system's schema without sending anything. Lines, amounts and numbering stay as they are, and if the correction fails, the refusal still goes to finance in Slack.
- Ask the finance owner Posts the refusal, the explanation and what was changed to finance in Slack, with two buttons, File it again and Leave it with me.
- Wait for the finance owner's answer The run waits for the click, because filing can't be recalled. File it again files the corrected invoice with the exchange system, and Leave it with me says in the Slack thread that the invoice is corrected but not filed.
Before you turn it on
- Connect your Fatture in Cloud, Google Sheets, Google Drive and Slack accounts. If your Fatture in Cloud login reaches more than one company, set the Company ID in the Fatture in Cloud settings.
- Add your Anthropic key in the flow setting Anthropic key.
- Put the URL or ID of your tracking spreadsheet in the flow setting Tracking sheet. Its first sheet needs the columns Date, Invoice, Client, Amount, Code, Reason and Fix.
- Copy the URL of the block Wait for the finance owner's answer into the flow setting Answer link. The Slack buttons open it.
- Pick your Slack channel in the three Slack steps. Pick a Google Drive folder in Save the XML to Google Drive if you don't want the files in your Drive root.