service-de-waba-integrate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLinking a WABA to Salesforce
将WABA关联至Salesforce
What this skill does
该技能的作用
Gets the customer from "I have a WABA" to "my WABA is linked to Salesforce" — entirely by instruction. Meta intentionally gates this behind the human-approval UI at business.facebook.com; there's no Graph write endpoint that scripts the partnership. The two GET endpoints that would let us probe state (, ) need a Meta access token with scope that the customer would have to generate — a bigger ask than just "check your Partners tab."
/{waba-id}/subscribed_apps/{waba-id}/assigned_userswhatsapp_business_managementSo the skill is 100% instruction rendering + one confirmation prompt. No API calls. No SF DB writes. No Meta tokens.
After this skill returns success, downstream insertion () can proceed: the SF-side path doesn't require us to have proven the partnership — it'll fail with a clear Meta-precondition error if the customer lied, and our skill trusts the customer's confirmation.
service-de-channel-createsetupLiveMessageChannelEnhanced帮助客户从“我已有WABA”过渡到“我的WABA已关联至Salesforce”——全程仅通过指令完成。Meta特意将此步骤限制在business.facebook.com的人工审核UI中;目前没有Graph写入端点可以自动完成合作伙伴关联操作。原本可以用于探测状态的两个GET端点(、)需要客户生成带有权限范围的Meta访问令牌——这比让用户“检查你的合作伙伴标签页”要麻烦得多。
/{waba-id}/subscribed_apps/{waba-id}/assigned_userswhatsapp_business_management因此,该技能100%由指令生成+一次确认提示构成。无需调用API,无需写入SF数据库,无需处理Meta令牌。
当该技能返回成功后,后续的插入操作()即可进行:Salesforce端的流程不需要我们验证合作伙伴关系——如果客户撒谎,该流程会因明确的Meta前置条件错误而失败,而本技能信任用户的确认。
service-de-channel-createsetupLiveMessageChannelEnhancedWhen NOT to use this skill
不适用该技能的场景
- You've already confirmed the partnership on a previous run. The orchestrator's resume logic doesn't short-circuit Stage 1 (no cheap SF-side probe exists), so this skill always runs — but it's just text + a prompt, no round trip.
- You're inserting a non-WhatsApp channel. Line / Apple / Facebook don't use Meta Business Manager partnerships. Skip this skill entirely for those paths.
- The customer is using the Embedded Signup popup instead. That's a different flow (popup-driven, SF-UI-side OAuth); this skill is specifically the headless alternative.
- 你已在之前的操作中确认过合作伙伴关系。编排器的恢复逻辑不会跳过第一阶段(不存在低成本的Salesforce端探测方式),因此该技能总会运行——但它仅包含文本和提示,不会产生往返请求。
- 你正在插入非WhatsApp渠道。Line/苹果/Facebook渠道不使用Meta商务管理器合作伙伴关系。对于这些流程,请完全跳过本技能。
- 客户正在使用嵌入式注册弹窗。这是另一种流程(弹窗驱动,Salesforce UI端OAuth);本技能专门作为无界面的替代方案。
Inputs (from caller)
输入参数(来自调用方)
- — WhatsApp Business Account ID. Used only for rendering (so the instructions say "open YOUR WABA" with the right id visible).
{WABA_ID} - — optional. Defaults to
{SF_BM_ID}(Salesforce's Business Manager ID, confirmed by user 2026-04-29; see IMPLEMENTATION.md §13 journey log). Override only if Salesforce issues a different BM ID for a specific partner program.10152614792574154
- — WhatsApp Business Account ID。仅用于指令生成(使指令显示“打开你的WABA”并展示正确的ID)。
{WABA_ID} - — 可选参数。默认值为
{SF_BM_ID}(Salesforce的商务管理器ID,已于2026年4月29日由用户确认;参见IMPLEMENTATION.md第13节的流程日志)。仅当Salesforce为特定合作伙伴项目颁发不同的BM ID时才需覆盖此值。10152614792574154
Output (to caller)
输出结果(返回给调用方)
Success — user confirmed the partnership is in place:
json
{"ok": true, "linked": true, "path": "user-confirmed",
"note": "partnership confirmed by user; subsequent channel insert will
surface any server-side issues clearly"}Failure — partnership not yet in place:
json
{"ok": false, "kind": "partnership-blocked",
"hint": "customer reported Salesforce is not in the Partners tab;
most likely causes: (a) WABA ID typo, (b) user lacks admin
role in the Business Manager, (c) partnership request still
pending Meta approval. Retry this skill after resolving."}Failure — user-declined or dropped:
json
{"ok": false, "kind": "user-declined",
"hint": "user cancelled the linking step; re-run the orchestrator
when the customer is ready to click through Business Suite"}成功——用户确认合作伙伴关系已建立:
json
{"ok": true, "linked": true, "path": "user-confirmed",
"note": "partnership confirmed by user; subsequent channel insert will
surface any server-side issues clearly"}失败——合作伙伴关系尚未建立:
json
{"ok": false, "kind": "partnership-blocked",
"hint": "customer reported Salesforce is not in the Partners tab;
most likely causes: (a) WABA ID typo, (b) user lacks admin
role in the Business Manager, (c) partnership request still
pending Meta approval. Retry this skill after resolving."}失败——用户拒绝或放弃:
json
{"ok": false, "kind": "user-declined",
"hint": "user cancelled the linking step; re-run the orchestrator
when the customer is ready to click through Business Suite"}Stage 1: Render the instructions
第一阶段:生成指令
Substitute and and output the following directly as markdown text to the user (do NOT use , , or any Bash command that would collapse the output):
{WABA_ID}{SF_BM_ID}catechomarkdown
──────────────────────────────────────────────────────────────
**Before we can insert the WhatsApp channel in Salesforce, your
WhatsApp Business Account must be shared with Salesforce on
Meta's side.** Meta gates this step behind business.facebook.com —
there's no API we can call to automate it.替换和,并将以下内容直接以markdown文本形式输出给用户(请勿使用、或任何会折叠输出内容的Bash命令):
{WABA_ID}{SF_BM_ID}catechomarkdown
──────────────────────────────────────────────────────────────
**在Salesforce中插入WhatsApp渠道之前,你的
WhatsApp Business Account必须在Meta端与Salesforce共享。** Meta将此步骤限制在business.facebook.com中——
我们无法通过调用API来自动化完成。One-time steps (takes ~2 minutes):
一次性步骤(约需2分钟):
- Go to https://business.facebook.com
- In the left nav, open "WhatsApp Accounts" and click your WABA (ID: {WABA_ID})
- Click the "Partners" tab at the top of the WABA page
- Look at the list:
-
If "Salesforce" (or "Salesforce.com") is already listed with Full control — you're done, nothing to do.
-
If NOT listed (or listed with only partial access):a. Click "Add partners" → "Share account with partner"b. Paste this Business Manager ID in "Enter partner business ID":
{SF_BM_ID}c. Scroll to the "Full control" section at the bottom and toggle ON "Everything":[x] Everything — manage all settings, assign users, view payment information and send messagesThis is the option Salesforce needs. The Partial access toggles above (Phone numbers / Message templates / Messages) do NOT cover assigning users or managing webhook subscriptions — those require the Full control option. Don't try to grant access piecemeal through Partial access.d. Click "Assign"
-
- 访问https://business.facebook.com
- 在左侧导航栏中,打开“WhatsApp Accounts”并点击你的 WABA(ID:{WABA_ID})
- 点击WABA页面顶部的“Partners”标签页
- 查看列表:
-
如果“Salesforce”(或“Salesforce.com”)已在列表中 且拥有完全控制权——操作完成,无需其他步骤。
-
如果未列出(或仅拥有部分权限):a. 点击“Add partners” → “Share account with partner”b. 将以下商务管理器ID粘贴到“Enter partner business ID”中:
{SF_BM_ID}c. 滚动至底部的“Full control”区域, 开启“Everything”开关:[x] Everything — manage all settings, assign users, view payment information and send messages这是Salesforce所需的权限。上方的部分权限开关 (Phone numbers / Message templates / Messages)不包含用户分配 或Webhook订阅管理权限——这些需要完全控制选项。请勿尝试通过部分权限 分授予访问权限。d. 点击“Assign”
-
Notes:
注意事项:
- Your Meta Business Manager must be business-verified for Meta to accept the partnership. If it's not verified, Meta will block the "Assign" step with a clear error.
- You need admin role on the Business Manager to assign partners. If you're a regular employee, ask an admin on your team.
- Max 2 partners per WABA. If you've already shared with another BSP, Salesforce would be the second — which is fine. ──────────────────────────────────────────────────────────────
**CRITICAL:** Output this text directly in your response to the user, not via Bash/cat/echo. Tool results get collapsed; direct text output stays visible.
---- 你的Meta商务管理器必须完成企业验证,Meta才会接受合作伙伴关系。 如果未验证,Meta会在“Assign”步骤中显示明确的错误信息。
- 你需要拥有商务管理器的管理员角色才能分配合作伙伴。 如果你是普通员工,请联系团队中的管理员。
- 每个WABA最多可添加2个合作伙伴。如果你已与其他BSP共享, Salesforce将作为第二个合作伙伴——这是允许的。 ──────────────────────────────────────────────────────────────
**重要提示:** 直接在回复用户时输出此文本,请勿通过Bash/cat/echo输出。工具结果会被折叠,直接输出的文本将保持可见。
---Stage 2: Ask for confirmation
第二阶段:请求确认
Use AskUserQuestion to prompt:
text
Question: Is "Salesforce" now showing in the Partners tab for this WABA?
Header: Partnership
Options:
1. Yes — already there or just added it
(Salesforce appears in the Partners tab with Full control)
2. No — still not showing
(Partnership not yet in place after attempting to add it)
3. Skip — abort setup for now
(Not going to complete this step right now)Do not try to validate the answer with Meta. Trust the user. If they said yes and lied, downstream will fail with a envelope that clearly names the issue — that's a cleaner failure than fabricating a probe here that would need a customer Meta token.
service-de-channel-createmeta-precondition使用AskUserQuestion工具提示用户:
text
Question: Is "Salesforce" now showing in the Partners tab for this WABA?
Header: Partnership
Options:
1. Yes — already there or just added it
(Salesforce appears in the Partners tab with Full control)
2. No — still not showing
(Partnership not yet in place after attempting to add it)
3. Skip — abort setup for now
(Not going to complete this step right now)请勿尝试通过Meta验证用户的回答。信任用户即可。如果用户回答“是”但实际未完成关联,后续的流程会因错误包明确指出问题——这比在此处构建需要客户提供Meta令牌的探测逻辑更清晰。
service-de-channel-createmeta-preconditionStage 3: Emit the envelope
第三阶段:生成结果包
Based on the user's answer, construct the appropriate envelope and write it to so the calling skill can parse it:
/tmp/linking-waba-result.json| User's answer | Envelope to write |
|---|---|
| |
| |
| |
Write the envelope using:
bash
echo '{envelope json}' > /tmp/linking-waba-result.jsonThen display the human-readable summary to the user:
- For :
ySuccess — WABA linked — Salesforce confirmed as a partner on WABA {WABA_ID}. Proceed to service-de-channel-create. - For :
nError: Partnership not yet in place — fix the issue on Meta's side (see instructions above) and re-run. Common fixes: check WABA ID, confirm your Business Manager is business-verified, confirm you have admin role. - For :
s⏸ Linking skipped by user — re-run when ready.
根据用户的回答,构建相应的结果包并写入到,以便调用方技能解析:
/tmp/linking-waba-result.json| 用户回答 | 要写入的结果包 |
|---|---|
| |
| |
| |
使用以下命令写入结果包:
bash
echo '{envelope json}' > /tmp/linking-waba-result.json然后向用户显示可读性强的摘要:
- 若用户回答:
ySuccess — WABA linked — Salesforce confirmed as a partner on WABA {WABA_ID}. Proceed to service-de-channel-create. - 若用户回答:
nError: Partnership not yet in place — fix the issue on Meta's side (see instructions above) and re-run. Common fixes: check WABA ID, confirm your Business Manager is business-verified, confirm you have admin role. - 若用户回答:
s⏸ Linking skipped by user — re-run when ready.
Worked example: customer already has Salesforce shared
示例:客户已将Salesforce设为合作伙伴
Input:
{WABA_ID}=1558753535400324Stage 1: skill renders the instructions with the WABA ID visible. Customer opens Business Suite → WhatsApp Accounts → 1558753535400324 → Partners. Sees "Salesforce" in the list.
Stage 2: customer answers .
yStage 3: emits:
json
{"ok":true, "linked":true, "path":"user-confirmed",
"note":"partnership confirmed by user; subsequent channel insert will surface any server-side issues clearly"}Orchestrator continues to .
service-de-channel-create输入:
{WABA_ID}=1558753535400324第一阶段:技能生成包含WABA ID的指令。客户打开Business Suite → WhatsApp Accounts → 1558753535400324 → Partners,看到列表中有“Salesforce”。
第二阶段:客户回答。
y第三阶段:生成结果包:
json
{"ok":true, "linked":true, "path":"user-confirmed",
"note":"partnership confirmed by user; subsequent channel insert will surface any server-side issues clearly"}编排器继续执行。
service-de-channel-createWorked example: customer needs to add the partnership
示例:客户需要添加合作伙伴关系
Same input. Customer opens Business Suite, doesn't see Salesforce in Partners, clicks Add partners → Share account with partner → pastes → scrolls down to the "Full control" section → toggles ON "Everything" → Assign. Meta shows "Partnership request sent" or similar. Partnership lands (usually instant; occasionally pending for a few minutes if Meta needs to review).
10152614792574154Customer answers after confirming Salesforce now shows up.
yOrchestrator continues.
输入相同。客户打开Business Suite,未在合作伙伴列表中看到Salesforce,点击Add partners → Share account with partner → 粘贴 → 滚动至“Full control”区域 → 开启“Everything”开关 → Assign。Meta显示“合作伙伴请求已发送”或类似提示。合作伙伴关系随即生效(通常立即生效;偶尔需等待几分钟,若Meta需要审核)。
10152614792574154客户确认Salesforce已出现在列表中后回答。
y编排器继续执行后续流程。
Worked example: Business Manager not business-verified
示例:商务管理器未完成企业验证
Customer clicks Assign and Meta rejects with "Your business must be verified to assign partners." Customer answers in our prompt.
nStage 3: emits:
json
{"ok":false, "kind":"partnership-blocked",
"hint":"customer reported Salesforce is not in the Partners tab; most likely causes: (a) WABA ID typo, (b) user lacks admin role in the Business Manager, (c) partnership request still pending Meta approval. Retry this skill after resolving."}Orchestrator emits a step-annotated failure pointing at this skill; user pursues business verification through Meta separately and re-runs later.
客户点击Assign后,Meta拒绝并提示“你的企业必须完成验证才能分配合作伙伴”。客户在我们的提示中回答。
n第三阶段:生成结果包:
json
{"ok":false, "kind":"partnership-blocked",
"hint":"customer reported Salesforce is not in the Partners tab; most likely causes: (a) WABA ID typo, (b) user lacks admin role in the Business Manager, (c) partnership request still pending Meta approval. Retry this skill after resolving."}编排器生成指向本技能的分步错误提示;用户需单独通过Meta完成企业验证,之后重新运行流程。
Gotchas
注意事项
-
We can't probe state without a customer Meta token.and
GET /{waba-id}/subscribed_appswould confirm SF's app is subscribed / user is assigned, but both need a token the customer would have to generate in a Meta app — a 20-minute detour to save one prompt. Not worth it. Trust the customer's eyeballs.GET /{waba-id}/assigned_users -
"Salesforce in Partners" ≠ "SF webhook subscription landed." Subscription is a separate server-side event that happens after the partnership is in place, when SF's BSP app notices and calls its own internal setup. The customer's confirmation in this skill is about the partnership, not subscription state — subscription will catch up by the timeruns. If it hasn't, the insert fails clearly with a Meta-precondition error and we retry.
service-de-channel-create -
Theis a single static value.
SF_BM_IDis Salesforce's Business Manager ID, the same for every customer in every org. Confirmed 2026-04-29 (IMPLEMENTATION.md §13). Don't let callers override it casually — if someone passes a different value, they've likely misunderstood what the field is for. Keep the override capability for edge cases (SF issuing a partner-specific BM ID at some future date), but don't document it prominently.10152614792574154 -
The "Users" tab and the "Partners" tab are different. Older IMPLEMENTATION.md drafts used the "add SF admin user" framing (users tab); the current canonical flow is "add SF as Partner" with the BM ID above. Both end up granting Salesforce access to the WABA, but the Partners flow is cleaner (no per-user maintenance, permission scoping is by partner role). Stick with Partners.
-
Embedded Signup is an alternative, not a complement. Customers using the Embedded Signup popup skip this skill entirely — the popup handles partnership grant inline via Meta's OAuth flow. This skill is for the headless path (customer prefers Business Suite click-through over a browser popup). Don't try to run both.
-
Orchestrator calls this skill even on resume. There's no SF-side state to check (the subscription landing is silent), so re-runs re-render the instructions and re-prompt. That's fine — the prompt is near-instant if the customer already confirmed before, and this skill produces no side-effects. Idempotency is inherent.
-
NoCLI commands, no SOQL, no HTTP. This skill should be pure text + one prompt. If a future version wants to probe state (customer-supplied Meta token via env var, etc.), that's an additive enhancement — don't let it crowd the happy path. The instruction-only design is the feature.
sf -
Max 2 partners per WABA. If the customer is already sharing with another BSP (Twilio, 360dialog, etc.), Salesforce would be partner #2 — fine. If they've got 2 BSPs already, Meta blocks the Assign — customer would need to remove one first. This is rare but documented in the Stage 1 rendered text so customers hit a known error message rather than a mysterious failure.
-
"Full control / Everything" is required, not just the Partial access toggles. Meta's partner-share dialog has two sections: "Partial access" (individual toggles: Phone numbers view/manage, Message templates view/manage, Manage phone numbers and message templates, Messages) and "Full control" (a single "Everything" toggle). Salesforce needs Full control / Everything because:
- Assigning users — SF provisions service accounts on the WABA to operate it. Only the Everything toggle grants this; none of the Partial access toggles cover it.
- Webhook subscription management — (which lets SF's BSP app receive inbound messages) requires
POST /{waba-id}/subscribed_appsscope, which maps to Full control, not the partial toggles.whatsapp_business_management - Credit-line / payment method visibility — needed so SF can route sends through the customer's own billing. Explicitly only in the "Everything" description ("view payment information").
If a customer grants only partial access (e.g. just "Manage phone numbers and message templates"), the channel may insert successfully on the SF side but activation/send will fail later with opaque Meta errors about missing permissions. The Partial access path is for non-BSP integrations (marketing tools that only need to send templated messages, etc.), not BSPs. Don't let anyone "optimize" the rendered instructions toward narrower permissions — it's a false economy that surfaces as a confusing failure much later in the flow.
-
没有客户提供的Meta令牌无法探测状态。和
GET /{waba-id}/subscribed_apps可以确认Salesforce应用是否已订阅/用户是否已分配,但这两个端点都需要客户在Meta应用中生成令牌——这会花费20分钟的额外时间,只为节省一次提示。得不偿失。信任用户的判断即可。GET /{waba-id}/assigned_users -
“Salesforce在合作伙伴列表中”≠“Salesforce Webhook订阅已生效”。订阅是合作伙伴关系建立后发生的独立服务器端事件,当Salesforce的BSP应用检测到合作伙伴关系后,会调用内部设置流程完成订阅。本技能中用户的确认仅针对合作伙伴关系,而非订阅状态——在运行时,订阅流程通常已完成。若未完成,插入操作会因明确的Meta前置条件错误而失败,我们可以重试。
service-de-channel-create -
是单一静态值。
SF_BM_ID是Salesforce的商务管理器ID,适用于所有客户和所有组织。已于2026年4月29日确认(IMPLEMENTATION.md第13节)。请勿随意允许调用方覆盖此值——如果有人传入不同的值,他们很可能误解了该字段的用途。仅为边缘情况保留覆盖能力(例如未来Salesforce为特定合作伙伴项目颁发专属BM ID),但无需在文档中突出说明。10152614792574154 -
“Users”标签页和“Partners”标签页不同。旧版IMPLEMENTATION.md草稿使用“添加Salesforce管理员用户”的框架(Users标签页);当前标准流程是使用上述BM ID将Salesforce添加为合作伙伴(Partners标签页)。两种方式都能授予Salesforce访问WABA的权限,但Partners流程更简洁(无需维护单个用户,按合作伙伴角色划分权限范围)。请坚持使用Partners流程。
-
嵌入式注册是替代方案,而非补充方案。使用嵌入式注册弹窗的客户需完全跳过本技能——弹窗会通过Meta的OAuth流程内联完成合作伙伴权限授予。本技能适用于无界面流程(客户更喜欢通过Business Suite点击操作,而非浏览器弹窗)。请勿尝试同时运行两种流程。
-
编排器即使在恢复时也会调用本技能。没有Salesforce端的状态可以检查(订阅生效是静默操作),因此重新运行时会重新生成指令并再次提示用户。这并无问题——如果客户之前已确认过,提示操作几乎瞬间完成,且本技能不会产生任何副作用。幂等性是固有特性。
-
无需使用CLI命令、SOQL或HTTP请求。本技能应仅包含文本+一次提示。如果未来版本需要探测状态(例如通过环境变量获取客户提供的Meta令牌等),这属于附加增强功能——请勿让其干扰主流程。纯指令设计是本技能的核心特性。
sf -
每个WABA最多可添加2个合作伙伴。如果客户已与其他BSP(如Twilio、360dialog等)共享,Salesforce将作为第二个合作伙伴——这是允许的。如果客户已添加2个BSP,Meta会阻止Assign操作——客户需要先移除其中一个。这种情况很少见,但已在第一阶段的生成文本中说明,以便客户遇到已知错误信息,而非神秘的失败。
-
必须授予“Full control / Everything”权限,而非仅部分权限开关。Meta的合作伙伴共享对话框包含两个区域:“Partial access”(单独开关:Phone numbers view/manage、Message templates view/manage、Manage phone numbers and message templates、Messages)和“Full control”(单个“Everything”开关)。Salesforce需要Full control / Everything权限,原因如下:
- 用户分配——Salesforce会在WABA上配置服务账户以进行操作。只有Everything开关能授予此权限;所有部分权限开关都不包含此权限。
- Webhook订阅管理——(允许Salesforce的BSP应用接收入站消息)需要
POST /{waba-id}/subscribed_apps权限范围,对应Full control,而非部分权限开关。whatsapp_business_management - 信用额度/支付方式可见性——Salesforce需要此权限才能通过客户自己的账单路由消息发送。此权限明确仅在“Everything”的描述中(“view payment information”)。
如果客户仅授予部分权限(例如仅“Manage phone numbers and message templates”),渠道可能在Salesforce端成功插入,但后续激活/发送会因模糊的Meta权限错误而失败。部分权限路径适用于非BSP集成(如仅需发送模板消息的营销工具等),而非BSP。请勿让任何人“优化”生成的指令以缩小权限范围——这是得不偿失的,会在流程后期导致令人困惑的失败。