AI in workflows: generate, extract, classify and decide
Use AI in a Softr workflow to write, summarize, categorize, run your own prompt or decide on a path, with Softr AI or with your own AI provider API key.
AI steps read text and data in a workflow and write, summarize, categorize or decide. Use them to draft replies, sort incoming requests, enrich records or route a run.
AI steps
| Step | What it does |
|---|---|
| Write | Writes text from your instructions, such as a reply or a description |
| Summarize | Shortens a text to its key points |
| Categorize | Puts a text into one of the categories you list |
| Custom prompt | Runs your own prompt, with free text or a structured answer |
| Make a decision | Answers yes or no, picks one option from a list, or gives a score, to route the run. OpenAI step, from 2 to 255 options or 2 to 10 score levels |
| Image steps | Create an image from a prompt: Generate image (Image 2) in OpenAI, Nano Banana 2 (image) in Gemini, and Flux via Replicate and Pruna via Replicate in Replicate |
To read a PDF or a web page before an AI step, use Extract PDF or Scrape webpage. See Steps.

Softr AI or your own provider
Each AI step runs on Softr AI or on your own account with an AI provider:
- Softr AI runs models from OpenAI, Anthropic, Google and Mistral, and uses your workspace’s AI credits.
- Your own key for OpenAI, Anthropic, Gemini, Mistral or DeepSeek bills your provider account directly. Connect the account as an integration first. AI steps on your own key need the Business plan or above.
Choose a model
Pick the model by the task. The most capable model costs more credits and slows the workflow down, so avoid it on every step.
| Task | Model to start with |
|---|---|
| Classify and route | A small, fast model |
| Write, summarize, extract data | A mid-size model |
| Reason over many steps, write code | The most capable model |

Get a structured answer
By default, AI steps return free text. That works for writing content, but the format can vary, so it is hard to use in a Branch condition or a record update.
Turn on Structured output to get a JSON object with typed fields instead. You can then branch on it, store single fields, or pass specific values to later steps.
To turn it on:
- In a Custom prompt step, with Softr AI or your own key, turn on Structured output.
- Provide a JSON schema that describes the fields and types you expect.
Structured output needs Softr AI 1.3.0 or later, or OpenAI and Anthropic 1.2.0 or later. Every version of Gemini and Mistral has it.

This schema categorizes customer feedback with a confidence score:
{
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": ["bug", "feature_request", "billing"]
},
"confidence": {
"type": "integer",
"description": "Confidence score from 0 to 100"
}
},
"required": ["category", "confidence"]
}With this schema, the AI returns exactly two fields, category and confidence, that you can use in later steps.

How an AI step ends
Custom prompt, Write, Summarize and Categorize have two outputs:
result: the answer of the model.outcome: how the model ended the answer. Use it in a Branch to handle an answer that is not complete.
outcome | The step | What happened |
|---|---|---|
COMPLETED | Succeeds | The model finished its answer. |
TRUNCATED | Succeeds, with the answer so far | The answer reached the output limit and stops in the middle. |
FILTERED | Fails, and keeps the answer so far in result | The safety or content filter of the provider declined the prompt or stopped the answer. |
NO_ANSWER | Fails | The provider sent no answer at all. Usually it declined the prompt before it wrote anything. |
OTHER | Fails, and keeps the answer so far in result | The answer stopped for another reason, such as a tool call that the model could not make. |
UNKNOWN | Succeeds | The provider gave no reason. |
When the step fails, the run details show one of these messages:
FILTERED: “The AI provider declined the prompt or stopped the answer with its safety or content filter. Change the prompt and try again.”NO_ANSWER: “The AI model returned no answer. The provider may have declined the prompt. Change the prompt and try again.”OTHER: “The AI model stopped before it finished the answer (finish reason: …).” The reason of the provider replaces the dots.
A cut-off answer is a success, so the workflow continues. To catch it, add a Branch after the AI step that checks whether outcome is TRUNCATED. With Structured output on, a cut-off answer is not valid JSON, so the step fails instead. The message is “The AI response was cut off because it reached the maximum output length. Please ask for a shorter response or split the request into smaller steps.”
Mistral gives no signal when it declines a prompt. A Mistral refusal is a normal answer with the outcome COMPLETED.
Route a run with AI
Let an AI step classify or analyze data, then use a Branch to route the run on the result.
Route on a category
The Categorize step outputs a category value. The Branch checks it and sends the run down the matching path. Each path can notify a different team and update the record with the category.
Route on confidence
For more control, use a Custom prompt with Structured output that returns a category and a confidence score. Then branch on the confidence:
The AI handles the clear cases, and a person reviews the unclear ones. See Human in the loop for the review step.
Send only the records that matter
Sending all your records in one AI prompt is expensive and slow, and the answer is often worse because the AI has too much to sift through.
Instead, use two passes. A small AI model first picks the relevant records, and the workflow passes only those records to the main AI task.
The first pass is cheap, because a small model reads short titles and picks the relevant ones. The second pass is focused, because the larger model receives only the few records that matter. The total cost is lower than one large prompt.
For example, you keep 50 marketing insights in a database, and a user asks for a LinkedIn post about one product. The workflow sends the 50 titles to a small model, which picks “LinkedIn post framework”, “Product X specs” and “Brand voice guidelines”. The workflow then fetches those 3 records and passes them to a larger model to write the post.
Credits
AI steps on Softr AI use AI credits, based on the size of the prompt and the answer. A step that fails still uses credits for the tokens that the provider reports. Each run shows the credits it used. See AI credits.