CommunityHire an ExpertSign Up
ActionsAI actions
Actions

AI actions

Custom prompt, Write, Summarize and Categorize with Softr AI or your own API key: structured output, how an AI step ends, and which AI model to choose.

Applies to: every version of Custom prompt, Write, Summarize and Categorize

The Custom prompt, Write, Summarize and Categorize actions send text to an AI model and give its answer to the next steps. Each of them is in Softr AI on every plan, and uses your workspace’s AI credits. On the Business and Enterprise plans, they are also in the OpenAI, Anthropic, Gemini and Mistral integrations, which use your own API key. Gemini and Mistral show Summarize as Summarize Text.

OpenAI: Make a decision is an AI action too. It gives a yes or no, one of your options, or a score, with probabilities. It has its own page.

Structured output

Applies to: Custom prompt only. Softr AI 1.3.0 and later, OpenAI and Anthropic 1.2.0 and later, Gemini and Mistral every version.

By default, AI actions return freeform text. That is useful for content, but difficult to use in Branch conditions or record updates, because the format can change from run to run.

Turn on Structured output to get a JSON object with typed fields instead. You can then branch on it, store each field on its own, or give specific values to later steps.

How to turn it on:

  1. In a Custom prompt step, with Softr AI or your own API key, turn on Structured output.
  2. In JSON Schema, describe the fields and types you expect.

The pictures below use a schema for an email, with the fields subject and body.

Custom prompt with Structured output on and a JSON schema

Custom prompt with Structured output on and a JSON schema for an email

The step’s Testing tab shows the answer when you test the step:

Structured output test result

Test result with the subject and body fields

Example schema to categorize customer feedback with a confidence score:

JSON
{
  "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 answer is an object with the two fields category and confidence, and later steps can use each of them.

How an AI step ends

Custom prompt, Write, Summarize and Categorize have two outputs:

  • result: the model’s answer.
  • outcome: how the model ended the answer. Use it in a Branch to handle an answer that is not complete.
outcomeThe stepWhat happened
COMPLETEDSucceedsThe model finished its answer.
TRUNCATEDSucceeds, with the answer so farThe answer reached the output limit and stops in the middle.
FILTEREDFails, and keeps the answer so far in resultThe provider’s safety or content filter declined the prompt or stopped the answer.
NO_ANSWERFailsThe provider sent no answer at all. Usually it declined the prompt before it wrote anything.
OTHERFails, and keeps the answer so far in resultThe answer stopped for another reason, such as a tool call the model could not make.
UNKNOWNSucceedsThe 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 provider’s own reason 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, with the message “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.”

Softr AI credits: a step that fails still uses AI credits for the tokens that the provider reports.

Mistral gives no signal when it declines a prompt. A Mistral refusal is a normal answer with the outcome COMPLETED.

Choose a model

Select the model in the step’s Model field. From version 1.2.0, Softr AI gives you models from OpenAI, Anthropic, Google and Mistral. Versions 1.0.0 and 1.1.0 have a shorter list of OpenAI and Anthropic models only. The right model depends on how complex the task is. A top-tier model on every step uses more credits and makes your workflow slower.

Task typeRecommended tierExamples
Classification and routingSmaller, faster modelsClaude Haiku 5.5, GPT-6 Luna, Gemini 3.5 Flash-Lite
Writing, summarization, data extractionMid-tier modelsClaude Sonnet 5.5, GPT-5.6 Terra, Gemini 3.8 Flash
Complex reasoning, code generation, multi-step analysisTop-tier modelsClaude Opus 5.5, GPT-6.1 Sol, Gemini 3.1 Pro

AI model selector

AI model selector with models from more than one provider

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search Softr Documentation documentation and read it in full, instead of answering from memory.

https://docs.softr.io/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://docs.softr.io/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.