Start a flow from a ready spending rule

The nine templates of the gallery, the rule each one expresses, and how a template becomes a flow that runs.

5 min read

A template is a ready flow that expresses one rule about money or about a provider that fails. The gallery creates it as a draft of a new flow, and you read it, adapt it and publish it. This page is about the gallery of templates.

Where the templates are

Open AI Flows and its second tab, Templates. The templates are listed on the left; the one you choose is shown beside the list — its rule in a sentence with Create draft beside it, its flow, and How it works in three steps. The flow is drawn by the builder's own canvas: the whole draft you get, the refusals included, with the same nodes, names, branches and positions the builder opens it with. It cannot be edited there. The address keeps the template you chose, so a link opens that template.

Creating a flow from a template needs the flows:write permission — Organizations, projects and roles says which roles have it. Without it the templates and their pictures are still there to read.

The templates

TemplateThe ruleHow the flow carries it
Smart model choiceSpend on the strong model while the budget allows; when it does not, answer with a cheaper one instead of failingBudget Check before the call to gpt-4o. A refusal of the check, and a refusal, an error or a rate limit of that call, lead through Fallback to gpt-4o-mini. When that call is refused too, the request is refused with budget_exceeded
Request approvalA small job runs at once; a big one waits for a person before anything is heldCondition compares the size the caller declares in input.expected_tokens with 20 000. Above it, Require Approval waits for a decision, then the model is called. A rejection or a decision that never came ends the request with a refusal
Cache firstAn answer that is already known is not paid for againCache Lookup answers a repeated request from the cache, without a model call. On a miss gpt-4o-mini answers, and Cache Write keeps the answer for a day
Customer budget guardA call that does not fit the budget of the customer is refused before the provider is reachedBudget Check checks the budgets of the organization, the project, the operation and the customer before anything is held, and the hold of the model call is checked again. Either refusal ends the request with budget_exceeded. Capture & Release closes the hold after the call. A call already under way is not stopped halfway
Model by planA customer on a paid plan gets the strong model; everyone else a cheaper oneCondition checks whether input.plan, which the caller sends, is pro or business. Then gpt-4o answers; any other plan, or no plan at all, goes to gpt-4o-mini
Backup providerWhen OpenAI fails, the same request goes to Anthropic instead of failingAn error or an exhausted pool of gpt-4o leads through Fallback to claude-sonnet-4-5. The project needs a connection to Anthropic for it. When that call fails too, the request is refused with provider_unavailable; a refused spend of either call ends it with budget_exceeded
Limit on the expensive modelThe strong model has a monthly limit of its own; past it a cheaper one answersBudget Check has an allocation of its own: 50.00 a calendar month (UTC) for gpt-4o, counted by the estimates of the calls it let through. Past it — or when the budgets of the project refuse the call — Fallback leads to gpt-4o-mini
Flag expensive requestsA request estimated above $0.05 is marked in the trace, and answered as usualEstimate Cost prices the call to gpt-4o. Above 0.05, a Trace Note node writes a warning with the estimate into the trace of the execution, and the model answers either way
Defer background jobsA low-priority job waits; every other request is answered at onceCondition checks whether input.priority is low. Then Queue parks the execution for 15 minutes — the caller is answered that it waits, and reads the result later — and gpt-4o-mini answers after the wait

In every template a Reject Request node answers for one reason: a refused spend with budget_exceeded, a provider that did not answer with provider_unavailable, and in Request approval a person's no, or a decision that never came, with a code of its own. The exact code of a refusal stays in the trace of the execution, on the model node.

The nodes of the templates that deal with the money and the model have pages of their own: Budget Check, Require Approval, Capture & Release, AI Model and Fallback. The other nodes they use have pages too: Request, Condition, Estimate Cost, Trace Note, Queue, Cache Lookup, Cache Write, Return Response and Reject Request.

From a template to a running flow

1. Create the draft

Choose the template and press Create draft. Slen creates a flow named after the template in the language of the console, with the template as its draft — its nodes, its named branches and the texts of its refusals, of its approval and of its trace note in that language too, its codes as they are — and opens it in the builder. A second copy of the same template is another flow of the same name.

2. Read and adapt it

Open each node and check its settings: the models, the limits, the texts of the refusals. The models of the templates are OpenAI's — Backup provider calls Anthropic as well — so the project needs a connection to OpenAI, or a pool that serves it — Connections.

3. Bind an operation code

Open the Settings tab of the flow and bind the operation code your application sends — AI flows.

4. Publish it

Press Publish. Until then the flow runs nothing: a template never starts to spend on its own.

Where to go next