How to Use Agentforce Grid to Find and Resolve Duplicate Cases

A practical walkthrough using Prompt Builder, Flow, and a spreadsheet-style AI workspace.

If you have ever solved a bulk AI problem by exporting records, running a script, and loading the results back into Salesforce, Agentforce Grid will feel familiar – but much more direct. It is a spreadsheet-style workspace in which every record is a row and every column can supply data, run a prompt, invoke an agent or action, and pass its output to the next step. Salesforce describes the product as a way to chain CRM data, Data 360, prompts, actions, and agents into bulk AI workflows. The practical advantage is visibility: you can inspect intermediate results before allowing the workflow to change business data. Salesforce overview

The use case: duplicate cases across channels

Active customers may contact support through email, chat, web forms, and other channels. The same issue can arrive as several cases, but exact-match rules often fail because the only meaningful signal is buried in each Description. Grid is a good fit because generative AI can interpret the text while the worksheet exposes the result for review.

For each new case, the workflow should return one of three outcomes:

  • Unique: no credible match was found.
  • Related: the issue belongs under an existing parent case.
  • Duplicate: the case is a candidate for the approved merge process.

Before you build

Prepare an active prompt template, an autolaunched Flow or other invocable action for the record update, and a safe set of test cases. Agentforce must be enabled, and builders need a permission set that includes the Manage Agentforce Grids system permission. Start in a sandbox or with records that can be restored. AI should recommend the disposition; deterministic automation should validate and perform the write.

Build the grid

1. Load the case rows

Create a worksheet and use Salesforce data as the starting source. Retrieve the target Case Id plus the fields that help establish context, such as Subject, Description, Account, Contact, Created Date, Status, and channel. Each returned case becomes one row.

2. Assemble comparison context

Add the target case’s record snapshot. Then call a prompt Flow that queries plausible sibling cases – for example, recent open cases for the same account or contact – and appends a compact list containing each candidate’s Id, subject, description, status, and creation date. Narrowing the candidate set reduces noise, cost, and false matches.

3. Classify with a prompt template

Tell the template exactly what Unique, Related, and Duplicate mean, and require a predictable response. In this implementation, a compact delimiter format such as 500…|duplicate|500… is easier for downstream Grid steps to consume than free-form prose. Return the assessed Case Id, the status, and a parent or merge-target Id; require a blank target when the status is Unique.

4. Separate and inspect the result

Expose the classification, target Id, and proposed parent Id in separate columns so reviewers can scan rows side by side. Validate that the classification is allowed, the target is the current row, and the proposed parent came from the candidate set. Treat malformed or incomplete output as an exception, not as approval to update a record.

5. Invoke a deterministic Flow

Pass only validated values into an invocable action. For Related, the Flow can set ParentId. For Duplicate, it can call the organization’s approved merge process. For Unique, it should make no change. The Flow should re-check record state and permissions, prevent double execution, write an audit result, and return a clear success or failure message. This boundary matters: the model proposes; Flow enforces.

6. Run from left to right

Test five to ten representative rows first. Review the context, prompt result, parsed values, and action output before expanding the run. Because every column builds on earlier columns, a visible worksheet makes it easier to identify whether bad output came from missing data, weak candidate retrieval, the prompt, or the action. Salesforce recommends Grid for prototyping and iteration; formal agent testing still belongs in Testing Center.

Troubleshooting: read every cell carefully

Large runs can expose timeouts, service limits, prompt variability, or failures in downstream actions. Use the cell-level rerun control to retry only the failed step after you understand the cause. In my testing, successful actions did not always look identical: one cell could show a clear completion label while another displayed a generic object representation. Do not rely only on red highlighting or surface text. Open the cell details, inspect the response or trace, and confirm the Salesforce record before declaring success.

ProblemPractical response
Some rows failInspect the failed cell, correct the cause, and rerun that cell or step.
Output variesTighten instructions, reduce candidate noise, and keep the response schema small.
Action may run twiceUse an idempotency key or a processed flag in the Flow.
Run is slow or costlyTest smaller batches, simplify prompts, and monitor credit consumption.

Where Grid fits

Agentforce Grid does not replace production-grade automation, security review, or operational monitoring. Its strength is turning a bulk AI idea into a visible, testable sequence without first building a trigger, batch job, and data-loading routine. For classification, enrichment, outreach, and other repeatable record-level work, it provides a familiar surface where admins and developers can select data, segment it, run AI, compare outcomes, and invoke existing Salesforce actions.

The safest pattern is simple: start with a small dataset, keep intermediate columns visible, demand structured output, and put every record change behind a validated, auditable Flow. That gives you the speed of AI experimentation without surrendering the control expected of a Salesforce implementation.

Sources and further reading

Salesforce Help: Agentforce Grid

Salesforce Help: Create an Agentforce Grid Worksheet

Salesforce Help: Troubleshooting and Tips

Salesforce: Scaling Beyond One-Off AI Tasks

Salesforce Admins: Streamline AI Workflows With Agentforce Grid

Discover more from Vsevolod Tsurikov

Subscribe now to keep reading and get access to the full archive.

Continue reading