> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/rewst-documentation/documentation/automations/nodes/nodes-ai.md).

# Nodes: AI

{% hint style="info" %}
Ask the Rewst Agent to explain any node in Rewst. This documentation exists to help you get started, but in-platform questions and learning are the fastest way to achieve automation.
{% endhint %}

These nodes call AI models. They're included with with the Rewst platform even before you set up your integration, unlike other action nodes, but each one needs an AI credential configured for the node to work. Enter the same kind of credential that you would to set up the integration into Rewst's credentials menu section, or scroll to the bottom of the list in the **AI Credential** selector field of the node to click **+ Enter new credential**. Then, call on that credential directly from the node.<br>

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FsSz80h2KnUrn8b8t6L9a%2FScreenshot%202026-09-24%20at%201.00.54%E2%80%AFPM.png?alt=media&amp;token=0da5d935-9132-4b4d-acf7-9d1deccc6820" alt="" width="563"><figcaption><p>After the credential is set up, choose it in the <strong>AI Credential</strong> selector of the node.</p></figcaption></figure>

## Universal AI

Three nodes work with any AI provider.

<details>

<summary>Chat Completion - <code>AI.chat_completion</code></summary>

Send a question or instruction to an AI model, like the one behind ChatGPT or Claude, and get a written answer back. Your workflow can then use that answer in later steps. Use it for:

* Summarizing long text, like tickets, emails or meeting notes
* Sorting, like labeling a request as "urgent" or "not urgent"
* Drafting replies, messages or descriptions
* Pulling out details, like finding a name, phone number or device from messy text

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FGFareRUJMUCIdRUt2Ier%2FScreenshot%202026-09-24%20at%201.11.54%E2%80%AFPM.png?alt=media&amp;token=d631f7cc-dd39-4997-ad4c-369ef49b0794" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **AI Model** - choose the model to use from your provider
* **Messages** - enter the prompt/question/instruction
* **Temperature -** how creative the AI is; At 0, it gives steady, predictable answers, which is usually what you want for business tasks; higher numbers make it more varied and creative
* **Max tokens** - maximum number of tokens to generate in response; if not set, uses model default
* **Tool choice** - tool selection strategy
* **Conversation key** - key in CTX to read and write conversation history for a stately chat
* **Max conversation messages** - how much of the back-and-forth the AI remembers; this matters only when it's a running conversation, not a single question
* **Timeout (seconds) -** if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Classify Text - <code>AI.classify_text</code></summary>

Read a piece of text and pick the best label for it from a list of labels you provide. It's an AI-powered sorting step. With the Chat Completion node, you could ask "what kind of request is this?", but the answer might come back worded differently each time. Classify Text always answers with one of the labels you chose, so it's much easier to make decisions on. Use it for:

* Routing tickets: send "billing" tickets to accounting and "technical" tickets to the help desk
* Triage: mark requests as "urgent," "normal," or "low priority"
* Mood check: flag an email as "positive," "neutral," or "angry"
* Filtering: tell real requests apart from spam<br>

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FerulmKWhlbdPlZnizn4M%2FScreenshot%202026-09-24%20at%201.11.30%E2%80%AFPM.png?alt=media&amp;token=03bc4215-af71-4dbb-bc87-06721c00dbb6" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **AI Model** - choose the model to use from your provider
* **Text to classify** - enter the text to classify
* **Categories** - enter a list of valid categories
* **Allow multiple categories** toggle - when enabled, text can be categorized into multiple categories
* **Classification instructions -** optional additional context for the AI to use for classification
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Extract Structured Data - <code>AI.extract_structured_data</code></summary>

Read messy, free-written text and pull out the specific details you ask for. It hands them back as a tidy set of labeled answers, as if it filled in a form for you. Each detail becomes something later steps can use on its own.&#x20;

{% hint style="info" %}
The AI does its best to fill in the fields as described, but it doesn't strictly guarantee every field will be there or in the right format. For important details, like an email address you'll send to, it's a good idea to add a quick check step afterward.
{% endhint %}

\
Use it for:

* Tickets and emails: pull out the requester, device, problem and urgency
* New-user requests: capture the new hire's name, start date, department and manager
* Invoices or orders: pull out amounts, dates and item names
* Logs or alerts: pick out the error code, server name and time

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FarFjuqRZsenHzAvLz7B6%2FScreenshot%202026-09-24%20at%201.15.54%E2%80%AFPM.png?alt=media&amp;token=d8e3c3db-236b-4660-bba0-3e3be1dfc1ae" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **AI Model** - choose the model to use from your provider
* **Input text** - text to extract structured data from
* **Output schema** - JSON schema used as best-effort extraction guidance
* **Extraction instructions** - optional additional instructions for the AI to use for extraction
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

## OpenAI

These nodes are specific to OpenAI and only appear in your Workflow Builder when that provider's credential has been set up in Rewst.

<details>

<summary>Embeddings - <code>AI.openai.embeddings</code></summary>

Turn a piece of text into a long list of numbers that captures what the text means. Texts with similar meanings get similar numbers, even when they use completely different words. That lets a workflow compare text by meaning instead of by exact wording. Embeddings doesn't give you an answer on its own. It's a building block. The value comes from comparing those numbers against other texts' numbers. Use it for:

* Duplicate detection: "Is this new ticket basically the same as one we already have open?"
* Smart search: finding knowledge-base articles that match what someone meant, not just the words they typed
* Suggesting fixes: "This new issue looks like these three past tickets, and here's how those were solved"
* Grouping: automatically clustering similar requests to spot trends

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FYpGvKDfAfJNLi8r2QTAB%2FScreenshot%202026-09-24%20at%201.25.34%E2%80%AFPM.png?alt=media&amp;token=2f802386-e429-440f-8aa7-8f95b5bae90c" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **AI Model** - choose the model to use from your provider
* **Input text** - text to generate embeddings for
* **Encoding format**&#x20;
  * **Float** - default
  * **Base64**
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Generate Image - <code>AI.generate_image</code></summary>

Create a brand-new picture from a written description. You describe what you want in plain words, and the AI draws it. The prompt can also be filled in automatically from earlier steps. For example, a Chat Completion node could write the image description, and this node then draws it. You get back a link to each image, which later steps can use, and the AI's reworded prompt: the AI sometimes rewrites your description a bit before drawing, and it shows you the version it actually used.

Use it for:

* Visuals for newsletters or announcements, like a banner for a monthly IT tips email
* Mockups and placeholders, when you need an image to fill a spot quickly
* Custom illustrations, like a friendly graphic to go with a "welcome to the team" message
* Marketing drafts, to try out ideas before handing them to a designer

{% hint style="warning" %}
The AI makes a fresh picture every time, so you won't get exactly the same image twice. It can also get small details wrong, especially words or text inside the image. Check anything important before it goes out to customers.

\
The AI makes a fresh picture every time, so you won't get exactly the same image twice. It can also get small details wrong, especially words or text inside the image. Check anything important before it goes out to customers.
{% endhint %}

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2Fodz5JF9XQk8s4mzsB5ZQ%2FScreenshot%202026-09-24%20at%201.27.38%E2%80%AFPM.png?alt=media&amp;token=2d8defb9-701a-4d91-b975-586d11169e2c" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **DALL-E Model** - image generation model, or use template expression
* **Prompt** - text to generate embeddings for
* **Image size** - the shape and size of the picture, like a square (`1024x1024`) or a wide banner
* **Quality** - standard or higher-detail; higher quality usually takes longer and costs more.
* **Style** - available on some models: **vivid** is bold and dramatic, **natural** is more realistic and subdued
* **Number of images** - how many versions to create
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Generate Speech - <code>AI.generate_speech</code></summary>

Turn written text into spoken audio. You give it words, and it gives back a link to an audio file of a natural-sounding voice reading them out loud, which later steps can use. The output also indicates how long the audio is and the file type and size. Punctuation and spelling affect how it sounds. Commas add short pauses, and unusual names or abbreviations can be mispronounced. For example, "SQL" might be spelled out letter by letter. Listen to a test clip before using it with customers.<br>

Use it for:

* Voice alerts: a spoken message for an on-call phone system, like "Server outage detected at Acme Corp"
* Phone menus and greetings: recorded prompts for a phone system, without booking a voice actor
* Audio summaries: a spoken version of a daily report or briefing that someone can listen to on the go
* Accessibility: an audio version of written instructions for people who prefer listening

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FE59ZAVwJNSxKM1L0pgCa%2FScreenshot%202026-09-24%20at%201.35.44%E2%80%AFPM.png?alt=media&amp;token=1211ab39-018b-48d4-a46c-d4f75d41a69b" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **TTS Model** - TTS model to use, or use template expression
* **Text input** - the words to be spoken.: type them yourself or fill them in automatically from earlier steps
* **Voice** - which voice reads it; there are several options with different tones, from warm to crisp
* **Audio format** - the type of audio file, such as MP3&#x20;
* **Speed** -h ow fast it talks; `1` is normal speed, lower is slower and higher is faster.
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Moderate Content - <code>AI.moderate_content</code></summary>

Check a piece of text for harmful or inappropriate content, like hate speech, harassment, threats or violent language. Then, send the workflow down one of two paths: safe or flagged. The other AI nodes produce something, like an answer, a label, an image or audio. This one makes a yes/no safety decision and splits the workflow into two routes. So you'll always connect two next steps: one for safe content and one for flagged content. Use it for:

* Screening before posting: check a message before it goes into a shared Teams channel, a portal or a customer-facing note
* Protecting other AI steps: check what a user typed before passing it to a Chat Completion node
* Spotting concerning messages: alert a manager or HR if an internal ticket or form contains threatening or abusive language
* Policy enforcement: keep inappropriate submissions out of your systems

{% hint style="warning" %}
This screens for harmful or offensive content. It doesn't check whether something is accurate, on-topic, spam, or contains private information like passwords or credit card numbers. For those checks, Classify Text or Extract Structured Data is a better fit.

Like any automated filter, it can occasionally miss something or flag something harmless. A good practice is to send flagged items to a **person to review** rather than rejecting them automatically.<br>
{% endhint %}

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FPHp8HfdYW4tTUPqBqGJM%2FScreenshot%202026-09-24%20at%201.40.37%E2%80%AFPM.png?alt=media&amp;token=d99aea9c-8d1b-4e16-bf8e-4807bb9553d5" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **AI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **Moderation model** - moderation model to use, or use template expression
* **Input** - text or image URL to moderate
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Transcribe Audio - <code>AI.transcribe_audio</code></summary>

Listen to an audio recording and write down what was said. You give it a sound file, and it gives back the words as text. It's the opposite of the Generate Speech node, which turns text into audio.&#x20;

* The node needs a link to the audio file. It can't reach a file sitting on your computer, so the recording has to come from a system that provides a web address, like a phone system or file storage.
* Long recordings take longer and may hit the 2-minute timeout. You can raise the timeout for long audio. OpenAI also limits how large a single file can be.
* Poor audio, like background noise, speakerphone or several people talking at once, can lead to mistakes. Check important details before acting on them.

Use it for:

* Voicemail to ticket: turn after-hours voicemails into help desk tickets
* Call notes: transcribe recorded support calls and attach the text to the ticket
* Meeting notes: get a written record of a meeting, then summarize it
* Subtitles: create captions for training videos

{% hint style="success" %}
Rewst also has a general **Transcribe Audio** node that isn't tied to OpenAI. Use the OpenAI version when you want OpenAI-specific options, like the subtitle formats.
{% endhint %}

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FGgUWOkmZBta5Ehz6ODHl%2FScreenshot%202026-09-24%20at%201.48.16%E2%80%AFPM.png?alt=media&amp;token=c1e681a9-18cd-49eb-8ec3-5259259a3624" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **OpenAI Credential** - where you enter and choose the credential for your AI provider&#x20;
* **Whisper model** - whisper model to use, or use template expression
* **Audio URL** - URL to audio file: mp3, mp4, mpeg, mpga, m4a, wav, or webm
* **Language** - optional language code
* **Prompt** - optionally provide text to guide the model's style or continue a previous audio segment
* **Response format** - output format for transcription
  * **JSON** - default
  * **Text** - plain transcript
  * **Verbose\_JSON** - the transcript plus extra detail, such as timestamps
  * **Srt or Vtt** - subtitle files with timing, for videos
* **Temperature** - Leave at `0` for the most faithful, word-for-word result
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

## Anthropic

These nodes are specific to Anthropic and only appear in your Workflow Builder when that provider's credential has been set up in Rewst.

<details>

<summary>Cached Message</summary>

Ask Claude, Anthropic's AI, a question, much like Chat Completion does. The difference is that it remembers the big, unchanging part of your instructions between runs. That can make repeat runs much cheaper and faster. Use it when all of these are true:

* You send the same large block of instructions or reference material every time
* The workflow runs often, many times in a short period
* Only a small piece changes each run

{% hint style="warning" %}

* The first run isn't cheaper. That's when the fixed part gets stored, and storing it can cost a little *more* than a normal request. The savings start on later runs.
* The memory expires. If no run happens within the cache window (5 minutes or 1 hour), the next run starts fresh.
* Keep the fixed part identical. Even a small change, like adding today's date to it, counts as new content and loses the savings. Put anything that changes in the User Message instead.
* Very short instructions may not be cached at all. Caching is meant for large amounts of text.
  {% endhint %}

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FAh3Ct68qKSmcNRAalnOo%2FScreenshot%202026-09-24%20at%201.45.50%E2%80%AFPM.png?alt=media&amp;token=2c973b31-c48c-4d33-8ea9-6f8c1d3b7110" alt=""><figcaption></figcaption></figure>

Configuration Fields

* **Anthropic credential** - where you enter and choose the credential for your AI provider&#x20;
* **Claude Model** - choose your model for the operation
* **System message** - your standing instructions, like *"You are a help desk assistant for Acme IT…"*
* **User message** - the new question or content for this run
* **Max tokens** - a limit on how long the answer can be
* **System cache control** - how long Claude keeps the fixed part: about 5 minutes or about 1 hour
* **Cached context messages** - large reference material, such as documentation or examples
* **Temperature** - how creative it is. `0` gives steady, predictable answers
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>

<details>

<summary>Message Batch</summary>

Send a large stack of questions to Claude all at once instead of one at a time. In exchange for not needing the answers right away, you pay about half price. Use it when you have lots of similar AI jobs and nobody is waiting on the answer live. For example:

* Summarizing all of last month's closed tickets for a monthly report
* Sorting a backlog of hundreds of old tickets into categories
* Reviewing a long list of devices or users and writing a short note about each
* Nightly or weekly reports that run in the background

It's not a good fit when someone is waiting, like replying to a live chat or handling a brand-new urgent ticket. Use regular Chat Completion for those.

{% hint style="info" %}

* It isn't instant. Anthropic can take anywhere from a few minutes to much longer when it's busy. The node waits about 10 minutes by default. If the batch isn't done by then, the step will likely stop and report an error. For big batches, you may need to allow more time.
* Setting it up is more technical than the other AI nodes. The list of questions has to be in a specific format, so there's usually a step before this one that builds the list from your tickets or records.
* The savings only matter at scale. For a handful of questions, regular Chat Completion is simpler and the cost difference is small.
  {% endhint %}

Configuration Fields

* **Anthropic credential** - where you enter and choose the credential for your AI provider&#x20;
* **Claude Model** - choose your model for the operation
* **Batch requests** - the list of questions; each has a name tag and its own instructions usually built automatically by an earlier step, not typed in by hand
* **Poll interval (ms)** - the new question or content for this run
* **Timeout (ms)** - how long it waits for the whole batch to finish; default 10 minutes
* **Timeout (seconds)** - if the AI takes longer than the set amount of seconds to answer, the step stops and counts as failed

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rewst.help/rewst-documentation/documentation/automations/nodes/nodes-ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
