Workspace agents · 9 min
Create a Workspace Agent That Writes Email Bills to a Dataset
Use a Bills dataset when you want recurring vendor payment details pulled out of email and kept in a structured table. The agent reads mailbox messages, identifies payees and payment intervals, then upserts rows in the dataset.
Walkthrough
Step by step
Create the Bills dataset
Open Datasets, create a dataset named Bills, and rename the first columns to Payee, Interval, and Interval Number.
Create a Bills dataset and use exact column names for the extracted values.
Keep these column names exact so the agent can write to the right fields without creating duplicates or extra columns.
Create a workspace agent
Open Agents, choose Create workspace agent, and name it Bills Email Scanner or another narrow operational name.
Workspace agents
Automation agents
Read workspace data and write controlled updates.
Create a dedicated workspace agent for the bill-scanning job.
Use one agent for this job so the run logs, permissions, and dataset updates are easy to audit.
Paste the bill-scanning instructions
In Instructions, tell the agent to search the last 90 days of email, identify bills and invoices, infer payment interval timing, and write the values to the Bills dataset.
Use precise instructions so the agent knows the lookback window, target dataset, and matching rule.
The prompt should tell the agent exactly which dataset and columns to maintain: Bills, Payee, Interval, and Interval Number.
Allow email and dataset reads
In Read access, enable Mailbox messages and Datasets. The agent needs mailbox access to find invoices and dataset access to inspect existing rows before updating them.
The agent needs both email history and existing dataset rows before it writes.
Reading existing rows lets the agent update a matching Payee instead of creating duplicates every run.
Allow dataset writes
In Write access, enable Dataset records. Save the agent after setting permissions.
Read access
Write access
Dataset records is the only write permission this workflow needs.
Do not enable broader write permissions unless this agent has another job. Dataset records is the only write permission needed for this workflow.
Run a 90-day backfill and review the results
Run the agent once after setup. Open the run log to confirm it searched mailbox messages, read the Bills dataset, and called upsert_dataset_row for the rows it found.
Use the run log to confirm the agent searched email and wrote rows to the dataset.
After the run, open the Bills dataset. Populated rows should show Payee, Interval, and Interval Number near the top of the grid.
Before you finish
Launch checklist
- The Bills dataset exists.
- The dataset has columns named Payee, Interval, and Interval Number.
- Mailbox messages read access is enabled.
- Datasets read access is enabled.
- Dataset records write access is enabled.
- The prompt asks for a 90-day email search and names the exact dataset and columns.
- The first run log shows upsert_dataset_row calls.
Fix common issues
Troubleshooting
The agent reports that it cannot read email.
Enable Mailbox messages under Read access, then rerun the agent.
The agent finds invoices but does not write rows.
Enable Dataset records under Write access and confirm the agent instructions name the Bills dataset.
The agent creates extra columns.
Rename the dataset columns to the exact expected names: Payee, Interval, and Interval Number. Then update the prompt to use those names.
Keep learning