Skip to content
flowon.com

Case management · Part 6 of 7

Expose it

Give a customer portal a secure read endpoint for case summaries with Logic API, and let an AI assistant answer SLA questions through Logic Conductor.

Your case logic now runs inside Dataverse. In this part you open it to two new consumers. First, you design a Logic API endpoint that a customer portal calls to show a case summary, and you make sure a customer can read only their own cases. Second, on Dataverse, you build a small Get case SLA flow and expose it as an MCP tool, so that an AI assistant connected to Logic Conductor can answer “What’s the SLA for case CAS-01001-A1B2C3?” from the same formula your recipe and process use.

  • Complete Part 5: Orchestrate the escalation.
  • For the API: the Logic Fabric API Builder and Logic Fabric API Builder Tools solutions are installed, and your organization runs an API host that signs portal users in. Agree with the team that runs the host on a user property that carries the signed-in contact’s ID. See Install and host Logic API.
  • For the AI tool (Dataverse only): Logic Conductor is set up for the Case Management project, and you have an AI client connected to it. See Set up Logic Conductor.

The portal shows a customer the title, number, priority, status and creation date of a case. You expose these with a Read action on the Case table.

  1. In the Logic Fabric API Builder app, create an API named Customer Portal API in the Case Management project. Creating the API creates its first draft.

  2. Open the draft in API Studio: select the version whose Version is Draft, then Flowon APIOpen in Studio.

  3. Under Context > User, select Add user property and add contactId with Type Unique Identifier. The host fills it in when a customer signs in.

  4. Select Modules > Add module and enter Service as the Module name.

  5. In the module, select Entities > Add entities, select Add next to the Case table (incident) and close the panel.

  6. Open the incident entity and select Add read action. Work through its steps:

    Step Setting
    Definition Action Name summary
    Docs Title Case summary, description Returns the summary of one of the signed-in customer's cases.
    Data Fetcher Look up the case’s customer.
    Access Control Authorization Policy: Demand Authenticated User. Precondition: the case’s customer equals the caller’s contactId; Error Code NOT_YOUR_CASE; Error Message You can only view your own cases.
    Properties title, ticketnumber, prioritycode, statuscode, createdon
  7. Press Ctrl+S. The header shows Saved at and no issues button.

  8. Back in the app, select the draft and Flowon APIPublish Major Version, then confirm.

Callers reach the action at GET /service/incident/{id}/summary. A portal request and its answer look like this:

GET /service/incident/3f2a9c1e-5b7d-4e8a-9f10-2c3d4e5f6a7b/summary
Authorization: Bearer eyJ0eXAiOi...
{
"title": "Router drops connection",
"ticketnumber": "CAS-01001-A1B2C3",
"prioritycode": 1,
"statuscode": 1,
"createdon": "2026-10-19T09:00:00Z"
}

Ask the portal team, or use an HTTP client with tokens from your host, to call the action three times:

Caller Expected answer
No token 401 with UNAUTHORIZAD_ACCESS
A customer, for a case of their own 200 OK with the summary
A customer, for another customer’s case Refused with NOT_YOUR_CASE and the message You can only view your own cases.

A case ID that does not exist returns 404 Not Found. See Responses and errors.

Dataverse (cloud)Expose as MCP ToolApplies to the other edition

AI tools are available in Logic Fabric for Dataverse only. On-premises, skip this section, or make the flow callable from other systems with Expose as Action.

An assistant asks about a case by its number, so the tool takes the case number as text, finds the case and calls the Case response due date formula.

  1. Create a logic flow named Get case SLA in the Case Management project.

  2. On the Docs tab, add the Title Get case SLA and the Description Returns when the first response to a case is due under the service desk SLA, and how many working days are left. Use it when someone asks about a case's SLA, response deadline or due date.

  3. Add the input CaseNumber (Text, Must have a value on, description The case number, for example CAS-01001-A1B2C3) and the outputs ResponseDue (Date and Time) and WorkingDaysLeft (Whole Number).

  4. On the Flow tab, add these steps:

    # Step type Step name Settings
    1 Execute Query FindCase Multiplicity Single. Query on Case with the columns Created On and Priority, where Case Number equals CaseNumber.
    2 Condition NotFound Condition: Null FindCase. In Then, add Raise Error with Error Code CASE_NOT_FOUND and Error Message Concatenate("No case found with number ", CaseNumber).
    3 Run Logic Block SlaDue Case response due date with CreatedOn = FindCase.createdon and Priority = FindCase.prioritycode.
    4 Set Output Done ResponseDue = SlaDue.Output.result. WorkingDaysLeft = BusinessDaysDif(Now, SlaDue.Output.result).
  5. Turn on Expose as MCP Tool and save.

  6. Run the flow once from the Run dialog with the number of your test case, to check the outputs.

  7. Ask your administrator to restart Logic Conductor. It builds its list of tools when it starts.

In your AI client, refresh the tools: get_case_sla appears (with the project name in front when Conductor exposes several projects). Ask:

What’s the SLA for case CAS-01001-A1B2C3?

The assistant calls get_case_sla with the case number and answers with the due date and the working days left, for example “The first response is due on Thursday, October 22. That is 2 working days from now.” When the case is overdue, Business Days Between returns a negative number, which the assistant can report as overdue. A wrong case number returns your CASE_NOT_FOUND message.

The tool runs as the signed-in user, with their Dataverse permissions: a user who cannot read a case gets no answer about it. The flow only reads data, but because flow tools can change data in general, keep exposed flows small and give them a precise description. See How Logic Conductor works.

  • The Customer Portal API has a published version with the summary action, its Access shows Signed-in users, and a customer can read only their own cases.
  • On Dataverse, get_case_sla appears in your AI client, and its answer matches the due date in the triage email for the same case.

Continue with Part 7: Deploy, where you move the whole project to a test environment with the Logic Fabric CLI.