Automation
Add AI summary and classification steps to a workflow
The Naffes CRM workflow builder has an AI group with two steps: one writes a summary from the record's data into a field, the other picks one label from your list and returns a confidence score. Here is when to use each and how to write a prompt that holds up.
Which one do you need?
| Step as named in the builder | What it does | Typical use |
|---|---|---|
| AI summary to field | Runs your prompt over the record's data and writes the result into the field you name | Condense a web-form request into two lines in the deal description |
| AI classification | Picks exactly one label from a list you define and returns a confidence score | Sort inbound messages into pricing question, complaint or booking request |
Both write in the user's interface language, Arabic or English, unless your prompt asks otherwise, and the model is instructed to use only the data it is given, never inventing names, dates or amounts.
Steps
Pick a trigger that carries the text
Open the workflow from Tools → Workflows. Good fits are Webform submitted, Message received (WhatsApp / SMS) and Deal created.
Add a step from the AI group
From the Steps palette, add AI summary to field or AI classification. The inspector lists the step's inputs by their technical names.
Write the prompt
For a summary fill prompt_template; for a classification fill prompt. Pull in record data with merge tags, for example: Summarise the customer's request in two lines and mention the budget if given:
{{deal.name}}. Be explicit about length and format.Set the target field or the labels
For a summary, put the name of the field that should receive the text in target_field; it is written onto the record that fired the run. For a classification, list your labels in labels, ideally as short English words such as pricing, complaint and booking.
Test for free, then save
Save and click Test run. The dry run shows the prompt with every merge tag resolved without calling the AI, so you can check the data before the first real run.
What happens at run time
- If the AI call fails, the error is recorded on the step and the workflow carries on with its remaining steps, so a passing timeout does not stall your triage.
- Both steps run through the platform's AI gateway. An OpenAI or Anthropic key connected from the Marketplace is not used by workflow steps.
- A classification returns a label and a confidence between 0 and 1, visible in the run details alongside every other step's result.
For the rest of the AI in the product, from deal summaries to the Naffes Smart assistant, see AI features. Builder basics are in building and activating a workflow.
Troubleshooting
- The step did nothing: open its result in the run details. no prompt means the prompt is empty; ai_not_configured means AI has not been set up on the platform yet.
- The summary never reached the field: check that target_field is the name of an existing, writable field on the record type that fired the run (deal, contact or company).
- The label is not one of yours: open the test run result and check that your labels list appears there. If it is empty, the model picks a short label of its own.
- Merge tags appear literally in the prompt: the field name in the tag is wrong or does not belong to the triggering record.