Skip to main content

How to Build an Agent in Agent Builder

How to build a Weflow agent step by step: schedule, record lookup, AI Agent prompt and delivery by email, Slack or Teams, then test and activate.

You build an agent as a flow: it starts on a schedule, looks up Salesforce records, runs an AI Agent step over them and delivers the result by email to Weflow users and teams, or to Slack or Microsoft Teams.

This article walks through each step in that order, then the test run and activation.

Note: Only Weflow admins can build, edit and manage agents. Each scheduled run uses agent actions from your workspace's monthly allowance; test runs use none, and Weflow limits test runs that go beyond fair use, at its own discretion.

How to create an agent in Agent Builder

  1. Click Agents in the left menu to open the AI Agents page.

  2. Click Add New Agent.

  3. Under Start from Scratch, choose Schedule-Triggered Flow, or choose one of the Agent Templates.

The flow editor opens with the Schedule-Triggered Flow start and the End step. To add a step, click + on the line between two steps and choose Get/Lookup Record or AI Agent. Click any step to open its settings in the panel beside the canvas; a step with a required field still empty is flagged on the canvas.

How to schedule an agent in Agent Builder

  1. Click the Schedule-Triggered Flow step.

  2. Under Frequency, choose Daily, Weekly or Monthly.

  3. For Weekly, select the days the agent runs, from Mo to Su. One agent can run on several days.

  4. Set the Time and the Timezone.

Daily means every day of the week. For weekdays only, choose Weekly and select those days. The schedule is the only trigger: an agent runs at its set time, not when a record changes.

How to look up Salesforce records in an agent

  1. Click + after the start and choose Get/Lookup Record.

  2. Under Object, choose Account, Contact, Lead, Opportunity, Task, Event or Contract.

  3. Under Condition Requirements, set a condition: a field, an operator such as Lesser than, and a value, for example Close Date is Next month. Conditions can use standard, custom and methodology fields such as BANT and MEDDPICC.

  4. Click +Add condition for more conditions. They join all with And or all with Or; for a rule that needs both, click +Add condition group, which carries its own And or Or.

  5. To keep the lookup to one team's records, filter on Weflow teams: the step then returns only records owned by people in those teams and the teams nested below them.

Note: A lookup needs at least one condition, and the editor flags an empty one with At least one condition is required. A field Weflow's integration user cannot see is not offered here; grant the integration user access in Salesforce to use it.

The lookup reads Salesforce live, so a change made a minute ago is in the run. The AI Agent step then reads the activities, emails, calls and transcripts attached to the records it found.

How to set up the AI Agent step in an agent

  1. Click + after the lookup and choose AI Agent.

  2. Under Prompt, write the instructions, up to 4,000 characters.

  3. Switch on Web Search to let the agent bring public information, such as a company's latest news, into its reasoning.

  4. Under Output Format, choose Ask AI Message, PDF, CSV, or several at once.

  • Files come from Output Format: the step makes a PDF or CSV file only when you choose it there. Asking for a file in the prompt produces none. CSV suits a list, PDF a narrative report

  • One step for one answer: each AI Agent step is its own run of the model, so two steps with the same instructions return different content. For one answer in several forms, choose several formats in one step

  • Instructions live in the prompt: the step takes no uploaded document

AI Agent step in the agent flow editor: Prompt up to 4,000 characters, the Web Search toggle and Output Format with Ask AI Message, PDF and CSV

How to set the End step and recipients for an agent

  1. Click the End step.

  2. In To, and optionally Cc and Bcc, search for and select Weflow users and teams.

  3. Enter a Subject.

  4. Optionally, add a short message, shown above the results.

  5. Optionally, tick Skip if there are no new results: nothing is sent when the Get Records steps find nothing, or when the agent returns no text and no report.

PDF and CSV files from earlier steps attach automatically, up to 7 MB in total. Email recipients are Weflow users and teams only, so a team receives the report as its membership changes, without the agent being edited.

Slack and Microsoft Teams: once your workspace's Slack or Teams app is connected in Admin Console > Setup & Integrations, the End step also lets you send the report to Slack or Microsoft Teams. The message arrives from Weflow AI, headed by the agent's name, with the result in the message. Without a connected app, the End step offers email only.

End step of an agent: To, Cc and Bcc search users and teams, Subject, an optional message and Skip if there are no new results

How to test and activate an agent in Agent Builder

  1. Click Save Agent.

  2. Click Run Test. The result is emailed to the agent's recipients with TEST RUN in the subject.

  3. Follow each step in the Running Test panel. A test takes a few minutes; download the PDF from the AI Agent step if it made one.

  4. Click Preview Results to open the output in Ask Weflow AI as a chat named after the agent, and ask follow-up questions about it.

  5. When the test passes, turn on Active. The agent runs on its schedule.

The Estimated cost icon in the top bar gives the cost in actions per workflow run. Actions vary with the data an agent processes, so review the usage after the first full run.

How to manage agents on the AI Agents page

The AI Agents page lists every agent with its Name, Status (an on/off toggle), Last run, Flow Type, Created by and Last Edited. You can filter by time, status and type, and search by name.

  • Row menu: the three-dot menu offers Edit, Duplicate, View History and Delete

  • History: lists every run with its Start Date, Duration, Status, Type, Consumed Actions and Result, filtered by date, status and test runs

  • Usage summary: shows the actions used this month against your plan and the reset date

Frequently asked questions about building agents in Agent Builder

Can an agent run when a Salesforce record changes?

No. Agents run on their schedule only, so a change to a record reaches the report at the next scheduled run.

Can an agent use a document I upload?

No. The AI Agent step takes no uploaded document, so condense the rules into the 4,000-character prompt, or split the work across two agents with their own prompts.

Can one agent send each rep a personal report?

No. An agent runs one fixed prompt, so a personal report needs one agent per rep with the rep's name in the prompt. Alternatively, send one team-wide report, and each rep asks which deals are theirs in Ask Weflow AI.

Why didn't my agent send its report?

Most often the agent is not Active, its run found nothing new to send, the workspace ran out of agent actions, or, for a Slack or Teams report, the workspace's Slack or Teams app is not connected.

Did this answer your question?