Design an AI assistant with IFS Cloud workflows
Documentation-based guide draft · Reviewed against sources on 2026-09-27 · Not executed in an IFS environment. IFS references use 26R1 unless stated otherwise. Confirm available APIs, components, and permissions in your installed release.
Build an IFS workflow that turns a user-entered draft service note into an AI suggestion and asks the user to review it. This walkthrough uses the native IFS AI Task rather than embedding a third-party API key in workflow scripts.
Before you start
Section titled “Before you start”Use a development environment with the required AI component/use case enabled and sufficient IFS AI tokens. For the worked example, confirm that the smart-editor-generation use case and SMART_EDITOR_IMPROVE_COMMAND model are available. If they are absent, the administrator must enable the entitled use case or you must select another documented model and follow its parameter contract.
Use fictional text. Define the outcome as an editable suggestion; this lab does not automatically change a business record.
1. Create the workflow and input form
Section titled “1. Create the workflow and input form”Create a process key such as labNoteAssistant. Add Start → User Task → IFS AI Task → Script Task → User Task → End.
In the first User Task, add a text field with ID DraftNote and a clear label asking for a short fictional service note. Keep the initial input below 500 characters. Follow the form’s actual generated variable name, inspected through the workflow tools; do not guess how the designer prefixes form fields.
Use a neutral fixture such as: “Checked the lab pump. No leak seen. Need a second vibration reading tomorrow.”
2. Select the AI model and map its parameters
Section titled “2. Select the AI model and map its parameters”Select the IFS AI Task and set Business Use Case to smart-editor-generation and Model Name to SMART_EDITOR_IMPROVE_COMMAND. Review the auto-populated parameter list and model information.
For the documented model contract, configure value from the inspected draft-note variable and supply the correct page_name and note_field_name context for your chosen test use. Use the information icons/current model metadata to confirm those values; they are context identifiers, not arbitrary prose instructions.
Set Retry Count to 0 for the first test so a configuration error does not repeatedly consume tokens.
3. Inspect the raw output once
Section titled “3. Inspect the raw output once”Enable Show Raw Output and give its output variable an identifiable name such as labAiRaw. Also enable Show Status Code. Run one controlled inspection and examine the actual response shape.
Add an output mapping named suggestedNote using the JSONPath for the model’s returned suggestion. Use the inspected response; different models do not necessarily return choices[0].message.content or any other common provider schema.
Disable unnecessary raw-output retention after mapping is proven. Model output and prompts may contain business data in a real implementation.
4. Guard the suggestion before displaying it
Section titled “4. Guard the suggestion before displaying it”Add a JavaScript Script Task after the AI task:
var suggestion = execution.getVariable('suggestedNote');var usable = suggestion != null && String(suggestion).trim().length > 0 && String(suggestion).length <= 2000;execution.setVariable('suggestionUsable', usable);execution.setVariable('reviewText', usable ? String(suggestion) : 'No usable suggestion was returned. Keep the original note.');Add a gateway if you need distinct success/failure forms. If you enable Log Errors on the AI Task, an exception is handled and execution continues; explicitly route that error state instead of interpreting every continuation as success.
5. Build the review step
Section titled “5. Build the review step”In the second User Task, display the original draft and reviewText using the form’s supported variable bindings. Ask the user to accept/edit or cancel. For this lab, end without saving to IFS.
If adding a business update later, put the supported IFS API update after explicit confirmation, verify the target record and ETag, and preserve the original note for review. Canceling a form does not necessarily undo work committed before that form, so keep earlier tasks read-only except for the AI invocation itself.
6. Publish a controlled command and test
Section titled “6. Publish a controlled command and test”Validate, deploy, and attach the workflow through an ExecuteWorkflow command on the intended page using forms and commands. Map only the permitted record context and grant the intended role the workflow/business-function access.
Test a normal note, empty note, very long note, model failure, and text containing an instruction to change another record. The assistant must produce only a suggestion for review; no extra business action should become available through text instructions.
Use AI Invocation History and workflow administration to inspect the invocation, status, and token use. Troubleshooting and retries can consume tokens too. Remove the lab command/grants before retiring the workflow, and delete test content according to your environment’s retention process.
Sources and scope
Section titled “Sources and scope”Older IFS Applications examples are historical context, not evidence of Cloud compatibility. No third-party code, screenshots, or downloadable workflows are reproduced.