AI Variables
|
Variable |
Action or Value |
Example |
|
[TOKENLIMITUSER()] The token limits are configured in the Admin / Main Options / AI panel |
Returns the configured End User token limit |
5000000 |
|
[TOKENLIMITADMIN()] The token limits are configured in the Admin / Main Options / AI panel |
Returns the configured Admin User token limit |
5000000 |
|
[TOKENUSAGEUSER(From|To)] |
Returns the amount of tokens used by End Users in a given time frame From - Date From - defaults to the first day of the current month To - Date To - defaults to the last day of the current month The From and To dates are read as UTC dates, and the default month is the current UTC month — matching the usage reports, the limits and billing, so a workflow comparing usage against a limit always sees the same numbers the system enforces. |
2427690 |
|
[TOKENUSAGECONFIG(From|To)] [TOKENUSAGEADMIN(From|To)] |
Returns the amount of tokens used by Builder/Admin features in a given time frame From - Date From - defaults to the first day of the current month To - Date To - defaults to the last day of the current month The From and To dates are read as UTC dates, and the default month is the current UTC month — matching the usage reports, the limits and billing, so a workflow comparing usage against a limit always sees the same numbers the system enforces. |
3445690 |
|
[TOKENUSAGEAUTOMATION(From|To)] [TOKENUSAGEWORKFLOW(From|To)] |
Returns the amount of tokens used by Process/Workflow Actions in a given time frame From - Date From - defaults to the first day of the current month To - Date To - defaults to the last day of the current month The From and To dates are read as UTC dates, and the default month is the current UTC month — matching the usage reports, the limits and billing, so a workflow comparing usage against a limit always sees the same numbers the system enforces. |
7642234 |
|
[TOKENLIMITAUTOMATION] [TOKENLIMITPROCESS] [TOKENLIMITWORKFLOW] |
Returns the configured Workflow (Automation) token limit. Returns **0** if Workflow AI is disabled, or **-1** if it has been set to No monthly limit. Any other number is the monthly limit in weighted tokens. |
5000000 |
Working with the token limit values
The three limit variables return the raw setting, so a rule can tell the difference between a real limit, a disabled pool and an uncapped one:
- A positive number is the monthly limit in weighted tokens.
- 0 means that pool is switched off. Nothing in it will run.
- -1 means No monthly limit, and is only possible on the Automation pool.
This matters most when you calculate a percentage. Dividing usage by the limit is only meaningful when the limit is positive — against 0 you would be dividing by zero, and against -1 you would get a negative percentage that looks like plenty of headroom on a site that in fact has no ceiling at all. Always confirm the limit is greater than zero before comparing against it.
Example: your own "approaching the limit" alert
DocMgt does not send limit warning emails of its own, because a rule you write beats a threshold we pick. A scheduled workflow, a rule and a Send Email action give you the alert you actually want.
Build a workflow that runs on a daily schedule, and put these rules on the Send Email action so it only fires when there is something worth saying:
- [TOKENLIMITAUTOMATION] is greater than 0 — skips sites where Workflow AI is switched off or deliberately uncapped, neither of which can be "close to the limit".
- [TOKENUSAGEAUTOMATION] is greater than the threshold you care about — for a fixed limit you can simply type the number that represents your warning point.
Then write the email body using the variables directly, so the message carries the figures:
Workflow AI usage for this month is [TOKENUSAGEAUTOMATION] of [TOKENLIMITAUTOMATION] weighted tokens.
AI workflow actions will stop running when the limit is reached. Raise the limit under Admin > AI Configuration > AI Settings Settings if this month's processing needs more.
A few refinements worth knowing:
- Run it daily, not hourly. The pool is a monthly figure and moves slowly; a daily check gives plenty of warning without a stream of mail.
- One alert or several. Nothing stops you adding a second action at a higher threshold, so you get an early heads-up and a final warning.
- Both date arguments are optional. [TOKENUSAGEAUTOMATION] on its own covers the current calendar month, which is what the limit applies to. Supply From and To only when you want a different window for reporting — a rule that compares against the limit should always use the default month.
- The same pattern works for the other two pools using [TOKENUSAGEUSER] with [TOKENLIMITUSER], or [TOKENUSAGECONFIG] with [TOKENLIMITCONFIG]. Neither of those can be set to No monthly limit, but the "greater than 0" rule is still worth keeping so the alert stays quiet on a site where that pool is switched off.