For AI agents and developers: machine-readable getting-started guide and automated Salesforce org setup (/llms.txt).

Goal-Based Agent

Goal-Based Agent 10 min

Autonomous AI agent runtime engine built natively on Salesforce. Enables goal-driven, multi-step workflows that run independently — executing tasks, calling tools, managing memory, and adapting over time.

What You Get

  • Goal-driven workflows — define a goal, the agent plans and executes multi-step tasks autonomously
  • Sequential or parallel execution — subtasks run sequentially by default, with opt-in parallel mode for independent work
  • Workflow defaults — configure runtime defaults from the Settings > Defaults tab, automatically applied to chat-initiated workflows
  • 28 built-in tools — SOQL, DML, memory, scheduling, email, Flows, prompt templates, Slack, and more
  • REST API — full external integration at /services/apexrest/genui/agent/*
  • Persistent memory — save, query, update, and promote memories across workflows
  • Sub-agent orchestration — spawn parallel child workflows and create reusable skills
  • Scheduling — cron-style recurring workflows and future follow-ups
  • Optional Slack integration — read channels and send notifications

Prerequisites

Before installing (automated or manual), your org needs:

  • Einstein AI enabled — Go to Setup > Einstein Setup and turn on Einstein and Beta Generative AI Models
  • System Administrator profile — required for package installation
  • Lightning Experience — must be enabled

Manual Installation (Fallback)

If automated installation is unavailable or fails, follow these steps:

Step 1: Install the Package

1
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tal000006hMrRAAU

Choose Install for All Users (recommended). This grants all users access to the Goal Agent app and custom objects without needing to assign permission sets individually.

Step 2: Assign Permission Set (if needed)

If you chose "Install for Admins Only", assign the Goal Agent User permission set to every user who needs access:

  1. Go to Setup > Permission Sets
  2. Find Goal Agent User
  3. Click Manage Assignments > Add Assignment
  4. Select the users and save

This grants access to all custom objects (Goals, Workflows, Tasks, Memory, Skills, etc.) and the Goal Agent Lightning app.

REST API

The package exposes a full REST API for external integrations, automation, and programmatic workflow management.

Base URL

All endpoints are relative to: {instance_url}/services/apexrest/genui/agent

Authentication

All requests require a valid Salesforce access token passed via the Authorization: Bearer {access_token} header.

1
2
ACCESS_TOKEN=$(sf org display --target-org myOrg --json | jq -r '.result.accessToken')
INSTANCE_URL=$(sf org display --target-org myOrg --json | jq -r '.result.instanceUrl')

Managed Package Namespace

In managed package orgs, field names in GET responses include the genui__ namespace prefix (e.g., genui__Title__c instead of Title__c). POST request bodies use parameter names without the namespace prefix.

Endpoints Overview

MethodPathDescription
POST/goalsCreate a new goal
POST/workflowsCreate a new workflow
POST/workflows/{id}/startStart a workflow
POST/workflows/{id}/messageSend a message (human-in-the-loop)
POST/workflows/{id}/pausePause a running workflow
POST/workflows/{id}/resumeResume a paused workflow
POST/workflows/{id}/cancelCancel a workflow
GET/goalsList goals
GET/workflowsList workflows
GET/workflows/{id}/statusGet workflow status with tasks and steps
GET/workflows/{id}/messagesGet workflow messages
GET/memoriesGet memories

Endpoints Reference

Full Example

A complete walkthrough: authenticate, create a goal, create and start a workflow, interact with it, and manage its lifecycle.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Authenticate
ACCESS_TOKEN=$(sf org display --target-org myOrg --json | jq -r '.result.accessToken')
INSTANCE_URL=$(sf org display --target-org myOrg --json | jq -r '.result.instanceUrl')

# 1. Create a goal
curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/goals" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Q1 Pipeline Review",
    "description": "Review and analyze open opportunities",
    "completionCriteria": "All opps reviewed with next steps",
    "priority": "High"
  }'
# => {"id": "a2s...", "title": "Q1 Pipeline Review", "status": "Draft"}

# 2. Create a workflow
curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/workflows" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "goalId": "a2sXXXXXXXXXXXXXXX",
    "title": "Analyze Pipeline",
    "workflowType": "Chat",
    "instructions": "Analyze my open opportunities and summarize the pipeline",
    "maxIterations": 25
  }'
# => {"id": "a32...", "title": "Analyze Pipeline", "status": "Queued"}

# 3. Start the workflow
curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/workflows/a32XXXXXXXXXXXXXXX/start" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
# => {"workflowId": "a32...", "status": "Running"}

# 4. Check status
curl "$INSTANCE_URL/services/apexrest/genui/agent/workflows/a32XXXXXXXXXXXXXXX/status" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

# 5. Send a message (when workflow is WaitingForInput)
curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/workflows/a32XXXXXXXXXXXXXXX/message" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message": "Focus on deals over $100k"}'

# 6. Lifecycle control
curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/workflows/a32XXXXXXXXXXXXXXX/pause" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" -d '{}'

curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/workflows/a32XXXXXXXXXXXXXXX/resume" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" -d '{}'

curl -X POST "$INSTANCE_URL/services/apexrest/genui/agent/workflows/a32XXXXXXXXXXXXXXX/cancel" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" -d '{}'

Built-in Tools

The agent comes with 28 built-in tools. Enable or disable them from Settings > Tools in the Goal Agent app.

Data & Metadata

ToolDescription
soql_queryExecute SOQL queries
dml_operationCreate, update, delete Salesforce records
describe_objectGet object/field metadata
report_toolRun Salesforce Reports

Agents & Automation

ToolDescription
invoke_agentInvoke an Agentforce agent
list_agentsList available Agentforce agents
apex_actionInvoke Apex invocable actions
list_apex_actionsList available Apex invocable actions
flow_invokeRun Salesforce Flows
list_flowsList available Salesforce Flows

Prompt Templates

ToolDescription
list_prompt_templatesList available prompt templates
describe_prompt_templateGet prompt template details and inputs
invoke_prompt_templateExecute a prompt template

Memory

ToolDescription
save_memorySave information to persistent memory
query_memorySearch memories by keyword or category
update_memoryUpdate an existing memory
promote_memoryPromote workflow memory to core memory

Orchestration

ToolDescription
create_taskCreate sub-tasks within a workflow
create_workflowCreate child workflows
spawn_subtasksCreate parallel sub-agent workflows
create_skillCreate reusable skills (custom tools)

Scheduling

ToolDescription
schedule_followupSchedule a future follow-up
schedule_workflowSchedule a recurring workflow (cron)
list_schedulesList scheduled entries
cancel_scheduleCancel a scheduled entry
slack_notifySend Slack notifications (requires setup)
slack_readRead Slack channel messages (requires setup)

rest_callout (HTTP callouts to external APIs) is also available but disabled by default. It requires Remote Site Settings to be configured for target domains.

Communication

ToolDescription
send_emailSend emails
slack_notifySend Slack notifications (requires setup)
slack_readRead Slack channel messages (requires setup)

External API Callouts

rest_callout (HTTP callouts to external APIs) is also available but disabled by default. It requires Remote Site Settings to be configured for target domains.

Optional: Slack Integration

The agent includes two Slack tools — slack_notify and slack_read — both disabled by default.

A. Create a Slack App

  1. Go to https://api.slack.com/apps > Create New App > From scratch
  2. Enter an app name (e.g., "Salesforce Agent") and select your workspace
  3. Click Create App

B. Configure Bot Token Scopes (for slack_read)

  1. In your Slack app settings, go to OAuth & Permissions
  2. Under Scopes > Bot Token Scopes, add:
    • channels:history — Read messages from public channels
    • channels:read — View basic channel information
  3. Click Install to Workspace (or Reinstall if already installed)
  4. Copy the Bot User OAuth Token (starts with xoxb-)

C. Configure Incoming Webhooks (for slack_notify)

  1. In your Slack app settings, go to Incoming Webhooks
  2. Toggle Activate Incoming Webhooks to On
  3. Click Add New Webhook to Workspace
  4. Select the channel where notifications should post
  5. Copy the Webhook URL

D. Add Remote Site Settings in Salesforce

Go to Setup > Remote Site Settings and create two entries:

Remote Site NameURLActive
SlackAPIhttps://slack.comYes
SlackWebhookshttps://hooks.slack.comYes

E. Store Tokens in Custom Metadata

Go to Setup > Custom Metadata Types > Agent Config > Manage Records and create:

For slack_read:

FieldValue
LabelSlack Bot Token
Agent Config NameSlackBotToken
Valuexoxb-your-bot-token-here
Is ActiveChecked

For slack_notify:

FieldValue
LabelSlack Webhook URL
Agent Config NameSlackWebhookUrl
Valuehttps://hooks.slack.com/services/T.../B.../xxx
Is ActiveChecked

F. Enable the Slack Tools

  1. Open the Goal Agent app
  2. Go to Settings > Tools tab
  3. Find slack_read and slack_notify in the tools list
  4. Toggle them On

G. Invite the Bot to Channels

In Slack, go to each channel you want the agent to read from and type:

1
/invite @YourBotName

The bot can only read messages from channels it has been invited to.

Troubleshooting

Permission errors

  • Ensure the Goal Agent User permission set is assigned (or package was installed for All Users)
  • Check that the user's profile has API access enabled

Slack tools not working

  • Verify Remote Site Settings are active for https://slack.com and https://hooks.slack.com
  • Confirm SlackBotToken and SlackWebhookUrl metadata records exist and are active
  • Ensure the bot has been invited to the target channel
  • Check that the tools are enabled in Settings > Tools

Custom metadata fields not visible in Setup UI

  • If fields don't appear when creating AgentConfig__mdt records, check that the page layout includes the custom fields
  • Go to Setup > Custom Metadata Types > Agent Config > Page Layouts and add all fields

Real-time updates not appearing in chat

  • Platform Events require the user to have the Goal Agent User permission set
  • Check browser console for EMP API subscription errors
  • Try refreshing the page

Agent workflow stuck

  • Go to Settings and check the workflow status
  • Use Cancel to stop a stuck workflow, then create a new one
  • Check Setup > Apex Jobs for any failed Queueable jobs