AI Prompt Action Type
The AI Prompt action type sends a prompt to the AI whenever the action is triggered, then uses the AI’s answer inside your process - for example, summarizing an uploaded document into a field, classifying a request, or deciding which branch of a decision tree to follow.
To set up an AI Prompt action:
-
On the desired template, click the Automated Actions icon in the template designer menu
-
Give the action a name and select AI Prompt as your Action Type
-
Select a trigger and add any conditions
-
In Action setup, complete the settings below
AI Prompt settings
Section titled “AI Prompt settings”-
AI Prompt Type - Select Custom to write your own prompt, or choose a predefined prompt type such as PDF Splitter
-
AI Role Description - An optional description of the role the AI should play (for example, “You are a thorough AI financial analyst”). Shown only when the prompt type is Custom
-
Natural Language Prompt - The instructions for the AI. The more detailed and specific the prompt, the better and more reliable the results. Pro tip: ask the AI to respond using specific, predictable words that you can use in the success formula below. Use the Insert Field Token button to include values from your process
-
AI Model - Choose the level of intelligence needed
-
File Attachment (If Necessary) - Use a file attachment field token to send files from the process along with the prompt. Images, PDFs, Word documents, Excel spreadsheets, and text-based files (such as .txt, .csv, and .json) are supported. Very large text files are trimmed to their beginning, and the AI is told when that happens. There is a size limit on what the AI can read in one go - see When a file is too large below
-
How to Determine Success? (Optional) - A semicolon-separated list of responses to be considered successful, or a formula that evaluates to true or false. If provided, any response not in the list (or a formula that evaluates to false) is considered a failure
-
Store Result in Field - Optionally select the process field in which to store the AI’s answer
Asking for JSON
Section titled “Asking for JSON”When you ask the AI to answer with JSON, only the JSON is kept. Any sentence the AI writes before or after it, and the code block it wraps the JSON in, are discarded before the answer is stored in a field or matched against a task response. This holds even when the AI adds a caveat at the end, such as a note that a value in the document did not match one of the choices you listed.
There is one shortcut worth knowing: if the JSON has exactly one property, the value of that property is stored rather than the whole JSON. Asking for {"decision":"Approved"} puts Approved in the field, which is usually what you want for a single answer. Ask for two or more properties when you want the JSON itself.
Instructions go in the prompt, not in the file
Section titled “Instructions go in the prompt, not in the file”Write everything you want the AI to do in the Natural Language Prompt. The contents of an attached file are treated as material to work on, never as instructions to obey, so a note that tells the AI what to do will not be followed if you put it inside an attached file: in a spreadsheet cell, in a document, or as text in an image.
This protects your processes. Attachments often reach a process from outside your company, through a public form, an emailed reply, or a file a supplier sent you, and nothing inside them should be able to change what your automation does.
The subject matter of a file is still read normally. If you attach a policy or a procedure that says “approve when the total is under $5,000”, the AI uses that as information when it answers your question.
When a file is too large
Section titled “When a file is too large”The AI can read a large amount in one go, but not an unlimited amount. A single PDF can be around 30 MB. Images and other documents need to be smaller, and everything attached to one prompt shares the same allowance - so several medium-sized files together can reach the limit even when no single one of them would.
If an attachment is too large, the action fails and nothing is sent to the AI. It does not quietly go ahead without the file. The process audit trail records which file was too big, so you can see exactly what happened rather than wondering why an answer looks thin.
This matters because the alternative would be worse. An AI asked to review a contract it was never given will still answer, and it will sound just as confident as it would have with the contract in front of it. Failing is the honest outcome.
If you hit the limit, the usual fixes are to split the document into sections and attach them to separate steps, or to reduce the file’s size before it enters the process - a scanned PDF is often many times larger than it needs to be, and rescanning it at a lower resolution can shrink it dramatically without losing anything the AI needs to read.
Completing a task with the AI’s answer
Section titled “Completing a task with the AI’s answer”Use the Complete Task step to have the action complete a process task once the AI responds:
-
If the AI’s answer exactly matches the name of one of the task’s responses, that response is selected - this lets the AI drive your decision tree directly
-
Otherwise, the How to Determine Success? setting decides whether the task is completed with the success response or the failure response
-
If there is no answer to work with at all, because the action itself failed (the AI service was too busy, an attachment was too large, the answer ran too long), the task is completed with the Response on Failure you set. See When an action fails
The PDF Splitter prompt type
Section titled “The PDF Splitter prompt type”When AI Prompt Type is set to PDF Splitter, the AI reads the attached PDF, decides where the individual documents inside it begin and end, splits it into separate PDF files, and saves the resulting files to the attachment field you select. This is useful when a single scanned file contains several documents (for example, a packet of invoices).
Use the prompt to describe how the file should be split: by section, by topic, by page count, or wherever a particular heading appears.
How the split files are named. Unless you say otherwise, each new file keeps the original file’s name and adds a short description the AI chooses. A file called PO Receipt.pdf might produce PO Receipt_purchase_order.pdf and PO Receipt_drawings.pdf. To name the files yourself, give the exact names in the prompt, for example: “Name the purchase order pages PO only.pdf and each drawing page Drawings only_part 1.pdf, Drawings only_part 2.pdf, and so on.” When you give exact names, the original file name is not added. Characters that are not allowed in a file name are removed, and .pdf is added if you leave it off. If two pieces would end up with the same name, the second gets a number, for example PO only (2).pdf.
Several PDFs in one field. If the attachment field holds more than one PDF, each file is split on its own, and page numbers in your prompt count from the first page of each file.
Checking the AI’s work
Section titled “Checking the AI’s work”When the process is running in Test Mode, the prompt that was actually sent (with your field tokens filled in), the AI’s reasoning, and its answer are all written to the Instance Audit Log. Start there when an answer is not what you expected - most surprises turn out to be a field token that was empty or held something different than you assumed.
When the answer runs too long
Section titled “When the answer runs too long”There is a limit on how much the AI can write in a single answer. If it reaches that limit before finishing, the answer is cut off partway through, and a half-finished answer is not something your process should act on. When this happens the action reports a failure and stores nothing, rather than saving a partial value to a field or matching a task response against half an answer. Any task the action was set to complete takes its Response on Failure instead, so the process keeps moving down the branch you built for that case.
This is uncommon, and it almost always means the prompt is asking for more writing than it needs. Ask for a shorter answer - a single decision word, a short list, or only the fields you actually use - rather than a full explanation alongside the result.
Note: AI Prompt actions count toward your account’s AI usage. If the account’s AI allowance has been used up, the action will not run until the allowance resets.