Creating an AI Agent
Creating an AI Agent
There are four ways to get an agent:
- Build it in the Workbench — describe the job in a sentence, then run each step and keep what works.
- Install one from the Catalog — agents we built, ready to install and yours to change.
- Turn a chat into an agent — pin the steps the AI Assistant took and open them in the Workbench.
- Convert an assistant — on the AI Assistants page, Make this an agent moves an assistant to the Agents list.
All of them need the DataMagik - Builder role and the AI Agents plan feature (see AI Agents).
Build an agent in the Workbench
The Workbench is where you build an agent by doing: every step runs against your real data so you see the actual result before you keep it. Open it with Create agent on the Agents list, or Edit on an existing agent.
1. Describe the goal
In What should this agent do? write one sentence, for example "Every weekday morning, find the invoices that failed overnight and email the list to the AR desk." Press Draft the first steps and DataMagik drafts the first few steps for you. Prefer to start from nothing? Use Start with a blank step.
If your sentence says when it runs, a card Your goal says when it runs offers Use this schedule. The schedule is added when you first save or run.
2. Run each step and keep what works
Each step is a card written as a sentence, with its values inline. A step is one of:
| Step kind | What it does |
|---|---|
| Look something up | Reads data — a Plex data source, a saved query, a lookup table, and so on. |
| Ask the model | Has the AI summarise, classify, draft or reason over what earlier steps found. |
| Run a script | Runs one of your Script Engine scripts. |
| Decide | Splits into If yes and Otherwise lanes using a rule built from the columns above it. |
| Send / notify | Sends an email or posts to a Teams / Slack channel. |
| Remember | Saves a note the agent can use on later runs. |
| What it learned before | Reads the notes earlier runs saved. |
- Press Run this step (Ctrl/⌘-Enter) to run it and see its result — a table, a number, an email preview and so on. Run this step and every step below it (Ctrl/⌘-Shift-Enter) runs the rest of the agent.
- Click a column header or cell in a result to feed that value into the next step.
- Records a step needs (a script, a credential, a template) are chosen from pickers by name — you never type IDs.
- Add the next step in What should the next step do? and press Add this step (Ctrl/⌘-K), or pick one of the suggested next steps under a result.
- Reorder with move up / move down, remove with Delete step, and undo edits with Ctrl/⌘-Z.
3. Let DataMagik build what is missing
If a step needs something that does not exist yet, the card offers to build it. Each builder drafts and previews first and saves nothing until you press its save button:
- Write this script → Save script and use it
- Write the query (a read-only SELECT) → Save query and use it
- Set up the table (a lookup table) → Save table and use it
- Design the email → Save template and use it
- Design the report (PDF, Excel or CSV) → Save report and use it
- Pick an existing channel for Teams / Slack / email notifications, or Set up the channel to create one (creating a channel needs DataMagik - Security)
- Deliver a file to an FTP / SFTP / FTPS destination → Test and save
When a step fails, the card offers the fix that matches the reason. If the agent is not allowed to use a tool, the button names the setting — for example Turn on Data. Other fixes include Write a script instead, Add a recipient, Pick the value again, Check what Plex has granted and Fill this step in.
4. Save as agent
Tap the title (Untitled agent) to rename it, then press Save as agent (Ctrl/⌘-S). Each save keeps the steps as a new version; runs always use the latest saved version. Saving also records the results you just watched as a fixture — a check that can be replayed later without calling the model. Steps you never ran, or only practised, mark the version as not fully tested — the Not tried yet pill tells you before you save.
Agent settings (About this agent)
The side panel holds the agent's settings. They save themselves as you change them.
| Section | What it controls |
|---|---|
| Name & purpose | What is it called?, What does it do? (up to 160 characters), the AI model (the company default, or Override with a model you have a key for), Turn this agent on, and Can be run from chat. |
| What it can use | Which groups of tools the agent may call — Data, Documents, Automations & scripts, Applications, Dashboards, Email, Files & connectors, EDI, Shop floor, Website, Platform — each with a Read and a Can change switch, plus Scripts it may run. |
| When it runs | Its triggers: schedules, conditions and automation buttons. See When AI Agents Run. |
| Approval & safety | Its autonomy (Only reads, Asks before changing anything, Acts on its own) and Who approves its changes (a role). Acts on its own is greyed out when your plan does not include it. See Approvals, Safety & Monitoring. |
| Tell people | Which notification channels hear about it, and when. |
Saved versions lists every saved version; Restore puts an older version's steps back on the page (nothing changes until you save again). Story shows the agent in plain words, and Share creates a read-only link — valid for 7 days, showing no credentials or data rows — for a colleague to review what the agent does.
Install a ready-made agent from the Catalog
Open Start from a ready-made agent on the Agents list, or the Catalog tab, and search with Search every agent — e.g. EDI, Plex, invoices. Agents are grouped into packs — Platform, ERP, MES, Quality and Accounting — and onto two shelves:
- Agents that only look read and report, and cannot change anything. Most install switched on and ready to use. Those that come with a Shop Floor condition and escalation rung install switched off, with the condition and rung off too.
- Agents that propose a change ask before changing anything, and arrive switched off.
Each card tells you what it reads, what it watches, what it may propose, what it needs (including any Plex data) and its suggested schedule.
An agent that only looks installs with Install. An agent that proposes changes opens a short form first:
- Choose Who approves its changes? (or Choose later — until someone is chosen, every change it proposes is refused).
- Optionally pick channels under Tell these channels (optional).
- Press Install switched off.
If the agent reads Plex, use Check what Plex has granted with your Plex company code and login. If the expected data source is missing, DataMagik shows what your PCN has instead; nothing is used until you choose one. Before any agent installs, its recorded checks run; if one fails, it does not install.
The suggested schedule is added switched off — turn it on once a run looks right. An installed agent is yours to change in the Workbench. When we release a newer version, the list shows Update available; updating keeps your name, approver, channels, schedule and Plex data source.
Turn a chat into an agent
In the AI Assistant chat, each step the assistant took has a Pin button. Pin the steps you want to keep, then press Open in Workbench. The pinned steps (up to eight) arrive in the Workbench as new steps for you to run and save.