Documentation Index
Fetch the complete documentation index at: https://docs.affzero.com/llms.txt
Use this file to discover all available pages before exploring further.
What it does
The Generate Invoice Number step uses AI to analyze your invoice number pattern and generate the next number in a local, per-automation sequence. It understands common formats — sequential numbers, year-based prefixes, zero-padded series, alphanumeric formats — and continues the pattern automatically. The step produces one variable (the next invoice number) that you can use in Create Invoice steps, email bodies, or any downstream step.Using the global sequence instead? For most users the better option is to configure the global Invoice Numbering setting under Invoices → Invoice Numbering. That makes
{invoice_number_global} available automatically inside every Create Invoice step — no separate numbering step needed. Use this step when you need a secondary or automation-specific sequence alongside the global one.Global vs Local — What’s the difference?
| This step (local) | Global sequence | |
|---|---|---|
| Variable | {invoice_number_local} (default, customisable) | {invoice_number_global} |
| Scope | This automation only | All automations |
| Configured in | This step’s config | Invoices → Invoice Numbering |
| When generated | When this step runs | Inside the Create Invoice step |
When to use it
- You need a separate invoice sequence for a specific automation (e.g. a different prefix for advertiser billing vs affiliate billing)
- You want the sequence to be entirely self-contained within one automation
- You already have a global sequence configured but need an additional series for this workflow
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 used for the generated number variable. Defaults toinvoice_number_local. You can change it if you have multiple Generate Invoice Number steps in one automation (e.g. invoice_number_affiliate, invoice_number_advertiser).
The variable will be available as {invoice_number_local} (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”
Each run of this step consumes one AI call for complex patterns. Simple numeric formats (e.g.
INV-001 → INV-002) are handled deterministically without an AI call.This step generates the next logical number based on the pattern — it does not check your records to guarantee uniqueness. Make sure you’re providing the most recent example numbers, and that automations using the same local sequence do not run in parallel.

