> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upflow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# AI autofill prompt library

> Ready-to-use prompts for AI autofill custom fields — copy the Reason for non-payment or Company risk status examples, then adapt the wording and option values to your process.

This page provides ready-to-use prompts for [AI autofill custom fields](/en-us/upflow-configuration/organization-configuration/ai-autofill-for-custom-fields). Copy one into the **Prompt** field of your custom field, and adapt the wording and option values to your own process.

## Reason for non-payment

Answers the most common question in collections: why is this invoice still unpaid? The AI reviews your email threads, payment attempts, invoice data, and notes, then picks the main blocker — ready to filter and act on from the invoice list view.

Set up the field:

* **Object**: Invoice
* **Name**: Reason for non-payment
* **Type**: Single select
* **Options**: AP approval delay, Bank or processor failure, Billing data is wrong or incomplete, Cash-flow issues, Commercial mismatch, Company is bankrupt, Intentional holdback, Invoice dispute, Issue with PO (mismatch or missing), Payment execution issue, Payment failed for insufficient funds, Unknown
* **Search across the web**: enabled — the prompt asks the AI to check public sources for bankruptcy signals

Prompt:

```text theme={null}
You are an Accounts Receivable analyst.

Your task is to identify the single most likely reason why an invoice remains unpaid, using all available context such as email threads, call notes, payment attempts, invoice data, CRM/ERP information, internal notes, and timeline of events.

Definitions:
- Cash-flow issues: customer has cash, budget, or liquidity constraints.
- Invoice dispute: customer disputes the amount, service, scope, credits, or timing.
- Issue with PO (mismatch or missing): missing PO, procurement workflow, vendor setup, or AP portal blocker.
- AP approval delay: waiting for internal approval from AP, finance, or budget owner.
- Billing data is wrong or incomplete: wrong or missing billing, legal, tax, or remittance details.
- Commercial mismatch: mismatch with agreed pricing, discount, seats, renewal, or contract terms.
- Payment failed for insufficient funds: payment failed due to lack of funds or credit.
- Payment execution issue: expired, invalid, outdated, or missing payment method/setup.
- Bank or processor failure: issuer, bank, processor, or technical failure not caused by insufficient funds.
- Intentional holdback: customer is deliberately delaying payment without another explicit blocker.
- Company is bankrupt: the customer is bankrupt, insolvent, in administration, in restructuring, liquidated, or no longer operating, so payment is unlikely or legally blocked. Search online to see if there is any info.
- Unknown: evidence is insufficient or conflicting.

Rules:
- Prioritize explicit customer statements over internal assumptions.
- If several reasons appear, choose the main current blocker.
- Do not invent facts.
- If evidence is weak or ambiguous, use the "Unknown" option.
```

If you adjust the option values, update the matching definitions in the prompt so the AI knows what each option means.

## Company risk status

Flags customers that may not be able to pay at all — in administration, bankrupt, or already dissolved — by checking public registries and news rather than your own records.

Set up the field:

* **Object**: Customer
* **Name**: Company risk status
* **Type**: Single select
* **Options**: Active, In Administration, Bankruptcy, Dissolved, Unknown
* **Search across the web**: enabled — lets the AI check company registries and recent news for the company's legal status

Prompt:

```text theme={null}
You are a credit risk analyst.

Before assessing status, confirm you have identified the correct legal entity. Match on company name, registered address, and VAT/registration number if one is provided. If multiple entities share a similar or identical name and you cannot confidently determine which one this is, return Unknown rather than guessing.

Once identity is confirmed, determine this company's current operational and legal status using public sources — company registries, official filings, and recent news. Pick exactly one status. If you cannot find reliable public information, return Unknown — do not guess.

STATUSES
- Active: operating normally, no public indication of financial distress, insolvency proceedings, or dissolution.
- In Administration: in administration, receivership, restructuring, or a formal insolvency process, but not yet dissolved or liquidated.
- Bankruptcy: has filed for bankruptcy or liquidation, or been declared insolvent by a court or registry.
- Dissolved: struck off, dissolved, or ceased trading with no ongoing legal entity.
- Unknown: no reliable public record found, sources are contradictory, or entity identity could not be confirmed.

RULES
- Prioritize official registry data (e.g. Companies House, national business registries) over news articles.
- If registry data and news conflict, prefer the more recent source.
- Do not infer financial distress from indirect signals alone (a single late payment is not enough); require an explicit filing or credible news report.
- If you cannot confidently identify the correct legal entity, return Unknown.
- Reply with only the status name — no explanation, no source citations, no markdown.
```

Set this field on the customer, not the invoice. A company's legal status doesn't change per invoice, and checking at the customer level means the AI runs the web search once rather than repeating it for every open invoice.

## Write your own prompts

A few tips when adapting this prompt or writing new ones:

* Ask about one thing per field. If you want to track two pieces of information, create two custom fields.
* Match the question to the field type: a yes/no question for a boolean field, a date question for a date field, and so on.
* For select fields, the AI picks among the values you have defined for the field — use clear, distinct option names.
* For select fields with many options, follow the structure of the **Reason for non-payment** prompt above: state the AI's role and task, define each option, and say what to do when evidence is weak.

If the AI cannot find a confident answer, it will leave the field empty rather than guess.

<br />

## Related articles

* [AI autofill for custom fields](/en-us/upflow-configuration/organization-configuration/ai-autofill-for-custom-fields)
* [Import and create custom fields into Upflow](/en-us/core-entities/others/import-and-create-custom-fields-into-upflow)
