Loading

AI Decision and AI Check Workflow Steps

Two workflow steps put a typed question about a record to TypeSafe Jev and branch on the answer. AI decision picks one option from a list, or a level on a scale; AI check asks how likely a statement is to be true.

This article covers adding and configuring them. For the builder in general, see Workflow Builder.

Where to find it

Architect Panel → Automation:

  • Workflow Builder — the AI decisions group in the step palette

Architect Panel → Activity:

  • TypeSafe Jev — the playground, for working out the wording first

Before you start

The AI decisions group appears in the palette only while the AI module is switched on under Platform Modules. If Jev itself is not set up, the group shows the note Needs TypeSafe Jev, which is not set up on this installation and its steps cannot be added. A workflow that already has AI steps still loads and runs, but every one of them goes down Needs a person.

Adding an AI decision

  1. Drag AI decision from the AI decisions group onto the canvas and connect it after the step that should come before it.
  2. Decide: choose One of a list of options or A level on a scale.
  3. Decide about: the record the workflow runs on, or the current row of a For each step. Choose the row only when this step sits on that For each's each row path; the builder reports an error otherwise.
  4. Instructions: what to decide, in plain words, such as "Which team should handle this request?".
  5. Send these fields: pick each field Jev should see and, if you like, a label for it. At least one is required. Nothing else about the record is sent.
  6. Notes (optional): a fact the fields do not carry. Notes are sent first and may use placeholders.
  7. For a list of options, set Options to Written here and fill in Choose from (an Option and What it means, 2 to 255 rows), or to The options of a pick-list field and choose a drop-down or radio list under Pick-list field.
  8. For a scale, fill in Levels, lowest first, one per line, 2 to 10 of them.
  9. Sure enough at: the confidence, from 0 to 1, below which the run goes down Needs a person. Blank means 0.6. For a choice, Lead over the next option can also require the winner to be ahead of the runner-up by a margin.
  10. Connect both ports: Sure and Needs a person.

Adding an AI check

  1. Drag AI check onto the canvas and set Decide about.
  2. Statement to check: one plain sentence, such as "The customer is asking for a refund".
  3. Send these fields and, optionally, Notes, as above.
  4. Yes means and No means (optional): what counts as true and as false.
  5. Yes at (blank means 0.75) and No at (blank means 0.25). No at must be below Yes at; between the two a person decides.
  6. Connect the ports: Yes, No and Needs a person.

Both steps also have Save the answer as, Also write the answer to, Write it and an optional-failure tick box, covered in Branching on the Answer, and When Jev Cannot Answer.

What is sent, and what never is

  • Only the listed fields, each under its field name or your label. Pick-lists and tick boxes go as their option names, not their stored numbers.
  • Never sent: ID and other system columns, password and secret fields, encrypted fields, and anything that is not a defined field of the datastore. Listing one is a validation error.
  • Reference fields (a user, a file, a relational drop-down) are sent as stored, which is usually a number. The builder warns you; send a field that holds the words instead.
  • HTML is stripped from rich text and code fields. What you write in the instructions and options is sent as written.
  • A field placeholder in the instructions or statement is not pasted into the question. The question shows the field's name in brackets, such as [Subject], and its value goes with the data, so a record's own text can never rewrite the question. Write the question about the field by name.
  • A whole row, such as {{customer}} or {{record}}, is never sent, even in the Notes. Name the field: {{customer.name}}.
  • Empty fields do not count. If every listed field is empty and there are no Notes, no call is made and the step goes down Needs a person.

Worked example

A support desk adds an AI decision to its new-ticket workflow. Decide is set to one of a list of options; it sends only Subject and Description; the instructions read "Which team should handle this ticket?"; and Choose from lists billing (payments, refunds and invoices), technical (bugs and integrations), sales (pricing and new accounts) and none (none of these). Sure enough at is 0.7. Sure leads to a Condition: when decision.choice is none, a Notify step tells the duty lead; otherwise an Update record step sets Team to {{decision.choice}}. Needs a person leads to the same Notify step.

Recommendations

  • Work the wording out in the playground before you build the step.
  • Send two or three fields, not ten. Accuracy and privacy both improve.
  • Always offer a "none of these" option when the list may not cover every case.
  • Connect Needs a person every time, to someone who will act on it.