agentforce-in-slack

Use when configuring Slack-specific Agentforce capabilities AFTER the basic Slack deployment is complete: enabling Slack-native actions, managing public vs. private action scope, mapping Salesforce-to-Slack user identity, or troubleshooting Slack action failures. Triggers: 'add General Slack Actions topic to agent', 'configure canvas creation for Agentforce in Slack', 'Agentforce private action requires user identity mapping', 'Slack agent cannot send DMs after deployment', 'Agentforce Look Up User action not working in Slack', 'how to map Slack users to Salesforce identities for private actions'. NOT for core Agentforce setup, NOT for basic Slack OAuth installation or DM vs channel-mention mode — those are covered by agentforce/agent-channel-deployment.

Best use case

agentforce-in-slack is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when configuring Slack-specific Agentforce capabilities AFTER the basic Slack deployment is complete: enabling Slack-native actions, managing public vs. private action scope, mapping Salesforce-to-Slack user identity, or troubleshooting Slack action failures. Triggers: 'add General Slack Actions topic to agent', 'configure canvas creation for Agentforce in Slack', 'Agentforce private action requires user identity mapping', 'Slack agent cannot send DMs after deployment', 'Agentforce Look Up User action not working in Slack', 'how to map Slack users to Salesforce identities for private actions'. NOT for core Agentforce setup, NOT for basic Slack OAuth installation or DM vs channel-mention mode — those are covered by agentforce/agent-channel-deployment.

Teams using agentforce-in-slack should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/agentforce-in-slack/SKILL.md --create-dirs "https://raw.githubusercontent.com/PranavNagrecha/AwesomeSalesforceSkills/main/skills/agentforce/agentforce-in-slack/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/agentforce-in-slack/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How agentforce-in-slack Compares

Feature / Agentagentforce-in-slackStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when configuring Slack-specific Agentforce capabilities AFTER the basic Slack deployment is complete: enabling Slack-native actions, managing public vs. private action scope, mapping Salesforce-to-Slack user identity, or troubleshooting Slack action failures. Triggers: 'add General Slack Actions topic to agent', 'configure canvas creation for Agentforce in Slack', 'Agentforce private action requires user identity mapping', 'Slack agent cannot send DMs after deployment', 'Agentforce Look Up User action not working in Slack', 'how to map Slack users to Salesforce identities for private actions'. NOT for core Agentforce setup, NOT for basic Slack OAuth installation or DM vs channel-mention mode — those are covered by agentforce/agent-channel-deployment.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Agentforce In Slack

Use this skill when an Agentforce agent has already been deployed to Slack (the Slack deployment flow in Setup is complete and the agent responds to Slack messages) and the work now involves Slack-specific action capabilities, user identity management, or private vs. public action scope. This skill is the post-deployment configuration layer that unlocks Slack-native agent behaviors. It does NOT cover core Agentforce setup, agent creation, topic design, or the initial Slack OAuth installation flow — those are handled by `agentforce/agentforce-agent-creation`, `agentforce/agent-topic-design`, and `agentforce/agent-channel-deployment`.

The most important concept in this skill domain is that Agentforce connects to Slack via a **Salesforce-managed Slack app** — not a custom app created by the customer. This managed app holds the OAuth scopes, handles the session model, and routes traffic through the Einstein Trust Layer. All Slack-native actions operate through this managed app. Attempts to replicate Slack-native functionality with custom Apex invocable methods that call the Slack API directly bypass the Trust Layer, introduce token management overhead, and are an anti-pattern.

---

## Before Starting

Gather this context before working on anything in this domain:

- Has the Slack deployment been completed? Confirm in Setup > Agentforce > Slack Deployment that the workspace is connected and the agent is in Active state. This skill starts where agent-channel-deployment ends.
- Which Slack-native actions are needed? The four managed Slack-native actions are: Create Canvas, Search Message History, Send DM, and Look Up User. All four require the General Slack Actions topic.
- What is the Slack workspace plan? Canvas creation is not available on the Slack Free plan. Confirm the plan before designing canvas-based workflows.
- Are any actions user-specific (querying or modifying data the invoking user owns)? These require private action scope and Salesforce-to-Slack identity mapping.
- Have all Slack users completed identity mapping? For private actions, each Slack user must have their Slack User ID mapped to a Salesforce User ID. Unmapped users trigger hard authorization failures, not graceful degradation.

---

## Core Concepts

### The General Slack Actions Topic Is Not Auto-Added After Slack Deployment

Connecting an Agentforce agent to Slack through the Setup deployment flow does not automatically include Slack-native actions in the agent's action set. The General Slack Actions topic is a standard Salesforce-managed topic that must be explicitly added to the agent in Agent Builder. Until this topic is added, the agent has no ability to create canvases, send DMs, search message history, or look up Slack users — even though the Slack connection is active and the agent is responding to messages.

The General Slack Actions topic bundles all four Slack-native actions together. Adding the topic once unlocks all four. Removing the topic removes all four simultaneously.

### Public vs. Private Action Scope Controls Data Visibility

Every Agentforce action has a scope designation: public or private.

**Public actions** execute under the integration user's Salesforce credentials. All Slack users who trigger a public action see the same data because the action always runs as the same Salesforce identity. Public actions are appropriate for shared, non-sensitive data (for example, querying a shared FAQ knowledge base or returning org-wide announcements).

**Private actions** execute under the invoking Slack user's Salesforce identity. The agent's identity proxy layer resolves the Slack User ID to a Salesforce User ID at action invocation time and runs the action under that user's Salesforce permission set. Private actions are required for any query or mutation that is user-specific (for example, "my open cases", "my pipeline", "update my task"). Without private action scope, user-specific queries either return the integration user's data to everyone or must implement manual identity filtering — both outcomes are incorrect and violate Salesforce's record-level security model.

### Identity Mapping Is A Prerequisite For Private Actions

The Salesforce-to-Slack identity mapping is a per-user data record stored in the Salesforce org that links a Slack User ID to a Salesforce User ID. The identity proxy layer reads this record at private action invocation time to determine which Salesforce identity to use.

Identity mapping is created through two paths:

1. **User self-service OAuth**: the first time an unmapped user triggers a private action, the agent prompts them with a connection link. The user clicks the link, authenticates with Salesforce, and the mapping record is created automatically.
2. **Admin bulk provisioning**: an admin exports Salesforce User IDs and Slack User IDs, formats them as a CSV, and imports the CSV via the bulk mapping interface in Setup > Slack for Salesforce > User Mappings.

Identity mappings are stored as data records, not metadata. They are org-specific and do not survive sandbox refreshes or metadata deployments to production. Every production go-live must include an explicit step to re-provision identity mappings.

### Canvas Creation Requires A Paid Slack Plan

Slack canvases are a paid feature. The Create Canvas action is available in the General Slack Actions topic regardless of the workspace plan, so it will appear available in Agent Builder and the agent will attempt to use it. However, at runtime, canvas creation will fail in a Free workspace. The failure may not surface as a clear plan-restriction error in the Slack conversation. Always validate the workspace plan before building canvas-dependent workflows. Design fallback behavior (plain text responses) for workspaces that may be on or transition to the Free plan.

---

## Common Patterns

### Pattern 1: Enable General Slack Actions Topic

**When to use:** The Slack deployment is active but the agent has no Slack-native action capabilities (no canvas creation, no Send DM, no message history search, no Look Up User).

**How it works:**

1. In Setup, navigate to **Agentforce Agents** and click the relevant agent to open Agent Builder.
2. Click the **Topics** tab.
3. Click **Add Topic**.
4. Search for **General Slack Actions** in the topic picker. This is a standard Salesforce-managed topic — it appears in the standard library, not in custom topics.
5. Select it and click **Add**. Save the agent.
6. If the agent transitions out of Active state after saving, click **Activate**.
7. Test in Slack: ask the agent to look up a user, search message history, or (if the workspace is on a paid plan) create a canvas.

**Why not the alternative:** Do not build custom Apex invocable methods or external REST actions to call the Slack API directly. The managed topic provides all four actions with Trust Layer coverage, no token management, and Salesforce-maintained support. Custom Slack API calls bypass the Trust Layer, require managing OAuth tokens as Named Credentials, and duplicate functionality the platform already provides.

### Pattern 2: Configure Private Action Scope And Identity Mapping

**When to use:** One or more agent actions must return or modify data specific to the invoking Slack user (for example, querying the user's own cases, opportunities, or tasks).

**How it works:**

1. In Agent Builder, open the action that must be user-specific.
2. Set the action's **Scope** to **Private**. Save.
3. Communicate to Slack users that they must complete a one-time identity connection. Either:
   - Direct them to trigger a private action and follow the connection prompt the agent returns.
   - Or pre-provision mappings in bulk: collect Salesforce User IDs (SOQL: `SELECT Id, Name FROM User WHERE IsActive = true`) and Slack User IDs (Slack API: `GET /users.lookupByEmail` with `users:read.email` scope), format as CSV, and import via Setup > Slack for Salesforce > User Mappings > Bulk Import.
4. Verify mappings in Setup > Slack for Salesforce > User Mappings. Confirm mapped users show as "Connected".
5. Test with a mapped user: trigger the private action and confirm the response contains the user's own data, not the integration user's data.
6. Test with an unmapped user: confirm the agent returns a clear "please connect your account" message rather than an opaque error.

### Pattern 3: Validate And Handle Canvas Plan Restrictions

**When to use:** Canvas-based workflows are being designed or canvas creation is failing.

**How it works:**

1. Confirm the Slack workspace plan: ask the Slack workspace admin or check Settings > Administration > Billing in the Slack workspace.
2. If the workspace is on a paid plan (Pro, Business+, or Enterprise Grid), canvas creation is available. Proceed with canvas workflow design.
3. If the workspace is on Free, either:
   - Remove canvas-dependent agent instructions and replace with plain text equivalents.
   - Or initiate a workspace plan upgrade with the Slack workspace admin before designing canvas workflows.
4. Add explicit fallback instructions to the agent topic: "If canvas creation is unavailable, respond with a formatted plain-text summary instead."
5. After a canvas action is tested and confirmed working, check Einstein Trust Layer logs to confirm the canvas content passed through ZDR policies as expected.

---

## Decision Guidance

| Situation | Recommended Approach | Reason |
|---|---|---|
| Agent connected to Slack but Slack-native actions not available | Add General Slack Actions topic in Agent Builder | Topic is never auto-added; required for all four managed Slack actions |
| Action returns user-specific Salesforce data | Set action scope to Private; configure identity mapping | Public scope executes as integration user — wrong data for every user |
| Action returns shared non-sensitive data (FAQ, announcements) | Public scope is acceptable | No identity mapping needed; simpler deployment |
| Canvas creation needed | Verify paid Slack plan first; design fallback for Free plan | Canvas is unavailable on Free; failure is silent without plan check |
| New hire has no identity mapping | User self-service OAuth connection flow (or admin bulk import) | Mapping is not auto-created; must be provisioned per user |
| Moving from sandbox to production | Re-provision identity mappings in production explicitly | Mappings are data records, not metadata; deployments do not transfer them |
| Custom Slack API call being considered | Use General Slack Actions topic instead | Custom calls bypass Trust Layer and require manual OAuth token management |

---

## Recommended Workflow

Step-by-step instructions for configuring Slack-specific Agentforce capabilities on an already-deployed Slack agent:

1. **Confirm deployment baseline** — verify in Setup > Agentforce > Slack Deployment that the workspace is connected, the agent is Active, and users can already interact with the agent in Slack. This skill starts after the initial deployment is complete.
2. **Add the General Slack Actions topic** — open the agent in Agent Builder, navigate to Topics, and add the General Slack Actions standard topic. Save and reactivate if needed. This single step unlocks Create Canvas, Search Message History, Send DM, and Look Up User.
3. **Designate public vs. private scope for each action** — for every action in the agent, evaluate whether it accesses user-specific Salesforce data. Mark user-specific actions as Private. Mark shared-data actions as Public. Document the scope decision for each action.
4. **Provision identity mappings for private actions** — communicate the one-time connection flow to all Slack users who will trigger private actions, or bulk-import identity mappings via the admin interface. Verify mappings in Setup > Slack for Salesforce > User Mappings.
5. **Validate canvas plan compatibility** — if any canvas actions are configured, confirm the Slack workspace is on a paid plan. Add fallback topic instructions for canvas failure cases.
6. **Test all action types end-to-end in sandbox** — test each Slack-native action (canvas, DM, message search, user lookup), test at least one private action with a mapped user, and test the unmapped-user flow to confirm the agent returns a clear connection prompt.
7. **Confirm Trust Layer coverage** — review Einstein Trust Layer logs after testing to verify all Slack action traffic (canvas content, DM payloads, search results) is logged and subject to org ZDR policies.

---

## Review Checklist

Run through these before marking Slack action configuration work complete:

- [ ] General Slack Actions topic is present in the agent's topic list in Agent Builder.
- [ ] Agent is in Active state after the General Slack Actions topic was added.
- [ ] Every user-specific action (querying or modifying user-owned records) is set to Private scope.
- [ ] Every shared-data action (non-sensitive, org-wide content) is set to Public scope.
- [ ] Slack workspace plan has been confirmed as paid if canvas creation workflows are configured.
- [ ] Fallback topic instructions exist for canvas failure (plain text response alternative).
- [ ] All Slack users who will trigger private actions have identity mappings in Setup > Slack for Salesforce > User Mappings.
- [ ] Unmapped-user failure flow tested: agent returns a clear "connect your account" prompt.
- [ ] Private action tested with mapped user: response contains the user's own data, not integration user data.
- [ ] Identity mapping re-provisioning is included in the production go-live runbook.
- [ ] Einstein Trust Layer logs reviewed for canvas content and DM payloads.

---

## Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

1. **General Slack Actions topic is never auto-added** — every Slack deployment requires a manual post-deployment step in Agent Builder to add the topic. Missing this step means the agent has no Slack-native capabilities despite being fully connected.
2. **Canvas creation fails silently on Slack Free plan** — the Create Canvas action appears available in Agent Builder regardless of workspace plan. The failure only appears at runtime, often without a clear error in the Slack conversation.
3. **Private action failures are hard failures, not graceful degradation** — an unmapped user triggering a private action gets a hard refusal, not a fallback to a broader context. Design explicit connection-prompt instructions into private-action topics.
4. **Identity mappings are data, not metadata** — sandbox mappings do not survive sandbox refreshes or production promotions. Every go-live checklist must include re-provisioning identity mappings as a mandatory step.
5. **Send DM requires `im:write` scope which may be missing in older deployments** — workspaces that installed the Salesforce-managed Slack app before Spring '25 may lack this scope. The Slack workspace admin must re-authorize the app to grant the missing scope.

---

## Output Artifacts

| Artifact | Description |
|---|---|
| Post-deployment Slack action checklist | Ordered configuration steps to enable Slack-native actions on an existing deployment |
| Public vs. private action scope matrix | Per-action scope decisions with justification for each action in the agent |
| Identity mapping setup guide | Step-by-step instructions for self-service OAuth and admin bulk import paths |
| Canvas plan validation output | Workspace plan confirmation and fallback design recommendations |
| Trust Layer verification summary | Confirmation that Slack action traffic appears in Trust Layer logs with correct user identity stamps |

---

## Related Skills

- `agentforce/agent-channel-deployment` — use for initial Slack OAuth setup, managed app installation, and DM vs. channel-mention mode configuration. This skill starts where agent-channel-deployment ends.
- `agentforce/agent-actions` — use when the problem is action contract design, invocable method structure, or action availability within topics generally (not Slack-specific).
- `agentforce/agent-topic-design` — use when the problem is topic boundary design, topic instructions, or classification logic.
- `agentforce/einstein-trust-layer` — use alongside this skill to review ZDR, data masking, and audit logging policies for canvas content and DM payloads.
- `agentforce/agentforce-agent-creation` — use if the agent itself has not yet been created or if core agent setup work is needed before Slack channel work begins.

---

## Official Sources Used

- Connect an Agent to Slack (Agentforce for Slack Setup) — https://help.salesforce.com/s/articleView?id=ai.agent_deploy_emp_slack.htm
- Customizing Agentforce Agents with Custom Slack Actions — https://docs.slack.dev/ai/customizing-agentforce-agents-with-custom-slack-actions
- Set Up and Manage Agentforce in Slack — https://slack.com/help/36218109305875
- Agentforce Developer Guide — https://developer.salesforce.com/docs/einstein/genai/guide/agentforce.html
- Einstein Platform Services — https://developer.salesforce.com/docs/einstein/genai/guide/overview.html
- Salesforce Well-Architected Overview — https://architect.salesforce.com/docs/architect/well-architected/guide/overview.html

Related Skills

slack-workflow-builder

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when designing or troubleshooting Slack Workflow Builder workflows that call Salesforce — especially the Salesforce connector step Run a Flow, mapping inputs/outputs, handling failures, and understanding limits. Triggers on: Slack Workflow Builder Salesforce, Run a Flow from Slack, autolaunched flow from Slack, Slack automation calling Salesforce. NOT for Salesforce Flow Builder tutorials unrelated to Slack (use flow skills), not for Flow Core Actions that send Slack messages from Salesforce (use flow-for-slack), not for initial org-to-workspace connection (use slack-salesforce-integration-setup), and not for building custom Slack apps outside Workflow Builder.

slack-salesforce-integration-setup

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when setting up or troubleshooting the Salesforce for Slack managed app — including connecting a Salesforce org to a Slack workspace, configuring the three-party admin handshake, linking Slack channels to Salesforce records, enabling record preview sharing, and managing org-level limits. Triggers on: Salesforce for Slack app not connecting, Slack org connection setup, Salesforce record sharing in Slack, Slack workspace admin approval, connecting Salesforce to Slack. NOT for building custom Slack apps or Slack bots (separate development platform), not for Slack Workflow Builder Salesforce connector (use slack-workflow-builder skill), not for Flow-based Slack messaging (use flow-for-slack skill).

slack-connect-patterns

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing, governing, or troubleshooting Slack Connect channel sharing between two independent organizations. Trigger phrases: external Slack channel collaboration, cross-org Slack channel setup, Slack Connect DLP policy, Slack partner channel governance, regulated industry Slack Connect compliance. Does NOT cover Salesforce-to-Salesforce integration, Salesforce for Slack app setup, or internal single-workspace Slack channels. NOT for Salesforce-to-Salesforce integration.

flow-for-slack

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when using Salesforce Flow Core Actions for Slack to send messages, create/archive channels, add users, check user connectivity, or launch flows from Slack — including prerequisite setup of the Salesforce for Slack managed package and required permission sets. Triggers on: Send Slack Message from Flow, Create Slack Channel action in Flow, Flow Core Actions for Slack not visible, Slack actions missing in Flow Builder, add users to Slack channel from Flow. NOT for Slack Workflow Builder (Slack-native tool that calls autolaunched Flows FROM Slack — use slack-workflow-builder skill), not for Agentforce Slack agent deployment (use agentforce-in-slack skill), not for initial Salesforce-Slack org connection (use slack-salesforce-integration-setup skill).

einstein-bots-to-agentforce-migration

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when migrating an existing Einstein Bot (legacy or Enhanced) to Agentforce: feature mapping, conversation design translation, cutover planning, hybrid bot/agent architecture, and context handoff. Triggers: 'migrate einstein bot to agentforce', 'convert legacy bot to agentforce', 'einstein bot retiring deadline', 'hybrid bot agentforce pattern', 'bot dialog to topic migration'. NOT for new Agentforce setup with no existing bot — use agentforce/agentforce-agent-creation instead.

data-cloud-grounding-for-agentforce

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when grounding an Agentforce agent with Data Cloud retrievers, DMO selection, chunking, and freshness windows. Triggers: agent grounding, retriever, DMO, data graph, RAG, vector index, citations. Does NOT cover Data Cloud ingestion pipelines or Data Cloud identity resolution tuning.

agentforce-tool-use-patterns

8
from PranavNagrecha/AwesomeSalesforceSkills

Pick the right tool shape for each agent action: Apex invocable vs Flow action vs External Service vs Prompt Template vs Data Cloud retrieval. Covers action selection by use case, argument design for LLM clarity, return-shape contracts, error-surfacing, cost implications, and when to chain tools vs keep a single action. NOT for authoring a specific action (use custom-agent-actions-apex). NOT for topic design (use agent-topic-design).

agentforce-testing-strategy

8
from PranavNagrecha/AwesomeSalesforceSkills

Design Agentforce testing: topic coverage, action unit tests, deterministic golden sets, adversarial prompts, and regression harness. Trigger keywords: agentforce testing, agent eval, agent regression suite, prompt golden set, action unit test agentforce. Does NOT cover: generic LLM evaluation academia, human-labeled RLHF pipelines, or Einstein Classify accuracy.

agentforce-service-ai-setup

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill to verify prerequisites, license entitlements, and org readiness before enabling Einstein for Service AI features: Case Classification, Article Recommendations, Reply Recommendations, and Work Summaries. Trigger keywords: Einstein for Service setup, enable Case Classification, enable Article Recommendations, enable Reply Recommendations, enable Work Summaries, Einstein generative AI prerequisites, Data Cloud for Work Summaries. NOT for core Agentforce agent setup, Agent Builder topic design, Einstein Copilot configuration, ongoing optimization of already-running features, or Einstein Trust Layer configuration.

agentforce-sales-ai-setup

8
from PranavNagrecha/AwesomeSalesforceSkills

Step-by-step setup and configuration of Einstein for Sales AI features: Opportunity Scoring, Pipeline Inspection AI insights, Einstein email insights and composition, and Forecasting AI. Covers prerequisites, license checks, feature sequencing, and data readiness validation. NOT for core Agentforce agent creation, agent topic design, Einstein Trust Layer configuration, or Einstein Activity Capture troubleshooting.

agentforce-prompt-versioning

8
from PranavNagrecha/AwesomeSalesforceSkills

Version Prompt Templates and agent topic prompts: source-control shape, change review, model-version pinning, A/B, and rollback. Trigger keywords: prompt template versioning, prompt changelog, prompt rollback, A/B prompt test, agentforce prompt release. Does NOT cover: prompt engineering tips, general LLM fine-tuning, or Classify / Einstein Generate studio UI walkthroughs.

agentforce-production-readiness-checklist

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when an Agentforce agent is being moved from build/sandbox to live end-user traffic and the team needs a comprehensive readiness gate covering coverage testing, Trust Layer config, guardrails, cost telemetry, observability, rate limits, permissions, rollout strategy, rollback plan, and performance benchmarks. Triggers: 'we want to ship our Agentforce agent next week', 'pre-prod readiness review for our Service Agent', 'what do we need before turning the agent on for real customers', 'agent went live and is hallucinating, what should we have caught', 'cost monitoring for our internal sales agent', 'rollout strategy from internal pilot to GA'. NOT a substitute for the lighter sign-off ritual in agent-deployment-checklist (use this skill instead when the team needs technical depth on what to actually verify, not just sign-off rows). NOT for Trust Layer feature configuration in isolation (use einstein-trust-layer). NOT for designing the guardrails themselves (use agentforce-guardrails) or the test harness (use agentforce-eval-harness).