What it does
The Generate Invoice Number step uses AI to analyze your existing invoice number pattern and generate the next number in the sequence. It understands common formats — sequential numbers, year-based prefixes, zero-padded series, alphanumeric formats — and continues the pattern automatically. This step produces one variable (the next invoice number) that you can use in Create Invoice steps, email bodies, or any downstream step. Each run of this step consumes one AI call.When to use it
- You want invoice numbers to follow a consistent format automatically (e.g.
INV-2026-0047) - You’re generating invoices on a schedule and don’t want to track numbering manually
- Your invoice format includes the year and resets at the start of each year
Configuration
Examples
Paste 2 to 4 recent invoice numbers from your own records. The AI analyzes the pattern from these examples. Example inputs:| If your format is… | Enter examples like… |
|---|---|
| Simple sequential | INV-001, INV-002, INV-003 |
| Year + sequence | INV-2026-001, INV-2026-002 |
| Year + zero-padded | 2026-0045, 2026-0046, 2026-0047 |
| Custom prefix | ACME/2026/0010, ACME/2026/0011 |
Pattern Description (optional)
Add a plain-English description of the pattern for extra clarity, especially for complex formats:Regex (optional)
If you need the generated number to match a specific format exactly, enter a regex pattern:Variable Name
The name to use for the generated number variable. Defaults toinvoice_number. You can customize it if you have multiple Generate Invoice Number steps in one automation (e.g. invoice_number_a, invoice_number_b).
The variable will be available as {invoice_number} (or your custom name) in all subsequent steps.
Example Output
Given examplesINV-2026-044, INV-2026-045, INV-2026-046:
Tips
- Always provide at least 2 examples — the AI needs a pattern to follow, not just one number
- Include context about year resets in the Pattern Description if your series resets annually
- Test before scheduling — run the step manually first to confirm it produces the expected output
- If you have an existing “last used” invoice number that isn’t in the examples, mention it in the Pattern Description: “Last used number was INV-2026-046”
The AI generates the next logical number based on the pattern — it doesn’t check your records or database to ensure uniqueness. Make sure you’re feeding it the most recent example numbers each time, or that your automation runs sequentially (not in parallel) to avoid duplicate numbers.

