Skip to main content
In about fifteen minutes you will build a small invoice checker:
  1. an agent that reads an invoice and returns its fields as JSON,
  2. a function that checks the line items add up to the total,
  3. a workflow that runs the two in order,
and run it from the Wavefront Console and with curl. You need access to an app in the Wavefront Console, and an API key for one of the supported model providers.

1. Add a model

Open your app and go to LLM Repository → Add LLM. Click Add Model, then copy the new entry’s id from the list. Agents refer to the model by this id, so the key never appears in your YAML.
The Add LLM to Repository dialog

2. Create the agent

Go to Agents → Create Agent. Enter an Agent ID (invoice-reader), pick a Namespace, and paste this YAML, replacing <your-model-id>:
invoice-reader.yaml
The parser makes the agent return JSON with exactly these fields. Field descriptions matter: the model reads them.

Try it

Open the agent. The console shows its name in title case (invoice-reader becomes Invoice Reader). In the Ask anything box, paste an invoice and send it:
The reply is structured:
You can also attach a photo or a PDF of an invoice instead of pasting text: use + → Select Images or Select Documents.
Testing the invoice-reader agent in its chat panel

3. Create the function

The agent reads the invoice; a function does the arithmetic. Arithmetic, comparisons and decisions belong in functions: they are exact, testable and cost nothing to run. Go to Functions → Create Function. Name it check-invoice-total, paste the YAML below into the editor, and click Create Processor:
check-invoice-total.yaml
Test it from the function page with a sample input, for example the JSON reply from step 2. Copy the function’s id.

4. Create the workflow

Go to Workflows → Create Workflow. Enter a Workflow ID (invoice-check), pick the same namespace, and paste this YAML, replacing <your-model-id> and <your-function-id>:
invoice-check.yaml
How to read it:
  • agents and function_nodes declare the steps; workflow wires them together.
  • input_filter: [invoice_reader] hands the agent’s JSON to the function. The function sees its fields directly: input.total_amount, input.line_items.
  • The workflow’s output is the output of its last node, check_total.

Run it in the console

Open the workflow. Its YAML is on the left; on the right is the same chat panel as for agents. Paste the invoice text from step 2 into Ask anything and send. (This workflow needs no variables; when one does, add them with + → Add variables.) The result:
Change a line amount in the input and run again to see TOTAL_MISMATCH.
Running the invoice-check workflow in the console

5. Run it from the API

Your application calls the app directly, with an app user (not your console account). Sign in to get a token:
Then run the workflow by its id (shown on the workflow page):
Response
A workflow’s result is a string containing the last node’s output; parse it as JSON. An agent run through POST /floware/v2/agents/<agent-id>/inference returns result as an object when the agent has a parser.
Every response uses the same envelope: meta.status is success or failure, and on failure meta.error says why.
Signing in again with the same app user ends that user’s other sessions. Give each script or service its own user.

What you built

You used the pattern most Wavefront features follow: an agent gathers the facts, a function makes the call, a workflow runs them in order.

Next steps

Workflows in depth

Routers, sub-workflows, iterators and versions.

Read and write your data

Load the record to check from a database and save the result.

Rules as configuration

Move the tolerance into a configuration admins can edit.

Run in the background

Queue long runs and poll for their result.