Loading

Branching on the Answer, and When Jev Cannot Answer

An AI decision or AI check step is only as good as what you connect after it. This article covers branching on the answer and its confidence, writing the answer back to the record, and what happens when Jev cannot answer.

Where to find it

Architect Panel → Automation:

  • Workflow Builder — the step's ports and its Save the answer as and write-back settings
  • Workflow Run History — what each AI step decided, and why

Architect Panel → Activity:

  • AI Usage — each step's call, under the feature workflow.decide

The ports

  • AI decision: Sure when the answer clears Sure enough at (and any Lead over the next option); Needs a person otherwise.
  • AI check: Yes at or above Yes at, No at or below No at, Needs a person in between.

Needs a person is also where every failure goes, so it is never optional in practice.

Branching on the answer

Sure tells you the step is confident, not what it chose. To route by the choice, follow Sure with a Condition step and type the answer's name as the field: decision.choice equals billing, for example. For a scale, test decision.level, where 0 is the lowest level. When the options come from a pick-list, decision.choice holds the option's stored number, so compare decision.label with the option's name using contains.

To act automatically only on very confident answers, either raise Sure enough at, or keep it and add a Condition on decision.confidence (0 to 1), sending answers above, say, 0.9 straight on and the rest to a person to confirm.

Using the answer in later steps

Save the answer as names it; blank means decision or check. Use a different name for each AI step in the same workflow. The placeholder picker in later steps offers:

  • {{decision.label}}: the answer in words. For an AI check, {{check.label}} is your Yes means or No means wording (or simply yes or no), and empty when unsure.
  • {{decision.choice}} or {{decision.level}}, and {{check.noul}}: the option, the level, or the probability that the statement is true.
  • {{decision.confidence}}: how sure, from 0 to 1.
  • {{decision.outcome}}: confident or review (yes, no or review for a check), or error when Jev did not answer.
  • {{decision.why}}: one sentence explaining the outcome, useful in a notification to the person reviewing.

Writing the answer back

Also write the answer to puts it in one field of the record (or of the For each row): the option key for a choice, the level's position for a scale (0 for the lowest), and 1 or 0 for a check. Write it is either Only when the answer is sure or Always; with Always, an unsure check is written as 1 when the probability is at least a half.

In a workflow that runs before the save, the value is set on the record being saved. Otherwise it goes through the same audited path as an Update record step, so rules, field security and validation apply. A pick-list field accepts only a choice made from its own options, and system, secret and encrypted fields never take an answer; the builder's checks report both.

When Jev cannot answer

The AI module switched off, Jev not set up, the AI budget spent, no reply in time, or a step misconfigured: in every case the step is marked failed, {{decision.outcome}} is error, the reason is in {{decision.why}}, and the run carries on down Needs a person. What happens when nothing is connected there depends on the tick box If TypeSafe Jev cannot answer and nothing is connected to 'needs a person', finish the run instead of failing it:

  • Unticked: the run fails. In a workflow that runs while the record is being saved, the save is refused.
  • Ticked: the run ends there and the save goes ahead, without the answer.

An answer that is merely unsure, with nothing connected to Needs a person, simply ends the run. The builder's checks warn about each of these shapes.

Loops, schedules and outages

  • Inside a For each the step asks once for every row: one call, and one charge, each. Set Decide about to the current row, or every row sends the same record and gets the same answer.
  • A scheduled run with no record of its own needs its AI steps to decide about a For each row; the builder reminds you. Where a schedule runs once for every matching record, each record is one call, and the builder says how many.
  • In background work each step waits at most 10 seconds an attempt, with one retry and 15 seconds in all. After a failure that the retry did not cure, later AI steps fail straight away for up to five minutes, sending nothing, so an outage cannot hold up other scheduled work.

Testing

Simulate makes no AI call: you choose which way each AI step goes. Run for real makes the call. Afterwards, open the run in Workflow Run History: the step's detail gives the sentence explaining the outcome, the model, the input tokens, any field held back and anything written. Both screens are covered in general under Workflow Builder.

Worked example

A lettings team's workflow runs whenever a tenant message is created. An AI check, "The tenant is reporting a repair", sends only the message text. Yes creates a repair job, No ends the run, and Needs a person notifies the duty officer with {{check.why}}. When the AI budget runs out one Friday, every message goes down Needs a person, so nothing is lost: the duty officer sorts them by hand until the budget is topped up.

Recommendations

  • Connect Needs a person in every AI step, to someone who will look.
  • Decide deliberately about the optional box in before-save workflows: ticked, a failed AI step can never block a save.
  • Name each answer when a workflow has more than one AI step.
  • Prefer scheduled work for volume: a For each over thousands of rows is thousands of calls.