← All examples
100 / 100
Jev Workflow completion check Code Example
Confirm the outcome instead of assuming the last step succeeded.
Publish approved article
Goal Publish approved article
Last Event Draft saved
Public Url none
Is the requested outcome complete?
0%
Continue workflow.
Let the application continue workflow.
Code
// Conceptual pseudocode — not Jev SDK syntax
const state = {
"goal": "Publish approved article",
"last_event": "Draft saved",
"public_url": "none"
};
const decision = await evaluateDecision({
state,
question: "Is the requested outcome complete?",
options: ["Continue workflow","Complete","Ask owner"],
});
// Your adapter normalizes the provider response.
// Tune this example threshold on labelled data.
if (decision.outcome === "Continue workflow"
&& decision.probability >= 0.85) {
resumeIncompleteWorkflow(decision);
} else {
queueForReview(decision);
} This adapter illustrates the decision boundary. Check the official Jev docs for current API syntax.