Chapter 13
The Workbench
Run SOQL and SOSL on a connected Salesforce org, chart the results, browse its objects, fields and setup data, read its Apex logs, watch its limits, and see your MuleSoft deployments, APIs and logs, on a screen that only reads.
What the Workbench is
ARRIVING · Switched on per environment
The Workbench is built and is being tried before it is switched on everywhere. If your rail has no Workbench entry, your environment does not have it yet. Nothing in this chapter can be done until it does.
The Workbench is a page next to the chat for the jobs a developer does with a mouse and a keyboard: write a SOQL query and read the rows, look up what fields an object has, and check what is deployed in MuleSoft. It is the same page in the browser, in the Mac app and in the Windows app.
It only reads. There is no button on it that creates, changes, deploys, stops or deletes anything. That is true in every mode and for every org, including Production. The Workbench panels do not use an AI model and never send anything to the Copilot on their own: rows, logs and cell values reach the Copilot only when you choose to send them, and you see exactly what goes first.
| Tab | Use it to |
|---|---|
| Query | Write a SOQL query, run it on one of your Salesforce orgs, and read, sort, copy or download the rows. |
| Objects | Search an org's objects, read an object's fields, relationships and record types, and add a field to your query with one click. |
| Metadata | Read the setup data of the org: Apex classes and triggers, flows, validation rules, custom objects and fields, Lightning web components, installed packages, record types, permission sets and profiles. |
| Limits | See how much of the org's daily and storage limits is used, as gauges, most used first. |
| MuleSoft | See the deployments of a MuleSoft environment and the APIs with the policies applied to each. Shown only where MuleSoft discovery is switched on. |
| Search and Logs | Search many objects at once with SOSL, and read the org's Apex debug logs. Part of the second wave in 13.8, which is switched on separately. |
Open it from the rail (the window icon, labelled Workbench). At the top, choose the Salesforce org. Each org shows its type, and a Production org also shows a note that the page only reads there.
13.1 Run a query
Run your first query
Open Workbench in the rail and choose a Salesforce org at the top right.
You should see The org's name and type appear, with a badge reading read-only.
Look at the box. It starts with a sample: SELECT Id, Name, CreatedDate FROM Account ORDER BY CreatedDate DESC LIMIT 25. Change it, or replace it with your own SELECT query.
Press Run, or press Ctrl and Enter together (Command and Enter on a Mac).
You should see A line above the table says how many rows came back, how long it took, and how many Salesforce API calls the org has left today.
Click a column heading to sort by it. Click again to reverse, and a third time to put the rows back in the order Salesforce gave them.
Before the first run, the empty page offers example queries you can start from: the newest accounts, a count of contacts, open opportunities, and two that read setup data (Apex classes and validation rules). Picking one fills the box; it does not run until you press Run.
The query box colours keywords, text values, numbers and dates as you type. It is a plain text box: nothing is changed in your text, and a pasted query keeps its line breaks.
| Do this | To |
|---|---|
| Ctrl or Command + Enter | Run the query, or only the part of the text you have selected. |
| Ctrl + Space (or Alt + /) | Suggest names at the caret: the fields of the object the query reads, or object names right after FROM. Arrow keys choose, Enter or Tab takes one, Escape closes the list. |
| Ctrl or Command + Shift + S | Save the query with a name. |
| Stop (while it runs) | Stop waiting. Salesforce may still finish the query, but nothing is shown. |
| Rows | Choose how many rows to fetch: 100, 200, 500, 1,000 or 2,000. The default is 200. |
| Setup data | Query setup data such as Apex classes, flows and validation rules, which Salesforce answers through its Tooling API. |
| The row number at the left of a row | Open that row as a list of its fields, which is easier to read when a row is wide. Press Escape to close it. |
| Filter rows | Keep only the rows that have your text in any cell. Copy and Download CSV then use the rows you see. |
| Copy | Copy the rows as tab-separated text to paste into a spreadsheet. |
| Download CSV | Save the rows as a CSV file named after the object and the time. |
| Drag a column's right edge, or focus it and press the left or right arrow | Make the column narrower or wider. |
ADVISORY · What a result is
Everything in the table is text, even if it looks like a web address or like code. A value that starts with an equals sign is written to a CSV file with a leading apostrophe, so a spreadsheet shows it as text instead of running it as a formula.
History and Saved. Beside the box, History keeps your last 50 queries (the text of the query, whether it worked, how many rows, and the org). Running the same query again refreshes its line instead of adding another. Click one to put it back in the box; it does not run until you press Run. Saved holds up to 100 queries you named. Both are yours alone, and both are removed when you delete your account. Neither ever holds the rows a query returned.
What it will not run. One SELECT at a time. A second statement after a semicolon, FOR UPDATE, and any query with a write word such as INSERT, UPDATE or DELETE are refused with a sentence saying why, before anything is sent to Salesforce.
13.2 Browse objects and fields
Choose the Objects tab. Type in the search box to find an object by its name or its label. Tick Custom objects only to keep the ones your team added.
You should see The list shows the objects your Salesforce user can read, and how many match.
Click an object.
You should see Its name, label and field count appear, with three tabs: Fields, Relationships and Record types.
In Fields, search by name, label or type, then press Add beside a field.
You should see You are taken back to the Query tab with the field added to your query's field list, and the cursor is in the box.
- Add puts the field in the SELECT list of a query that already reads that object. If your query reads another object, or the box is empty, it starts a new query on this object.
- A lookup field also shows a second button with the parent's name, for example Owner.Name, so you can bring the parent's value into the same row.
- In Relationships, Add subquery adds the children of the object, for example (SELECT Id FROM Contacts), to the field list.
- A picklist field shows how many values it has. Press the number to list them (inactive values are struck through) and Copy values to copy them, one per line. A very long picklist shows its first 200.
- Query this object starts a fresh query on the object you are looking at.
Each object you open costs one Salesforce API call, and it is kept while the page is open, so going back to it costs nothing more.
13.3 Read the org's setup data
The Metadata tab lists what has been built in the org, without writing a query. Pick a kind on the left: Apex classes, Apex triggers, flows, validation rules, custom objects, custom fields, Lightning web components, installed packages, record types, permission sets or profiles. The list appears in the same grid as a query result, so you can sort it, filter it, open a row as a list, copy it or download it as CSV.
- Each kind is a plain read-only query. The code and automation ones read through Salesforce's Tooling API, the same as the Setup data switch on the Query tab.
- Open in Query puts that query in the Query tab's box so you can change it, for example to add a WHERE clause.
- A list is kept while the page is open, so going back to a kind does not read it again. Refresh reads it again.
- Up to 2,000 rows are read for each kind. If an org has more, the page says the list was cut.
ADVISORY
Your Salesforce user needs View Setup and Configuration for the Setup lists. Without it Salesforce refuses, and the page says your user is not allowed to read that. Ask an administrator, or use a different connection.
13.4 Watch the org's limits
The Limits tab reads the org's limits in one call and shows each as a gauge: how much is used, how much is left, and the share used. The ones closest to their maximum come first. A gauge is green below 70 percent, amber from 70, and red from 90. Limits the org gives no maximum for are left out. Use the search box to find one, for example API or storage, and Refresh to read them again.
ADVISORY
The daily API request limit is shared by everything that uses the org, including Cockpit. If it is amber or red, avoid large queries until it resets.
13.5 MuleSoft deployments and APIs
The MuleSoft tab reads from Anypoint with the connected app you set up in chapter 6. Choose the connection and the environment. A production environment shows a note that the page only reads.
Above the tables, tiles show the organisation's name, its subscription and the vCores assigned to Production, Sandbox and Design. These are what Anypoint reports as assigned, not what is in use. A tile is left out when Anypoint does not report it.
- Deployments lists each application with its state: Failing, Starting, Running or Stopped. The ones that need a look come first, and a row of counts above the table gives the totals. Hover a state to see Anypoint's own status words. The table also shows the runtime version, the replicas and vCores, the artifact and when it last changed, where Anypoint reports them.
- APIs lists the API instances managed in the environment: the API and its instance name, version, status, active contracts and endpoint. Press Policies on a row to see the policies applied to that API, in order.
CAUTION · Policy settings are not shown
A policy's settings can hold keys and credentials. The Workbench shows the policy's name and order, and the names of its settings, never their values.
If a value is missing from a row, Anypoint did not report it for that application, and the Workbench leaves it blank instead of guessing.
13.6 What it reads, what it records, and the limits
| Question | Answer |
|---|---|
| Can it change my org? | No. Every call it makes to Salesforce and to Anypoint is a read. The query guard refuses anything but one SELECT. |
| Which orgs can I use? | Only your own connected orgs and MuleSoft connections. Another person's cannot be reached, even by a guessed id. |
| What is recorded? | An audit event for each query with the connection, the object name, how many rows came back and how long it took. The text of your query and the rows are not in it. Your History holds the text of your own queries and nothing else. |
| Does a query use my org's API allowance? | Yes: one call for each page of up to 2,000 rows, plus one for each object you open. The line above the results shows what is left today. |
| How big can a result be? | Up to 2,000 rows, and about 4 MB. A cut result says so above the table. |
| How long may a query take? | 25 seconds. A slower query stops with a sentence suggesting a filter or a LIMIT. |
| How often may I run queries? | Up to 30 a minute. After that the page asks you to wait a few seconds. |
ADVISORY · Production orgs
A Production org is marked in amber because it is the one your customers use. The Workbench cannot change it, but a very large query still spends that org's daily API allowance, which is shared with everything else that uses it.
13.7 When something goes wrong
| You see | What it means | What to do |
|---|---|---|
| Write a SELECT query first | The box is empty, or the text does not start with SELECT. | Write one SELECT query. |
| Only one query at a time | There is a semicolon and more text after it. | Remove the semicolon and anything after it. |
| A message in Salesforce's own words, such as an unexpected token | Salesforce read the query and did not understand it. | Fix the query. The message names the part it stopped at. |
| Cockpit lost the sign-in to this connection | The saved sign-in for that org or MuleSoft connection no longer works. | Press Reconnect in the message, or use Connectors. |
| This Salesforce org has used up its daily API allowance | Salesforce refused the call because the org's limit for the day is spent. | Wait for the limit to reset, or use another org. |
| Your user on that connection is not allowed to read this | The connected user has no access to that object or area. | Ask an administrator for the access, or try another connection. |
| The query took longer than 25 seconds | Salesforce did not answer in time. | Add a filter or a LIMIT, and run it again. |
| That is a lot of requests | You ran more than 30 queries in a minute. | Wait a few seconds. |
| Write a search that starts with FIND | The Search tab got text that is not a FIND search (for example a SELECT). | Start with FIND {your words}, or run a SELECT in the Query tab. |
| This application has no log yet | Anypoint has not given the application a version to read logs from, usually because it is still starting. | Try again in a minute. |
| Connect a Salesforce org to start | No org is connected to your account. | Press Connect an org and follow the guide in chapter 6. |
If a message is not in this table, or the page shows a reference that starts with CKP, send it to support and say what you were doing.
13.8 Search, charts, logs and shortcuts
ARRIVING · Switched on separately
Everything in this section is a second wave that is switched on on its own, after the Workbench itself. If you do not see a Search tab and a Logs tab, your environment does not have it yet. The Workbench in sections 13.1 to 13.7 works without it.
These additions read exactly as the rest of the Workbench does: every call is a read, only your own connected orgs and MuleSoft connections can be reached, and nothing you do here is sent to an AI model on its own (rows and logs reach the Copilot only when you choose to send them).
Search (SOSL). The Search tab finds a word across many objects at once. Write a search that starts with FIND and the words in curly braces, for example FIND {Acme} IN ALL FIELDS RETURNING Account(Id, Name), Contact(Id, Name, Email), and press Search (or Ctrl or Command and Enter). The rows from every object share one grid, and the first column, SObject, says which object each row belongs to. Sort, filter, copy and download CSV work as they do for a query. Your last searches appear in History beside the box; click one to put it back in the box. If you paste a FIND into the Query tab and press Run, the Workbench moves it to the Search tab for you.
Charts. When a query result has a column of numbers, a Table and Chart switch appears above it. A query with COUNT(), SUM() or AVG() and a GROUP BY is the usual case. Pick Bars or Line, and choose which column is the label and which is the number. Bars are sorted with the largest first, unless the labels are years or months, which keep the order of the query. A chart shows at most 40 bars or 200 points and says when it left some out. For a screen reader the chart has a one-sentence summary, and under it a list called The numbers behind the chart gives every value as a table.
Apex logs. The Logs tab lists the newest debug logs in the org (who, what, when, how big, how long). Press Open on one to read it as numbered lines. Use Show to keep only errors, warnings or other levels, and the search box to find a word; press More lines for the next page and Older logs for the next page of the list. Cockpit works out each line's level from its event name (for example EXCEPTION_THROWN is an error, USER_DEBUG uses the level written in the line), so it is a good way to find the errors, but it is not Salesforce's own logging setting. Cockpit only reads logs: it does not turn trace flags on or off, and it does not delete a log. If the list is empty, no trace flag is on in Setup.
CAUTION · A log can hold record values
A debug log can contain the values of the records the code touched. Cockpit shows the log text only to you, as plain text, and does not store it, but do not paste it into a ticket without looking first.
MuleSoft details and logs. In the Deployments table, Details opens one application: Anypoint's status words, the state it wants, the runtime, the size, the artifact, when it last changed, the last version that worked, each replica with its state, and its public address. Logs opens its newest log lines (50, 100 or 200) for a period you choose, with a level list and a search box. Lines are written by the application, so they are shown as plain text and anything that looks like a secret is hidden. Anypoint keeps the log by version, so an application that has not started yet answers that it has no log yet.
ADVISORY · CPU and memory use are not here
The Workbench does not show how much CPU or memory an application is using (the Runtime config view shows the limits it is set to). The Metrics view under Operations in the MuleSoft tab shows its messages, errors, error rate and response time, and an API's requests by status group. Alerts are not read yet: that view says they could not be read, and never that none is firing.
Saved query folders. When you save a query, the optional Folder box files it under that name; the Saved list then shows the queries grouped by folder, folders A to Z. A folder is just the first part of the saved name, written Folder / Name, so you can also rename by saving again with a new name.
| Press | To |
|---|---|
| Alt + 1 to 9 | Go to the first, second, third… tab. |
| / | Jump to the filter or search box of the tab you are on. |
| ? | Show or hide the list of shortcuts (also the Keyboard shortcuts button). Escape closes it. |
| Ctrl or Command + Enter | Run the query or the search. |
| Question | Answer |
|---|---|
| How many search rows? | Up to 2,000 and about 4 MB, like a query. Salesforce does not page a search, so put a LIMIT in it for fewer. |
| How many logs, and how long may one be? | 50 logs at a time (up to 200). A log is read up to about 5 MB and shown 300 lines at a time (up to 1,000); a line over 2,000 characters is shortened. |
| How many MuleSoft log lines? | At most 200 of the newest, from the last 15 minutes up to 24 hours. Anypoint's read does not page back further. |
| How often? | Up to 30 searches a minute and 20 log reads a minute. After that the page asks you to wait. |
| What is recorded? | An audit event with the connection, counts and a log id, never the search text, a log line or a row. Your History holds the text of your own searches, like queries. |
13.9 Links and Open in Workbench
Every Workbench view has an address. The address follows the tab and the org you are on, so a reload comes back to the same place, and Copy link to this view copies it (on the Query tab it includes the SELECT in the box). Opening a link puts the query in the box and picks the tab; it never runs anything, so you press Run yourself.
In a chat, the Brain panel lists each tool the Copilot used. A step that has a Workbench panel (a Salesforce or Tooling query, a describe, a MuleSoft deployment status or log read) carries an Open in Workbench link that opens the same read on the same org. The link holds only the query text and identifiers, never a row, a log line or a token.
The org you pick in the Workbench is remembered as the one you are working in, and the chat uses the same choice. A link that names an org, object or deployment you do not have opens nothing for it. The search box (Ctrl K) lists each Workbench view that is on for you, for example Workbench: Logs, and opens it.
13.10 The GitHub tab
ARRIVING · Switched on separately
The GitHub tab is switched on on its own, after the Workbench itself and only where GitHub is connected. If you do not see it, your environment does not have it yet.
The GitHub tab reads one repository at a time, with your own GitHub sign-in: Pull requests (the list, then one with its checks, reviews and the diff of every changed file), Actions (runs, the jobs of one, and the end of a failed job's log, or just its error lines), Issues, Files (browse folders and read a file) and Search (code, issues, pull requests and commits). Type the repository as owner/name, or pick one from your own list.
It only reads. Nothing on this tab changes GitHub and nothing is sent to the Copilot. Everything GitHub sends is shown as text: a title that looks like a web page or a formula is shown as the characters it is. Secret-looking values in logs and files are hidden and counted, the values in .env files are always hidden, and key, certificate and binary files are not shown. A link to GitHub appears only when it really is a github.com address.
Each read is limited in rows and size, and you can make 20 to 60 a minute depending on the kind (searches and files are the fewest). The audit trail records the repository and the kind of read, never the path, the search text or what was read.
13.14 What the Copilot knows about the panel you have open
When this is switched on, the Copilot is told, in the short list of facts it gets with every message, which Workbench panel you have open and which of your connections (or which GitHub repository) it is on, for example: the Query panel on your Dev org. That is only the name of the panel and its connection. The Copilot cannot see what the panel shows: not a row, a log line, a file name or a query. If it needs something from the panel it asks you, and you decide whether to send it with Send to Copilot (13.12), after reading exactly what would be sent.
The note is replaced each time you change panel or org, is forgotten when you leave the Workbench or hide the page, and is not told to the Copilot after 15 minutes. It belongs to you, not to one chat, so any of your chats (and a scheduled run) can be told it while it is fresh. Only the panels your team's Captain has given you are ever named.
13.15 Access, audit and MuleSoft operations
When this is switched on, the Workbench has an Access and audit tab for your Salesforce org and an Operations view inside the MuleSoft tab. Each view is one of the Copilot's own read tools with a form in front of it: the same checks, the same hidden secrets and the same limits, on your own connection. Nothing on these pages changes anything, and nothing you read is sent to the Copilot unless you say so in a chat.
| View | What it answers |
|---|---|
| Who can access | Which users can read, create, edit or delete an object or a field, or what one user can do with an object, a field or one record, worked out from profiles, permission sets and sharing. |
| Permission audit | Who holds high-risk permissions such as Modify All Data, what differs between two permission sets or profiles, and which licensed users have not logged in for a number of days. |
| Audit trail | Logins (who, when, from where), changes made in Setup, or the history of one field on one record. Salesforce keeps this for 180 days. |
| Exchange | A search of your organisation's Anypoint Exchange, or one asset in detail: versions, dependencies, files, tags and who published it. |
| Runtime config | One application's runtime settings, or what differs between two deployments of it, or between two different applications. Values that look like secrets are hidden. |
| Metrics | An application's messages, errors, error rate and response time, or an API's requests by status group with its error rate and response time. Not CPU or memory use. Alerts are not read yet: the panel says they could not be read, never that none is firing. |
| Capacity | What each environment is estimated to use of your vCores, whether a trial is running out, and whether a deploy you are thinking about would fit. |
| API Manager | One API in full, its SLA tiers, its alert rules (not whether they fired), the client applications that hold a contract on it, and the organisation's applications. |
A form is sent only when it is complete: the page names a missing field, and a number, date or name that does not look right, before anything is sent. A field that does not apply to your question is not shown and not sent. Environments, applications and APIs are picked from lists read from your own connection. The answer is always shown as text, as a table, a list or a set of facts, and a line above it says how many reads it took and how many secret-looking values were hidden. A view your account does not have yet says so.
Limits: each view allows a few reads a minute (10 to 30, and 60 in all across these views), so the page asks you to wait if you go faster. The audit event names the view and the kind of question, never a name, an id or a row.
13.13 The Workstation tab
ARRIVING · Switched on separately
The Workstation tab is switched on on its own, after the Workbench itself, and only where the Workstation is switched on. If you do not see it, your environment does not have it yet.
The Workstation tab is a read-only window on your own Workstation. It shows the machine's state and hours, a live Activity trail of what happened to it (starting, ready, stopping, errors), its files (browse folders, read a text file), and the git status and recent commits of a folder. There is no terminal and no editor: nothing here types into a file or runs a command you typed.
The tab never wakes your Workstation for you. When it is asleep the files and the Run menu say so, and the Wake button (with the hours it will use) is the only way to start it. Secret-looking values in files and output are hidden and counted, the values in .env files are always hidden, and key and binary files are not shown.
The Run menu starts one governed command on the machine: build a Mule project, scan Salesforce code, run Lightning web component tests, or run Apex tests in your default Salesforce org (the one your chats use). These change nothing in an org or on GitHub; they write only inside the workspace. One runs at a time (20 an hour), each uses Workstation hours while it works, and the output appears when it finishes. To deploy, run Apex or change a file, ask the Copilot in a chat: the approval card does the write.
13.11 Apex and jobs
ARRIVING · Switched on separately
The Apex and jobs tab is switched on on its own, after the Workbench itself. If you do not see it, your environment does not have it yet.
The Apex and jobs tab reads five things from the chosen org, each a read-only query: Apex code coverage (lines covered per class and trigger, lowest first, with the org-wide figure the way the deploy check counts it), Failing Apex tests and Recent Apex test results, Async Apex jobs (batch, queueable and future jobs, newest first) and Scheduled jobs. Each has an Open in Query tab button, so you can change the query.
Record by Id shows the fields of one record: choose the object, paste the 15 or 18 character Id and press Open record. Its related lists are buttons that open a query for the children of that record in the Query tab; nothing runs until you press Run. Everything the org sends back is shown as text.
Nothing on this tab runs tests, runs Apex or changes a record. To do any of those, ask the Copilot in a chat: it proposes the action and the approval card does the write, with the same guards as always.
13.12 Send to Copilot
ARRIVING · Switched on separately
Send to Copilot is switched on on its own, after the Workbench itself. If you do not see the button, your environment does not have it yet.
The Workbench never sends anything to the Copilot by itself. When you want the Copilot to look at what you are looking at, press Send to Copilot above a table of rows. A window shows you the exact text that would be sent: the rows you see (after your filter, the first 25 rows and 8 columns), with secrets, email addresses, cloud resource names, instance ids and Salesforce record ids replaced by a marker such as [hidden:email], and a count of what was hidden.
Nothing is stored until you press Send to Copilot in that window. Then Cockpit starts a new chat, bound to the same org, whose first message is that text, and opens it. No AI model has been asked anything yet: the Copilot reads the excerpt when you ask your first question in that chat. Cancel, or Escape, sends nothing. The excerpt is marked as data, so text inside it is never treated as an instruction.
You can make 10 sends a minute. The audit trail records the panel, the number of rows, the size and the counts of what was hidden, never a cell or the title.